From patchwork Mon May 9 09:13:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian Hui Lee X-Patchwork-Id: 1628422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=WWrqcXsl; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kxb8b1tyJz9sGJ for ; Mon, 9 May 2022 19:14:23 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nnzT6-0001NA-Lz; Mon, 09 May 2022 09:14:16 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nnzT5-0001LM-GM for kernel-team@lists.ubuntu.com; Mon, 09 May 2022 09:14:15 +0000 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 85A533F221 for ; Mon, 9 May 2022 09:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1652087654; bh=DM/kMV4TTg7x2kjo23kC8XN98rMh38rhe2DRpunnZjM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WWrqcXslZLj9Rcn8qTJYGzKWwokM6i0G5U6GE4IC80Uxnyyh4yKZx1BIOwaNpN92c lOKXSRizbDpGwwJXuD3qKvb8k7eqbQOtLFFfiRCuCoG8Hbuix3cIXzP/G0I/bxFNyR 4IIwK6fVQZVtvcRI+CGxlMitIqYB9W6+HIUTcbvYKRS7oe0NNa018QqkrOJ+Mqg0pb 6C/cBaQl2+VeohxmqP7feeYpciGpGRwgrGZcwQuuVY2+d63XBWaMh7x1F8baocYxMl qymRQszUoH9TgAI3FnkwumoBtRfWDY4UNkZGY+IevdXSAwQKT8RWk/7A+Bukwxun7P O7yMqK9znamiA== Received: by mail-pj1-f70.google.com with SMTP id h23-20020a17090adb9700b001dcce3bb2d4so5827795pjv.7 for ; Mon, 09 May 2022 02:14:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DM/kMV4TTg7x2kjo23kC8XN98rMh38rhe2DRpunnZjM=; b=iv5yaIhSQ9W3z1WN8i//h0xP6/0oRgfzICBnR8VGy1C5IwsoRzPWjfHzG+1sr3keXF RZhS9vKPoXveeAweV0zz3BDXMrKsxmkw0aauOLKLKkB7tcl5NqsPXcsENPBJy5umMn0b PmuXYf8cRPda90knarKuCZit0NODHcFwbUCa/WBnfGpGZTrqKk7SN0/WxUlHso5F55ON qgvv3kyFctY927L9wMWNzfjKVx3pzejK0oxoDrFTZ3VvfNcBn20Emz0e1BwsR/AnBWTS cqW54VSS4HP/YwwH8kt17ZOS3m2XGQMb7bWivZMykqXbCI1DnCdzzc9/hTnVYLJLVx7E /Vew== X-Gm-Message-State: AOAM532tuMIuM1TDftsLy5jyCkIkjiu2ffuE6d9Vw9ZwfVm4JqhKGxk2 XYlM9jvP2S0ujKRO0/uaunGJHeqEgZvsCQICwvELutVH99UM5uLL1bMnXK+wvAeTU97wIDQggRB MCEydvOsfVZBUxMWzUsXbZ0BzWLNkJnZc1kAvmmmxXA== X-Received: by 2002:a17:90a:ee96:b0:1dc:6680:6f2d with SMTP id i22-20020a17090aee9600b001dc66806f2dmr17152538pjz.174.1652087653327; Mon, 09 May 2022 02:14:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOaJ93nQu0PAFqvDeVw0bsLizFt6hzfBVj1qrCqfaEz63G6LPfq8JyGFRcTq7/Z4ChRt8nIA== X-Received: by 2002:a17:90a:ee96:b0:1dc:6680:6f2d with SMTP id i22-20020a17090aee9600b001dc66806f2dmr17152517pjz.174.1652087653072; Mon, 09 May 2022 02:14:13 -0700 (PDT) Received: from Razer-Stealth.. (36-230-106-94.dynamic-ip.hinet.net. [36.230.106.94]) by smtp.gmail.com with ESMTPSA id r1-20020a170902c7c100b0015e8d4eb2e9sm6437057pla.307.2022.05.09.02.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:14:12 -0700 (PDT) From: Jian Hui Lee To: kernel-team@lists.ubuntu.com Subject: [SRU][Focal:linux-intel-iotg-5.15][PATCH 02/10] iio: accel: adxl345: Set driver_data for OF enumeration Date: Mon, 9 May 2022 17:13:58 +0800 Message-Id: <20220509091406.39552-3-jianhui.lee@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220509091406.39552-1-jianhui.lee@canonical.com> References: <20220509091406.39552-1-jianhui.lee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Andy Shevchenko BugLink: https://launchpad.net/bugs/1962674 In order to enable this driver on mode platforms, assign driver_data field in the OF device ID table. While at it, make sure that device type is not 0 which may be wrongly interpreted by device property APIs in the future. Signed-off-by: Andy Shevchenko Tested-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20220222090009.2060-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron (cherry picked from commit 024f5d4f0ac087f73732a3084bdea5029ab0ca6b) Signed-off-by: Jian Hui Lee --- drivers/iio/accel/adxl345.h | 4 ++-- drivers/iio/accel/adxl345_i2c.c | 4 ++-- drivers/iio/accel/adxl345_spi.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/accel/adxl345.h b/drivers/iio/accel/adxl345.h index af0fdd02c4f2..5a68d4dac717 100644 --- a/drivers/iio/accel/adxl345.h +++ b/drivers/iio/accel/adxl345.h @@ -9,8 +9,8 @@ #define _ADXL345_H_ enum adxl345_device_type { - ADXL345, - ADXL375, + ADXL345 = 1, + ADXL375 = 2, }; int adxl345_core_probe(struct device *dev, struct regmap *regmap, diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c index 4363d5bd2ee9..7feaaba865d3 100644 --- a/drivers/iio/accel/adxl345_i2c.c +++ b/drivers/iio/accel/adxl345_i2c.c @@ -44,8 +44,8 @@ static const struct i2c_device_id adxl345_i2c_id[] = { MODULE_DEVICE_TABLE(i2c, adxl345_i2c_id); static const struct of_device_id adxl345_of_match[] = { - { .compatible = "adi,adxl345" }, - { .compatible = "adi,adxl375" }, + { .compatible = "adi,adxl345", .data = (const void *)ADXL345 }, + { .compatible = "adi,adxl375", .data = (const void *)ADXL375 }, { }, }; diff --git a/drivers/iio/accel/adxl345_spi.c b/drivers/iio/accel/adxl345_spi.c index f590215f0d52..49625dfa109b 100644 --- a/drivers/iio/accel/adxl345_spi.c +++ b/drivers/iio/accel/adxl345_spi.c @@ -46,8 +46,8 @@ static const struct spi_device_id adxl345_spi_id[] = { MODULE_DEVICE_TABLE(spi, adxl345_spi_id); static const struct of_device_id adxl345_of_match[] = { - { .compatible = "adi,adxl345" }, - { .compatible = "adi,adxl375" }, + { .compatible = "adi,adxl345", .data = (const void *)ADXL345 }, + { .compatible = "adi,adxl375", .data = (const void *)ADXL375 }, { }, };