All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] rtc: s5m: Allow usage on device type different than main MFD type
@ 2015-03-17  9:54 Krzysztof Kozlowski
  2015-03-17  9:54 ` [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13 Krzysztof Kozlowski
  0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2015-03-17  9:54 UTC (permalink / raw)
  To: Sangbeom Kim, Samuel Ortiz, Lee Jones, Alessandro Zummo,
	linux-kernel, rtc-linux, linux-samsung-soc
  Cc: Kyungmin Park, Marek Szyprowski, Chanwoo Choi, Krzysztof Kozlowski

The RTC driver supports two flavors of S5M devices: S5M8767-like and
S2MPS14-like.

On S2MPS13 and S2MPS14 devices the RTC module is the same so we want to
re-use the existing support of S2MPS14. However device type was passed
from parent MFD driver in platform data structure.  This way for the
S2MPS13 device the main MFD driver passed device type of 'S2MPS13X'.

Instead decouple detecting of device type between main MFD and
RTC driver. This allows adding support for other S2MPS14 variations
(like S2MPS11 and S2MPS13) easily by adding to mfd/sec-core.c:

static const struct mfd_cell s2mps13_devs[] = {
	{ .name = "s2mps14-rtc", }
};

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

---

Changes since v1:
1. Consistently use platform_get_device_id() instead of pdev->id_entry.
---
 drivers/rtc/rtc-s5m.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index 4008b84246ca..1f15b67da232 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -90,7 +90,7 @@ struct s5m_rtc_info {
 	struct regmap *regmap;
 	struct rtc_device *rtc_dev;
 	int irq;
-	int device_type;
+	enum sec_device_type device_type;
 	int rtc_24hr_mode;
 	const struct s5m_rtc_reg_config	*regs;
 };
@@ -650,7 +650,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 	if (!info)
 		return -ENOMEM;
 
-	switch (pdata->device_type) {
+	switch (platform_get_device_id(pdev)->driver_data) {
 	case S2MPS14X:
 		regmap_cfg = &s2mps14_rtc_regmap_config;
 		info->regs = &s2mps_rtc_regs;
@@ -667,7 +667,9 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 		alarm_irq = S5M8767_IRQ_RTCA1;
 		break;
 	default:
-		dev_err(&pdev->dev, "Device type is not supported by RTC driver\n");
+		dev_err(&pdev->dev,
+				"Device type %lu is not supported by RTC driver\n",
+				platform_get_device_id(pdev)->driver_data);
 		return -ENODEV;
 	}
 
@@ -687,7 +689,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 
 	info->dev = &pdev->dev;
 	info->s5m87xx = s5m87xx;
-	info->device_type = s5m87xx->device_type;
+	info->device_type = platform_get_device_id(pdev)->driver_data;
 
 	if (s5m87xx->irq_data) {
 		info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13
  2015-03-17  9:54 [PATCH v2 1/2] rtc: s5m: Allow usage on device type different than main MFD type Krzysztof Kozlowski
@ 2015-03-17  9:54 ` Krzysztof Kozlowski
  2015-03-17  9:57   ` Krzysztof Kozlowski
  2015-03-23 12:34   ` Lee Jones
  0 siblings, 2 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2015-03-17  9:54 UTC (permalink / raw)
  To: Sangbeom Kim, Samuel Ortiz, Lee Jones, Alessandro Zummo,
	linux-kernel, rtc-linux, linux-samsung-soc
  Cc: Kyungmin Park, Marek Szyprowski, Chanwoo Choi, Krzysztof Kozlowski

From: Chanwoo Choi <cw00.choi@samsung.com>

This patch modify the RTC compatible name of S2MPS13 because S2MPS13's RTC is
equal to S2MPS14's RTC.

Cc: Lee Jones <lee.jones@linaro.org>
Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

---

