summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 10:53:15 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 10:53:15 -0800
commitcf8d7e3850ee44dc2f0a69405d731af62528a948 (patch)
treee36f0dc08b60cf063dda46a258ee841aeb0e54ce /drivers/rtc
parent5c43019f25977fb6119dff471d592321ed0d2333 (diff)
parent9fb41166076b197318807a5f1829911450b43218 (diff)
downloadlinux-cf8d7e3850ee44dc2f0a69405d731af62528a948.tar.bz2
Merge tag 'mfd-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones: "New Device Support: - Add support for s2mps15; sec-core - Add support for Lewisburg; lpc_ich - Add support for cs47l24 and wm1831; arizona New Functionality: - Allow user to select syscon register width; syscon Fix-ups: - Lots of Checkpatch fixes - Rename -pmic/-regulator; s2mps11 - Build driver components into a single module; wm8994-* - Better handing of IRQ during suspend/resume; as3722 - Constify things; da903x - Remove unused code; ab8500-core - Improve error handing; qcom_rpm - Simplify code: wm831x-otp, sta2x11-mfd - Improve locking; cros_ec_spi - Fix incorrect DT binding filename reference; arizona, palmas, snps-dwapb-gpio, wm8994 Bug Fixes: - Fix broken SYSFS 'show ID' call; wm831x-otp - Protect reads from non-existent registers; qcom-spmi-pmic - Repair build warnings; as3722 - Fix IRQ request ordering; arizona-irq - Ensure return value is boolean; ucb1x00-core, tps65010, tc6393xb, htc-egpio, dm355evm_msp, asic3" * tag 'mfd-for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (58 commits) mfd: davinci_voicecodec: Remove pointless 'out of memory' error message mfd: da9052-irq: Fix trivial 'space before comma' error mfd: da9052-i2c: Fix tabbing/whitespace issue mfd: da903x: Fix white space and split string issues mfd: cs5535-mfd: Add missing line spacing and make local array static mfd: cros_ec_spi: Repair comparison ordering issue mfd: cros_ec_i2c: Fix trivial 'tabs before spaces' whitespace issue. mfd: asic3: Fix a plethora of Checkpatch errors and warnings mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings mfd: arizona-i2c: Add blank line formatting after declaration mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead mfd: adp5520: Some trivial 'no space before tab' fixes mfd: ab8500-sysctrl: Fix Constify, printk => pr_info and formatting issues mfd: ab8500-gpadc: Squash a whole bunch of Checkpatch warnings and one error mfd: ab8500-debugfs: Clean-up non-conforming commenting and print formatting mfd: ab8500-core: Fix many warnings reported by Checkpatch mfd: ab2100-otp: Remove pointless 'out of memory' error message mfd: ab3100-core.c: Fix multiple warnings reported by Checkpatch mfd: aat2870-core: Remove unnecessary 'out of memory' message mfd: 88pm860x-core: Fix commenting and declaration spacing ...
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-s5m.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index f2504b4eef34..0d68a85dd429 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -188,6 +188,7 @@ static inline int s5m_check_peding_alarm_interrupt(struct s5m_rtc_info *info,
ret = regmap_read(info->regmap, S5M_RTC_STATUS, &val);
val &= S5M_ALARM0_STATUS;
break;
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
ret = regmap_read(info->s5m87xx->regmap_pmic, S2MPS14_REG_ST2,
@@ -219,9 +220,22 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info)
return ret;
}
- data |= info->regs->rtc_udr_mask;
- if (info->device_type == S5M8763X || info->device_type == S5M8767X)
- data |= S5M_RTC_TIME_EN_MASK;
+ switch (info->device_type) {
+ case S5M8763X:
+ case S5M8767X:
+ data |= info->regs->rtc_udr_mask | S5M_RTC_TIME_EN_MASK;
+ case S2MPS15X:
+ /* As per UM, for write time register, set WUDR bit to high */
+ data |= S2MPS15_RTC_WUDR_MASK;
+ break;
+ case S2MPS14X:
+ case S2MPS13X:
+ data |= info->regs->rtc_udr_mask;
+ break;
+ default:
+ return -EINVAL;
+ }
+
ret = regmap_write(info->regmap, info->regs->rtc_udr_update, data);
if (ret < 0) {
@@ -252,6 +266,11 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
case S5M8767X:
data &= ~S5M_RTC_TIME_EN_MASK;
break;
+ case S2MPS15X:
+ /* As per UM, for write alarm, set A_UDR(bit[4]) to high
+ * rtc_udr_mask above sets bit[4]
+ */
+ break;
case S2MPS14X:
data |= S2MPS_RTC_RUDR_MASK;
break;
@@ -317,7 +336,8 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
u8 data[info->regs->regs_count];
int ret;
- if (info->device_type == S2MPS14X || info->device_type == S2MPS13X) {
+ if (info->device_type == S2MPS15X || info->device_type == S2MPS14X ||
+ info->device_type == S2MPS13X) {
ret = regmap_update_bits(info->regmap,
info->regs->rtc_udr_update,
S2MPS_RTC_RUDR_MASK, S2MPS_RTC_RUDR_MASK);
@@ -339,6 +359,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
break;
case S5M8767X:
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
s5m8767_data_to_tm(data, tm, info->rtc_24hr_mode);
@@ -366,6 +387,7 @@ static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm)
s5m8763_tm_to_data(tm, data);
break;
case S5M8767X:
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
ret = s5m8767_tm_to_data(tm, data);
@@ -414,6 +436,7 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
break;
case S5M8767X:
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
s5m8767_data_to_tm(data, &alrm->time, info->rtc_24hr_mode);
@@ -463,6 +486,7 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
break;
case S5M8767X:
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
for (i = 0; i < info->regs->regs_count; i++)
@@ -508,6 +532,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
break;
case S5M8767X:
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
data[RTC_SEC] |= ALARM_ENABLE_MASK;
@@ -548,6 +573,7 @@ static int s5m_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
break;
case S5M8767X:
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
s5m8767_tm_to_data(&alrm->time, data);
@@ -631,6 +657,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
ret = regmap_raw_write(info->regmap, S5M_ALARM0_CONF, data, 2);
break;
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
data[0] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT);
@@ -679,6 +706,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
return -ENOMEM;
switch (platform_get_device_id(pdev)->driver_data) {
+ case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
regmap_cfg = &s2mps14_rtc_regmap_config;
@@ -805,6 +833,7 @@ static const struct platform_device_id s5m_rtc_id[] = {
{ "s5m-rtc", S5M8767X },
{ "s2mps13-rtc", S2MPS13X },
{ "s2mps14-rtc", S2MPS14X },
+ { "s2mps15-rtc", S2MPS15X },
{ },
};
MODULE_DEVICE_TABLE(platform, s5m_rtc_id);