Skip to content

Commit 6fa908a

Browse files
dlechjic23
authored andcommitted
iio: adc: ad7173: fix setting ODR in probe
Fix the setting of the ODR register value in the probe function for AD7177. The AD7177 chip has a different ODR value after reset than the other chips (0x7 vs. 0x0) and 0 is a reserved value on that chip. The driver already has this information available in odr_start_value and uses it when checking valid values when writing to the sampling_frequency attribute, but failed to set the correct initial value in the probe function. Fixes: 37ae838 ("iio: adc: ad7173: add support for additional models") Signed-off-by: David Lechner <[email protected]> Link: https://patch.msgid.link/20250710-iio-adc-ad7173-fix-setting-odr-in-probe-v1-1-78a100fec998@baylibre.com Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 1d9a21f commit 6fa908a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iio/adc/ad7173.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
15891589
chan_st_priv->cfg.bipolar = false;
15901590
chan_st_priv->cfg.input_buf = st->info->has_input_buf;
15911591
chan_st_priv->cfg.ref_sel = AD7173_SETUP_REF_SEL_INT_REF;
1592+
chan_st_priv->cfg.odr = st->info->odr_start_value;
15921593
chan_st_priv->cfg.openwire_comp_chan = -1;
15931594
st->adc_mode |= AD7173_ADC_MODE_REF_EN;
15941595
if (st->info->data_reg_only_16bit)
@@ -1655,7 +1656,7 @@ static int ad7173_fw_parse_channel_config(struct iio_dev *indio_dev)
16551656
chan->scan_index = chan_index;
16561657
chan->channel = ain[0];
16571658
chan_st_priv->cfg.input_buf = st->info->has_input_buf;
1658-
chan_st_priv->cfg.odr = 0;
1659+
chan_st_priv->cfg.odr = st->info->odr_start_value;
16591660
chan_st_priv->cfg.openwire_comp_chan = -1;
16601661

16611662
chan_st_priv->cfg.bipolar = fwnode_property_read_bool(child, "bipolar");

0 commit comments

Comments
 (0)