Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1259237 > unrolled thread

[PATCH v5 0/4] mfd: sec: add S2MPS15 PMIC support

Started byAlim Akhtar <alim.akhtar@samsung.com>
First post2015-10-30 07:30 +0100
Last post2015-11-02 12:00 +0100
Articles 11 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v5 0/4] mfd: sec: add S2MPS15 PMIC support Alim Akhtar <alim.akhtar@samsung.com> - 2015-10-30 07:30 +0100
    [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Alim Akhtar <alim.akhtar@samsung.com> - 2015-10-30 07:30 +0100
      Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-10-30 09:40 +0100
        Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Alim Akhtar <alim.akhtar@samsung.com> - 2015-10-30 10:30 +0100
      Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Lee Jones <lee.jones@linaro.org> - 2015-10-30 18:30 +0100
      Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-11-01 18:50 +0100
        Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-11-02 00:50 +0100
          Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-11-02 01:50 +0100
            Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Lee Jones <lee.jones@linaro.org> - 2015-11-02 10:10 +0100
              Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-11-02 11:20 +0100
                Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC Lee Jones <lee.jones@linaro.org> - 2015-11-02 12:00 +0100

#1259237 — [PATCH v5 0/4] mfd: sec: add S2MPS15 PMIC support

FromAlim Akhtar <alim.akhtar@samsung.com>
Date2015-10-30 07:30 +0100
Subject[PATCH v5 0/4] mfd: sec: add S2MPS15 PMIC support
Message-ID<qpbmh-2ij-3@gated-at.bofh.it>
Samsung's S2MPS15 PMIC is targetted to be used with Samsung's Exynos7 SoC.
The S2MPS15 PMIC is similar in functionality to S2MPS11/14 PMIC. It contains
27 LDO and 10 Buck regulators, RTC, three 32.768 KHz clock outputs and allows
programming these blocks via a I2C interface. This patch series adds initial
support for LDO/Buck regulators of S2MPS15 PMIC.

Changes since v4:
* Dorpped Krzysztof reviewed-by and Lee Acked-by tags from patch 1/4,
  because of the new changes to DT bindings. Seeking a fresh review/ack tags.
* Removed samsung,s2mps15-clk compatible as we can reuse exsisting compatible of s2mps13.
* Added acked-by on patch 2/4
* Modified rtc driver as s2mps15 differs from s2mps14/13 etc, addressed Krzysztof
  concerns on rtc patch.
  There are some other improvement suggestion from Krzystof for the rtc, I feel that can be done
  as a sperate patch later.

Changes since v3:
* Changes regulator driver name from s2mps15-pmic -> s2mps15-regulator as disscussed here [2]
* Re-use the exsisting compatible/names for s2mps15 clock block.

Changes since v2:
* Addressed Lee Jones review comments.

Changes since v1:
* Added suggestion from Krzysztof [1].
* Added s2mps15's 32.768 clocks support.
* Added s2mps15's rtc support.

V1 of these patches (with a lesser features) were posted a year back,
since then there is not much progress on this, this is my attempt to
move things forward.

[1]-> https://lkml.org/lkml/2014/10/14/67
[2]-> https://lkml.org/lkml/2015/10/28/417

This series is based on linux-next-20151022.
This is tested on exynos7-espresso board.

Alim Akhtar (1):
  drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

Thomas Abraham (3):
  dt-bindings: mfd: s2mps11: add documentation for s2mps15 PMIC
  mfd: sec: Add support for S2MPS15 PMIC
  regulator: s2mps11: add support for S2MPS15 regulators

 Documentation/devicetree/bindings/mfd/s2mps11.txt |   21 ++-
 drivers/mfd/sec-core.c                            |   31 ++++
 drivers/mfd/sec-irq.c                             |    8 ++
 drivers/regulator/Kconfig                         |    4 +-
 drivers/regulator/s2mps11.c                       |  135 +++++++++++++++++-
 drivers/rtc/rtc-s5m.c                             |   37 ++++-
 include/linux/mfd/samsung/core.h                  |    1 +
 include/linux/mfd/samsung/rtc.h                   |    2 +
 include/linux/mfd/samsung/s2mps15.h               |  158 +++++++++++++++++++++
 9 files changed, 383 insertions(+), 14 deletions(-)
 create mode 100644 include/linux/mfd/samsung/s2mps15.h

-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1259241 — [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromAlim Akhtar <alim.akhtar@samsung.com>
Date2015-10-30 07:30 +0100
Subject[PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qpbmi-2ij-17@gated-at.bofh.it>
In reply to#1259237
RTC found in s2mps15 is almost same as one found on s2mps13
with few differences in RTC_UPDATE register fields, like:
1> Bit[4] and Bit[1] are reversed
   - On s2mps13
          WUDR -> bit[4], AUDR -> bit[1]
   - On s2mps15
	  WUDR -> bit[1], AUDR -> bit[4]
2> In case of s2mps13, for alarm register, need to set both
   WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
   at the same time.

This patch add required changes to enable s2mps15 rtc timer.

Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
---
 drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
 include/linux/mfd/samsung/rtc.h |    2 ++
 2 files changed, 35 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);
diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h
index 29c30ac36020..a65e4655d470 100644
--- a/include/linux/mfd/samsung/rtc.h
+++ b/include/linux/mfd/samsung/rtc.h
@@ -107,6 +107,8 @@ enum s2mps_rtc_reg {
 #define S2MPS_RTC_WUDR_MASK	(1 << S2MPS_RTC_WUDR_SHIFT)
 #define S2MPS13_RTC_AUDR_SHIFT	1
 #define S2MPS13_RTC_AUDR_MASK	(1 << S2MPS13_RTC_AUDR_SHIFT)
+#define S2MPS15_RTC_WUDR_SHIFT	1
+#define S2MPS15_RTC_WUDR_MASK	(1 << S2MPS15_RTC_WUDR_SHIFT)
 #define S2MPS_RTC_RUDR_SHIFT	0
 #define S2MPS_RTC_RUDR_MASK	(1 << S2MPS_RTC_RUDR_SHIFT)
 #define RTC_TCON_SHIFT		1
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259315 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-10-30 09:40 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qpdo5-3wq-5@gated-at.bofh.it>
In reply to#1259241
On 30.10.2015 15:25, Alim Akhtar wrote:
> RTC found in s2mps15 is almost same as one found on s2mps13
> with few differences in RTC_UPDATE register fields, like:
> 1> Bit[4] and Bit[1] are reversed
>    - On s2mps13
>           WUDR -> bit[4], AUDR -> bit[1]
>    - On s2mps15
> 	  WUDR -> bit[1], AUDR -> bit[4]
> 2> In case of s2mps13, for alarm register, need to set both
>    WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
> 3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
>    at the same time.
> 
> This patch add required changes to enable s2mps15 rtc timer.
> 
> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
>  drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
>  include/linux/mfd/samsung/rtc.h |    2 ++
>  2 files changed, 35 insertions(+), 4 deletions(-)
> 

The usage of rtc_udr_mask is now a little bit messy and not-consistent
but this can be fixed in separate patch.

Current approach is the simplest way to add S2MPS15 and looks correct:

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259355 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromAlim Akhtar <alim.akhtar@samsung.com>
Date2015-10-30 10:30 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qpeau-42j-21@gated-at.bofh.it>
In reply to#1259315
Hi Krzysztof,

On 10/30/2015 02:08 PM, Krzysztof Kozlowski wrote:
> On 30.10.2015 15:25, Alim Akhtar wrote:
>> RTC found in s2mps15 is almost same as one found on s2mps13
>> with few differences in RTC_UPDATE register fields, like:
>> 1> Bit[4] and Bit[1] are reversed
>>     - On s2mps13
>>            WUDR -> bit[4], AUDR -> bit[1]
>>     - On s2mps15
>> 	  WUDR -> bit[1], AUDR -> bit[4]
>> 2> In case of s2mps13, for alarm register, need to set both
>>     WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
>> 3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
>>     at the same time.
>>
>> This patch add required changes to enable s2mps15 rtc timer.
>>
>> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
>> ---
>>   drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
>>   include/linux/mfd/samsung/rtc.h |    2 ++
>>   2 files changed, 35 insertions(+), 4 deletions(-)
>>
>
> The usage of rtc_udr_mask is now a little bit messy and not-consistent
> but this can be fixed in separate patch.
>
> Current approach is the simplest way to add S2MPS15 and looks correct:
>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>
Thanks!

> Best regards,
> Krzysztof
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1259655 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromLee Jones <lee.jones@linaro.org>
Date2015-10-30 18:30 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qplF1-bI-43@gated-at.bofh.it>
In reply to#1259241
On Fri, 30 Oct 2015, Alim Akhtar wrote:

> RTC found in s2mps15 is almost same as one found on s2mps13
> with few differences in RTC_UPDATE register fields, like:
> 1> Bit[4] and Bit[1] are reversed
>    - On s2mps13
>           WUDR -> bit[4], AUDR -> bit[1]
>    - On s2mps15
> 	  WUDR -> bit[1], AUDR -> bit[4]
> 2> In case of s2mps13, for alarm register, need to set both
>    WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
> 3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
>    at the same time.
> 
> This patch add required changes to enable s2mps15 rtc timer.
> 
> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
>  drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
>  include/linux/mfd/samsung/rtc.h |    2 ++

For the MFD change:
  Acked-by: Lee Jones <lee.jones@linaro.org>

>  2 files changed, 35 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);
> diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h
> index 29c30ac36020..a65e4655d470 100644
> --- a/include/linux/mfd/samsung/rtc.h
> +++ b/include/linux/mfd/samsung/rtc.h
> @@ -107,6 +107,8 @@ enum s2mps_rtc_reg {
>  #define S2MPS_RTC_WUDR_MASK	(1 << S2MPS_RTC_WUDR_SHIFT)
>  #define S2MPS13_RTC_AUDR_SHIFT	1
>  #define S2MPS13_RTC_AUDR_MASK	(1 << S2MPS13_RTC_AUDR_SHIFT)
> +#define S2MPS15_RTC_WUDR_SHIFT	1
> +#define S2MPS15_RTC_WUDR_MASK	(1 << S2MPS15_RTC_WUDR_SHIFT)
>  #define S2MPS_RTC_RUDR_SHIFT	0
>  #define S2MPS_RTC_RUDR_MASK	(1 << S2MPS_RTC_RUDR_SHIFT)
>  #define RTC_TCON_SHIFT		1

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260209 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-11-01 18:50 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qq4Vr-2TY-9@gated-at.bofh.it>
In reply to#1259241
On 30/10/2015 at 11:55:34 +0530, Alim Akhtar wrote :
> RTC found in s2mps15 is almost same as one found on s2mps13
> with few differences in RTC_UPDATE register fields, like:
> 1> Bit[4] and Bit[1] are reversed
>    - On s2mps13
>           WUDR -> bit[4], AUDR -> bit[1]
>    - On s2mps15
> 	  WUDR -> bit[1], AUDR -> bit[4]
> 2> In case of s2mps13, for alarm register, need to set both
>    WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
> 3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
>    at the same time.
> 
> This patch add required changes to enable s2mps15 rtc timer.
> 
> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
>  drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
>  include/linux/mfd/samsung/rtc.h |    2 ++
>  2 files changed, 35 insertions(+), 4 deletions(-)
> 
Applied after fixing the small alignment issue, thanks.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260266 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-11-02 00:50 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qqaxP-6iv-1@gated-at.bofh.it>
In reply to#1260209
On 02.11.2015 02:40, Alexandre Belloni wrote:
> On 30/10/2015 at 11:55:34 +0530, Alim Akhtar wrote :
>> RTC found in s2mps15 is almost same as one found on s2mps13
>> with few differences in RTC_UPDATE register fields, like:
>> 1> Bit[4] and Bit[1] are reversed
>>    - On s2mps13
>>           WUDR -> bit[4], AUDR -> bit[1]
>>    - On s2mps15
>> 	  WUDR -> bit[1], AUDR -> bit[4]
>> 2> In case of s2mps13, for alarm register, need to set both
>>    WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
>> 3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
>>    at the same time.
>>
>> This patch add required changes to enable s2mps15 rtc timer.
>>
>> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
>> ---
>>  drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
>>  include/linux/mfd/samsung/rtc.h |    2 ++
>>  2 files changed, 35 insertions(+), 4 deletions(-)
>>
> Applied after fixing the small alignment issue, thanks.
> 

I think you cannot apply it directly because it depends on headers from
patch 2/4. It won't build.

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260278 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-11-02 01:50 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qqbtU-6Wl-7@gated-at.bofh.it>
In reply to#1260266
On 02/11/2015 at 08:46:21 +0900, Krzysztof Kozlowski wrote :
> On 02.11.2015 02:40, Alexandre Belloni wrote:
> > On 30/10/2015 at 11:55:34 +0530, Alim Akhtar wrote :
> >> RTC found in s2mps15 is almost same as one found on s2mps13
> >> with few differences in RTC_UPDATE register fields, like:
> >> 1> Bit[4] and Bit[1] are reversed
> >>    - On s2mps13
> >>           WUDR -> bit[4], AUDR -> bit[1]
> >>    - On s2mps15
> >> 	  WUDR -> bit[1], AUDR -> bit[4]
> >> 2> In case of s2mps13, for alarm register, need to set both
> >>    WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
> >> 3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
> >>    at the same time.
> >>
> >> This patch add required changes to enable s2mps15 rtc timer.
> >>
> >> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> >> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> >> ---
> >>  drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
> >>  include/linux/mfd/samsung/rtc.h |    2 ++
> >>  2 files changed, 35 insertions(+), 4 deletions(-)
> >>
> > Applied after fixing the small alignment issue, thanks.
> > 
> 
> I think you cannot apply it directly because it depends on headers from
> patch 2/4. It won't build.
> 

Yeah, this depends on the mfd tree. I don't thin Lee applied patch 2/4
yet so I'm taking that one for 4.5.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260464 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromLee Jones <lee.jones@linaro.org>
Date2015-11-02 10:10 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qqjhL-3tg-5@gated-at.bofh.it>
In reply to#1260278
On Mon, 02 Nov 2015, Alexandre Belloni wrote:

> On 02/11/2015 at 08:46:21 +0900, Krzysztof Kozlowski wrote :
> > On 02.11.2015 02:40, Alexandre Belloni wrote:
> > > On 30/10/2015 at 11:55:34 +0530, Alim Akhtar wrote :
> > >> RTC found in s2mps15 is almost same as one found on s2mps13
> > >> with few differences in RTC_UPDATE register fields, like:
> > >> 1> Bit[4] and Bit[1] are reversed
> > >>    - On s2mps13
> > >>           WUDR -> bit[4], AUDR -> bit[1]
> > >>    - On s2mps15
> > >> 	  WUDR -> bit[1], AUDR -> bit[4]
> > >> 2> In case of s2mps13, for alarm register, need to set both
> > >>    WDUR and ADUR high, whereas for s2mps15 only set AUDR to high.
> > >> 3> On s2mps15, WUDR, RUDR and AUDR functions should never be used
> > >>    at the same time.
> > >>
> > >> This patch add required changes to enable s2mps15 rtc timer.
> > >>
> > >> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > >> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> > >> ---
> > >>  drivers/rtc/rtc-s5m.c           |   37 +++++++++++++++++++++++++++++++++----
> > >>  include/linux/mfd/samsung/rtc.h |    2 ++
> > >>  2 files changed, 35 insertions(+), 4 deletions(-)
> > >>
> > > Applied after fixing the small alignment issue, thanks.
> > > 
> > 
> > I think you cannot apply it directly because it depends on headers from
> > patch 2/4. It won't build.
> > 
> 
> Yeah, this depends on the mfd tree. I don't thin Lee applied patch 2/4
> yet so I'm taking that one for 4.5.

I don't mind if you take it, but if you do so you need to take the
Regulator patch as well AND provide Mark and I a pull-request from an
immutable branch please. 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260517 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-11-02 11:20 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qqknw-45z-27@gated-at.bofh.it>
In reply to#1260464
On 02/11/2015 at 09:03:59 +0000, Lee Jones wrote :
> > > I think you cannot apply it directly because it depends on headers from
> > > patch 2/4. It won't build.
> > > 
> > 
> > Yeah, this depends on the mfd tree. I don't thin Lee applied patch 2/4
> > yet so I'm taking that one for 4.5.
> 
> I don't mind if you take it, but if you do so you need to take the
> Regulator patch as well AND provide Mark and I a pull-request from an
> immutable branch please. 
> 

Actually, I was thinking that you would take 2/4 through your tree and I
would either base myself on that or delay the patch for 4.5. You could
also take the rtc patch if you plan to apply 2/4, feel free to add my
acked-by.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1260531 — Re: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC

FromLee Jones <lee.jones@linaro.org>
Date2015-11-02 12:00 +0100
SubjectRe: [PATCH v5 4/4] drivers/rtc/rtc-s5m.c: add support for S2MPS15 RTC
Message-ID<qql0d-4in-1@gated-at.bofh.it>
In reply to#1260517
On Mon, 02 Nov 2015, Alexandre Belloni wrote:

> On 02/11/2015 at 09:03:59 +0000, Lee Jones wrote :
> > > > I think you cannot apply it directly because it depends on headers from
> > > > patch 2/4. It won't build.
> > > > 
> > > 
> > > Yeah, this depends on the mfd tree. I don't thin Lee applied patch 2/4
> > > yet so I'm taking that one for 4.5.
> > 
> > I don't mind if you take it, but if you do so you need to take the
> > Regulator patch as well AND provide Mark and I a pull-request from an
> > immutable branch please. 
> > 
> 
> Actually, I was thinking that you would take 2/4 through your tree and I
> would either base myself on that or delay the patch for 4.5. You could
> also take the rtc patch if you plan to apply 2/4, feel free to add my
> acked-by.

Perfect.  I will do the latter.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web