]> git.baikalelectronics.ru Git - kernel.git/commit
iio: adc: meson-saradc: fix the clock frequency on Meson8 and Meson8b
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Tue, 31 Oct 2017 20:01:46 +0000 (21:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:03:42 +0000 (16:03 +0100)
commit8607dbdfe76c5654b5f760c88cfadf306f9f5420
treeae63afb952771ebc0e318d554fb42e4557faf8d6
parentd984827abc85a9ea7e02d25f9438b43fee298d16
iio: adc: meson-saradc: fix the clock frequency on Meson8 and Meson8b

GX SoCs use a 1.2 MHz ADC clock, while the older SoCs use a 1.14 MHz
clock.

A comment in the driver from Amlogic's GPL kernel says that it's
running at 1.28 MHz. However, it's actually programming a divider of
20 + 1. With a XTAL clock of 24 MHz this results in a frequency of
1.14 MHz. (their calculation might be based on a 27 MHz XTAL clock,
but this is not what we have on the Meson8 and Meson8b SoCs).

The ADC was still working with the 1.2MHz clock. In my own tests I did
not see a difference between 1.2 and 1.14 MHz (regardless of the clock
frequency used, the ADC results were identical).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/meson_saradc.c