mfd: ti_am335x_tscadc: Fix spin lock and reg_cache
authorZubair Lutfullah <zubair.lutfullah@gmail.com>
Mon, 5 Aug 2013 19:10:45 +0000 (20:10 +0100)
committerLee Jones <lee.jones@linaro.org>
Wed, 14 Aug 2013 17:53:03 +0000 (18:53 +0100)
commit45491ada9830cd22e386499cbeb7cab2f24a1136
tree555887d6d4d01558b86a1d825078d8cb9e00f34c
parente293e847275b2d1a4768ca25f0933a70b2383016
mfd: ti_am335x_tscadc: Fix spin lock and reg_cache

Reg_cache variable is used to lock step enable register
from being accessed and written by both TSC and ADC
at the same time.
However, it isn't updated anywhere in the code at all.

If both TSC and ADC are used, eventually 1FFFF is always
written enabling all 16 steps uselessly causing a mess.

Patch fixes it by correcting the locks and updates the
variable by reading the step enable register

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/ti_am335x_tscadc.c