Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp2288029rwe; Sat, 15 Apr 2023 16:13:52 -0700 (PDT) X-Google-Smtp-Source: AKy350bw9n0poWT4JXjwV06308L7ywHj11esZ08HykmEu1QpXjcWK6zKZK6aAHLEM1f2twE5lufA X-Received: by 2002:a17:902:dac5:b0:1a6:87f7:2dbf with SMTP id q5-20020a170902dac500b001a687f72dbfmr9248426plx.62.1681600431951; Sat, 15 Apr 2023 16:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681600431; cv=none; d=google.com; s=arc-20160816; b=d98Uj4WCXsxmEW1YJMFTBFIJi2gopMaejwOdZus1R+EkjfXfqNnFYi+zmDHgglT/JU 1gpNu1PifghmIXDXmhAZ1VogK3NV4vNwaN05xzw/ixE1reYC380JC3amem0qb/JQ+a4Y RP3fUmhB+JeZ/yEriHH6TGix+seFoMizOV6gJUASu/Q+wZlk8N6B3TVnBFs5muWlmPqf u6Nm2KDImQ4GbRxDDoHsJoD0EzzThK0J7xs5sTjGV3+xkP8fLEPBLuydzmSVDeqcKr+k FlmWw/mHk9K1m2WDLGHWJeR/z8qLRnjxvY5juVF6uU4DP+TJF1+rH/Dhf0KVl7/YIHLT y8sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1WwL9O2qJHa3oAVrL3RtZPgGuUcuaz3nWHKZHdcckfE=; b=fynuz7SNtaWZRUmUMQVVQJU++A6ziBmYbFM+cAXEHGn4q5ek11pDRDONlG0PXSHhFo SIw3RM1dKlXKIrAjtagWuKhAqps+oX5ewbC51eU9Npl+1QOoU2A8jFJ4L2ztptbpZvI2 q4NtE2I/f1PrQzPGBZquLkKXeFGGeXsmT/5AYmzwEeXUvbryvCl/7pkmf36LofKRQJX5 GMk5ygb+aQ8VfSoJLCGruW78d8Zfi0STnPifgCkM39HGxLvIaUp70YPcqhGq8NxTDPZ/ i/fI2Ialj0Vspo/vu0TTyGBu2H8axNgoTmVjMkAR+DVEPKt7I5/V8N+SfcfoZYa3eGYO 0Thw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mariushoch.de header.s=MBO0001 header.b=t8cnwrED; 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 l4-20020a170903244400b001a6c72e79e6si879459pls.279.2023.04.15.16.13.40; Sat, 15 Apr 2023 16:13:51 -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=t8cnwrED; 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 S230130AbjDOXMU (ORCPT + 99 others); Sat, 15 Apr 2023 19:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbjDOXMO (ORCPT ); Sat, 15 Apr 2023 19:12:14 -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 A396FD8; Sat, 15 Apr 2023 16:12:12 -0700 (PDT) Received: from smtp1.mailbox.org (unknown [10.196.197.1]) (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 4PzTbs1M44z9t5J; Sun, 16 Apr 2023 01:12:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariushoch.de; s=MBO0001; t=1681600329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1WwL9O2qJHa3oAVrL3RtZPgGuUcuaz3nWHKZHdcckfE=; b=t8cnwrEDXGqyObXq8Ob/gBnWBO/8SjRfyoSAYDWozunBkZTRgy2fI5AlwY2vSrUh0vYiYy 7KhlPdTs3JWS8BfXbWA/S2FMs5CnBp/5WkAnhXjxS2Fbw7F3EViP/DhY9S+DC5fuLJoqi3 o5ATap13cpZ07IPihn0W33cBmkdJSEBl1MvP7cxfB2pmiNazrsEHuBq2VSsBuveNxDUC9+ VsJp0pWHUKvlHbppMI4B0YDK1IPU+aadSizYqZo3jl6+Aciu1cXkmrylkkrRWxXrwOUH2j cGWUh14rfzKRD6VraM3hIkSTy7BHGgwa2zvwVBzbW3V+zf/Q0HFDAY3iWMeTiw== From: Marius Hoch To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Denis Ciocca , Linus Walleij , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Hans de Goede , Marius Hoch Subject: [PATCH v3 4/6] iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU driver Date: Sun, 16 Apr 2023 01:11:28 +0200 Message-Id: <20230415231130.115094-5-mail@mariushoch.de> In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de> References: <20230415231130.115094-1-mail@mariushoch.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 | 7 +++++++ drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 7 +++++++ 2 files changed, 14 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..52f1ea6c457f 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c @@ -37,6 +37,12 @@ static const struct i2c_device_id st_lsm9ds0_id_table[] = { }; MODULE_DEVICE_TABLE(i2c, st_lsm9ds0_id_table); +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); + static const struct regmap_config st_lsm9ds0_regmap_config = { .reg_bits = 8, .val_bits = 8, @@ -73,6 +79,7 @@ static struct i2c_driver st_lsm9ds0_driver = { .driver = { .name = "st-lsm9ds0-i2c", .of_match_table = st_lsm9ds0_of_match, + .acpi_match_table = 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..55f3738193af 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c @@ -37,6 +37,12 @@ static const struct spi_device_id st_lsm9ds0_id_table[] = { }; MODULE_DEVICE_TABLE(spi, st_lsm9ds0_id_table); +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); + static const struct regmap_config st_lsm9ds0_regmap_config = { .reg_bits = 8, .val_bits = 8, @@ -72,6 +78,7 @@ static struct spi_driver st_lsm9ds0_driver = { .driver = { .name = "st-lsm9ds0-spi", .of_match_table = st_lsm9ds0_of_match, + .acpi_match_table = st_lsm9ds0_acpi_match, }, .probe = st_lsm9ds0_spi_probe, .id_table = st_lsm9ds0_id_table, -- 2.39.2