mfd: Support LP3974 RTC
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 4 Jan 2011 05:17:39 +0000 (14:17 +0900)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 14 Jan 2011 11:38:16 +0000 (12:38 +0100)
commit337ce5d1c5759644cea6c47220ce7e84f0398362
tree0436dbc242425226202476d6181fa6ae89e3a206
parentde8255ccd219267cfd34139022b197c1ef8f032f
mfd: Support LP3974 RTC

The first releases of LP3974 have a large delay in RTC registers,
which requires 2 seconds of delay after writing to a rtc register
(recommended by National Semiconductor's engineers)
before reading it.

If "rtc_delay" field of the platform data is true, the rtc driver
assumes that such delays are required. Although we have not seen
LP3974s without requiring such delays, we assume that such LP3974s
will be released soon (or they have done so already) and they are
supported by "lp3974" without setting "rtc_delay" at the platform
data.

This patch adds delays with msleep when writing values to RTC registers
if the platform data has rtc_delay set.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/max8998.c
drivers/regulator/max8998.c
drivers/rtc/rtc-max8998.c
include/linux/mfd/max8998.h