public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Ramona Gradinariu <ramona.bolboaca13@gmail.com>
To: linux-kernel@vger.kernel.org, jic23@kernel.org,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	robh@kernel.org, nuno.sa@analog.com
Cc: Ramona Gradinariu <ramona.bolboaca13@gmail.com>
Subject: [PATCH v4 08/10] iio: imu: adis16475: Re-define ADIS16475_DATA
Date: Fri, 24 May 2024 12:00:29 +0300	[thread overview]
Message-ID: <20240524090030.336427-9-ramona.bolboaca13@gmail.com> (raw)
In-Reply-To: <20240524090030.336427-1-ramona.bolboaca13@gmail.com>

Re-define ADIS16475_DATA such that it takes _has_fifo as parameter.

Signed-off-by: Ramona Gradinariu <ramona.bolboaca13@gmail.com>
---
 drivers/iio/imu/adis16475.c | 95 +++++++++++++++++++------------------
 1 file changed, 48 insertions(+), 47 deletions(-)

diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
index c589f214259b..3bbf3e181e1a 100644
--- a/drivers/iio/imu/adis16475.c
+++ b/drivers/iio/imu/adis16475.c
@@ -695,32 +695,33 @@ static const char * const adis16475_status_error_msgs[] = {
 	[ADIS16475_DIAG_STAT_CLK] = "Clock error",
 };
 
