Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp2293326rwe; Sat, 15 Apr 2023 16:22:11 -0700 (PDT) X-Google-Smtp-Source: AKy350bEgrSfdhlE2dQPpliZOKe2oLf8kOCJWT8uFy81S8Tfop2KCYB71zNScOSJnKyho8EeyNQ+ X-Received: by 2002:a05:6a20:431b:b0:ef:4f14:e3bd with SMTP id h27-20020a056a20431b00b000ef4f14e3bdmr914481pzk.1.1681600930814; Sat, 15 Apr 2023 16:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681600930; cv=none; d=google.com; s=arc-20160816; b=AR0AsChmngIi21YEaPPEjT0NfSFeyilmmdWYmnT78SSOVwBHWtAlQY8FZHItrqBobS hAXxqeF3K0QUYdkmpGQ0AqUrlOZPTeQK2tvfj/aKW7Xy5kVSpi1bqPCiaAF57yh8I3ci +ijsXcTTPRkwfwMx119fBIxpWcfjG1bHbJ+0vdmRx0zEI2T4vWMBXtO57UmXUMdQ2Lvy zc2o/uLEGiguMSTTst7gHZ3OaZGvCUMikDtIps5UbSnR9RNzk0IX9nEQx8+AaPq5Vca5 V199OAfSPs+LRnAtUZ2txIpTlt4M8bg7p6fVhD79gCcFv1n3tBcdyZyz3l3vKcLOBG5k Lklg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:mime-version:date :message-id:dkim-signature; bh=ID7qo9GtR2DnSaTsjeNTaKbxdx00/tMw/AKSjHfLv28=; b=N99jZOuvDTmUX3U5gab2pB0q8lIurqbPl+b4ukGbaiy/EY5dYbR8Gg5XyBBFMyuuqy cJdHeXHlcncwhQc0INqs95v2H8Wu5rQsWHG9BSn2d1oW+1VYTdWeq8edSr/vl8RgmvAf BORdB+wkVq1nR52U84lDG54Zka4yDmN+QjoA6XNKAFtOYYzlH9b5AU6S5cm3wr2XIn+G aa7/1Euefz1Z+EhHEmiCYJ3yuuW5mJV/U7eTgu6/4R7CAnky4Kdek3hjvGPRSDrUyJfo MA5sfU0Cl4qCI4RzEk0Zt+UVihMMjmiacYB7t7AKxV7OYlQS9Iyh3r/7bL7NA4u0Dz1x D+7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mariushoch.de header.s=MBO0001 header.b="lW/MmLQq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a63444a000000b0051398688754si8341810pgk.54.2023.04.15.16.21.56; Sat, 15 Apr 2023 16:22:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mariushoch.de header.s=MBO0001 header.b="lW/MmLQq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbjDOXRn (ORCPT + 99 others); Sat, 15 Apr 2023 19:17:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbjDOXRm (ORCPT ); Sat, 15 Apr 2023 19:17:42 -0400 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050:0:465::101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B33C2117; Sat, 15 Apr 2023 16:17:41 -0700 (PDT) Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4PzTkB0FmKz9t5J; Sun, 16 Apr 2023 01:17:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariushoch.de; s=MBO0001; t=1681600658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ID7qo9GtR2DnSaTsjeNTaKbxdx00/tMw/AKSjHfLv28=; b=lW/MmLQqe7UtJ9dH4xrygrRu8KmrS99uBQ5FexOHK4SjEeJQeixh95VuVu5pUpcVp+QIyH uMEjL0M/E2aGNIji3ZZYxmAZ0IxyxU8XziKdR8TqHTaHv2+kD86vWNvK4WyeU2irrbeFm2 QW5f8FZ+JDghLJ0Yx/q4bsQ0ULV8hKbUfYaM9nbeDMLdt+lG62N4szRpHV3WeP031s6zi1 +G93Qh+depD9Jf3xVCxMPuLFTVoqytrDJZkxIgEuHJJ/tVeQfgPdzzZ8Gi39bc9D6V2yvI KS6dORBo8B+ONhVfCilY7AHJL7dVGX6vmvsl/Co0zRQ36ym1Q90CSLijHgYvIQ== Message-ID: Date: Sun, 16 Apr 2023 01:17:36 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v2 4/6] iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU driver To: Jonathan Cameron Cc: Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Hans de Goede References: <20230413024013.450165-1-mail@mariushoch.de> <20230413024013.450165-5-mail@mariushoch.de> <20230415175520.65adfc60@jic23-huawei> Content-Language: en-US From: Marius Hoch In-Reply-To: <20230415175520.65adfc60@jic23-huawei> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4PzTkB0FmKz9t5J X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/04/2023 18:55, Jonathan Cameron wrote: > On Thu, 13 Apr 2023 04:40:11 +0200 > Marius Hoch wrote: > >> The lsm303d can be found as ACCL0001 on various Lenovo devices, >> including the Lenovo Yoga Tablet 2 1051-F, where I tested this >> patch. >> >> Signed-off-by: Marius Hoch >> --- >> drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 10 ++++++++++ >> drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 10 ++++++++++ >> 2 files changed, 20 insertions(+) >> >> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c >> index 64fa77d302e2..79be8d28d965 100644 >> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c >> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c >> @@ -12,6 +12,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> >> @@ -37,6 +38,14 @@ static const struct i2c_device_id st_lsm9ds0_id_table[] = { >> }; >> MODULE_DEVICE_TABLE(i2c, st_lsm9ds0_id_table); >> >> +#ifdef CONFIG_ACPI >> +static const struct acpi_device_id st_lsm9ds0_acpi_match[] = { >> + {"ACCL0001", (kernel_ulong_t)LSM303D_IMU_DEV_NAME}, >> + { }, >> +}; >> +MODULE_DEVICE_TABLE(acpi, st_lsm9ds0_acpi_match); >> +#endif > The table is tiny so I'd prefer dropping the complexity of ifdefs > and getting rid of the ACPI_PTR() below. Just assign the pointer > unconditionally. > > Rest of the series looks good to me > > Thanks, > > Jonathan Thanks for your review, applied in v3. >> + >> static const struct regmap_config st_lsm9ds0_regmap_config = { >> .reg_bits = 8, >> .val_bits = 8, >> @@ -73,6 +82,7 @@ static struct i2c_driver st_lsm9ds0_driver = { >> .driver = { >> .name = "st-lsm9ds0-i2c", >> .of_match_table = st_lsm9ds0_of_match, >> + .acpi_match_table = ACPI_PTR(st_lsm9ds0_acpi_match), >> }, >> .probe_new = st_lsm9ds0_i2c_probe, >> .id_table = st_lsm9ds0_id_table, >> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c >> index 997b5ff792be..27c5d99ce0e3 100644 >> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c >> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c >> @@ -12,6 +12,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> >> @@ -37,6 +38,14 @@ static const struct spi_device_id st_lsm9ds0_id_table[] = { >> }; >> MODULE_DEVICE_TABLE(spi, st_lsm9ds0_id_table); >> >> +#ifdef CONFIG_ACPI >> +static const struct acpi_device_id st_lsm9ds0_acpi_match[] = { >> + {"ACCL0001", (kernel_ulong_t)LSM303D_IMU_DEV_NAME}, >> + { }, >> +}; >> +MODULE_DEVICE_TABLE(acpi, st_lsm9ds0_acpi_match); >> +#endif >> + >> static const struct regmap_config st_lsm9ds0_regmap_config = { >> .reg_bits = 8, >> .val_bits = 8, >> @@ -72,6 +81,7 @@ static struct spi_driver st_lsm9ds0_driver = { >> .driver = { >> .name = "st-lsm9ds0-spi", >> .of_match_table = st_lsm9ds0_of_match, >> + .acpi_match_table = ACPI_PTR(st_lsm9ds0_acpi_match), >> }, >> .probe = st_lsm9ds0_spi_probe, >> .id_table = st_lsm9ds0_id_table,