Skip to content

Commit c8daf49

Browse files
ukleineknunojsa
authored andcommitted
iio: adc: ad4630: Specify the PWM phase in nano seconds
Since commit 2e424f1 ("iio: adc: ad4630: Specify PWM parameters in nanoseconds") the unit of PWM parameters is measured in nano seconds and since commit 4246bc9 ("pwm: Drop support for time units other than nanoseconds") only nano seconds are possible. Convert tquiet_con_delay to nano seconds accordingly. Fixes: a18c50e ("iio: adc: ad4630: Make fetch trigger PWM phase smaller than period") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
1 parent 35e2d4d commit c8daf49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iio/adc/ad4630.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
/* sequence starting with "1 0 1" to enable reg access */
9595
#define AD4630_REG_ACCESS 0x2000
9696
/* Sampling timing */
97-
#define AD4630_TQUIET_CNV_DELAY_PS 9800
97+
#define AD4630_TQUIET_CNV_DELAY_NS 10
9898
#define AD4630_MAX_RATE_1_LANE 1750000
9999
#define AD4630_MAX_RATE 2000000
100100

@@ -407,7 +407,7 @@ static int __ad4630_set_sampling_freq(const struct ad4630_state *st, unsigned in
407407
* tsync + tquiet_con_delay being tsync the conversion signal period
408408
* and tquiet_con_delay 9.8ns. Hence set the PWM phase accordingly.
409409
*/
410-
fetch_state.phase = AD4630_TQUIET_CNV_DELAY_PS;
410+
fetch_state.phase = AD4630_TQUIET_CNV_DELAY_NS;
411411

412412
return pwm_apply_state(st->fetch_trigger, &fetch_state);
413413
}
@@ -600,7 +600,7 @@ static int ad4630_update_sample_fetch_trigger(const struct ad4630_state *st, u32
600600
pwm_get_state(st->conv_trigger, &conv_state);
601601
pwm_get_state(st->fetch_trigger, &fetch_state);
602602
fetch_state.period = conv_state.period * 1 << avg;
603-
fetch_state.phase = AD4630_TQUIET_CNV_DELAY_PS;
603+
fetch_state.phase = AD4630_TQUIET_CNV_DELAY_NS;
604604

605605
return pwm_apply_state(st->fetch_trigger, &fetch_state);
606606
}

0 commit comments

Comments
 (0)