From patchwork Mon Mar 6 17:22:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13161930 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3E9CC64EC4 for ; Mon, 6 Mar 2023 17:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=itWAaOotAqJDAOi2afrgkjYlSFevISPMb4FfFGkd7fc=; b=AmF0HmIkRDhdUw tLF7UV4ZwGq6X76vfwLp342MnrrBkZr0fMBEt829DbiNCklW7RQ6HQraWOKU+3XBDf+sItKzqBAqL KQ5NaXwHSRvQgfUmHy2WZ1Y87oUJc7mZDpo343I30RTRXRITTTROhXG9U9dkiNdygkgh48IHCziED DxFY7XbaHnxZkRtHhrE0bL9HTL/6fbQFp0uJMU6PchBWKElCyuNnKi6D3j9YrwWL1vtyxvgZn5vP5 SK9ZU3GikXIoB4V1et46WE1ok4KBQjdsUz4sLxi3cqsV9h5Y45LP8W6m8BfIk/jidqy2mVD5OnQQ/ HQpSIqgNnVYfb56JdUCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZEb5-00E7Ey-3L; Mon, 06 Mar 2023 17:26:03 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZEYi-00E65B-Ew for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2023 17:23:40 +0000 Received: from stefanw-SCHENKER ([37.4.248.41]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MCbR7-1phj0q3Nit-009jEz; Mon, 06 Mar 2023 18:23:15 +0100 From: Stefan Wahren To: Rob Herring , Krzysztof Kozlowski , Jonathan Cameron , Lars-Peter Clausen , Arnd Bergmann , Olof Johansson , Evgeniy Polyakov , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: linux-imx@nxp.com, Li Yang , Denis Ciocca , soc@kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren , Stefan Wahren Subject: [PATCH 5/8] iio: accel: add support for IIS328DQ variant Date: Mon, 6 Mar 2023 18:22:46 +0100 Message-Id: <20230306172249.74003-6-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230306172249.74003-1-stefan.wahren@i2se.com> References: <20230306172249.74003-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:8pOSVs5pr3qo5I8gRJ4mnb4mzsthHgbkNTMbUsy+rAaH8Tcqei4 1nJJeYoOAlsnTs5CYx7U1BlLvzhb8SGehE1/OZn5fRLsm9jU7byYi5dcZ1jyaoaxkBZd9IX NTz7ElNVj2hIwUyMvNtjnSUwD5Mv7zp5Bs1Z4R96niKL6ZS5TiZ+mKuPzUecb38L5hShpV1 G9g7EXMnmqV+QmXt86snA== UI-OutboundReport: notjunk:1;M01:P0:fM4cGhjX5pQ=;mYVjZZF4EHnRj4w9nP3pgwXdpQo Uu4UFtqJ0Z4bLWHJXbmPytqy+ZKE9PjjuQceU78q38Le8d7IBTY4FqbAmSsiUJCWw95FX67Uu k1sSLcuA988IPrv/sVwaWInbnb9FlnpYsrMAsducYLcSbSXywXfV2SHR5l5btL1/kUMEFZRfL gzbLun9b77TJ43q99SwbNnSdbrwAmHtVaRXnxuzENv6hQnyPFVGUwdYsQshPSlEimuxrW7zoT M4wSc72OHiDvK96uc2jVH3V4dR1jTMvJiuUjyv9UwC9B8OetEsDJ4dccJBR7qioi7VjLkBKs/ xrN5mZPPFDXLO/8T3xE9TUxxxRLvn0NIlBCcrXDxm99bRioftulHqhMr8ROdJN+3FvUik9jQ1 3rQYQruPeoWnig2Ko97ykVaeJRy9Zu9JS3871qVabbnfqJjQnHlSQwJ6wuSYx/klTGOJtT6qp rohdMEC48DeUb5ImxmpafLOIgA8PsDzeWCD9kRxdOsdnppOrgMJ8axVN2zlp8E+hSuO9izGro fPBKAISUdP6CcCPjGn6E5JXyeGMqA+r3pYvBr2TLGIPN15cJHWlOHebnnCOLYP9e8FthgVunV gME1geY/bYGTiRF04z02WNMpud89Tpw3/aOwGxr9I4Hp/FIV3Q+adjohlkGfsUR30tN20sMQ6 ohriQqezf6Ssj3TCNuf1nwtkVAoCr0Z14dSlWUO2Kg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230306_092336_828894_8B660163 X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Stefan Wahren Add support for ST IIS328DQ accelerometer to the st_accel framework. The chip is compatible to the LIS331DL. Link: https://www.st.com/resource/en/datasheet/iis328dq.pdf Signed-off-by: Stefan Wahren Signed-off-by: Stefan Wahren --- drivers/iio/accel/st_accel.h | 1 + drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 +++++ drivers/iio/accel/st_accel_spi.c | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h index 56ed0c776d4a..e7525615712b 100644 --- a/drivers/iio/accel/st_accel.h +++ b/drivers/iio/accel/st_accel.h @@ -39,6 +39,7 @@ #define LIS302DL_ACCEL_DEV_NAME "lis302dl" #define LSM303C_ACCEL_DEV_NAME "lsm303c_accel" #define SC7A20_ACCEL_DEV_NAME "sc7a20" +#define IIS328DQ_ACCEL_DEV_NAME "iis328dq" #ifdef CONFIG_IIO_BUFFER diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 6b8562f684d5..5f7d81b44b1d 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -517,6 +517,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, .sensors_supported = { [0] = H3LIS331DL_ACCEL_DEV_NAME, + [1] = IIS328DQ_ACCEL_DEV_NAME, }, .ch = (struct iio_chan_spec *)st_accel_12bit_channels, .odr = { diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c index 3f02fd5d5946..fb9e2d6f4210 100644 --- a/drivers/iio/accel/st_accel_i2c.c +++ b/drivers/iio/accel/st_accel_i2c.c @@ -119,6 +119,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "silan,sc7a20", .data = SC7A20_ACCEL_DEV_NAME, }, + { + .compatible = "st,iis328dq", + .data = IIS328DQ_ACCEL_DEV_NAME, + }, {}, }; MODULE_DEVICE_TABLE(of, st_accel_of_match); @@ -157,6 +161,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LIS302DL_ACCEL_DEV_NAME }, { LSM303C_ACCEL_DEV_NAME }, { SC7A20_ACCEL_DEV_NAME }, + { IIS328DQ_ACCEL_DEV_NAME }, {}, }; MODULE_DEVICE_TABLE(i2c, st_accel_id_table); diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c index 5740dc1820bd..f72a24f45322 100644 --- a/drivers/iio/accel/st_accel_spi.c +++ b/drivers/iio/accel/st_accel_spi.c @@ -100,6 +100,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lsm303c-accel", .data = LSM303C_ACCEL_DEV_NAME, }, + { + .compatible = "st,iis328dq", + .data = IIS328DQ_ACCEL_DEV_NAME, + }, {} }; MODULE_DEVICE_TABLE(of, st_accel_of_match); @@ -157,6 +161,7 @@ static const struct spi_device_id st_accel_id_table[] = { { LIS3DE_ACCEL_DEV_NAME }, { LIS302DL_ACCEL_DEV_NAME }, { LSM303C_ACCEL_DEV_NAME }, + { IIS328DQ_ACCEL_DEV_NAME }, {}, }; MODULE_DEVICE_TABLE(spi, st_accel_id_table);