From: Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org,
lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
sbkim73-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
geunsik.lim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 4/5] rtc: s5m: Add the support for S2MPS13 RTC
Date: Tue, 18 Nov 2014 11:01:53 +0100 [thread overview]
Message-ID: <1416304913.1301.4.camel@AMDC1943> (raw)
In-Reply-To: <546A9D7D.7040207-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
On wto, 2014-11-18 at 10:14 +0900, Chanwoo Choi wrote:
> Hi Krzysztof,
>
> On 11/17/2014 07:19 PM, Krzysztof Kozłowski wrote:
> > On 17.11.2014 01:42, Chanwoo Choi wrote:
> >> This patch adds only the compatible string for S2MPS13 clock which is identical
> >> with S2MPS14 clock driver.
> >>
> >> Cc: Alessandro Zummo <a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>
> >> Signed-off-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> >> ---
> >> drivers/rtc/rtc-s5m.c | 15 ++++++++++++++-
> >> 1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > The RTC block looks exactly the same as S2MPS14. I wonder can S2MPS13 be
> > supported without adding all "+ case S2MPS13X:" here? Maybe pass the
> > same ID in s5m_rtc_id? This would reduce number of changes to only one line.
>
> I tried to use S2MPS14x type without adding S2MPS13X.
> But, there are two method to probe RTC driver probe.
> First, as you comment, use s5m_rtc_id (in drivers/rtc/rtc-s5m.c) to probe S2MPS13 RTC.
> Second, register mfd devcies for s2mps13 RTC(in drivers/mfd/sec-core.c) to probe S2MPS13 RTC.
>
> We could support S2MPS13 RTC to modify s5m_rtc_id table in first case as you comment,
> But, We could not support S2MPS13 RTC in second case because S2MPS13 is different from S2MPS14
> and S2MPS13 must have other type form existing S2MPS14x type.
OK, I'm fine with that. The patch looks good so:
Reviewed-by: Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Best regards,
Krzysztof
>
> Best Regards,
> Chanwoo Choi
>
> >
> > Best regards,
> > Krzysztof
> >
> >
> >>
> >> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> >> index 8754c33..e5fdfd3 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 },
> >> };
> >>
> >>
> >
> >
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-18 10:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 0:42 [PATCH 0/5] mfd: sec-core: Add support S2MPS13 PMIC device Chanwoo Choi
2014-11-17 0:42 ` [PATCH 1/5] mfd: sec-core: Add support for S2MPS13 device Chanwoo Choi
[not found] ` <1416184980-532-2-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-18 0:26 ` Sangbeom Kim
2014-11-18 8:22 ` Lee Jones
2014-11-18 8:33 ` Chanwoo Choi
2014-11-17 0:42 ` [PATCH 2/5] regulator: s2mps11: Add support S2MPS13 regulator device Chanwoo Choi
[not found] ` <1416184980-532-3-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-17 10:12 ` Krzysztof Kozłowski
[not found] ` <5469CA11.3000409-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-18 0:57 ` Chanwoo Choi
2014-11-17 23:48 ` Mark Brown
2014-11-18 0:28 ` Sangbeom Kim
2014-11-18 8:17 ` Lee Jones
2014-11-18 8:41 ` Chanwoo Choi
2014-11-17 0:42 ` [PATCH 3/5] clk: s2mps11: Add the support for S2MPS13 PMIC clock Chanwoo Choi
2014-11-17 10:16 ` Krzysztof Kozłowski
[not found] ` <5469CAF9.6020700-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-18 1:06 ` Chanwoo Choi
2014-11-17 0:42 ` [PATCH 4/5] rtc: s5m: Add the support for S2MPS13 RTC Chanwoo Choi
[not found] ` <1416184980-532-5-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-17 10:19 ` Krzysztof Kozłowski
2014-11-18 1:14 ` Chanwoo Choi
[not found] ` <546A9D7D.7040207-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-18 10:01 ` Krzysztof Kozlowski [this message]
2014-11-18 0:38 ` Sangbeom Kim
2014-11-18 0:55 ` Chanwoo Choi
2014-11-18 8:25 ` Lee Jones
2014-11-18 8:53 ` Chanwoo Choi
2014-11-17 0:43 ` [PATCH 5/5] mfd: s2mps11: Add binding documentation for Samsung S2MPS13 PMIC Chanwoo Choi
[not found] ` <1416184980-532-6-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-17 10:20 ` Krzysztof Kozłowski
2014-11-18 0:40 ` Sangbeom Kim
2014-11-18 8:19 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416304913.1301.4.camel@AMDC1943 \
--to=k.kozlowski-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=geunsik.lim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=sbkim73-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).