From patchwork Sat Apr 15 23:11:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Hoch X-Patchwork-Id: 13212671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC38EC77B73 for ; Sat, 15 Apr 2023 23:12:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbjDOXMM (ORCPT ); Sat, 15 Apr 2023 19:12:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbjDOXMK (ORCPT ); Sat, 15 Apr 2023 19:12:10 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C375359B; Sat, 15 Apr 2023 16:12:07 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::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-201.mailbox.org (Postfix) with ESMTPS id 4PzTbm0LpZz9sQy; Sun, 16 Apr 2023 01:12:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariushoch.de; s=MBO0001; t=1681600324; 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=ezPGoQ6QPL9E3+YlJ6ixpTBZV0SadJ4wrscpZIJ3NMk=; b=CDAGgUhvg3l9geNDUw5GbBPdgY8QoBh914E/43fM3Vj9Pxm0aGZ+Bi1pjyg6Ej0JLcbIDM aza0H6MMs3m8Zv0/UiHGdxGFOeGChq0YGGm00/e5cG6oeIpCurHIml4hOhla83MxA5CEkr AZC/dmM2MDQLLGsIBRz1G+lJAjR3OiSvOiVHsALDq14d5h5XL9atWZCjVJ34t10CrVJ/Sr nMj+SnxsUJckiNOFF6RXOOyG/AAnu6n/vZYuc8SfraRnxRSWqlz2YjSYagU+/PpcC5tBtJ V/Bpvuxw1knJLfqIpj/IkI85OhUnISyTdKUD7G0uvkZ+UbQV7sg4CcpqZPUZwg== 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 1/6] iio: accel: st_accel: Add LSM303D Date: Sun, 16 Apr 2023 01:11:25 +0200 Message-Id: <20230415231130.115094-2-mail@mariushoch.de> In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de> References: <20230415231130.115094-1-mail@mariushoch.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PzTbm0LpZz9sQy Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The lsm303d has the same register mapping as the lsm9ds0, thus we can just re-use that. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij --- drivers/iio/accel/st_accel_core.c | 1 + include/linux/iio/common/st_sensors.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 6b8562f684d5..1628b177d0ed 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -1006,6 +1006,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, .sensors_supported = { [0] = LSM9DS0_IMU_DEV_NAME, + [1] = LSM303D_IMU_DEV_NAME, }, .ch = (struct iio_chan_spec *)st_accel_16bit_channels, .odr = { diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index f5f3ee57bc70..607c3a89a647 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h @@ -22,6 +22,7 @@ #include #define LSM9DS0_IMU_DEV_NAME "lsm9ds0" +#define LSM303D_IMU_DEV_NAME "lsm303d" /* * Buffer size max case: 2bytes per channel, 3 channels in total + From patchwork Sat Apr 15 23:11:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Hoch X-Patchwork-Id: 13212669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BADFBC77B70 for ; Sat, 15 Apr 2023 23:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbjDOXML (ORCPT ); Sat, 15 Apr 2023 19:12:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbjDOXMK (ORCPT ); Sat, 15 Apr 2023 19:12:10 -0400 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050:0:465::202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 507C3D8; Sat, 15 Apr 2023 16:12:09 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::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-202.mailbox.org (Postfix) with ESMTPS id 4PzTbn6F4Qz9t4h; Sun, 16 Apr 2023 01:12:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariushoch.de; s=MBO0001; t=1681600325; 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=aaBdxoh2tTQE/D7UbYD1GfSy8FZRjzStnfxmiQyyUCU=; b=NQW5ku21w7BMbgJTUa80Ynbqp9OYOavkA84NeF+zHMi4NI/V2JyL85JW1nqS9++ECVkNdQ iH6apcmiAHqXV10IpdotW1T7FOE3jHmVT0fOzkowmicWhd+3Y0yBN1x0HTMdWPzEVc5BdB svV0qGXn9/qg9Wm8BDEOcP+ktAeM3f7ty5rIn8p0WzN41YECFr4alK5NwBwKp7akTldDP3 jNhiz2Kt1oQxOlNkz5VWJtPy6ulXTZvJy6xfqhsxeMBr7Ba0tgzsWNd5hB3ClvZAs078aO ITegTcZoyfkQPNj0yRguIBh/v68S/j4jc4XoCP4v5N9xT/vmewub4eutQM5Qtw== 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 2/6] iio: magnetometer: st_accel: Add LSM303D Date: Sun, 16 Apr 2023 01:11:26 +0200 Message-Id: <20230415231130.115094-3-mail@mariushoch.de> In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de> References: <20230415231130.115094-1-mail@mariushoch.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PzTbn6F4Qz9t4h Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The lsm303d has the same register mapping as the lsm9ds0, thus we can just re-use that. Tested on a Lenovo Yoga Tablet 2 1051-F. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij --- drivers/iio/magnetometer/st_magn_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index 8faa7409d9e1..6cc0dfd31821 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c @@ -427,6 +427,7 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = { .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, .sensors_supported = { [0] = LSM9DS0_IMU_DEV_NAME, + [1] = LSM303D_IMU_DEV_NAME, }, .ch = (struct iio_chan_spec *)st_magn_4_16bit_channels, .odr = { From patchwork Sat Apr 15 23:11:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Hoch X-Patchwork-Id: 13212673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 607BDC77B7D for ; Sat, 15 Apr 2023 23:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229781AbjDOXMP (ORCPT ); Sat, 15 Apr 2023 19:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbjDOXMO (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 A416F119; 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 4PzTbq3hhTz9t50; Sun, 16 Apr 2023 01:12:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariushoch.de; s=MBO0001; t=1681600327; 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=usGOq1CJVdyzoBS9/FtpRn4wOOe3OcKpt0J8nGiDhmo=; b=2FHWamYaZ2WM8wU+sbGCn7qzr1AA3IeEMYavJAGgZap823ocFWASBpWMDf0/PHJTxW/mQi Nw0USwKpyfbpyGyGUz1UL3XvkrLzVgd+v2PTaNAj2WmufdTVzZjLWHAcp5KTM5eMFxGIoC xwuxvdQZGK3nWjb5vmR87/dn2pwLRiGsvCo6qVBYAjEk4tjtu63Nn2pfvoENp8QQU3AvDv vIPeIsE1J0rCuZwYSSulUztPqSjdORS+nGQaVwDt52rRkCMj0dWa3nkoHXkPp3Jzu5LxaR u7wfvcoBOHioc27cfy51agx4w8WqPdsxu9Wzg3pdYZRSCUcIYF6p1QeyFaTSiQ== 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 3/6] iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver Date: Sun, 16 Apr 2023 01:11:27 +0200 Message-Id: <20230415231130.115094-4-mail@mariushoch.de> In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de> References: <20230415231130.115094-1-mail@mariushoch.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The lsm303d is basically the lsm9ds0 without the gyroscope (which the LSM9DS0 IMU driver doesn't handle), as far as I can tell. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij --- drivers/iio/imu/st_lsm9ds0/Kconfig | 3 ++- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 5 +++++ drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/iio/imu/st_lsm9ds0/Kconfig b/drivers/iio/imu/st_lsm9ds0/Kconfig index d29558edee60..7aef714b6ecb 100644 --- a/drivers/iio/imu/st_lsm9ds0/Kconfig +++ b/drivers/iio/imu/st_lsm9ds0/Kconfig @@ -10,7 +10,8 @@ config IIO_ST_LSM9DS0 help Say yes here to build support for STMicroelectronics LSM9DS0 IMU - sensor. Supported devices: accelerometer/magnetometer of lsm9ds0. + sensor. Supported devices: accelerometer/magnetometer of lsm9ds0 + and lsm303d. To compile this driver as a module, choose M here: the module will be called st_lsm9ds0. diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c index a90138d8b06a..64fa77d302e2 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c @@ -22,12 +22,17 @@ static const struct of_device_id st_lsm9ds0_of_match[] = { .compatible = "st,lsm9ds0-imu", .data = LSM9DS0_IMU_DEV_NAME, }, + { + .compatible = "st,lsm303d-imu", + .data = LSM303D_IMU_DEV_NAME, + }, {} }; MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match); static const struct i2c_device_id st_lsm9ds0_id_table[] = { { LSM9DS0_IMU_DEV_NAME }, + { LSM303D_IMU_DEV_NAME }, {} }; MODULE_DEVICE_TABLE(i2c, 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 b743bf3546a7..997b5ff792be 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c @@ -22,12 +22,17 @@ static const struct of_device_id st_lsm9ds0_of_match[] = { .compatible = "st,lsm9ds0-imu", .data = LSM9DS0_IMU_DEV_NAME, }, + { + .compatible = "st,lsm303d-imu", + .data = LSM303D_IMU_DEV_NAME, + }, {} }; MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match); static const struct spi_device_id st_lsm9ds0_id_table[] = { { LSM9DS0_IMU_DEV_NAME }, + { LSM303D_IMU_DEV_NAME }, {} }; MODULE_DEVICE_TABLE(spi, st_lsm9ds0_id_table); From patchwork Sat Apr 15 23:11:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Hoch X-Patchwork-Id: 13212672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2112C77B71 for ; Sat, 15 Apr 2023 23:12:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbjDOXMO (ORCPT ); Sat, 15 Apr 2023 19:12:14 -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 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 Acked-by: Linus Walleij --- 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, From patchwork Sat Apr 15 23:11:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Hoch X-Patchwork-Id: 13212674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F30EC77B7F for ; Sat, 15 Apr 2023 23:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbjDOXMV (ORCPT ); Sat, 15 Apr 2023 19:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbjDOXMP (ORCPT ); Sat, 15 Apr 2023 19:12:15 -0400 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3170B1722; Sat, 15 Apr 2023 16:12:14 -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-102.mailbox.org (Postfix) with ESMTPS id 4PzTbt5gccz9sTd; Sun, 16 Apr 2023 01:12:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariushoch.de; s=MBO0001; t=1681600330; 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=HD1lsfuCz1zmXZ1k8I21GKrPVmmS4V4XSfqP1z1rnxs=; b=sjkypoBSYfW52x1wEsowcVqy8/+6bm5LndsugsDDzeX/CLxqpRCjKTxG8Y4J0C2RL6kgPd elMyC3w0nZ9aRch+zQg7EtRFN9UsxnKs5XBrRKf8NRj4a1QExvRUbujgbSgb37Rw7QRO8i jdmMgJY48SRm9Up8uskffZdOXSGuMNBxB5COb/FN8h0vAsOdtbwLoEbt20XQ9ka4IUJp+3 pRhMaBHDDd+0lx8PQIt4hi/4O0k+JHqitV6Mv14ik4QR+jK8utwm4CyVhWBQ2JbG1knjcN PWcsX/VCgwtETaHexkQUI4zZnCqjFA8mjfk/RXwUL/IaYtBkmnVhjcaCBwwfpQ== 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 5/6] iio: Comment that the LSM303D also has the Magnetometer DRDY Date: Sun, 16 Apr 2023 01:11:29 +0200 Message-Id: <20230415231130.115094-6-mail@mariushoch.de> In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de> References: <20230415231130.115094-1-mail@mariushoch.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Per its datasheet, the LSM303D also features that pin. Signed-off-by: Marius Hoch Reviewed-by: Linus Walleij --- include/linux/platform_data/st_sensors_pdata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/platform_data/st_sensors_pdata.h b/include/linux/platform_data/st_sensors_pdata.h index 897051e51b78..a657830232ae 100644 --- a/include/linux/platform_data/st_sensors_pdata.h +++ b/include/linux/platform_data/st_sensors_pdata.h @@ -15,7 +15,7 @@ * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2). * Available only for accelerometer, magnetometer and pressure sensors. * Accelerometer DRDY on LSM330 available only on pin 1 (see datasheet). - * Magnetometer DRDY is supported only on LSM9DS0. + * Magnetometer DRDY is supported only on LSM9DS0 and LSM303D. * @open_drain: set the interrupt line to be open drain if possible. * @spi_3wire: enable spi-3wire mode. * @pullups: enable/disable i2c controller pullup resistors. From patchwork Sat Apr 15 23:11:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Hoch X-Patchwork-Id: 13212675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10694C77B73 for ; Sat, 15 Apr 2023 23:12:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230203AbjDOXMa (ORCPT ); Sat, 15 Apr 2023 19:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbjDOXMX (ORCPT ); Sat, 15 Apr 2023 19:12:23 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050:0:465::201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DF052114; Sat, 15 Apr 2023 16:12:17 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::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-201.mailbox.org (Postfix) with ESMTPS id 4PzTbw2pDPz9sjS; Sun, 16 Apr 2023 01:12:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mariushoch.de; s=MBO0001; t=1681600332; 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=wlxmi8TjfHTxZJwdTO4o4SDvKTGV2TgJ+RNBxFINEus=; b=x2haiR7C1chddEjmmWPDgCwMDuU0Mc7cB6buwyH896ERrSi0tSVlAF5d1TtIMJ4mOjGrFO UGhLzsIBS/fjVyD368fj3aLn1dTDK9uq0V0Bck9kngcea7NDGEnIoPVWhg++wJXZdu6zGy vEmt2/1ubRmha5DthSf+PIx/N/gKlC7fZaqbKLz9ZDX8ZehoAoGzFRq3JzAOCUeUQHoTET 6gmrNRHOYnRq+RVAAJutuHfTbMU4BIEvfUo7gJJtaezsYUnJ1R2TsqHWEMHm/BIM3k234P /pBhasoD6ld0l5n/gJjwxwXk7LLFAv1gEtOMO9nY6LZtxODfq3wMUJpg/Qluzg== 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 6/6] dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer Date: Sun, 16 Apr 2023 01:11:30 +0200 Message-Id: <20230415231130.115094-7-mail@mariushoch.de> In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de> References: <20230415231130.115094-1-mail@mariushoch.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PzTbw2pDPz9sjS Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Same as the lsm9ds0, except that the lsm303d doesn't feature a gyroscope. Signed-off-by: Marius Hoch Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml index c6201976378f..194aca5542c2 100644 --- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml +++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml @@ -85,6 +85,7 @@ properties: - description: IMUs enum: - st,lsm9ds0-imu + - st,lsm303d-imu - description: Deprecated bindings enum: - st,lis302dl-spi