* [PATCH 0/3] AD7173 fixes
@ 2024-05-21 8:45 Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 1/3] iio: adc: ad7173: fix buffers enablement for ad7176-2 Dumitru Ceclan via B4 Relay
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Dumitru Ceclan via B4 Relay @ 2024-05-21 8:45 UTC (permalink / raw)
To: Lars-Peter Clausen, Jonathan Cameron
Cc: linux-iio, linux-kernel, Dumitru Ceclan, David Lechner
This patch series adds fixes for ad7173 driver that were originally
sent along AD411x series. To ensure that they are included in this
current rc cycle they are sent in a separate series with the Fixes tag.
Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
---
Dumitru Ceclan (3):
iio: adc: ad7173: fix buffers enablement for ad7176-2
iio: adc: ad7173: Add ad7173_device_info names
iio: adc: ad7173: Remove index from temp channel
drivers/iio/adc/ad7173.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
---
base-commit: 5ab61121a34759eb2418977f0b3589b7edc57776
change-id: 20240521-ad7173-fixes-4e2e5a061ef2
Best regards,
--
Dumitru Ceclan <dumitru.ceclan@analog.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] iio: adc: ad7173: fix buffers enablement for ad7176-2
2024-05-21 8:45 [PATCH 0/3] AD7173 fixes Dumitru Ceclan via B4 Relay
@ 2024-05-21 8:45 ` Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 2/3] iio: adc: ad7173: Add ad7173_device_info names Dumitru Ceclan via B4 Relay
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Dumitru Ceclan via B4 Relay @ 2024-05-21 8:45 UTC (permalink / raw)
To: Lars-Peter Clausen, Jonathan Cameron
Cc: linux-iio, linux-kernel, Dumitru Ceclan, David Lechner
From: Dumitru Ceclan <dumitru.ceclan@analog.com>
AD7176-2 does not feature input buffers and marks corespondent register
bits as read only. Enable buffers only on supported models.
Fixes: 8eb903272f75 ("iio: adc: ad7173: add AD7173 driver")
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
---
drivers/iio/adc/ad7173.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
index f6d29abe1d04..850574437bda 100644
--- a/drivers/iio/adc/ad7173.c
+++ b/drivers/iio/adc/ad7173.c
@@ -145,6 +145,7 @@ struct ad7173_device_info {
unsigned int id;
char *name;
bool has_temp;
+ bool has_input_buf;
bool has_int_ref;
bool has_ref2;
u8 num_gpios;
@@ -212,6 +213,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_configs = 4,
.num_gpios = 2,
.has_temp = true,
+ .has_input_buf = true,
.has_int_ref = true,
.clock = 2 * HZ_PER_MHZ,
.sinc5_data_rates = ad7173_sinc5_data_rates,
@@ -224,6 +226,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_configs = 8,
.num_gpios = 4,
.has_temp = false,
+ .has_input_buf = true,
.has_ref2 = true,
.clock = 2 * HZ_PER_MHZ,
.sinc5_data_rates = ad7173_sinc5_data_rates,
@@ -237,6 +240,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_configs = 8,
.num_gpios = 4,
.has_temp = true,
+ .has_input_buf = true,
.has_int_ref = true,
.has_ref2 = true,
.clock = 2 * HZ_PER_MHZ,
@@ -251,6 +255,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_configs = 4,
.num_gpios = 2,
.has_temp = true,
+ .has_input_buf = true,
.has_int_ref = true,
.clock = 16 * HZ_PER_MHZ,
.sinc5_data_rates = ad7175_sinc5_data_rates,
@@ -263,6 +268,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_configs = 8,
.num_gpios = 4,
.has_temp = true,
+ .has_input_buf = true,
.has_int_ref = true,
.has_ref2 = true,
.clock = 16 * HZ_PER_MHZ,
@@ -277,6 +283,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_configs = 4,
.num_gpios = 2,
.has_temp = false,
+ .has_input_buf = false,
.has_int_ref = true,
.clock = 16 * HZ_PER_MHZ,
.sinc5_data_rates = ad7175_sinc5_data_rates,
@@ -289,6 +296,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_configs = 4,
.num_gpios = 2,
.has_temp = true,
+ .has_input_buf = true,
.has_int_ref = true,
.clock = 16 * HZ_PER_MHZ,
.odr_start_value = AD7177_ODR_START_VALUE,
@@ -932,7 +940,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
AD7173_CH_ADDRESS(chan_arr[chan_index].channel,
chan_arr[chan_index].channel2);
chan_st_priv->cfg.bipolar = false;
- chan_st_priv->cfg.input_buf = true;
+ chan_st_priv->cfg.input_buf = st->info->has_input_buf;
chan_st_priv->cfg.ref_sel = AD7173_SETUP_REF_SEL_INT_REF;
st->adc_mode |= AD7173_ADC_MODE_REF_EN;
@@ -989,7 +997,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
chan_st_priv->ain = AD7173_CH_ADDRESS(ain[0], ain[1]);
chan_st_priv->chan_reg = chan_index;
- chan_st_priv->cfg.input_buf = true;
+ chan_st_priv->cfg.input_buf = st->info->has_input_buf;
chan_st_priv->cfg.odr = 0;
chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar");
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] iio: adc: ad7173: Add ad7173_device_info names
2024-05-21 8:45 [PATCH 0/3] AD7173 fixes Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 1/3] iio: adc: ad7173: fix buffers enablement for ad7176-2 Dumitru Ceclan via B4 Relay
@ 2024-05-21 8:45 ` Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 3/3] iio: adc: ad7173: Remove index from temp channel Dumitru Ceclan via B4 Relay
2024-05-25 16:44 ` [PATCH 0/3] AD7173 fixes Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Dumitru Ceclan via B4 Relay @ 2024-05-21 8:45 UTC (permalink / raw)
To: Lars-Peter Clausen, Jonathan Cameron
Cc: linux-iio, linux-kernel, Dumitru Ceclan
From: Dumitru Ceclan <dumitru.ceclan@analog.com>
Add missing names from the device info struct for 3 models to ensure
consistency with the rest of the models.
Fixes: 8eb903272f75 ("iio: adc: ad7173: add AD7173 driver")
Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
---
drivers/iio/adc/ad7173.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
index 850574437bda..58620be41ef5 100644
--- a/drivers/iio/adc/ad7173.c
+++ b/drivers/iio/adc/ad7173.c
@@ -220,6 +220,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates),
},
[ID_AD7172_4] = {
+ .name = "ad7172-4",
.id = AD7172_4_ID,
.num_inputs = 9,
.num_channels = 8,
@@ -262,6 +263,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
},
[ID_AD7175_8] = {
+ .name = "ad7175-8",
.id = AD7175_8_ID,
.num_inputs = 17,
.num_channels = 16,
@@ -290,6 +292,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
.num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
},
[ID_AD7177_2] = {
+ .name = "ad7177-2",
.id = AD7177_ID,
.num_inputs = 5,
.num_channels = 4,
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] iio: adc: ad7173: Remove index from temp channel
2024-05-21 8:45 [PATCH 0/3] AD7173 fixes Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 1/3] iio: adc: ad7173: fix buffers enablement for ad7176-2 Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 2/3] iio: adc: ad7173: Add ad7173_device_info names Dumitru Ceclan via B4 Relay
@ 2024-05-21 8:45 ` Dumitru Ceclan via B4 Relay
2024-05-25 16:44 ` [PATCH 0/3] AD7173 fixes Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Dumitru Ceclan via B4 Relay @ 2024-05-21 8:45 UTC (permalink / raw)
To: Lars-Peter Clausen, Jonathan Cameron
Cc: linux-iio, linux-kernel, Dumitru Ceclan
From: Dumitru Ceclan <dumitru.ceclan@analog.com>
Temperature channel is unique per device, index is not needed.
This is breaking userspace: Include fixes tag to be released within the
same rc cycle.
Fixes: 8eb903272f75 ("iio: adc: ad7173: add AD7173 driver")
Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
---
drivers/iio/adc/ad7173.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
index 58620be41ef5..eb512878c30e 100644
--- a/drivers/iio/adc/ad7173.c
+++ b/drivers/iio/adc/ad7173.c
@@ -815,7 +815,6 @@ static const struct iio_chan_spec ad7173_channel_template = {
static const struct iio_chan_spec ad7173_temp_iio_channel_template = {
.type = IIO_TEMP,
- .indexed = 1,
.channel = AD7173_AIN_TEMP_POS,
.channel2 = AD7173_AIN_TEMP_NEG,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] AD7173 fixes
2024-05-21 8:45 [PATCH 0/3] AD7173 fixes Dumitru Ceclan via B4 Relay
` (2 preceding siblings ...)
2024-05-21 8:45 ` [PATCH 3/3] iio: adc: ad7173: Remove index from temp channel Dumitru Ceclan via B4 Relay
@ 2024-05-25 16:44 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2024-05-25 16:44 UTC (permalink / raw)
To: Dumitru Ceclan via B4 Relay
Cc: dumitru.ceclan, Lars-Peter Clausen, linux-iio, linux-kernel,
David Lechner
On Tue, 21 May 2024 11:45:38 +0300
Dumitru Ceclan via B4 Relay <devnull+dumitru.ceclan.analog.com@kernel.org> wrote:
> This patch series adds fixes for ad7173 driver that were originally
> sent along AD411x series. To ensure that they are included in this
> current rc cycle they are sent in a separate series with the Fixes tag.
>
> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
Applied to the fixes-togreg branch of iio.git. That has been rebased
on char-misc/char-misc-linus post the char-misc pull request going upstream
but will be rebased again on rc1, probably on Monday.
Jonathan
> ---
> Dumitru Ceclan (3):
> iio: adc: ad7173: fix buffers enablement for ad7176-2
> iio: adc: ad7173: Add ad7173_device_info names
> iio: adc: ad7173: Remove index from temp channel
>
> drivers/iio/adc/ad7173.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
> ---
> base-commit: 5ab61121a34759eb2418977f0b3589b7edc57776
> change-id: 20240521-ad7173-fixes-4e2e5a061ef2
>
> Best regards,
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-05-25 16:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21 8:45 [PATCH 0/3] AD7173 fixes Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 1/3] iio: adc: ad7173: fix buffers enablement for ad7176-2 Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 2/3] iio: adc: ad7173: Add ad7173_device_info names Dumitru Ceclan via B4 Relay
2024-05-21 8:45 ` [PATCH 3/3] iio: adc: ad7173: Remove index from temp channel Dumitru Ceclan via B4 Relay
2024-05-25 16:44 ` [PATCH 0/3] AD7173 fixes Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox