From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Bharadwaj Raju" <bharadwaj.raju777@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, shuah@kernel.org,
linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH 3/5] iio: imu: icm20948: add support for gyroscope
Date: Sun, 31 Aug 2025 14:58:24 +0200 [thread overview]
Message-ID: <7c98542d-c196-4071-b29c-91cd81072aa5@kernel.org> (raw)
In-Reply-To: <20250831-icm20948-v1-3-1fe560a38de4@gmail.com>
On 30/08/2025 20:42, Bharadwaj Raju wrote:
> Add support for reading the gyroscope, which is exposed as another IIO
> device under the icm20948 driver.
>
> For now, the only configuration supported is changing the full-scale
> range.
>
> Signed-off-by: Bharadwaj Raju <bharadwaj.raju777@gmail.com>
> ---
> drivers/iio/imu/inv_icm20948/Makefile | 1 +
> drivers/iio/imu/inv_icm20948/inv_icm20948.h | 78 ++++--
> drivers/iio/imu/inv_icm20948/inv_icm20948_core.c | 55 ++--
> drivers/iio/imu/inv_icm20948/inv_icm20948_gyro.c | 343 +++++++++++++++++++++++
> 4 files changed, 432 insertions(+), 45 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_icm20948/Makefile b/drivers/iio/imu/inv_icm20948/Makefile
> index c508c2dc3eee2c32be20067e3e0868a203d8aa1a..88a37be159e1d6f575da1c070c84ac94cd963020 100644
> --- a/drivers/iio/imu/inv_icm20948/Makefile
> +++ b/drivers/iio/imu/inv_icm20948/Makefile
> @@ -3,6 +3,7 @@
> obj-$(CONFIG_INV_ICM20948) += inv-icm20948.o
> inv-icm20948-y += inv_icm20948_core.o
> inv-icm20948-y += inv_icm20948_temp.o
> +inv-icm20948-y += inv_icm20948_gyro.o
>
> obj-$(CONFIG_INV_ICM20948_I2C) += inv-icm20948-i2c.o
> inv-icm20948-i2c-y += inv_icm20948_i2c.o
> diff --git a/drivers/iio/imu/inv_icm20948/inv_icm20948.h b/drivers/iio/imu/inv_icm20948/inv_icm20948.h
> index f9830645fbe96fd02eef7c54d1e5908647d5a0fe..ca2513114378cdcba5bc315fc94cd61f930b4dfa 100644
> --- a/drivers/iio/imu/inv_icm20948/inv_icm20948.h
> +++ b/drivers/iio/imu/inv_icm20948/inv_icm20948.h
> @@ -3,45 +3,83 @@
> * Copyright (C) 2025 Bharadwaj Raju <bharadwaj.raju777@gmail.com>
> */
>
> -#ifndef INV_ICM20948_H_
> -#define INV_ICM20948_H_
> + #ifndef INV_ICM20948_H_
> + #define INV_ICM20948_H_
>
> -#include <linux/bits.h>
> -#include <linux/bitfield.h>
> -#include <linux/mutex.h>
> -#include <linux/regmap.h>
> -#include <linux/i2c.h>
> -#include <linux/iio/iio.h>
> -#include <linux/err.h>
> + #include <linux/bits.h>
> + #include <linux/bitfield.h>
> + #include <linux/mutex.h>
> + #include <linux/regmap.h>
> + #include <linux/i2c.h>
> + #include <linux/iio/iio.h>
> + #include <linux/err.h>
>
> /* accel takes 20ms, gyro takes 35ms to wake from full-chip sleep */
> -#define INV_ICM20948_SLEEP_WAKEUP_MS 35
> + #define INV_ICM20948_SLEEP_WAKEUP_MS 35
>
> -#define INV_ICM20948_REG_BANK_SEL 0x7F
> -#define INV_ICM20948_BANK_SEL_MASK GENMASK(5, 4)
> + #define INV_ICM20948_REG_BANK_SEL 0x7F
> + #define INV_ICM20948_BANK_SEL_MASK GENMASK(5, 4)
>
> -#define INV_ICM20948_REG_WHOAMI 0x0000
> -#define INV_ICM20948_WHOAMI 0xEA
> + #define INV_ICM20948_REG_WHOAMI 0x0000
> + #define INV_ICM20948_WHOAMI 0xEA
>
> -#define INV_ICM20948_REG_FIFO_RW 0x0072
> + #define INV_ICM20948_REG_FIFO_RW 0x0072
>
> -#define INV_ICM20948_REG_PWR_MGMT_1 0x0006
> -#define INV_ICM20948_PWR_MGMT_1_DEV_RESET BIT(7)
> -#define INV_ICM20948_PWR_MGMT_1_SLEEP BIT(6)
> + #define INV_ICM20948_REG_PWR_MGMT_1 0x0006
> + #define INV_ICM20948_PWR_MGMT_1_DEV_RESET BIT(7)
This makes no sense.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-08-31 12:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-30 18:42 [PATCH 0/5] iio: imu: New driver for InvenSense ICM-20948 9-Axis sensor Bharadwaj Raju
2025-08-30 18:42 ` [PATCH 1/5] dt-bindings: iio: imu: Add ICM-20948 Bharadwaj Raju
2025-08-31 12:57 ` Krzysztof Kozlowski
2025-09-01 3:29 ` Krzysztof Kozlowski
2025-08-30 18:42 ` [PATCH 2/5] iio: imu: add inv_icm20948 Bharadwaj Raju
2025-08-30 20:42 ` Andy Shevchenko
2025-09-01 19:19 ` Jonathan Cameron
2025-08-30 18:42 ` [PATCH 3/5] iio: imu: icm20948: add support for gyroscope Bharadwaj Raju
2025-08-31 12:58 ` Krzysztof Kozlowski [this message]
2025-08-31 23:09 ` kernel test robot
2025-09-01 1:36 ` kernel test robot
2025-09-01 19:31 ` Jonathan Cameron
2025-08-30 18:42 ` [PATCH 4/5] MAINTAINERS: add entry for inv_icm20948 driver Bharadwaj Raju
2025-09-01 19:32 ` Jonathan Cameron
2025-08-30 18:42 ` [PATCH 5/5] iio: imu: icm20948: add runtime power management support Bharadwaj Raju
2025-08-31 19:23 ` Markus Elfring
2025-09-01 6:08 ` Greg KH
2025-09-01 19:40 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c98542d-c196-4071-b29c-91cd81072aa5@kernel.org \
--to=krzk@kernel.org \
--cc=andy@kernel.org \
--cc=bharadwaj.raju777@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).