aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-sw-trigger.c
diff options
context:
space:
mode:
authorMaarten ter Huurne <maarten@treewalker.org>2019-07-04 19:36:56 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-07-14 16:02:08 +0100
commit5a304e1a4ea000177cf25f5ecf26e786dda25b98 (patch)
tree96f6940581418d915583d7c0791fd2700a7d93d8 /drivers/iio/industrialio-sw-trigger.c
parentiio: adc: max9611: Fix misuse of GENMASK macro (diff)
downloadlinux-dev-5a304e1a4ea000177cf25f5ecf26e786dda25b98.tar.xz
linux-dev-5a304e1a4ea000177cf25f5ecf26e786dda25b98.zip
IIO: Ingenic JZ47xx: Set clock divider on probe
The SADC component can run at up to 8 MHz on JZ4725B, but is fed a 12 MHz input clock (EXT). Divide it by two to get 6 MHz, then set up another divider to match, to produce a 10us clock. If the clock dividers are left on their power-on defaults (a divider of 1), the SADC mostly works, but will occasionally produce erroneous readings. This led to button presses being detected out of nowhere on the RS90 every few minutes. With this change, no ghost button presses were logged in almost a day worth of testing. The ADCLK register for configuring clock dividers doesn't exist on JZ4740, so avoid writing it there. A function has been introduced rather than a flag because there is a lot of variation between the ADCLK registers on JZ47xx SoCs, both in the internal layout of the register and in the frequency range supported by the SADC. So this solution should make it easier to add support for other JZ47xx SoCs later. Fixes: 1a78daea107d ("iio: adc: probe should set clock divider") Signed-off-by: Maarten ter Huurne <maarten@treewalker.org> Signed-off-by: Artur Rojek <contact@artur-rojek.eu> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/industrialio-sw-trigger.c')
0 files changed, 0 insertions, 0 deletions