iio: adc: vf610: Determine sampling frequencies by using minimum sample time
authorSanchayan Maity <maitysanchayan@gmail.com>
Tue, 14 Jul 2015 13:53:22 +0000 (19:23 +0530)
committerJonathan Cameron <jic23@kernel.org>
Mon, 20 Jul 2015 17:41:16 +0000 (18:41 +0100)
commit5e9972cd6f1a69ee8a8ee8664d3e4c4ea59c0901
treebd6a8e015650efcaa5f20092fecc173f7956fb01
parentf686a36b4b79782a94f07769fb1c0187d24ea8a8
iio: adc: vf610: Determine sampling frequencies by using minimum sample time

The driver currently does not take into account the minimum sample time
as per the Figure 6-8 Chapter 9.1.1 12-bit ADC electrical characteristics.
We set a static amount of cycles instead of considering the sample time
as a given value, which depends on hardware characteristics.

Determine sampling frequencies by first reading the device tree property
node and then calculating the required Long Sample Time Adder (LSTAdder)
value, based on the ADC clock frequency and sample time value obtained
from the device tree. This LSTAdder value is then used for calculating
the sampling frequencies possible.

In case the sample time property is not specified through the device
tree, a safe default value of 1000ns is assumed.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
Acked-by: Stefan Agner <stefan@agner.ch>
Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/devicetree/bindings/iio/adc/vf610-adc.txt
drivers/iio/adc/vf610_adc.c