Skip to contentSkip to conversation

iio: adc: stm32: fix minimum sampling time values

PATCH In review Fabrice Gasnier 2 participants 2 messages Sep 24 – Sep 27

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: adc: stm32: fix minimum sampling time values

From: Cheick Traore <[email protected]>

- On stm32mp15: vddcpu and vddq_ddr are not connected to internal channel, so their sampling time shouldn't be set.

- On stm32mp13: vddcpu and vddq_ddr are connected to internal channels and the value for vddcore was not correct. Values from the datasheet are 1us (e.g. 1000ns) for ts_vddcore, ts_vddcpu and ts_vddq_ddr.

Fixes 7cb2303dd024 ("iio: adc: stm32: manage min sampling time on all internal channels")
---
 drivers/iio/adc/stm32-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/stm32-adc.c +2 -2
index 90f0e257e6d1..b024326775ae 100644
@@ -2734,7 +2734,7 @@ static const struct stm32_adc_cfg stm32h7_adc_cfg = {
 	.set_ovs = stm32h7_adc_set_ovs,
 };
 
-static const unsigned int stm32_adc_min_ts_mp1[] = { 100, 100, 100, 4300, 9800 };
+static const unsigned int stm32_adc_min_ts_mp1[] = { 100, 0, 0, 4300, 9800 };
 static_assert(ARRAY_SIZE(stm32_adc_min_ts_mp1) == STM32_ADC_INT_CH_NB);
 
 static const struct stm32_adc_cfg stm32mp1_adc_cfg = {
@@ -2756,7 +2756,7 @@ static const struct stm32_adc_cfg stm32mp1_adc_cfg = {
 	.set_ovs = stm32h7_adc_set_ovs,
 };
 
-static const unsigned int stm32_adc_min_ts_mp13[] = { 100, 0, 0, 4300, 9800 };
+static const unsigned int stm32_adc_min_ts_mp13[] = { 1000, 1000, 1000, 4300, 9800 };
 static_assert(ARRAY_SIZE(stm32_adc_min_ts_mp13) == STM32_ADC_INT_CH_NB);
 
 static const struct stm32_adc_cfg stm32mp13_adc_cfg = {

---
base-commit: 182c47735554925da9605dc9dd90a8c15a1bbae5
change-id: 20260924-adc-fix-sampling-526f0f26829b

Best regards,

Signature · 1 line
Fabrice Gasnier <[email protected]>
maintainer
#1 lore raw
Quoted 5 lines · On Thu, 24 Sep 2026 11:53:56 +0200 Fabrice Gasnier…

From: Cheick Traore <[email protected]>

- On stm32mp15: vddcpu and vddq_ddr are not connected to internal channel, so their sampling time shouldn't be set.

Quoted 8 lines

- On stm32mp13: vddcpu and vddq_ddr are connected to internal channels and the value for vddcore was not correct. Values from the datasheet are 1us (e.g. 1000ns) for ts_vddcore, ts_vddcpu and ts_vddq_ddr.

Fixes 7cb2303dd024 ("iio: adc: stm32: manage min sampling time on all internal channels")

Hi Cheick, Fabrice

Given we are fairly late in the cycle and that we have Fabrice's other series poking at this same driver I've queued this up on the testing branch of iio.git rather than taking a (possibly) faster path. That means it will go upstream in the next merge window.

Thanks,

Jonathan

Quoted 35 lines
---
 drivers/iio/adc/stm32-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/stm32-adc.c +2 -3
index 90f0e257e6d1..b024326775ae 100644
@@ -2734,7 +2734,7 @@ static const struct stm32_adc_cfg stm32h7_adc_cfg = {
 	.set_ovs = stm32h7_adc_set_ovs,
 };
 
-static const unsigned int stm32_adc_min_ts_mp1[] = { 100, 100, 100, 4300, 9800 };
+static const unsigned int stm32_adc_min_ts_mp1[] = { 100, 0, 0, 4300, 9800 };
 static_assert(ARRAY_SIZE(stm32_adc_min_ts_mp1) == STM32_ADC_INT_CH_NB);
 
 static const struct stm32_adc_cfg stm32mp1_adc_cfg = {
@@ -2756,7 +2756,7 @@ static const struct stm32_adc_cfg stm32mp1_adc_cfg = {
 	.set_ovs = stm32h7_adc_set_ovs,
 };
 
-static const unsigned int stm32_adc_min_ts_mp13[] = { 100, 0, 0, 4300, 9800 };
+static const unsigned int stm32_adc_min_ts_mp13[] = { 1000, 1000, 1000, 4300, 9800 };
 static_assert(ARRAY_SIZE(stm32_adc_min_ts_mp13) == STM32_ADC_INT_CH_NB);
 
 static const struct stm32_adc_cfg stm32mp13_adc_cfg = {
 
---

base-commit: 182c47735554925da9605dc9dd90a8c15a1bbae5
change-id: 20260924-adc-fix-sampling-526f0f26829b

Best regards,

Signature · 1 line
Fabrice Gasnier <[email protected]>