linux/drivers/iio/adc
Stefan Agner 6ba8fef3fc iio: adc: vf610: use ADC clock within specification
commit f54e9f2be3 upstream.

Depending on conversion mode used, the ADC clock (ADCK) needs
to be below a maximum frequency. According to Vybrid's data
sheet this is 20MHz for the low power conversion mode.

The ADC clock is depending on input clock, which is the bus
clock by default. Vybrid SoC are typically clocked at at 400MHz
or 500MHz, which leads to 66MHz or 83MHz bus clock respectively.
Hence, a divider of 8 is required to stay below the specified
maximum clock of 20MHz.

Due to the different bus clock speeds, the resulting sampling
frequency is not static. Hence use the ADC clock and calculate
the actual available sampling frequency dynamically.

This fixes bogous values observed on some 500MHz clocked Vybrid
SoC. The resulting value usually showed Bit 9 being stuck at 1,
or 0, which lead to a value of +/-512.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-04-13 16:48:58 +01:00
..
ad799x.c iio:adc:ad799x: Fix reading and writing of event values, apply shift 2014-06-21 10:43:13 +01:00
ad7266.c iio:ad7266: Mark transfer buffer as __be16 2013-12-03 20:22:27 +00:00
ad7298.c iio:ad7298: Use iio_push_to_buffers_with_timestamp() 2013-09-21 19:23:52 +01:00
ad7476.c iio:ad7476: Report scale as fractional value 2013-10-01 16:19:12 +01:00
ad7791.c iio:ad7791: Report scale as fractional value 2013-10-01 16:19:12 +01:00
ad7793.c iio: adc: ad7793: Use devm_* APIs 2013-08-03 18:40:39 +01:00
ad7887.c iio:adc:ad7887 Fix channel reported endianness from cpu to big endian 2013-12-17 20:37:14 +00:00
ad7923.c iio:ad7923: Use iio_push_to_buffers_with_timestamp() 2013-09-21 19:23:53 +01:00
ad_sigma_delta.c iio: adc: ad_sigma_delta: Fix indio_dev->trig assignment 2014-10-05 13:41:04 -07:00
at91_adc.c iio: fix drivers that check buffer->scan_mask 2015-04-13 16:48:55 +01:00
exynos_adc.c Merge 3.15-rc6 into staging-next. 2014-05-22 23:27:17 +09:00
Kconfig Third round of new stuff for IIO in the 3.16 cycle. 2014-05-25 10:56:30 -07:00
lp8788_adc.c iio: adc: lp8788_adc: Use devm_* APIs 2013-08-03 18:40:40 +01:00
Makefile First round of IIO new driver, functionality and cleanups for the 3.16 cycle. 2014-04-26 08:12:25 -07:00
max1363.c iio:adc:max1363 incorrect resolutions for max11604, max11605, max11610 and max11611. 2014-05-25 12:06:25 +01:00
mcp320x.c iio: adc: mcp320x: Use devm_* APIs 2013-08-03 18:40:41 +01:00
mcp3422.c iio:adc:mcp3422 Fix incorrect scales table 2015-03-18 14:41:47 +00:00
men_z188_adc.c iio: adc: men_z188_adc: Add terminating entry for men_z188_ids 2014-12-04 14:36:31 +00:00
nau7802.c tree-wide: use reinit_completion instead of INIT_COMPLETION 2013-11-15 09:32:21 +09:00
ti-adc081c.c iio: adc: ti-adc081c: Include linux/of.h header 2013-10-18 20:05:56 +01:00
ti_am335x_adc.c iio: fix drivers that check buffer->scan_mask 2015-04-13 16:48:55 +01:00
twl4030-madc.c twl4030-madc: Request processed values in twl4030_get_madc_conversion 2014-06-02 21:53:27 +01:00
twl6030-gpadc.c First set of new drivers and cleanups for IIO in the 3.15 cycle. 2014-02-11 14:12:12 -08:00
vf610_adc.c iio: adc: vf610: use ADC clock within specification 2015-04-13 16:48:58 +01:00
viperboard_adc.c iio: adc: viperboard: Drop platform_set_drvdata call 2014-02-03 19:27:59 +00:00
xilinx-xadc-core.c iio: adc: xilinx-xadc: assign auxiliary channels address correctly 2014-10-05 13:41:04 -07:00
xilinx-xadc-events.c iio:adc: Add Xilinx XADC driver 2014-03-01 21:04:29 +00:00
xilinx-xadc.h iio:adc: Add Xilinx XADC driver 2014-03-01 21:04:29 +00:00