From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Alim Akhtar <alim.akhtar@samsung.com>,
lee.jones@linaro.org, broonie@kernel.org
Cc: mturquette@baylibre.com, linux-samsung-soc@vger.kernel.org,
linux-clk@vger.kernel.org, rtc-linux@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/5] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Date: Wed, 28 Oct 2015 10:29:56 +0900 [thread overview]
Message-ID: <56302514.4090407@samsung.com> (raw)
In-Reply-To: <1445863883-5187-6-git-send-email-alim.akhtar@samsung.com>
On 26.10.2015 21:51, Alim Akhtar wrote:
> RTC found in s2mps15 is almost same as one found in s2mps14.
> This patch add required changes to enable s2mps15 rtc timer.
>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
> drivers/rtc/rtc-s5m.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
NACK.
I don't have S2MPS15 datasheet but looking at the code right now this
looks *exactly the same* device as S2MPS14.
If that's true, then don't add new compatibles, new names etc. Re-use.
No new code needed, no changes needed. Keep it simple.
Best regards,
Krzysztof
>
> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> index f2504b4eef34..ac3286a267ba 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,
> @@ -253,6 +254,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
> data &= ~S5M_RTC_TIME_EN_MASK;
> break;
> case S2MPS14X:
> + case S2MPS15X:
> data |= S2MPS_RTC_RUDR_MASK;
> break;
> case S2MPS13X:
> @@ -317,7 +319,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 == S2MPS14X || info->device_type == S2MPS15X ||
> + 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 +342,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 +370,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 +419,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 +469,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 +515,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 +556,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 +640,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 +689,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 +816,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);
>
next prev parent reply other threads:[~2015-10-28 1:30 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 12:51 [PATCH v3 0/5] mfd: sec: add S2MPS15 PMIC support Alim Akhtar
2015-10-26 12:51 ` [PATCH v3 1/5] dt-bindings: mfd: s2mps11: add documentation for s2mps15 PMIC Alim Akhtar
2015-10-26 12:51 ` [PATCH v3 2/5] mfd: sec: Add support for S2MPS15 PMIC Alim Akhtar
2015-10-26 14:34 ` Lee Jones
2015-10-28 1:15 ` Krzysztof Kozlowski
2015-10-28 8:46 ` Lee Jones
2015-10-28 11:21 ` Alim Akhtar
2015-10-28 13:47 ` Krzysztof Kozlowski
2015-10-28 13:44 ` Krzysztof Kozlowski
2015-10-28 13:51 ` Lee Jones
2015-10-29 4:19 ` Alim Akhtar
2015-10-28 1:28 ` Krzysztof Kozlowski
2015-10-26 12:51 ` [PATCH v3 3/5] regulator: s2mps11: add support for S2MPS15 regulators Alim Akhtar
2015-10-26 12:51 ` [PATCH v3 4/5] clk: s2mps15: Add support for S2MPS15 clocks Alim Akhtar
2015-10-28 1:22 ` Krzysztof Kozlowski
2015-10-28 3:36 ` Alim Akhtar
2015-10-28 1:26 ` Krzysztof Kozlowski
2015-10-28 4:34 ` Krzysztof Kozlowski
2015-10-28 4:55 ` Alim Akhtar
2015-10-28 5:36 ` Krzysztof Kozlowski
2015-10-26 12:51 ` [PATCH v3 5/5] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Alim Akhtar
2015-10-27 22:59 ` [rtc-linux] " Alexandre Belloni
2015-10-28 1:29 ` Krzysztof Kozlowski [this message]
2015-10-28 1:53 ` Mark Brown
2015-10-28 2:17 ` Krzysztof Kozlowski
2015-10-28 3:14 ` Alim Akhtar
2015-10-28 3:31 ` Krzysztof Kozlowski
2015-10-28 3:33 ` Alim Akhtar
2015-10-28 9:48 ` [rtc-linux] " Alexandre Belloni
2015-10-28 10:30 ` Alim Akhtar
2015-10-28 13:35 ` Krzysztof Kozlowski
2015-10-28 13:31 ` Krzysztof Kozlowski
2015-10-28 13:43 ` Alexandre Belloni
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=56302514.4090407@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=broonie@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=rtc-linux@googlegroups.com \
/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).