2019-02-14 09:25:54

by Stuart Menefy

[permalink] [raw]
Subject: [PATCH v3 0/2] mfd: sec: Add support for the RTC on S2MPA01

Add the RTC on the S2MPA01. As this is appears to be identical to the
RTC on the S2MPS14 we can use the existing code.

Before we can do that however tidy up the existing code as requested by
Lee:
https://lore.kernel.org/lkml/20190213072458.GB1863@dell/

Changes since v2:
- Add patch tidying up existing one element structure initialisation
- Rebase patch 2/2

Changes since v1:
- Remove the duplicated code and simply declare the RTC to be the same
as that on the S2MPS14.

Stuart Menefy (2):
mfd: sec: Put one element structure initialisation on one line
mfd: sec: Add support for the RTC on S2MPA01

drivers/mfd/sec-core.c | 59 +++++++++++++++++---------------------------------
drivers/mfd/sec-irq.c | 3 +++
2 files changed, 23 insertions(+), 39 deletions(-)

--
2.13.6



2019-02-14 09:29:08

by Stuart Menefy

[permalink] [raw]
Subject: [PATCH v3 1/2] mfd: sec: Put one element structure initialisation on one line

Change the layout of the initialisation of structures with one
element to a single line of code. This keeps the coding style
consistent.

Signed-off-by: Stuart Menefy <[email protected]>
---
drivers/mfd/sec-core.c | 58 +++++++++++++++++---------------------------------
1 file changed, 19 insertions(+), 39 deletions(-)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index e0835c9df7a1..5ff3fd726f9e 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -28,45 +28,33 @@
#include <linux/regmap.h>

static const struct mfd_cell s5m8751_devs[] = {
- {
- .name = "s5m8751-pmic",
- }, {
- .name = "s5m-charger",
- }, {
- .name = "s5m8751-codec",
- },
+ { .name = "s5m8751-pmic", },
+ { .name = "s5m-charger", },
+ { .name = "s5m8751-codec", },
};

static const struct mfd_cell s5m8763_devs[] = {
- {
- .name = "s5m8763-pmic",
- }, {
- .name = "s5m-rtc",
- }, {
- .name = "s5m-charger",
- },
+ { .name = "s5m8763-pmic", },
+ { .name = "s5m-rtc", },
+ { .name = "s5m-charger", },
};

static const struct mfd_cell s5m8767_devs[] = {
+ { .name = "s5m8767-pmic", },
+ { .name = "s5m-rtc", },
{
- .name = "s5m8767-pmic",
- }, {
- .name = "s5m-rtc",
- }, {
.name = "s5m8767-clk",
.of_compatible = "samsung,s5m8767-clk",
- }
+ },
};

static const struct mfd_cell s2mps11_devs[] = {
+ { .name = "s2mps11-regulator", },
+ { .name = "s2mps14-rtc", },
{
- .name = "s2mps11-regulator",
- }, {
- .name = "s2mps14-rtc",
- }, {
.name = "s2mps11-clk",
.of_compatible = "samsung,s2mps11-clk",
- }
+ },
};

static const struct mfd_cell s2mps13_devs[] = {
@@ -79,37 +67,29 @@ static const struct mfd_cell s2mps13_devs[] = {
};

static const struct mfd_cell s2mps14_devs[] = {
+ { .name = "s2mps14-regulator", },
+ { .name = "s2mps14-rtc", },
{
- .name = "s2mps14-regulator",
- }, {
- .name = "s2mps14-rtc",
- }, {
.name = "s2mps14-clk",
.of_compatible = "samsung,s2mps14-clk",
- }
+ },
};

static const struct mfd_cell s2mps15_devs[] = {
+ { .name = "s2mps15-regulator", },
+ { .name = "s2mps15-rtc", },
{
- .name = "s2mps15-regulator",
- }, {
- .name = "s2mps15-rtc",
- }, {
.name = "s2mps13-clk",
.of_compatible = "samsung,s2mps13-clk",
},
};

static const struct mfd_cell s2mpa01_devs[] = {
- {
- .name = "s2mpa01-pmic",
- },
+ { .name = "s2mpa01-pmic", },
};

static const struct mfd_cell s2mpu02_devs[] = {
- {
- .name = "s2mpu02-regulator",
- },
+ { .name = "s2mpu02-regulator", },
};

#ifdef CONFIG_OF
--
2.13.6


2019-02-14 09:29:31

by Stuart Menefy

[permalink] [raw]
Subject: [PATCH v3 2/2] mfd: sec: Add support for the RTC on S2MPA01

The RTC portion of the S2MPA01 appears to have the same
register layout as the S2MPS14.

Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Stuart Menefy <[email protected]>
---
drivers/mfd/sec-core.c | 1 +
drivers/mfd/sec-irq.c | 3 +++
2 files changed, 4 insertions(+)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 5ff3fd726f9e..8a299080cb55 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -86,6 +86,7 @@ static const struct mfd_cell s2mps15_devs[] = {

static const struct mfd_cell s2mpa01_devs[] = {
{ .name = "s2mpa01-pmic", },
+ { .name = "s2mps14-rtc", },
};

static const struct mfd_cell s2mpu02_devs[] = {
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index ad0099077e7e..a98c5d165039 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -455,6 +455,9 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
case S5M8767X:
sec_irq_chip = &s5m8767_irq_chip;
break;
+ case S2MPA01:
+ sec_irq_chip = &s2mps14_irq_chip;
+ break;
case S2MPS11X:
sec_irq_chip = &s2mps11_irq_chip;
break;
--
2.13.6


2019-03-20 10:00:08

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3 1/2] mfd: sec: Put one element structure initialisation on one line

On Wed, 13 Feb 2019, Stuart Menefy wrote:

> Change the layout of the initialisation of structures with one
> element to a single line of code. This keeps the coding style
> consistent.
>
> Signed-off-by: Stuart Menefy <[email protected]>
> ---
> drivers/mfd/sec-core.c | 58 +++++++++++++++++---------------------------------
> 1 file changed, 19 insertions(+), 39 deletions(-)

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2019-03-20 10:02:31

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3 2/2] mfd: sec: Add support for the RTC on S2MPA01

On Wed, 13 Feb 2019, Stuart Menefy wrote:

> The RTC portion of the S2MPA01 appears to have the same
> register layout as the S2MPS14.
>
> Reviewed-by: Krzysztof Kozlowski <[email protected]>
> Signed-off-by: Stuart Menefy <[email protected]>

Tags should be in chronological order.

That way they can give us more information about the submission path.

I'll fix this.

Applied, thanks.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog