* [PATCH v3] rtc: s5m: Add the support for S2MPS13 RTC
@ 2015-02-24 6:09 Chanwoo Choi
2015-02-24 8:21 ` [rtc-linux] " Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Chanwoo Choi @ 2015-02-24 6:09 UTC (permalink / raw)
To: a.zummo
Cc: akpm, inki.dae, rtc-linux, linux-kernel, linux-samsung-soc,
Chanwoo Choi
This patch adds only the compatible string for S2MPS13 clock which is identical
with S2MPS14 clock driver.
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
Changes from v1:
- Send this patch separately from S2MPS13 PMIC patchset[1]
[1] https://lkml.org/lkml/2014/11/18/130
drivers/rtc/rtc-s5m.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index 89ac1d5..fffd5d3 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -191,6 +191,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 S2MPS13X:
case S2MPS14X:
ret = regmap_read(info->s5m87xx->regmap_pmic, S2MPS14_REG_ST2,
&val);
@@ -254,6 +255,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
case S5M8767X:
data &= ~S5M_RTC_TIME_EN_MASK;
break;
+ case S2MPS13X:
case S2MPS14X:
data |= S2MPS_RTC_RUDR_MASK;
break;
@@ -311,7 +313,9 @@ 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) {
+ switch (info->device_type) {
+ case S2MPS13X:
+ case S2MPS14X:
ret = regmap_update_bits(info->regmap,
info->regs->rtc_udr_update,
S2MPS_RTC_RUDR_MASK, S2MPS_RTC_RUDR_MASK);
@@ -333,6 +337,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
break;
case S5M8767X:
+ case S2MPS13X:
case S2MPS14X:
s5m8767_data_to_tm(data, tm, info->rtc_24hr_mode);
break;
@@ -359,6 +364,7 @@ static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm)
s5m8763_tm_to_data(tm, data);
break;
case S5M8767X:
+ case S2MPS13X:
case S2MPS14X:
ret = s5m8767_tm_to_data(tm, data);
break;
@@ -406,6 +412,7 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
break;
case S5M8767X:
+ case S2MPS13X:
case S2MPS14X:
s5m8767_data_to_tm(data, &alrm->time, info->rtc_24hr_mode);
alrm->enabled = 0;
@@ -454,6 +461,7 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
break;
case S5M8767X:
+ case S2MPS13X:
case S2MPS14X:
for (i = 0; i < info->regs->regs_count; i++)
data[i] &= ~ALARM_ENABLE_MASK;
@@ -498,6 +506,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
break;
case S5M8767X:
+ case S2MPS13X:
case S2MPS14X:
data[RTC_SEC] |= ALARM_ENABLE_MASK;
data[RTC_MIN] |= ALARM_ENABLE_MASK;
@@ -537,6 +546,7 @@ static int s5m_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
break;
case S5M8767X:
+ case S2MPS13X:
case S2MPS14X:
s5m8767_tm_to_data(&alrm->time, data);
break;
@@ -641,6 +651,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 S2MPS13X:
case S2MPS14X:
data[0] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT);
ret = regmap_write(info->regmap, info->regs->ctrl, data[0]);
@@ -678,6 +689,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
return -ENOMEM;
switch (pdata->device_type) {
+ case S2MPS13X:
case S2MPS14X:
regmap_cfg = &s2mps14_rtc_regmap_config;
info->regs = &s2mps_rtc_regs;
@@ -831,6 +843,7 @@ static SIMPLE_DEV_PM_OPS(s5m_rtc_pm_ops, s5m_rtc_suspend, s5m_rtc_resume);
static const struct platform_device_id s5m_rtc_id[] = {
{ "s5m-rtc", S5M8767X },
+ { "s2mps13-rtc", S2MPS13X },
{ "s2mps14-rtc", S2MPS14X },
{ },
};
--
1.8.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [rtc-linux] [PATCH v3] rtc: s5m: Add the support for S2MPS13 RTC
2015-02-24 6:09 [PATCH v3] rtc: s5m: Add the support for S2MPS13 RTC Chanwoo Choi
@ 2015-02-24 8:21 ` Krzysztof Kozlowski
2015-02-24 8:43 ` Chanwoo Choi
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2015-02-24 8:21 UTC (permalink / raw)
To: rtc-linux
Cc: a.zummo, akpm, inki.dae, linux-kernel, linux-samsung-soc,
Chanwoo Choi
2015-02-24 7:09 GMT+01:00 Chanwoo Choi <cw00.choi@samsung.com>:
> This patch adds only the compatible string for S2MPS13 clock which is identical
> with S2MPS14 clock driver.
If everything is identical then maybe use the same ID?
{ "s5m-rtc", S5M8767X },
+ { "s2mps13-rtc", S2MPS14X },
{ "s2mps14-rtc", S2MPS14X },
Or in mfd/sec-core:
static const struct mfd_cell s2mps13_devs[] = {
- { .name = "s2mps13-rtc", },
+ { .name = "s2mps14-rtc", },
The duplication of all S2MPS14 labels seems not necessary in such case.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rtc-linux] [PATCH v3] rtc: s5m: Add the support for S2MPS13 RTC
2015-02-24 8:21 ` [rtc-linux] " Krzysztof Kozlowski
@ 2015-02-24 8:43 ` Chanwoo Choi
0 siblings, 0 replies; 3+ messages in thread
From: Chanwoo Choi @ 2015-02-24 8:43 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: rtc-linux, a.zummo, akpm, inki.dae, linux-kernel,
linux-samsung-soc
On 02/24/2015 05:21 PM, Krzysztof Kozlowski wrote:
> 2015-02-24 7:09 GMT+01:00 Chanwoo Choi <cw00.choi@samsung.com>:
>> This patch adds only the compatible string for S2MPS13 clock which is identical
>> with S2MPS14 clock driver.
>
> If everything is identical then maybe use the same ID?
> { "s5m-rtc", S5M8767X },
> + { "s2mps13-rtc", S2MPS14X },
> { "s2mps14-rtc", S2MPS14X },
>
> Or in mfd/sec-core:
> static const struct mfd_cell s2mps13_devs[] = {
> - { .name = "s2mps13-rtc", },
> + { .name = "s2mps14-rtc", },
>
> The duplication of all S2MPS14 labels seems not necessary in such case.
OK, I agree, I'll send patch according to your comment.
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-24 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 6:09 [PATCH v3] rtc: s5m: Add the support for S2MPS13 RTC Chanwoo Choi
2015-02-24 8:21 ` [rtc-linux] " Krzysztof Kozlowski
2015-02-24 8:43 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox