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 --- include/linux/mfd/max8998.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux/mfd') diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index 686a744e63fb..c22b9a417c35 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h @@ -76,6 +76,9 @@ struct max8998_regulator_data { * @buck1_set1: BUCK1 gpio pin 1 to set output voltage * @buck1_set2: BUCK1 gpio pin 2 to set output voltage * @buck2_set3: BUCK2 gpio pin to set output voltage + * @wakeup: Allow to wake up from suspend + * @rtc_delay: LP3974 RTC chip bug that requires delay after a register + * write before reading it. */ struct max8998_platform_data { struct max8998_regulator_data *regulators; @@ -89,6 +92,7 @@ struct max8998_platform_data { int buck1_set2; int buck2_set3; bool wakeup; + bool rtc_delay; }; #endif /* __LINUX_MFD_MAX8998_H */ -- cgit v1.2.1