-#define ADIS16475_DATA(_prod_id, _timeouts, _burst_max_len, _burst_max_speed_hz)	\
-{											\
-	.msc_ctrl_reg = ADIS16475_REG_MSG_CTRL,						\
-	.glob_cmd_reg = ADIS16475_REG_GLOB_CMD,						\
-	.diag_stat_reg = ADIS16475_REG_DIAG_STAT,					\
-	.prod_id_reg = ADIS16475_REG_PROD_ID,						\
-	.prod_id = (_prod_id),								\
-	.self_test_mask = BIT(2),							\
-	.self_test_reg = ADIS16475_REG_GLOB_CMD,					\
-	.cs_change_delay = 16,								\
-	.read_delay = 5,								\
-	.write_delay = 5,								\
-	.status_error_msgs = adis16475_status_error_msgs,				\
-	.status_error_mask = BIT(ADIS16475_DIAG_STAT_DATA_PATH) |			\
-		BIT(ADIS16475_DIAG_STAT_FLASH_MEM) |					\
-		BIT(ADIS16475_DIAG_STAT_SPI) |						\
-		BIT(ADIS16475_DIAG_STAT_STANDBY) |					\
-		BIT(ADIS16475_DIAG_STAT_SENSOR) |					\
-		BIT(ADIS16475_DIAG_STAT_MEMORY) |					\
-		BIT(ADIS16475_DIAG_STAT_CLK),						\
-	.unmasked_drdy = true,								\
-	.timeouts = (_timeouts),							\
-	.burst_reg_cmd = ADIS16475_REG_GLOB_CMD,					\
-	.burst_len = ADIS16475_BURST_MAX_DATA,						\
-	.burst_max_len = _burst_max_len,						\
-	.burst_max_speed_hz = _burst_max_speed_hz					\
+#define ADIS16475_DATA(_prod_id, _timeouts, _burst_max_len, _burst_max_speed_hz, _has_fifo)	\
+{												\
+	.msc_ctrl_reg = ADIS16475_REG_MSG_CTRL,							\
+	.glob_cmd_reg = ADIS16475_REG_GLOB_CMD,							\
+	.diag_stat_reg = ADIS16475_REG_DIAG_STAT,						\
+	.prod_id_reg = ADIS16475_REG_PROD_ID,							\
+	.prod_id = (_prod_id),									\
+	.self_test_mask = BIT(2),								\
+	.self_test_reg = ADIS16475_REG_GLOB_CMD,						\
+	.cs_change_delay = 16,									\
+	.read_delay = 5,									\
+	.write_delay = 5,									\
+	.status_error_msgs = adis16475_status_error_msgs,					\
+	.status_error_mask = BIT(ADIS16475_DIAG_STAT_DATA_PATH) |				\
+		BIT(ADIS16475_DIAG_STAT_FLASH_MEM) |						\
+		BIT(ADIS16475_DIAG_STAT_SPI) |							\
+		BIT(ADIS16475_DIAG_STAT_STANDBY) |						\
+		BIT(ADIS16475_DIAG_STAT_SENSOR) |						\
+		BIT(ADIS16475_DIAG_STAT_MEMORY) |						\
+		BIT(ADIS16475_DIAG_STAT_CLK),							\
+	.unmasked_drdy = true,									\
+	.has_fifo = _has_fifo,									\
+	.timeouts = (_timeouts),								\
+	.burst_reg_cmd = ADIS16475_REG_GLOB_CMD,						\
+	.burst_len = ADIS16475_BURST_MAX_DATA,							\
+	.burst_max_len = _burst_max_len,							\
+	.burst_max_speed_hz = _burst_max_speed_hz						\
 }
 
 static const struct adis16475_sync adis16475_sync_mode[] = {
@@ -760,7 +761,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16470, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16475_1] = {
 		.name = "adis16475-1",
@@ -779,7 +780,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16475, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16475_2] = {
 		.name = "adis16475-2",
@@ -798,7 +799,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16475, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16475_3] = {
 		.name = "adis16475-3",
@@ -817,7 +818,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16475, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16477_1] = {
 		.name = "adis16477-1",
@@ -837,7 +838,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16477, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16477_2] = {
 		.name = "adis16477-2",
@@ -857,7 +858,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16477, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16477_3] = {
 		.name = "adis16477-3",
@@ -877,7 +878,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16477, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16465_1] = {
 		.name = "adis16465-1",
@@ -896,7 +897,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16465, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16465_2] = {
 		.name = "adis16465-2",
@@ -915,7 +916,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16465, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16465_3] = {
 		.name = "adis16465-3",
@@ -934,7 +935,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16465, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16467_1] = {
 		.name = "adis16467-1",
@@ -953,7 +954,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16467, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16467_2] = {
 		.name = "adis16467-2",
@@ -972,7 +973,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16467, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16467_3] = {
 		.name = "adis16467-3",
@@ -991,7 +992,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.num_sync = ARRAY_SIZE(adis16475_sync_mode),
 		.adis_data = ADIS16475_DATA(16467, &adis16475_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16500] = {
 		.name = "adis16500",
@@ -1012,7 +1013,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16500, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16501] = {
 		.name = "adis16501",
@@ -1033,7 +1034,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16501, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16505_1] = {
 		.name = "adis16505-1",
@@ -1054,7 +1055,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16505, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16505_2] = {
 		.name = "adis16505-2",
@@ -1075,7 +1076,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16505, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16505_3] = {
 		.name = "adis16505-3",
@@ -1096,7 +1097,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16505, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16507_1] = {
 		.name = "adis16507-1",
@@ -1117,7 +1118,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16507, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16507_2] = {
 		.name = "adis16507-2",
@@ -1138,7 +1139,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16507, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 	[ADIS16507_3] = {
 		.name = "adis16507-3",
@@ -1159,7 +1160,7 @@ static const struct adis16475_chip_info adis16475_chip_info[] = {
 		.flags = ADIS16475_HAS_BURST32 | ADIS16475_HAS_BURST_DELTA_DATA,
 		.adis_data = ADIS16475_DATA(16507, &adis1650x_timeouts,
 					    ADIS16475_BURST32_MAX_DATA,
-					    ADIS16475_BURST_MAX_SPEED),
+					    ADIS16475_BURST_MAX_SPEED, false),
 	},
 };
 
-- 
2.34.1


  parent reply	other threads:[~2024-05-24  9:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24  9:00 [PATCH v4 00/10] adis16501 and adis1657x support Ramona Gradinariu
2024-05-24  9:00 ` [PATCH v4 01/10] dt-bindings: iio: imu: Add ADIS16501 compatibles Ramona Gradinariu
2024-05-24  9:00 ` [PATCH v4 02/10] drivers: iio: imu: Add support for ADIS16501 Ramona Gradinariu
2024-05-24 10:58   ` Nuno Sá
2024-05-24  9:00 ` [PATCH v4 03/10] iio: imu: adis16475: Re-define ADIS16475_DATA Ramona Gradinariu
2024-05-24  9:00 ` [PATCH v4 04/10] iio: imu: adis_buffer: Add buffer setup API with buffer attributes Ramona Gradinariu
2024-05-24 10:58   ` Nuno Sá
2024-05-26 12:38   ` Jonathan Cameron
2024-05-24  9:00 ` [PATCH v4 05/10] iio: imu: adis16475: Create push single sample API Ramona Gradinariu
2024-05-24 10:58   ` Nuno Sá
2024-05-24  9:00 ` [PATCH v4 06/10] drivers: iio: imu: adis16475: generic computation for sample rate Ramona Gradinariu
2024-05-24 10:59   ` Nuno Sá
2024-05-24  9:00 ` [PATCH v4 07/10] iio: imu: adis_trigger: Allow level interrupts for FIFO readings Ramona Gradinariu
2024-05-24 10:59   ` Nuno Sá
2024-05-24  9:00 ` Ramona Gradinariu [this message]
2024-05-24 10:47   ` [PATCH v4 08/10] iio: imu: adis16475: Re-define ADIS16475_DATA Nuno Sá
2024-05-26 12:43     ` Jonathan Cameron
2024-05-24  9:00 ` [PATCH v4 09/10] dt-bindings: iio: imu: Add ADIS1657X family devices compatibles Ramona Gradinariu

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=20240524090030.336427-9-ramona.bolboaca13@gmail.com \
    --to=ramona.bolboaca13@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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