diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2011-01-04 00:17:39 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-01-14 06:38:16 -0500 |
commit | 337ce5d1c5759644cea6c47220ce7e84f0398362 (patch) | |
tree | 0436dbc242425226202476d6181fa6ae89e3a206 /drivers/mfd | |
parent | de8255ccd219267cfd34139022b197c1ef8f032f (diff) |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/max8998.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 5ce00ad5241a..bbfe86732602 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c | |||
@@ -42,6 +42,14 @@ static struct mfd_cell max8998_devs[] = { | |||
42 | }, | 42 | }, |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static struct mfd_cell lp3974_devs[] = { | ||
46 | { | ||
47 | .name = "lp3974-pmic", | ||
48 | }, { | ||
49 | .name = "lp3974-rtc", | ||
50 | }, | ||
51 | }; | ||
52 | |||
45 | int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) | 53 | int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) |
46 | { | 54 | { |
47 | struct max8998_dev *max8998 = i2c_get_clientdata(i2c); | 55 | struct max8998_dev *max8998 = i2c_get_clientdata(i2c); |
@@ -146,11 +154,23 @@ static int max8998_i2c_probe(struct i2c_client *i2c, | |||
146 | 154 | ||
147 | max8998_irq_init(max8998); | 155 | max8998_irq_init(max8998); |
148 | 156 | ||
149 | ret = mfd_add_devices(max8998->dev, -1, | ||
150 | max8998_devs, ARRAY_SIZE(max8998_devs), | ||
151 | NULL, 0); | ||
152 | pm_runtime_set_active(max8998->dev); | 157 | pm_runtime_set_active(max8998->dev); |
153 | 158 | ||
159 | switch (id->driver_data) { | ||
160 | case TYPE_LP3974: | ||
161 | ret = mfd_add_devices(max8998->dev, -1, | ||
162 | lp3974_devs, ARRAY_SIZE(lp3974_devs), | ||
163 | NULL, 0); | ||
164 | break; | ||
165 | case TYPE_MAX8998: | ||
166 | ret = mfd_add_devices(max8998->dev, -1, | ||
167 | max8998_devs, ARRAY_SIZE(max8998_devs), | ||
168 | NULL, 0); | ||
169 | break; | ||
170 | default: | ||
171 | ret = -EINVAL; | ||
172 | } | ||
173 | |||
154 | if (ret < 0) | 174 | if (ret < 0) |
155 | goto err; | 175 | goto err; |
156 | 176 | ||