From: Kanak Shilledar <kanak.shilledar@axis.com>
To: "Henrik Grimler" <henrik.grimler@axis.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>,
"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
"Joshua Crofts" <joshua.crofts1@gmail.com>,
"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>,
"Chris Morgan" <macromorgan@hotmail.com>
Cc: Kanak Shilledar <kanak.shilledar@axis.com>, <kernel@axis.com>,
<linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v5 2/6] iio: imu: inv_icm42607: Simplify IIO channel macros
Date: Fri, 2 Oct 2026 13:54:26 +0200 [thread overview]
Message-ID: <20261002-b4-inv_icm42370p-v5-2-c65281b745c9@axis.com> (raw)
In-Reply-To: <20261002-b4-inv_icm42370p-v5-0-c65281b745c9@axis.com>
The INV_ICM42607_ACCEL_CHAN and INV_ICM42607_GYRO_CHAN macro had a third
parameter of _ext_info, drop it and just point the .ext_info field to
the respective inv_icm42607_*_ext_infos. This reduces the repetitive
calling of inv_icm42607_*_ext_infos struct in the IIO channel spec
struct and makes the code more easy to follow.
Signed-off-by: Kanak Shilledar <kanak.shilledar@axis.com>
---
drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c | 13 +++++--------
drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c | 13 +++++--------
2 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c b/drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c
index 0b3f035c2da0c..9a3ace3e7fcf9 100644
--- a/drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c
+++ b/drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c
@@ -17,7 +17,7 @@
#include "inv_icm42607.h"
#include "inv_icm42607_temp.h"
-#define INV_ICM42607_ACCEL_CHAN(_modifier, _index, _ext_info) \
+#define INV_ICM42607_ACCEL_CHAN(_modifier, _index) \
{ \
.type = IIO_ACCEL, \
.modified = 1, \
@@ -34,7 +34,7 @@
.storagebits = 16, \
.endianness = IIO_BE, \
}, \
- .ext_info = _ext_info, \
+ .ext_info = inv_icm42607_accel_ext_infos, \
}
enum inv_icm42607_accel_scan {
@@ -50,12 +50,9 @@ static const struct iio_chan_spec_ext_info inv_icm42607_accel_ext_infos[] = {
};
static const struct iio_chan_spec inv_icm42607_accel_channels[] = {
- INV_ICM42607_ACCEL_CHAN(IIO_MOD_X, INV_ICM42607_ACCEL_SCAN_X,
- inv_icm42607_accel_ext_infos),
- INV_ICM42607_ACCEL_CHAN(IIO_MOD_Y, INV_ICM42607_ACCEL_SCAN_Y,
- inv_icm42607_accel_ext_infos),
- INV_ICM42607_ACCEL_CHAN(IIO_MOD_Z, INV_ICM42607_ACCEL_SCAN_Z,
- inv_icm42607_accel_ext_infos),
+ INV_ICM42607_ACCEL_CHAN(IIO_MOD_X, INV_ICM42607_ACCEL_SCAN_X),
+ INV_ICM42607_ACCEL_CHAN(IIO_MOD_Y, INV_ICM42607_ACCEL_SCAN_Y),
+ INV_ICM42607_ACCEL_CHAN(IIO_MOD_Z, INV_ICM42607_ACCEL_SCAN_Z),
INV_ICM42607_TEMP_CHAN(INV_ICM42607_ACCEL_SCAN_TEMP),
};
diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c b/drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c
index 5b4683c2dd1e4..a3bad6fbc1981 100644
--- a/drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c
+++ b/drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c
@@ -17,7 +17,7 @@
#include "inv_icm42607.h"
#include "inv_icm42607_temp.h"
-#define INV_ICM42607_GYRO_CHAN(_modifier, _index, _ext_info) \
+#define INV_ICM42607_GYRO_CHAN(_modifier, _index) \
{ \
.type = IIO_ANGL_VEL, \
.modified = 1, \
@@ -34,7 +34,7 @@
.storagebits = 16, \
.endianness = IIO_BE, \
}, \
- .ext_info = _ext_info, \
+ .ext_info = inv_icm42607_gyro_ext_infos, \
}
enum inv_icm42607_gyro_scan {
@@ -50,12 +50,9 @@ static const struct iio_chan_spec_ext_info inv_icm42607_gyro_ext_infos[] = {
};
static const struct iio_chan_spec inv_icm42607_gyro_channels[] = {
- INV_ICM42607_GYRO_CHAN(IIO_MOD_X, INV_ICM42607_GYRO_SCAN_X,
- inv_icm42607_gyro_ext_infos),
- INV_ICM42607_GYRO_CHAN(IIO_MOD_Y, INV_ICM42607_GYRO_SCAN_Y,
- inv_icm42607_gyro_ext_infos),
- INV_ICM42607_GYRO_CHAN(IIO_MOD_Z, INV_ICM42607_GYRO_SCAN_Z,
- inv_icm42607_gyro_ext_infos),
+ INV_ICM42607_GYRO_CHAN(IIO_MOD_X, INV_ICM42607_GYRO_SCAN_X),
+ INV_ICM42607_GYRO_CHAN(IIO_MOD_Y, INV_ICM42607_GYRO_SCAN_Y),
+ INV_ICM42607_GYRO_CHAN(IIO_MOD_Z, INV_ICM42607_GYRO_SCAN_Z),
INV_ICM42607_TEMP_CHAN(INV_ICM42607_GYRO_SCAN_TEMP),
};
--
2.43.0
next prev parent reply other threads:[~2026-10-02 11:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 11:54 [PATCH v5 0/6] Add support for InvenSense ICM-42370-P accelerometer Kanak Shilledar
2026-10-02 11:54 ` [PATCH v5 1/6] dt-bindings: iio: imu: icm42600: Add ICM-42670-P Kanak Shilledar
2026-10-02 12:01 ` sashiko-bot
2026-10-02 17:11 ` Conor Dooley
2026-10-02 17:11 ` Conor Dooley
2026-10-02 11:54 ` Kanak Shilledar [this message]
2026-10-05 0:25 ` [PATCH v5 2/6] iio: imu: inv_icm42607: Simplify IIO channel macros Marcelo Schmitt
2026-10-02 11:54 ` [PATCH v5 3/6] iio: imu: inv_icm42607: Initialize gyro based on chip_info Kanak Shilledar
2026-10-02 13:03 ` Andy Shevchenko
2026-10-05 0:39 ` Marcelo Schmitt
2026-10-02 11:54 ` [PATCH v5 4/6] iio: imu: inv_icm42607: Add support for ICM-42370-P Kanak Shilledar
2026-10-02 13:04 ` Andy Shevchenko
2026-10-05 0:43 ` Marcelo Schmitt
2026-10-02 11:54 ` [PATCH v5 5/6] iio: imu: inv_icm42607: Implement MREGx register access Kanak Shilledar
2026-10-02 12:03 ` sashiko-bot
2026-10-02 13:12 ` Andy Shevchenko
2026-10-02 14:25 ` Kanak Shilledar
2026-10-03 15:02 ` andriy.shevchenko
2026-10-05 15:02 ` Kanak Shilledar
2026-10-02 11:54 ` [PATCH v5 6/6] iio: imu: inv_icm42607: Add accelerometer calibbias support Kanak Shilledar
2026-10-02 13:18 ` Andy Shevchenko
2026-10-02 14:03 ` Kanak Shilledar
2026-10-03 14:57 ` andriy.shevchenko
2026-10-05 0:51 ` Marcelo Schmitt
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=20261002-b4-inv_icm42370p-v5-2-c65281b745c9@axis.com \
--to=kanak.shilledar@axis.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=henrik.grimler@axis.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=joshua.crofts1@gmail.com \
--cc=kernel@axis.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macromorgan@hotmail.com \
--cc=marcelo.schmitt1@gmail.com \
--cc=nuno.sa@analog.com \
--cc=robh@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