Changes since v1:
1. New patch.
---
 drivers/mfd/sec-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 0a7bc43db4e4..59bf322feacd 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -76,7 +76,7 @@ static const struct mfd_cell s2mps11_devs[] = {
 
 static const struct mfd_cell s2mps13_devs[] = {
 	{ .name = "s2mps13-pmic", },
-	{ .name = "s2mps13-rtc", },
+	{ .name = "s2mps14-rtc", },
 	{
 		.name = "s2mps13-clk",
 		.of_compatible = "samsung,s2mps13-clk",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13
  2015-03-17  9:54 ` [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13 Krzysztof Kozlowski
@ 2015-03-17  9:57   ` Krzysztof Kozlowski
  2015-03-23 12:34     ` Lee Jones
  2015-03-23 12:34   ` Lee Jones
  1 sibling, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2015-03-17  9:57 UTC (permalink / raw)
  To: Sangbeom Kim
  Cc: Samuel Ortiz, Lee Jones, Alessandro Zummo, linux-kernel,
	rtc-linux, linux-samsung-soc, Kyungmin Park, Marek Szyprowski,
	Chanwoo Choi

On wto, 2015-03-17 at 10:54 +0100, Krzysztof Kozlowski wrote:
> From: Chanwoo Choi <cw00.choi@samsung.com>
> 
> This patch modify the RTC compatible name of S2MPS13 because S2MPS13's RTC is
> equal to S2MPS14's RTC.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>


Tested on Exynos5433 board with S2MPS13 PMIC.
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

I feel like talking to myself with this self-reply... but at least this
leaves a public track :).

Best regards,
Krzysztof




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13
  2015-03-17  9:57   ` Krzysztof Kozlowski
@ 2015-03-23 12:34     ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-03-23 12:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, Samuel Ortiz, Alessandro Zummo, linux-kernel,
	rtc-linux, linux-samsung-soc, Kyungmin Park, Marek Szyprowski,
	Chanwoo Choi

On Tue, 17 Mar 2015, Krzysztof Kozlowski wrote:

> On wto, 2015-03-17 at 10:54 +0100, Krzysztof Kozlowski wrote:
> > From: Chanwoo Choi <cw00.choi@samsung.com>
> > 
> > This patch modify the RTC compatible name of S2MPS13 because S2MPS13's RTC is
> > equal to S2MPS14's RTC.
> > 
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> 
> Tested on Exynos5433 board with S2MPS13 PMIC.
> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> I feel like talking to myself with this self-reply... but at least this
> leaves a public track :).

If you are submitting a patch, it is assumed that you tested it
_before_ sending. 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13
  2015-03-17  9:54 ` [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13 Krzysztof Kozlowski
  2015-03-17  9:57   ` Krzysztof Kozlowski
@ 2015-03-23 12:34   ` Lee Jones
  2015-03-24 14:02     ` [rtc-linux] " Krzysztof Kozlowski
  1 sibling, 1 reply; 8+ messages in thread
From: Lee Jones @ 2015-03-23 12:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sangbeom Kim, Samuel Ortiz, Alessandro Zummo, linux-kernel,
	rtc-linux, linux-samsung-soc, Kyungmin Park, Marek Szyprowski,
	Chanwoo Choi

On Tue, 17 Mar 2015, Krzysztof Kozlowski wrote:

> From: Chanwoo Choi <cw00.choi@samsung.com>
> 
> This patch modify the RTC compatible name of S2MPS13 because S2MPS13's RTC is
> equal to S2MPS14's RTC.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> ---
> 
> Changes since v1:
> 1. New patch.
> ---
>  drivers/mfd/sec-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index 0a7bc43db4e4..59bf322feacd 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -76,7 +76,7 @@ static const struct mfd_cell s2mps11_devs[] = {
>  
>  static const struct mfd_cell s2mps13_devs[] = {
>  	{ .name = "s2mps13-pmic", },
> -	{ .name = "s2mps13-rtc", },
> +	{ .name = "s2mps14-rtc", },
>  	{
>  		.name = "s2mps13-clk",
>  		.of_compatible = "samsung,s2mps13-clk",

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [rtc-linux] Re: [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13
  2015-03-23 12:34   ` Lee Jones
@ 2015-03-24 14:02     ` Krzysztof Kozlowski
  2015-03-26 14:18         ` Lee Jones
  0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2015-03-24 14:02 UTC (permalink / raw)
  To: rtc-linux
  Cc: Krzysztof Kozlowski, Sangbeom Kim, Samuel Ortiz,
	Alessandro Zummo, linux-kernel, linux-samsung-soc, Kyungmin Park,
	Marek Szyprowski, Chanwoo Choi

2015-03-23 13:34 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
> On Tue, 17 Mar 2015, Krzysztof Kozlowski wrote:
>
>> From: Chanwoo Choi <cw00.choi@samsung.com>
>>
>> This patch modify the RTC compatible name of S2MPS13 because S2MPS13's RTC is
>> equal to S2MPS14's RTC.
>>
>> Cc: Lee Jones <lee.jones@linaro.org>
>> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>>
>> ---
>>
>> Changes since v1:
>> 1. New patch.
>> ---
>>  drivers/mfd/sec-core.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Applied, thanks.

Hi,

Sorry for the mess but we did this wrong.
The S2MPS13 RTC is slightly different than S2MPS14 and that difference
is important. It is embarrassing... but the difference was written
small-print as a note in datasheet. Really. I found it after carefully
comparing two PDFs. The impact of difference was not detected because
of error in DTS for Exynos5433-based board.

This patch should be dropped (or reverted) and "s2mps13-rtc" should be
used for S2MPS13 RTC mfd_cell. The RTC driver (rtc/rtxc-s5m) should
have its own support for RTC which I will add in separate patch.

Lee, once again sorry for the mess. How would you like to proceed? Can
you just drop this commit?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [rtc-linux] Re: [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13
  2015-03-24 14:02     ` [rtc-linux] " Krzysztof Kozlowski
@ 2015-03-26 14:18         ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-03-26 14:18 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: rtc-linux, Sangbeom Kim, Samuel Ortiz, Alessandro Zummo,
	linux-kernel, linux-samsung-soc, Kyungmin Park, Marek Szyprowski,
	Chanwoo Choi

On Tue, 24 Mar 2015, Krzysztof Kozlowski wrote:

> 2015-03-23 13:34 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
> > On Tue, 17 Mar 2015, Krzysztof Kozlowski wrote:
> >
> >> From: Chanwoo Choi <cw00.choi@samsung.com>
> >>
> >> This patch modify the RTC compatible name of S2MPS13 because S2MPS13's RTC is
> >> equal to S2MPS14's RTC.
> >>
> >> Cc: Lee Jones <lee.jones@linaro.org>
> >> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> >> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> >> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> >>
> >> ---
> >>
> >> Changes since v1:
> >> 1. New patch.
> >> ---
> >>  drivers/mfd/sec-core.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Applied, thanks.
> 
> Hi,
> 
> Sorry for the mess but we did this wrong.
> The S2MPS13 RTC is slightly different than S2MPS14 and that difference
> is important. It is embarrassing... but the difference was written
> small-print as a note in datasheet. Really. I found it after carefully
> comparing two PDFs. The impact of difference was not detected because
> of error in DTS for Exynos5433-based board.
> 
> This patch should be dropped (or reverted) and "s2mps13-rtc" should be
> used for S2MPS13 RTC mfd_cell. The RTC driver (rtc/rtxc-s5m) should
> have its own support for RTC which I will add in separate patch.
> 
> Lee, once again sorry for the mess. How would you like to proceed? Can
> you just drop this commit?

Patch removed -- panic averted.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [rtc-linux] Re: [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13
@ 2015-03-26 14:18         ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2015-03-26 14:18 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: rtc-linux, Sangbeom Kim, Samuel Ortiz, Alessandro Zummo,
	linux-kernel, linux-samsung-soc, Kyungmin Park, Marek Szyprowski,
	Chanwoo Choi

On Tue, 24 Mar 2015, Krzysztof Kozlowski wrote:

> 2015-03-23 13:34 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
> > On Tue, 17 Mar 2015, Krzysztof Kozlowski wrote:
> >
> >> From: Chanwoo Choi <cw00.choi@samsung.com>
> >>
> >> This patch modify the RTC compatible name of S2MPS13 because S2MPS13's=
 RTC is
> >> equal to S2MPS14's RTC.
> >>
> >> Cc: Lee Jones <lee.jones@linaro.org>
> >> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> >> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> >> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> >>
> >> ---
> >>
> >> Changes since v1:
> >> 1. New patch.
> >> ---
> >>  drivers/mfd/sec-core.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Applied, thanks.
>=20
> Hi,
>=20
> Sorry for the mess but we did this wrong.
> The S2MPS13 RTC is slightly different than S2MPS14 and that difference
> is important. It is embarrassing... but the difference was written
> small-print as a note in datasheet. Really. I found it after carefully
> comparing two PDFs. The impact of difference was not detected because
> of error in DTS for Exynos5433-based board.
>=20
> This patch should be dropped (or reverted) and "s2mps13-rtc" should be
> used for S2MPS13 RTC mfd_cell. The RTC driver (rtc/rtxc-s5m) should
> have its own support for RTC which I will add in separate patch.
>=20
> Lee, once again sorry for the mess. How would you like to proceed? Can
> you just drop this commit?

Patch removed -- panic averted.

--=20
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org =E2=94=82 Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

--=20
--=20
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---=20
You received this message because you are subscribed to the Google Groups "=
rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-26 14:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17  9:54 [PATCH v2 1/2] rtc: s5m: Allow usage on device type different than main MFD type Krzysztof Kozlowski
2015-03-17  9:54 ` [PATCH v2 2/2] mfd: sec-core: Modify RTC compatible name of S2MPS13 Krzysztof Kozlowski
2015-03-17  9:57   ` Krzysztof Kozlowski
2015-03-23 12:34     ` Lee Jones
2015-03-23 12:34   ` Lee Jones
2015-03-24 14:02     ` [rtc-linux] " Krzysztof Kozlowski
2015-03-26 14:18       ` Lee Jones
2015-03-26 14:18         ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.