From 337ce5d1c5759644cea6c47220ce7e84f0398362 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Tue, 4 Jan 2011 14:17:39 +0900 Subject: 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 Signed-off-by: Kyungmin Park Reviewed-by: Mark Brown Signed-off-by: Samuel Ortiz --- drivers/regulator/max8998.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/regulator') diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c index 7568df6..af52ebf 100644 --- a/drivers/regulator/max8998.c +++ b/drivers/regulator/max8998.c @@ -835,6 +835,12 @@ static int __devexit max8998_pmic_remove(struct platform_device *pdev) return 0; } +static const struct platform_device_id max8998_pmic_id[] = { + { "max8998-pmic", TYPE_MAX8998 }, + { "lp3974-pmic", TYPE_LP3974 }, + { } +}; + static struct platform_driver max8998_pmic_driver = { .driver = { .name = "max8998-pmic", @@ -842,6 +848,7 @@ static struct platform_driver max8998_pmic_driver = { }, .probe = max8998_pmic_probe, .remove = __devexit_p(max8998_pmic_remove), + .id_table = max8998_pmic_id, }; static int __init max8998_pmic_init(void) -- cgit v1.1