mfd: sec: Add support for the RTC on S2MPA01
Subsystems (3)
v3 cover 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(-)
Signature · 1 line
2.13.6
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.
--- drivers/mfd/sec-core.c | 58 +++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 39 deletions(-)
drivers/mfd/sec-core.c +19 -39
@@ -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
Signature · 1 line
2.13.6
Lee Jones
AppliedRe: [PATCH v3 1/2] mfd: sec: Put one element structure initialisation on one line
Quoted 8 lines · Stuart Menefy
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.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH v3 2/2 mfd: sec: Add support for the RTC on S2MPA01
In reply to Stuart MenefyThe RTC portion of the S2MPA01 appears to have the same register layout as the S2MPS14.
--- drivers/mfd/sec-core.c | 1 + drivers/mfd/sec-irq.c | 3 +++ 2 files changed, 4 insertions(+)
drivers/mfd/sec-core.c +1 -0
@@ -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[] = {
drivers/mfd/sec-irq.c +3 -0
@@ -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 ;
Signature · 1 line
2.13.6
Lee Jones
AppliedQuoted 5 lines · Stuart Menefy
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.
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog