aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/adis_trigger.c
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2015-03-24 13:47:47 +0100
committerJonathan Cameron <jic23@kernel.org>2015-03-28 12:00:02 +0000
commitf54e9f2be312a4e71b54aea865b2e33ccb95ef0c (patch)
treebac655359a11f9319f62a84d4879cab0e1624128 /drivers/iio/imu/adis_trigger.c
parentiio/adc/cc10001_adc.c: Fix !HAS_IOMEM build (diff)
downloadlinux-dev-f54e9f2be312a4e71b54aea865b2e33ccb95ef0c.tar.xz
linux-dev-f54e9f2be312a4e71b54aea865b2e33ccb95ef0c.zip
iio: adc: vf610: use ADC clock within specification
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> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/imu/adis_trigger.c')
0 files changed, 0 insertions, 0 deletions