* [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic
@ 2025-09-14 12:42 Ivaylo Ivanov
2025-09-14 12:42 ` [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators Ivaylo Ivanov
` (6 more replies)
0 siblings, 7 replies; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
Hey folks,
This patchset adds support for the s2mps16 pmic, used on devices like
the Samsung Galaxy S7, S7 edge and the Note 7. It is still wired over
I2C, unlike newer exynoses, but also can be communicated with via APM,
support for which is not done (and probably will never be, as it's
pretty much useless).
The order of patches is important, hence why I've not split it into
subsystems. Patch 1/7 should go before patch 2/7, as 2/7 includes the
file made at 1/7. The rest can be applied without a specific order.
Thanks!
Best regards,
Ivaylo
Ivaylo Ivanov (7):
regulator: dt-bindings: add documentation for s2mps16-pmic regulators
dt-bindings: mfd: samsung,s2mps11: add compatible for s2mps16-pmic
dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible
mfd: sec: add support for s2mps16 pmic
clk: s2mps11: add the support for S2MPS16 PMIC clock
rtc: s5m: add support for S2MPS16 RTC
regulator: s2mps11: add support for S2MPS16 regulators
.../bindings/clock/samsung,s2mps11.yaml | 3 +-
.../bindings/mfd/samsung,s2mps11.yaml | 17 +-
.../bindings/regulator/samsung,s2mps16.yaml | 50 +++++
drivers/clk/clk-s2mps11.c | 8 +
drivers/mfd/sec-common.c | 10 +
drivers/mfd/sec-i2c.c | 16 ++
drivers/mfd/sec-irq.c | 46 +++++
drivers/regulator/Kconfig | 4 +-
drivers/regulator/s2mps11.c | 147 +++++++++++++
drivers/rtc/rtc-s5m.c | 16 ++
include/linux/mfd/samsung/core.h | 1 +
include/linux/mfd/samsung/irq.h | 66 ++++++
include/linux/mfd/samsung/s2mps16.h | 195 ++++++++++++++++++
13 files changed, 574 insertions(+), 5 deletions(-)
create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
create mode 100644 include/linux/mfd/samsung/s2mps16.h
--
2.43.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
@ 2025-09-14 12:42 ` Ivaylo Ivanov
2025-09-24 15:11 ` Rob Herring
2025-09-24 15:12 ` Rob Herring
2025-09-14 12:42 ` [PATCH v1 2/7] dt-bindings: mfd: samsung,s2mps11: add compatible for s2mps16-pmic Ivaylo Ivanov
` (5 subsequent siblings)
6 siblings, 2 replies; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
The S2MPS16 is a PMIC found in exynos8890 devices, which controls voltage
regulators - 38 LDOs, of which 11 are used for CP, and 11 BUCKs, of which
1 is used for CP. Provide documentation for devicetree definitions,
regulator naming patterns, etc.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
.../bindings/regulator/samsung,s2mps16.yaml | 50 +++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
diff --git a/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml b/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
new file mode 100644
index 000000000..ede87d3b9
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/samsung,s2mps16.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S2MPS16 Power Management IC regulators
+
+maintainers:
+ - Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
+
+description: |
+ This is a part of device tree bindings for S2M and S5M family of Power
+ Management IC (PMIC).
+
+ The S2MPS16 provides buck and LDO regulators.
+
+ See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
+ additional information and example.
+
+patternProperties:
+ # 27 LDOs
+ "^ldo([1-9]|1[0-3]|2[5-9]|3[0-8])$":
+ type: object
+ $ref: regulator.yaml#
+ unevaluatedProperties: false
+ description:
+ Properties for single LDO regulator.
+
+ LDOs 14-24 are used for CP, and they're left unimplemented due to lack
+ of documentation on them.
+
+ required:
+ - regulator-name
+
+ # 10 bucks
+ "^buck([1-9]|1[0-1])$":
+ type: object
+ $ref: regulator.yaml#
+ unevaluatedProperties: false
+ description:
+ Properties for single BUCK regulator.
+
+ BUCK 10 is used for CP, and it's left unimplemented due to lack of
+ documentation on it.
+
+ required:
+ - regulator-name
+
+additionalProperties: false
--
2.43.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v1 2/7] dt-bindings: mfd: samsung,s2mps11: add compatible for s2mps16-pmic
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
2025-09-14 12:42 ` [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators Ivaylo Ivanov
@ 2025-09-14 12:42 ` Ivaylo Ivanov
2025-09-24 15:13 ` Rob Herring (Arm)
2025-09-14 12:42 ` [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible Ivaylo Ivanov
` (4 subsequent siblings)
6 siblings, 1 reply; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
S2MPS16 is a PMIC present in Samsung's exynos8890 devices. It houses
voltage regulators (38 LDOs and 11 BUCKs), an RTC and a clocks module.
Add the compatible string "samsung,s2mps16-pmic" to the PMIC.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
.../bindings/mfd/samsung,s2mps11.yaml | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml b/Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml
index 31d544a9c..445596323 100644
--- a/Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml
+++ b/Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml
@@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/mfd/samsung,s2mps11.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Samsung S2MPS11/13/14/15 and S2MPU02 Power Management IC
+title: Samsung S2MPS11/13/14/15/16 and S2MPU02 Power Management IC
maintainers:
- Krzysztof Kozlowski <krzk@kernel.org>
@@ -13,7 +13,7 @@ description: |
This is a part of device tree bindings for S2M and S5M family of Power
Management IC (PMIC).
- The Samsung S2MPS11/13/14/15 and S2MPU02 is a family of Power Management IC
+ The Samsung S2MPS11/13/14/15/16 and S2MPU02 is a family of Power Management IC
which include voltage and current regulators, RTC, clock outputs and other
sub-blocks.
@@ -25,6 +25,7 @@ properties:
- samsung,s2mps13-pmic
- samsung,s2mps14-pmic
- samsung,s2mps15-pmic
+ - samsung,s2mps16-pmic
- samsung,s2mpu02-pmic
- samsung,s2mpu05-pmic
@@ -141,6 +142,18 @@ allOf:
samsung,s2mps11-acokb-ground: false
samsung,s2mps11-wrstbi-ground: false
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: samsung,s2mps16-pmic
+ then:
+ properties:
+ regulators:
+ $ref: /schemas/regulator/samsung,s2mps16.yaml
+ samsung,s2mps11-acokb-ground: false
+ samsung,s2mps11-wrstbi-ground: false
+
- if:
properties:
compatible:
--
2.43.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
2025-09-14 12:42 ` [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators Ivaylo Ivanov
2025-09-14 12:42 ` [PATCH v1 2/7] dt-bindings: mfd: samsung,s2mps11: add compatible for s2mps16-pmic Ivaylo Ivanov
@ 2025-09-14 12:42 ` Ivaylo Ivanov
2025-09-21 16:27 ` Stephen Boyd
2025-09-24 15:13 ` Rob Herring (Arm)
2025-09-14 12:42 ` [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
` (3 subsequent siblings)
6 siblings, 2 replies; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
The S2MPS16 PMIC, alongside regulators and an rtc, provides 3 clock
outputs, just like most of the other S2MPS PMICs. Document the S2MPS16
clock compatible.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml b/Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml
index d5296e605..e1666fff0 100644
--- a/Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml
+++ b/Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml
@@ -13,7 +13,7 @@ description: |
This is a part of device tree bindings for S2M and S5M family of Power
Management IC (PMIC).
- The S2MPS11/13/15 and S5M8767 provide three(AP/CP/BT) buffered 32.768 kHz
+ The S2MPS11/13/15/16 and S5M8767 provide three(AP/CP/BT) buffered 32.768 kHz
outputs. The S2MPS14 provides two (AP/BT) buffered 32.768 KHz outputs.
All available clocks are defined as preprocessor macros in
@@ -28,6 +28,7 @@ properties:
- samsung,s2mps11-clk
- samsung,s2mps13-clk # S2MPS13 and S2MPS15
- samsung,s2mps14-clk
+ - samsung,s2mps16-clk
- samsung,s5m8767-clk
"#clock-cells":
--
2.43.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
` (2 preceding siblings ...)
2025-09-14 12:42 ` [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible Ivaylo Ivanov
@ 2025-09-14 12:42 ` Ivaylo Ivanov
2025-09-16 15:55 ` Lee Jones
2025-10-10 13:12 ` Krzysztof Kozlowski
2025-09-14 12:42 ` [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock Ivaylo Ivanov
` (2 subsequent siblings)
6 siblings, 2 replies; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
Add support for Samsung's s2mps16 pmic. It's the primary PMIC used by
exynos8890 devices. It houses regulators (38 LDOs and 11 BUCKs), three
32.768KHz clock outputs and an RTC device.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
drivers/mfd/sec-common.c | 10 ++
drivers/mfd/sec-i2c.c | 16 +++
drivers/mfd/sec-irq.c | 46 +++++++
include/linux/mfd/samsung/core.h | 1 +
include/linux/mfd/samsung/irq.h | 66 ++++++++++
include/linux/mfd/samsung/s2mps16.h | 195 ++++++++++++++++++++++++++++
6 files changed, 334 insertions(+)
create mode 100644 include/linux/mfd/samsung/s2mps16.h
diff --git a/drivers/mfd/sec-common.c b/drivers/mfd/sec-common.c
index 42d55e70e..1f21d0d26 100644
--- a/drivers/mfd/sec-common.c
+++ b/drivers/mfd/sec-common.c
@@ -65,6 +65,12 @@ static const struct mfd_cell s2mps15_devs[] = {
MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"),
};
+static const struct mfd_cell s2mps16_devs[] = {
+ MFD_CELL_NAME("s2mps16-regulator"),
+ MFD_CELL_NAME("s2mps16-rtc"),
+ MFD_CELL_OF("s2mps16-clk", NULL, NULL, 0, 0, "samsung,s2mps16-clk"),
+};
+
static const struct mfd_cell s2mpa01_devs[] = {
MFD_CELL_NAME("s2mpa01-pmic"),
MFD_CELL_NAME("s2mps14-rtc"),
@@ -206,6 +212,10 @@ int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
sec_devs = s2mps15_devs;
num_sec_devs = ARRAY_SIZE(s2mps15_devs);
break;
+ case S2MPS16X:
+ sec_devs = s2mps16_devs;
+ num_sec_devs = ARRAY_SIZE(s2mps16_devs);
+ break;
case S2MPU02:
sec_devs = s2mpu02_devs;
num_sec_devs = ARRAY_SIZE(s2mpu02_devs);
diff --git a/drivers/mfd/sec-i2c.c b/drivers/mfd/sec-i2c.c
index 3132b849b..6b0a8e927 100644
--- a/drivers/mfd/sec-i2c.c
+++ b/drivers/mfd/sec-i2c.c
@@ -16,6 +16,7 @@
#include <linux/mfd/samsung/s2mps13.h>
#include <linux/mfd/samsung/s2mps14.h>
#include <linux/mfd/samsung/s2mps15.h>
+#include <linux/mfd/samsung/s2mps16.h>
#include <linux/mfd/samsung/s2mpu02.h>
#include <linux/mfd/samsung/s5m8767.h>
#include <linux/mod_devicetable.h>
@@ -116,6 +117,15 @@ static const struct regmap_config s2mps15_regmap_config = {
.cache_type = REGCACHE_FLAT,
};
+static const struct regmap_config s2mps16_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+
+ .max_register = S2MPS16_REG_VTH_OFFSET,
+ .volatile_reg = s2mps11_volatile,
+ .cache_type = REGCACHE_FLAT,
+};
+
static const struct regmap_config s2mpu02_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -193,6 +203,11 @@ static const struct sec_pmic_i2c_platform_data s2mps15_data = {
.device_type = S2MPS15X,
};
+static const struct sec_pmic_i2c_platform_data s2mps16_data = {
+ .regmap_cfg = &s2mps16_regmap_config,
+ .device_type = S2MPS16X,
+};
+
static const struct sec_pmic_i2c_platform_data s2mpu02_data = {
.regmap_cfg = &s2mpu02_regmap_config,
.device_type = S2MPU02,
@@ -215,6 +230,7 @@ static const struct of_device_id sec_pmic_i2c_of_match[] = {
{ .compatible = "samsung,s2mps13-pmic", .data = &s2mps13_data, },
{ .compatible = "samsung,s2mps14-pmic", .data = &s2mps14_data, },
{ .compatible = "samsung,s2mps15-pmic", .data = &s2mps15_data, },
+ { .compatible = "samsung,s2mps16-pmic", .data = &s2mps16_data, },
{ .compatible = "samsung,s2mpu02-pmic", .data = &s2mpu02_data, },
{ .compatible = "samsung,s2mpu05-pmic", .data = &s2mpu05_data, },
{ .compatible = "samsung,s5m8767-pmic", .data = &s5m8767_data, },
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index c5c80b1ba..c0bdc4314 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -116,6 +116,39 @@ static const struct regmap_irq s2mps14_irqs[] = {
REGMAP_IRQ_REG(S2MPS14_IRQ_TSD, 2, S2MPS14_IRQ_TSD_MASK),
};
+static const struct regmap_irq s2mps16_irqs[] = {
+ REGMAP_IRQ_REG(S2MPS16_IRQ_PWRONF, 0, S2MPS16_IRQ_PWRONF_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_PWRONR, 0, S2MPS16_IRQ_PWRONR_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_JIGONBF, 0, S2MPS16_IRQ_JIGONBF_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_JIGONBR, 0, S2MPS16_IRQ_JIGONBR_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_ACOKBF, 0, S2MPS16_IRQ_ACOKBF_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_ACOKBR, 0, S2MPS16_IRQ_ACOKBR_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_PWRON1S, 0, S2MPS16_IRQ_PWRON1S_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_MRB, 0, S2MPS16_IRQ_MRB_MASK),
+
+ REGMAP_IRQ_REG(S2MPS16_IRQ_RTC60S, 1, S2MPS16_IRQ_RTC60S_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_RTCA1, 1, S2MPS16_IRQ_RTCA1_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_RTCA0, 1, S2MPS16_IRQ_RTCA0_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_SMPL, 1, S2MPS16_IRQ_SMPL_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_RTC1S, 1, S2MPS16_IRQ_RTC1S_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_WTSR, 1, S2MPS16_IRQ_WTSR_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_WRSTB, 1, S2MPS16_IRQ_WRSTB_MASK),
+
+ REGMAP_IRQ_REG(S2MPS16_IRQ_INT120C, 2, S2MPS16_IRQ_INT120C_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_INT140C, 2, S2MPS16_IRQ_INT140C_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_TSD, 2, S2MPS16_IRQ_TSD_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_ADCDONE, 2, S2MPS16_IRQ_ADCDONE_MASK),
+
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC0, 3, S2MPS16_IRQ_OC0_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC1, 3, S2MPS16_IRQ_OC1_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC2, 3, S2MPS16_IRQ_OC2_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC3, 3, S2MPS16_IRQ_OC3_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC4, 3, S2MPS16_IRQ_OC4_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC5, 3, S2MPS16_IRQ_OC5_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC6, 3, S2MPS16_IRQ_OC6_MASK),
+ REGMAP_IRQ_REG(S2MPS16_IRQ_OC7, 3, S2MPS16_IRQ_OC7_MASK),
+};
+
static const struct regmap_irq s2mpu02_irqs[] = {
REGMAP_IRQ_REG(S2MPU02_IRQ_PWRONF, 0, S2MPS11_IRQ_PWRONF_MASK),
REGMAP_IRQ_REG(S2MPU02_IRQ_PWRONR, 0, S2MPS11_IRQ_PWRONR_MASK),
@@ -223,6 +256,16 @@ static const struct regmap_irq_chip s2mps15_irq_chip = {
S2MPS1X_IRQ_CHIP_COMMON_DATA,
};
+static const struct regmap_irq_chip s2mps16_irq_chip = {
+ .name = "s2mps16",
+ .irqs = s2mps16_irqs,
+ .num_irqs = ARRAY_SIZE(s2mps16_irqs),
+ .num_regs = 4,
+ .status_base = S2MPS14_REG_INT1,
+ .mask_base = S2MPS11_REG_INT1M,
+ .ack_base = S2MPS11_REG_INT1,
+};
+
static const struct regmap_irq_chip s2mpu02_irq_chip = {
.name = "s2mpu02",
.irqs = s2mpu02_irqs,
@@ -282,6 +325,9 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
case S2MPS15X:
sec_irq_chip = &s2mps15_irq_chip;
break;
+ case S2MPS16X:
+ sec_irq_chip = &s2mps16_irq_chip;
+ break;
case S2MPU02:
sec_irq_chip = &s2mpu02_irq_chip;
break;
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index d785e101f..d99fa609f 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -44,6 +44,7 @@ enum sec_device_type {
S2MPS13X,
S2MPS14X,
S2MPS15X,
+ S2MPS16X,
S2MPU02,
S2MPU05,
};
diff --git a/include/linux/mfd/samsung/irq.h b/include/linux/mfd/samsung/irq.h
index b4805cbd9..e62d00188 100644
--- a/include/linux/mfd/samsung/irq.h
+++ b/include/linux/mfd/samsung/irq.h
@@ -226,6 +226,72 @@ enum s2mps14_irq {
S2MPS14_IRQ_NR,
};
+enum s2mps16_irq {
+ S2MPS16_IRQ_PWRONF,
+ S2MPS16_IRQ_PWRONR,
+ S2MPS16_IRQ_JIGONBF,
+ S2MPS16_IRQ_JIGONBR,
+ S2MPS16_IRQ_ACOKBF,
+ S2MPS16_IRQ_ACOKBR,
+ S2MPS16_IRQ_PWRON1S,
+ S2MPS16_IRQ_MRB,
+
+ S2MPS16_IRQ_RTC60S,
+ S2MPS16_IRQ_RTCA1,
+ S2MPS16_IRQ_RTCA0,
+ S2MPS16_IRQ_SMPL,
+ S2MPS16_IRQ_RTC1S,
+ S2MPS16_IRQ_WTSR,
+ S2MPS16_IRQ_WRSTB,
+
+ S2MPS16_IRQ_INT120C,
+ S2MPS16_IRQ_INT140C,
+ S2MPS16_IRQ_TSD,
+ S2MPS16_IRQ_ADCDONE,
+
+ S2MPS16_IRQ_OC0,
+ S2MPS16_IRQ_OC1,
+ S2MPS16_IRQ_OC2,
+ S2MPS16_IRQ_OC3,
+ S2MPS16_IRQ_OC4,
+ S2MPS16_IRQ_OC5,
+ S2MPS16_IRQ_OC6,
+ S2MPS16_IRQ_OC7,
+
+ S2MPS16_IRQ_NR,
+};
+
+#define S2MPS16_IRQ_PWRONF_MASK BIT(0)
+#define S2MPS16_IRQ_PWRONR_MASK BIT(1)
+#define S2MPS16_IRQ_JIGONBF_MASK BIT(2)
+#define S2MPS16_IRQ_JIGONBR_MASK BIT(3)
+#define S2MPS16_IRQ_ACOKBF_MASK BIT(4)
+#define S2MPS16_IRQ_ACOKBR_MASK BIT(5)
+#define S2MPS16_IRQ_PWRON1S_MASK BIT(6)
+#define S2MPS16_IRQ_MRB_MASK BIT(7)
+
+#define S2MPS16_IRQ_RTC60S_MASK BIT(0)
+#define S2MPS16_IRQ_RTCA1_MASK BIT(1)
+#define S2MPS16_IRQ_RTCA0_MASK BIT(2)
+#define S2MPS16_IRQ_SMPL_MASK BIT(3)
+#define S2MPS16_IRQ_RTC1S_MASK BIT(4)
+#define S2MPS16_IRQ_WTSR_MASK BIT(5)
+#define S2MPS16_IRQ_WRSTB_MASK BIT(7)
+
+#define S2MPS16_IRQ_INT120C_MASK BIT(0)
+#define S2MPS16_IRQ_INT140C_MASK BIT(1)
+#define S2MPS16_IRQ_TSD_MASK BIT(2)
+#define S2MPS16_IRQ_ADCDONE_MASK BIT(7)
+
+#define S2MPS16_IRQ_OC0_MASK BIT(0)
+#define S2MPS16_IRQ_OC1_MASK BIT(1)
+#define S2MPS16_IRQ_OC2_MASK BIT(2)
+#define S2MPS16_IRQ_OC3_MASK BIT(3)
+#define S2MPS16_IRQ_OC4_MASK BIT(4)
+#define S2MPS16_IRQ_OC5_MASK BIT(5)
+#define S2MPS16_IRQ_OC6_MASK BIT(6)
+#define S2MPS16_IRQ_OC7_MASK BIT(7)
+
enum s2mpu02_irq {
S2MPU02_IRQ_PWRONF,
S2MPU02_IRQ_PWRONR,
diff --git a/include/linux/mfd/samsung/s2mps16.h b/include/linux/mfd/samsung/s2mps16.h
new file mode 100644
index 000000000..d4394b054
--- /dev/null
+++ b/include/linux/mfd/samsung/s2mps16.h
@@ -0,0 +1,195 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
+ * Copyright (c) 2025 Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
+ */
+
+#ifndef __LINUX_MFD_S2MPS16_H
+#define __LINUX_MFD_S2MPS16_H
+
+/* S2MPS16 registers */
+enum S2MPS16_reg {
+ S2MPS16_REG_ID,
+ S2MPS16_REG_INT1,
+ S2MPS16_REG_INT2,
+ S2MPS16_REG_INT3,
+ S2MPS16_REG_INT4,
+ S2MPS16_REG_INT1M,
+ S2MPS16_REG_INT2M,
+ S2MPS16_REG_INT3M,
+ S2MPS16_REG_INT4M,
+ S2MPS16_REG_ST1,
+ S2MPS16_REG_ST2,
+ S2MPS16_REG_PWRONSRC,
+ S2MPS16_REG_OFFSRC,
+ S2MPS16_REG_BU_CHG,
+ S2MPS16_REG_RTC_BUF,
+ S2MPS16_REG_CTRL1,
+ S2MPS16_REG_CTRL2,
+ S2MPS16_REG_ETC_TEST,
+ S2MPS16_REG_OTP_ADRL,
+ S2MPS16_REG_OTP_ADRH,
+ S2MPS16_REG_OTP_DATA,
+ S2MPS16_REG_CTRL3,
+ S2MPS16_REG_ETC_OTP,
+ S2MPS16_REG_UVLO_OTP,
+ S2MPS16_REG_CFG1,
+ S2MPS16_REG_CFG2,
+ S2MPS16_REG_B1CTRL1,
+ S2MPS16_REG_B1CTRL2,
+ S2MPS16_REG_B2CTRL1,
+ S2MPS16_REG_B2CTRL2,
+ S2MPS16_REG_B3CTRL1,
+ S2MPS16_REG_B3CTRL2,
+ S2MPS16_REG_B4CTRL1,
+ S2MPS16_REG_B4CTRL2,
+ S2MPS16_REG_B5CTRL1,
+ S2MPS16_REG_B5CTRL2,
+ S2MPS16_REG_B6CTRL1,
+ S2MPS16_REG_B6CTRL2,
+ S2MPS16_REG_B6CTRL3,
+ S2MPS16_REG_B7CTRL1,
+ S2MPS16_REG_B7CTRL2,
+ S2MPS16_REG_B8CTRL1,
+ S2MPS16_REG_B8CTRL2,
+ S2MPS16_REG_B9CTRL1,
+ S2MPS16_REG_B9CTRL2,
+ /* buck10 is used for CP */
+ S2MPS16_REG_B11CTRL1 = 0x30,
+ S2MPS16_REG_B11CTRL2,
+ S2MPS16_REG_BB1CTRL1,
+ S2MPS16_REG_BB1CTRL2,
+ S2MPS16_REG_BUCK_RAMP,
+ S2MPS16_REG_LDO7_DVS,
+ S2MPS16_REG_LDO8_DVS,
+ S2MPS16_REG_LDO9_DVS,
+ S2MPS16_REG_LDO10_DVS,
+ S2MPS16_REG_LDO11_DVS,
+ S2MPS16_REG_L1CTRL,
+ S2MPS16_REG_L2CTRL,
+ S2MPS16_REG_L3CTRL,
+ S2MPS16_REG_L4CTRL,
+ S2MPS16_REG_L5CTRL,
+ S2MPS16_REG_L6CTRL,
+ S2MPS16_REG_L7CTRL,
+ S2MPS16_REG_L8CTRL,
+ S2MPS16_REG_L9CTRL,
+ S2MPS16_REG_L10CTRL,
+ S2MPS16_REG_L11CTRL,
+ S2MPS16_REG_L12CTRL,
+ S2MPS16_REG_L13CTRL,
+ /* ldo14 to 24 are used for CP */
+ S2MPS16_REG_L25CTRL = 0x55,
+ S2MPS16_REG_L26CTRL,
+ S2MPS16_REG_L27CTRL,
+ S2MPS16_REG_L28CTRL,
+ S2MPS16_REG_L29CTRL,
+ S2MPS16_REG_L30CTRL,
+ S2MPS16_REG_L31CTRL,
+ S2MPS16_REG_L32CTRL,
+ S2MPS16_REG_L33CTRL,
+ S2MPS16_REG_L34CTRL,
+ S2MPS16_REG_L35CTRL,
+ S2MPS16_REG_L36CTRL,
+ S2MPS16_REG_L37CTRL,
+ S2MPS16_REG_L38CTRL,
+ S2MPS16_REG_LDO_DSCH,
+ S2MPS16_REG_LDO_CTRL0,
+ S2MPS16_REG_LDO_CTRL1,
+ S2MPS16_REG_LDO_CTRL2,
+ S2MPS16_REG_LDO_OCP,
+ S2MPS16_REG_IOCONF,
+ S2MPS16_REG_AVP,
+ S2MPS16_REG_ADC_CTRL1,
+ S2MPS16_REG_ADC_CTRL2,
+ S2MPS16_REG_ADC_DATA,
+ S2MPS16_REG_TCXO_CTRL,
+ S2MPS16_REG_SELMIF,
+ S2MPS16_REG_SQE_CTRL,
+ S2MPS16_REG_VTH_OFFSET = 0xFF,
+};
+
+/* S2MPS16 regulator ids */
+enum S2MPS16_regulators {
+ S2MPS16_LDO1,
+ S2MPS16_LDO2,
+ S2MPS16_LDO3,
+ S2MPS16_LDO4,
+ S2MPS16_LDO5,
+ S2MPS16_LDO6,
+ S2MPS16_LDO7,
+ S2MPS16_LDO8,
+ S2MPS16_LDO9,
+ S2MPS16_LDO10,
+ S2MPS16_LDO11,
+ S2MPS16_LDO12,
+ S2MPS16_LDO13,
+ /* ldo14 to 24 are used for CP */
+ S2MPS16_LDO25,
+ S2MPS16_LDO26,
+ S2MPS16_LDO27,
+ S2MPS16_LDO28,
+ S2MPS16_LDO29,
+ S2MPS16_LDO30,
+ S2MPS16_LDO31,
+ S2MPS16_LDO32,
+ S2MPS16_LDO33,
+ S2MPS16_LDO34,
+ S2MPS16_LDO35,
+ S2MPS16_LDO36,
+ S2MPS16_LDO37,
+ S2MPS16_LDO38,
+ S2MPS16_BUCK1,
+ S2MPS16_BUCK2,
+ S2MPS16_BUCK3,
+ S2MPS16_BUCK4,
+ S2MPS16_BUCK5,
+ S2MPS16_BUCK6,
+ S2MPS16_BUCK7,
+ S2MPS16_BUCK8,
+ S2MPS16_BUCK9,
+ /* buck10 is used for CP */
+ S2MPS16_BUCK11,
+ S2MPS16_REG_MAX,
+};
+
+#define S2MPS16_BUCK_MIN1 300000
+#define S2MPS16_BUCK_MIN2 600000
+#define S2MPS16_BUCK_MIN3 2600000
+#define S2MPS16_BUCK_STEP1 6250
+#define S2MPS16_BUCK_STEP2 12500
+
+#define S2MPS16_LDO_MIN1 300000
+#define S2MPS16_LDO_MIN2 500000
+#define S2MPS16_LDO_MIN3 700000
+#define S2MPS16_LDO_MIN4 1800000
+#define S2MPS16_LDO_STEP1 12500
+#define S2MPS16_LDO_STEP2 25000
+
+#define S2MPS16_ENABLE_SHIFT 0x06
+#define S2MPS16_LDO_VSEL_MASK 0x3F
+#define S2MPS16_BUCK_VSEL_MASK 0xFF
+#define S2MPS16_ENABLE_MASK (0x03 << S2MPS16_ENABLE_SHIFT)
+#define S2MPS16_LDO_N_VOLTAGES (S2MPS16_LDO_VSEL_MASK + 1)
+#define S2MPS16_BUCK_N_VOLTAGES (S2MPS16_BUCK_VSEL_MASK + 1)
+
+#define S2MPS16_BUCK_RAMP_SHIFT1 6
+#define S2MPS16_BUCK_RAMP_SHIFT2 4
+#define S2MPS16_BUCK_RAMP_SHIFT3 2
+#define S2MPS16_BUCK_RAMP_SHIFT4 0
+#define S2MPS16_BUCK_RAMP_MASK 0x3
+
+#define S2MPS16_ENABLE_TIME_LDO 128
+#define S2MPS16_ENABLE_TIME_BUCK1 95
+#define S2MPS16_ENABLE_TIME_BUCK2 95
+#define S2MPS16_ENABLE_TIME_BUCK3 95
+#define S2MPS16_ENABLE_TIME_BUCK4 95
+#define S2MPS16_ENABLE_TIME_BUCK5 95
+#define S2MPS16_ENABLE_TIME_BUCK6 128
+#define S2MPS16_ENABLE_TIME_BUCK7 95
+#define S2MPS16_ENABLE_TIME_BUCK8 106
+#define S2MPS16_ENABLE_TIME_BUCK9 150
+#define S2MPS16_ENABLE_TIME_BUCK10 95
+#define S2MPS16_ENABLE_TIME_BUCK11 95
+
+#endif /* __LINUX_MFD_S2MPS16_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
` (3 preceding siblings ...)
2025-09-14 12:42 ` [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
@ 2025-09-14 12:42 ` Ivaylo Ivanov
2025-09-15 4:56 ` Peng Fan
` (3 more replies)
2025-09-14 12:42 ` [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC Ivaylo Ivanov
2025-09-14 12:42 ` [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators Ivaylo Ivanov
6 siblings, 4 replies; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
Add the support for S2MPS16 PMIC clock, which is functionally the same
as the currently supported ones, with the exception of a different
register.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
drivers/clk/clk-s2mps11.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index d4e9c3577..7c766d05d 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -14,6 +14,7 @@
#include <linux/mfd/samsung/s2mps11.h>
#include <linux/mfd/samsung/s2mps13.h>
#include <linux/mfd/samsung/s2mps14.h>
+#include <linux/mfd/samsung/s2mps16.h>
#include <linux/mfd/samsung/s5m8767.h>
#include <linux/mfd/samsung/core.h>
@@ -149,6 +150,9 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
case S2MPS14X:
s2mps11_reg = S2MPS14_REG_RTCCTRL;
break;
+ case S2MPS16X:
+ s2mps11_reg = S2MPS16_REG_RTC_BUF;
+ break;
case S5M8767X:
s2mps11_reg = S5M8767_REG_CTRL1;
break;
@@ -224,6 +228,7 @@ static const struct platform_device_id s2mps11_clk_id[] = {
{ "s2mps11-clk", S2MPS11X},
{ "s2mps13-clk", S2MPS13X},
{ "s2mps14-clk", S2MPS14X},
+ { "s2mps16-clk", S2MPS16X},
{ "s5m8767-clk", S5M8767X},
{ },
};
@@ -249,6 +254,9 @@ static const struct of_device_id s2mps11_dt_match[] __used = {
}, {
.compatible = "samsung,s2mps14-clk",
.data = (void *)S2MPS14X,
+ }, {
+ .compatible = "samsung,s2mps16-clk",
+ .data = (void *)S2MPS16X,
}, {
.compatible = "samsung,s5m8767-clk",
.data = (void *)S5M8767X,
--
2.43.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
` (4 preceding siblings ...)
2025-09-14 12:42 ` [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock Ivaylo Ivanov
@ 2025-09-14 12:42 ` Ivaylo Ivanov
2025-09-14 16:35 ` Alexandre Belloni
2025-10-10 13:07 ` Krzysztof Kozlowski
2025-09-14 12:42 ` [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators Ivaylo Ivanov
6 siblings, 2 replies; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
Add support for Samsung's S2MPS16 PMIC RTC, which has pretty much
identical functionality to the existing S2MPS15 support, with the
difference being the ST2 register.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
drivers/rtc/rtc-s5m.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index a7220b4d0..910248731 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -18,6 +18,7 @@
#include <linux/mfd/samsung/irq.h>
#include <linux/mfd/samsung/rtc.h>
#include <linux/mfd/samsung/s2mps14.h>
+#include <linux/mfd/samsung/s2mps16.h>
/*
* Maximum number of retries for checking changes in UDR field
@@ -254,6 +255,11 @@ static int s5m_check_pending_alarm_interrupt(struct s5m_rtc_info *info,
ret = regmap_read(info->regmap, S5M_RTC_STATUS, &val);
val &= S5M_ALARM0_STATUS;
break;
+ case S2MPS16X:
+ ret = regmap_read(info->s5m87xx->regmap_pmic, S2MPS16_REG_ST2,
+ &val);
+ val &= S2MPS_ALARM0_STATUS;
+ break;
case S2MPG10:
case S2MPS15X:
case S2MPS14X:
@@ -303,6 +309,7 @@ static int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
udr_mask |= S5M_RTC_TIME_EN_MASK;
break;
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -354,6 +361,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
switch (info->device_type) {
case S5M8767X:
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -378,6 +386,7 @@ static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm)
switch (info->device_type) {
case S5M8767X:
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -416,6 +425,7 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
switch (info->device_type) {
case S5M8767X:
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -455,6 +465,7 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
switch (info->device_type) {
case S5M8767X:
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -494,6 +505,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
switch (info->device_type) {
case S5M8767X:
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -532,6 +544,7 @@ static int s5m_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
switch (info->device_type) {
case S5M8767X:
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -613,6 +626,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
break;
case S2MPG10:
+ case S2MPS16X:
case S2MPS15X:
case S2MPS14X:
case S2MPS13X:
@@ -680,6 +694,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
struct i2c_client *i2c;
switch (device_type) {
+ case S2MPS16X:
case S2MPS15X:
regmap_cfg = &s2mps14_rtc_regmap_config;
info->regs = &s2mps15_rtc_regs;
@@ -817,6 +832,7 @@ static const struct platform_device_id s5m_rtc_id[] = {
{ "s2mps13-rtc", S2MPS13X },
{ "s2mps14-rtc", S2MPS14X },
{ "s2mps15-rtc", S2MPS15X },
+ { "s2mps16-rtc", S2MPS16X },
{ },
};
MODULE_DEVICE_TABLE(platform, s5m_rtc_id);
--
2.43.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
` (5 preceding siblings ...)
2025-09-14 12:42 ` [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC Ivaylo Ivanov
@ 2025-09-14 12:42 ` Ivaylo Ivanov
2025-09-15 11:42 ` Mark Brown
2025-10-10 13:08 ` Krzysztof Kozlowski
6 siblings, 2 replies; 23+ messages in thread
From: Ivaylo Ivanov @ 2025-09-14 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
S2MPS16 is a PMIC, manufactured by Samsung, particularly used in
exynos8890 based devices, featuring 38 LDOs, of which 11 are used for
CP, and 11 BUCKs, of which 1 is used for CP. Add driver support for
controlling all BUCKs and LDOs, except the ones used for CP, as they are
not documented enough and the vendor kernel doesn't handle them anyways.
Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
drivers/regulator/Kconfig | 4 +-
drivers/regulator/s2mps11.c | 147 ++++++++++++++++++++++++++++++++++++
2 files changed, 149 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index eaa6df1c9..41b56b647 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -1352,10 +1352,10 @@ config REGULATOR_S2MPA01
via I2C bus. S2MPA01 has 10 Bucks and 26 LDO outputs.
config REGULATOR_S2MPS11
- tristate "Samsung S2MPS11/13/14/15/S2MPU02/05 voltage regulator"
+ tristate "Samsung S2MPS11/13/14/15/16/S2MPU02/05 voltage regulator"
depends on MFD_SEC_CORE || COMPILE_TEST
help
- This driver supports a Samsung S2MPS11/13/14/15/S2MPU02/05 voltage
+ This driver supports a Samsung S2MPS11/13/14/15/16/S2MPU02/05 voltage
output regulator via I2C bus. The chip is comprised of high efficient
Buck converters including Dual-Phase Buck converter, Buck-Boost
converter, various LDOs.
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 04ae9c615..f736b6ee9 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -20,6 +20,7 @@
#include <linux/mfd/samsung/s2mps13.h>
#include <linux/mfd/samsung/s2mps14.h>
#include <linux/mfd/samsung/s2mps15.h>
+#include <linux/mfd/samsung/s2mps16.h>
#include <linux/mfd/samsung/s2mpu02.h>
#include <linux/mfd/samsung/s2mpu05.h>
@@ -828,6 +829,146 @@ static const struct regulator_desc s2mps15_regulators[] = {
regulator_desc_s2mps15_buck(10, s2mps15_buck_voltage_ranges2),
};
+static int s2mps16_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
+{
+ unsigned int ramp_val, ramp_shift, ramp_reg;
+ int rdev_id = rdev_get_id(rdev);
+
+ switch (rdev_id) {
+ case S2MPS16_BUCK2:
+ case S2MPS16_BUCK4:
+ case S2MPS16_BUCK5:
+ ramp_shift = S2MPS16_BUCK_RAMP_SHIFT1;
+ break;
+ case S2MPS16_BUCK1:
+ case S2MPS16_BUCK3:
+ case S2MPS16_BUCK6:
+ ramp_shift = S2MPS16_BUCK_RAMP_SHIFT2;
+ break;
+ case S2MPS16_BUCK7:
+ case S2MPS16_BUCK11:
+ ramp_shift = S2MPS16_BUCK_RAMP_SHIFT3;
+ break;
+ case S2MPS16_BUCK8:
+ case S2MPS16_BUCK9:
+ ramp_shift = S2MPS16_BUCK_RAMP_SHIFT4;
+ break;
+ default:
+ return 0;
+ }
+ ramp_reg = S2MPS16_REG_BUCK_RAMP;
+ ramp_val = get_ramp_delay(ramp_delay);
+
+ return regmap_update_bits(rdev->regmap, ramp_reg,
+ S2MPS16_BUCK_RAMP_MASK << ramp_shift,
+ ramp_val << ramp_shift);
+}
+
+static const struct regulator_ops s2mps16_ldo_ops = {
+ .list_voltage = regulator_list_voltage_linear,
+ .map_voltage = regulator_map_voltage_linear,
+ .is_enabled = regulator_is_enabled_regmap,
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+};
+
+static const struct regulator_ops s2mps16_buck_ops = {
+ .list_voltage = regulator_list_voltage_linear,
+ .map_voltage = regulator_map_voltage_linear,
+ .is_enabled = regulator_is_enabled_regmap,
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .set_voltage_time_sel = regulator_set_voltage_time_sel,
+ .set_ramp_delay = s2mps16_set_ramp_delay,
+};
+
+#define regulator_desc_s2mps16_ldo(num, min, step) { \
+ .name = "ldo"#num, \
+ .id = S2MPS16_LDO##num, \
+ .ops = &s2mps16_ldo_ops, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ .min_uV = S2MPS16_LDO_##min, \
+ .uV_step = S2MPS16_LDO_##step, \
+ .n_voltages = S2MPS16_LDO_N_VOLTAGES, \
+ .vsel_reg = S2MPS16_REG_L##num##CTRL, \
+ .vsel_mask = S2MPS16_LDO_VSEL_MASK, \
+ .enable_reg = S2MPS16_REG_L##num##CTRL, \
+ .enable_mask = S2MPS16_ENABLE_MASK, \
+ .enable_time = S2MPS16_ENABLE_TIME_LDO \
+}
+
+#define regulator_desc_s2mps16_buck(num, min, step, vsel, enable) { \
+ .name = "buck"#num, \
+ .id = S2MPS16_BUCK##num, \
+ .ops = &s2mps16_buck_ops, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ .min_uV = S2MPS16_BUCK_##min, \
+ .uV_step = S2MPS16_BUCK_##step, \
+ .n_voltages = S2MPS16_BUCK_N_VOLTAGES, \
+ .vsel_reg = S2MPS16_REG_B##num##vsel, \
+ .vsel_mask = S2MPS16_BUCK_VSEL_MASK, \
+ .enable_reg = S2MPS16_REG_B##num##enable, \
+ .enable_mask = S2MPS16_ENABLE_MASK, \
+ .enable_time = S2MPS16_ENABLE_TIME_BUCK##num \
+}
+
+#define regulator_desc_s2mps16_buck1(num) \
+ regulator_desc_s2mps16_buck(num, MIN1, STEP1, CTRL2, CTRL1)
+
+#define regulator_desc_s2mps16_buck2(num) \
+ regulator_desc_s2mps16_buck(num, MIN1, STEP1, CTRL3, CTRL1)
+
+#define regulator_desc_s2mps16_buck3(num) \
+ regulator_desc_s2mps16_buck(num, MIN2, STEP2, CTRL2, CTRL1)
+
+static const struct regulator_desc s2mps16_regulators[] = {
+ regulator_desc_s2mps16_ldo(1, MIN2, STEP1),
+ regulator_desc_s2mps16_ldo(2, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(3, MIN3, STEP2),
+ regulator_desc_s2mps16_ldo(4, MIN3, STEP1),
+ regulator_desc_s2mps16_ldo(5, MIN3, STEP2),
+ regulator_desc_s2mps16_ldo(6, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(7, MIN1, STEP2),
+ regulator_desc_s2mps16_ldo(8, MIN1, STEP2),
+ regulator_desc_s2mps16_ldo(9, MIN1, STEP2),
+ regulator_desc_s2mps16_ldo(10, MIN1, STEP2),
+ regulator_desc_s2mps16_ldo(11, MIN1, STEP2),
+ regulator_desc_s2mps16_ldo(12, MIN3, STEP1),
+ regulator_desc_s2mps16_ldo(13, MIN3, STEP1),
+ /* LDOs 14-24 are used for CP. They aren't documented */
+ regulator_desc_s2mps16_ldo(25, MIN3, STEP1),
+ regulator_desc_s2mps16_ldo(26, MIN3, STEP1),
+ regulator_desc_s2mps16_ldo(27, MIN3, STEP1),
+ regulator_desc_s2mps16_ldo(28, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(29, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(30, MIN3, STEP2),
+ regulator_desc_s2mps16_ldo(31, MIN3, STEP1),
+ regulator_desc_s2mps16_ldo(32, MIN3, STEP2),
+ regulator_desc_s2mps16_ldo(33, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(34, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(35, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(36, MIN4, STEP2),
+ regulator_desc_s2mps16_ldo(37, MIN3, STEP2),
+ regulator_desc_s2mps16_ldo(38, MIN3, STEP1),
+ regulator_desc_s2mps16_buck1(1),
+ regulator_desc_s2mps16_buck1(2),
+ regulator_desc_s2mps16_buck1(3),
+ regulator_desc_s2mps16_buck1(4),
+ regulator_desc_s2mps16_buck1(5),
+ regulator_desc_s2mps16_buck2(6),
+ regulator_desc_s2mps16_buck1(7),
+ regulator_desc_s2mps16_buck3(8),
+ regulator_desc_s2mps16_buck3(9),
+ /* BUCK 10 is used for CP. It's not documented */
+ regulator_desc_s2mps16_buck1(11),
+};
+
static int s2mps14_pmic_enable_ext_control(struct s2mps11_info *s2mps11,
struct regulator_dev *rdev)
{
@@ -1238,6 +1379,11 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
regulators = s2mps15_regulators;
BUILD_BUG_ON(S2MPS_REGULATOR_MAX < ARRAY_SIZE(s2mps15_regulators));
break;
+ case S2MPS16X:
+ rdev_num = ARRAY_SIZE(s2mps16_regulators);
+ regulators = s2mps16_regulators;
+ BUILD_BUG_ON(S2MPS_REGULATOR_MAX < ARRAY_SIZE(s2mps16_regulators));
+ break;
case S2MPU02:
rdev_num = ARRAY_SIZE(s2mpu02_regulators);
regulators = s2mpu02_regulators;
@@ -1316,6 +1462,7 @@ static const struct platform_device_id s2mps11_pmic_id[] = {
{ "s2mps13-regulator", S2MPS13X},
{ "s2mps14-regulator", S2MPS14X},
{ "s2mps15-regulator", S2MPS15X},
+ { "s2mps16-regulator", S2MPS16X},
{ "s2mpu02-regulator", S2MPU02},
{ "s2mpu05-regulator", S2MPU05},
{ },
--
2.43.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC
2025-09-14 12:42 ` [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC Ivaylo Ivanov
@ 2025-09-14 16:35 ` Alexandre Belloni
2025-10-10 13:07 ` Krzysztof Kozlowski
1 sibling, 0 replies; 23+ messages in thread
From: Alexandre Belloni @ 2025-09-14 16:35 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
On 14/09/2025 15:42:26+0300, Ivaylo Ivanov wrote:
> Add support for Samsung's S2MPS16 PMIC RTC, which has pretty much
> identical functionality to the existing S2MPS15 support, with the
> difference being the ST2 register.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> drivers/rtc/rtc-s5m.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> index a7220b4d0..910248731 100644
> --- a/drivers/rtc/rtc-s5m.c
> +++ b/drivers/rtc/rtc-s5m.c
> @@ -18,6 +18,7 @@
> #include <linux/mfd/samsung/irq.h>
> #include <linux/mfd/samsung/rtc.h>
> #include <linux/mfd/samsung/s2mps14.h>
> +#include <linux/mfd/samsung/s2mps16.h>
>
> /*
> * Maximum number of retries for checking changes in UDR field
> @@ -254,6 +255,11 @@ static int s5m_check_pending_alarm_interrupt(struct s5m_rtc_info *info,
> ret = regmap_read(info->regmap, S5M_RTC_STATUS, &val);
> val &= S5M_ALARM0_STATUS;
> break;
> + case S2MPS16X:
> + ret = regmap_read(info->s5m87xx->regmap_pmic, S2MPS16_REG_ST2,
> + &val);
> + val &= S2MPS_ALARM0_STATUS;
> + break;
> case S2MPG10:
> case S2MPS15X:
> case S2MPS14X:
> @@ -303,6 +309,7 @@ static int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
> udr_mask |= S5M_RTC_TIME_EN_MASK;
> break;
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -354,6 +361,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
> switch (info->device_type) {
> case S5M8767X:
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -378,6 +386,7 @@ static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm)
> switch (info->device_type) {
> case S5M8767X:
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -416,6 +425,7 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
> switch (info->device_type) {
> case S5M8767X:
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -455,6 +465,7 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
> switch (info->device_type) {
> case S5M8767X:
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -494,6 +505,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
> switch (info->device_type) {
> case S5M8767X:
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -532,6 +544,7 @@ static int s5m_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
> switch (info->device_type) {
> case S5M8767X:
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -613,6 +626,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
> break;
>
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
> @@ -680,6 +694,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
> struct i2c_client *i2c;
>
> switch (device_type) {
> + case S2MPS16X:
> case S2MPS15X:
> regmap_cfg = &s2mps14_rtc_regmap_config;
> info->regs = &s2mps15_rtc_regs;
> @@ -817,6 +832,7 @@ static const struct platform_device_id s5m_rtc_id[] = {
> { "s2mps13-rtc", S2MPS13X },
> { "s2mps14-rtc", S2MPS14X },
> { "s2mps15-rtc", S2MPS15X },
> + { "s2mps16-rtc", S2MPS16X },
> { },
> };
> MODULE_DEVICE_TABLE(platform, s5m_rtc_id);
> --
> 2.43.0
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock
2025-09-14 12:42 ` [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock Ivaylo Ivanov
@ 2025-09-15 4:56 ` Peng Fan
2025-09-15 7:46 ` André Draszik
` (2 subsequent siblings)
3 siblings, 0 replies; 23+ messages in thread
From: Peng Fan @ 2025-09-15 4:56 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni, linux-samsung-soc, devicetree, linux-clk,
linux-rtc, linux-kernel
On Sun, Sep 14, 2025 at 03:42:25PM +0300, Ivaylo Ivanov wrote:
>Add the support for S2MPS16 PMIC clock, which is functionally the same
>as the currently supported ones, with the exception of a different
>register.
>
>Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock
2025-09-14 12:42 ` [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock Ivaylo Ivanov
2025-09-15 4:56 ` Peng Fan
@ 2025-09-15 7:46 ` André Draszik
2025-09-21 16:28 ` Stephen Boyd
2025-10-10 13:05 ` Krzysztof Kozlowski
3 siblings, 0 replies; 23+ messages in thread
From: André Draszik @ 2025-09-15 7:46 UTC (permalink / raw)
To: Ivaylo Ivanov, Krzysztof Kozlowski, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
On Sun, 2025-09-14 at 15:42 +0300, Ivaylo Ivanov wrote:
> Add the support for S2MPS16 PMIC clock, which is functionally the same
> as the currently supported ones, with the exception of a different
> register.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Reviewed-by: André Draszik <andre.draszik@linaro.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators
2025-09-14 12:42 ` [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators Ivaylo Ivanov
@ 2025-09-15 11:42 ` Mark Brown
2025-10-10 13:08 ` Krzysztof Kozlowski
1 sibling, 0 replies; 23+ messages in thread
From: Mark Brown @ 2025-09-15 11:42 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood,
Alexandre Belloni, linux-samsung-soc, devicetree, linux-clk,
linux-rtc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
On Sun, Sep 14, 2025 at 03:42:27PM +0300, Ivaylo Ivanov wrote:
> +static int s2mps16_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
> +{
> + unsigned int ramp_val, ramp_shift, ramp_reg;
> + int rdev_id = rdev_get_id(rdev);
> +
> + switch (rdev_id) {
..
> + ramp_shift = S2MPS16_BUCK_RAMP_SHIFT4;
> + break;
> + default:
> + return 0;
> + }
The operation should not be present if it's not supported, and should
error out if mistakenly called on an invalid regulator.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic
2025-09-14 12:42 ` [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
@ 2025-09-16 15:55 ` Lee Jones
2025-10-10 13:12 ` Krzysztof Kozlowski
1 sibling, 0 replies; 23+ messages in thread
From: Lee Jones @ 2025-09-16 15:55 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Liam Girdwood, Mark Brown,
Alexandre Belloni, linux-samsung-soc, devicetree, linux-clk,
linux-rtc, linux-kernel
On Sun, 14 Sep 2025, Ivaylo Ivanov wrote:
> Add support for Samsung's s2mps16 pmic. It's the primary PMIC used by
> exynos8890 devices. It houses regulators (38 LDOs and 11 BUCKs), three
> 32.768KHz clock outputs and an RTC device.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> drivers/mfd/sec-common.c | 10 ++
> drivers/mfd/sec-i2c.c | 16 +++
> drivers/mfd/sec-irq.c | 46 +++++++
> include/linux/mfd/samsung/core.h | 1 +
> include/linux/mfd/samsung/irq.h | 66 ++++++++++
> include/linux/mfd/samsung/s2mps16.h | 195 ++++++++++++++++++++++++++++
> 6 files changed, 334 insertions(+)
> create mode 100644 include/linux/mfd/samsung/s2mps16.h
Looks okay. Once you have the Regulator Ack we can merge this through MFD.
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible
2025-09-14 12:42 ` [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible Ivaylo Ivanov
@ 2025-09-21 16:27 ` Stephen Boyd
2025-09-24 15:13 ` Rob Herring (Arm)
1 sibling, 0 replies; 23+ messages in thread
From: Stephen Boyd @ 2025-09-21 16:27 UTC (permalink / raw)
To: Alexandre Belloni, Alim Akhtar, André Draszik, Chanwoo Choi,
Conor Dooley, Ivaylo Ivanov, Krzysztof Kozlowski, Lee Jones,
Liam Girdwood, Mark Brown, Michael Turquette, Rob Herring,
Sylwester Nawrocki
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
Quoting Ivaylo Ivanov (2025-09-14 05:42:23)
> The S2MPS16 PMIC, alongside regulators and an rtc, provides 3 clock
> outputs, just like most of the other S2MPS PMICs. Document the S2MPS16
> clock compatible.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
Acked-by: Stephen Boyd <sboyd@kernel.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock
2025-09-14 12:42 ` [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock Ivaylo Ivanov
2025-09-15 4:56 ` Peng Fan
2025-09-15 7:46 ` André Draszik
@ 2025-09-21 16:28 ` Stephen Boyd
2025-10-10 13:05 ` Krzysztof Kozlowski
3 siblings, 0 replies; 23+ messages in thread
From: Stephen Boyd @ 2025-09-21 16:28 UTC (permalink / raw)
To: Alexandre Belloni, Alim Akhtar, André Draszik, Chanwoo Choi,
Conor Dooley, Ivaylo Ivanov, Krzysztof Kozlowski, Lee Jones,
Liam Girdwood, Mark Brown, Michael Turquette, Rob Herring,
Sylwester Nawrocki
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
Quoting Ivaylo Ivanov (2025-09-14 05:42:25)
> Add the support for S2MPS16 PMIC clock, which is functionally the same
> as the currently supported ones, with the exception of a different
> register.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
Acked-by: Stephen Boyd <sboyd@kernel.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators
2025-09-14 12:42 ` [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators Ivaylo Ivanov
@ 2025-09-24 15:11 ` Rob Herring
2025-09-24 15:12 ` Rob Herring
1 sibling, 0 replies; 23+ messages in thread
From: Rob Herring @ 2025-09-24 15:11 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni, linux-samsung-soc, devicetree, linux-clk,
linux-rtc, linux-kernel
On Sun, Sep 14, 2025 at 03:42:21PM +0300, Ivaylo Ivanov wrote:
> The S2MPS16 is a PMIC found in exynos8890 devices, which controls voltage
> regulators - 38 LDOs, of which 11 are used for CP, and 11 BUCKs, of which
> 1 is used for CP. Provide documentation for devicetree definitions,
> regulator naming patterns, etc.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> .../bindings/regulator/samsung,s2mps16.yaml | 50 +++++++++++++++++++
> 1 file changed, 50 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
>
> diff --git a/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml b/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
> new file mode 100644
> index 000000000..ede87d3b9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/samsung,s2mps16.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung S2MPS16 Power Management IC regulators
> +
> +maintainers:
> + - Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> +
> +description: |
> + This is a part of device tree bindings for S2M and S5M family of Power
> + Management IC (PMIC).
> +
> + The S2MPS16 provides buck and LDO regulators.
> +
> + See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
> + additional information and example.
> +
> +patternProperties:
> + # 27 LDOs
> + "^ldo([1-9]|1[0-3]|2[5-9]|3[0-8])$":
> + type: object
> + $ref: regulator.yaml#
> + unevaluatedProperties: false
> + description:
You need '>' modifier to preserve paragraphs.
> + Properties for single LDO regulator.
> +
> + LDOs 14-24 are used for CP, and they're left unimplemented due to lack
> + of documentation on them.
What does unimplemented mean? In some driver? If so, that's specific to
a driver and not relevant to the binding.
> +
> + required:
> + - regulator-name
> +
> + # 10 bucks
> + "^buck([1-9]|1[0-1])$":
> + type: object
> + $ref: regulator.yaml#
> + unevaluatedProperties: false
> + description:
> + Properties for single BUCK regulator.
> +
> + BUCK 10 is used for CP, and it's left unimplemented due to lack of
> + documentation on it.
> +
> + required:
> + - regulator-name
> +
> +additionalProperties: false
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators
2025-09-14 12:42 ` [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators Ivaylo Ivanov
2025-09-24 15:11 ` Rob Herring
@ 2025-09-24 15:12 ` Rob Herring
1 sibling, 0 replies; 23+ messages in thread
From: Rob Herring @ 2025-09-24 15:12 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Krzysztof Kozlowski, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni, linux-samsung-soc, devicetree, linux-clk,
linux-rtc, linux-kernel
On Sun, Sep 14, 2025 at 03:42:21PM +0300, Ivaylo Ivanov wrote:
> The S2MPS16 is a PMIC found in exynos8890 devices, which controls voltage
> regulators - 38 LDOs, of which 11 are used for CP, and 11 BUCKs, of which
> 1 is used for CP. Provide documentation for devicetree definitions,
> regulator naming patterns, etc.
Also, drop 'documentation for' in the subject.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> .../bindings/regulator/samsung,s2mps16.yaml | 50 +++++++++++++++++++
> 1 file changed, 50 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
>
> diff --git a/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml b/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
> new file mode 100644
> index 000000000..ede87d3b9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/samsung,s2mps16.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/samsung,s2mps16.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung S2MPS16 Power Management IC regulators
> +
> +maintainers:
> + - Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> +
> +description: |
> + This is a part of device tree bindings for S2M and S5M family of Power
> + Management IC (PMIC).
> +
> + The S2MPS16 provides buck and LDO regulators.
> +
> + See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
> + additional information and example.
> +
> +patternProperties:
> + # 27 LDOs
> + "^ldo([1-9]|1[0-3]|2[5-9]|3[0-8])$":
> + type: object
> + $ref: regulator.yaml#
> + unevaluatedProperties: false
> + description:
> + Properties for single LDO regulator.
> +
> + LDOs 14-24 are used for CP, and they're left unimplemented due to lack
> + of documentation on them.
> +
> + required:
> + - regulator-name
> +
> + # 10 bucks
> + "^buck([1-9]|1[0-1])$":
> + type: object
> + $ref: regulator.yaml#
> + unevaluatedProperties: false
> + description:
> + Properties for single BUCK regulator.
> +
> + BUCK 10 is used for CP, and it's left unimplemented due to lack of
> + documentation on it.
> +
> + required:
> + - regulator-name
> +
> +additionalProperties: false
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 2/7] dt-bindings: mfd: samsung,s2mps11: add compatible for s2mps16-pmic
2025-09-14 12:42 ` [PATCH v1 2/7] dt-bindings: mfd: samsung,s2mps11: add compatible for s2mps16-pmic Ivaylo Ivanov
@ 2025-09-24 15:13 ` Rob Herring (Arm)
0 siblings, 0 replies; 23+ messages in thread
From: Rob Herring (Arm) @ 2025-09-24 15:13 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Sylwester Nawrocki, Chanwoo Choi, Lee Jones, Krzysztof Kozlowski,
Stephen Boyd, André Draszik, devicetree, Alexandre Belloni,
Conor Dooley, linux-samsung-soc, Alim Akhtar, linux-kernel,
Liam Girdwood, Mark Brown, linux-rtc, linux-clk,
Michael Turquette
On Sun, 14 Sep 2025 15:42:22 +0300, Ivaylo Ivanov wrote:
> S2MPS16 is a PMIC present in Samsung's exynos8890 devices. It houses
> voltage regulators (38 LDOs and 11 BUCKs), an RTC and a clocks module.
> Add the compatible string "samsung,s2mps16-pmic" to the PMIC.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> .../bindings/mfd/samsung,s2mps11.yaml | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible
2025-09-14 12:42 ` [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible Ivaylo Ivanov
2025-09-21 16:27 ` Stephen Boyd
@ 2025-09-24 15:13 ` Rob Herring (Arm)
1 sibling, 0 replies; 23+ messages in thread
From: Rob Herring (Arm) @ 2025-09-24 15:13 UTC (permalink / raw)
To: Ivaylo Ivanov
Cc: Conor Dooley, Alexandre Belloni, Alim Akhtar, Krzysztof Kozlowski,
Sylwester Nawrocki, Liam Girdwood, André Draszik,
linux-samsung-soc, Michael Turquette, linux-kernel, linux-rtc,
Stephen Boyd, Mark Brown, linux-clk, Chanwoo Choi, Lee Jones,
devicetree
On Sun, 14 Sep 2025 15:42:23 +0300, Ivaylo Ivanov wrote:
> The S2MPS16 PMIC, alongside regulators and an rtc, provides 3 clock
> outputs, just like most of the other S2MPS PMICs. Document the S2MPS16
> clock compatible.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock
2025-09-14 12:42 ` [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock Ivaylo Ivanov
` (2 preceding siblings ...)
2025-09-21 16:28 ` Stephen Boyd
@ 2025-10-10 13:05 ` Krzysztof Kozlowski
3 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10 13:05 UTC (permalink / raw)
To: Ivaylo Ivanov, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
On 14/09/2025 14:42, Ivaylo Ivanov wrote:
> Add the support for S2MPS16 PMIC clock, which is functionally the same
> as the currently supported ones, with the exception of a different
> register.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> drivers/clk/clk-s2mps11.c | 8 ++++++++
This depends on mfd patch. Many maintainers would appreciate if you
mention it also in the patch changelog (---), not only cover letter.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC
2025-09-14 12:42 ` [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC Ivaylo Ivanov
2025-09-14 16:35 ` Alexandre Belloni
@ 2025-10-10 13:07 ` Krzysztof Kozlowski
1 sibling, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10 13:07 UTC (permalink / raw)
To: Ivaylo Ivanov, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
On 14/09/2025 14:42, Ivaylo Ivanov wrote:
> Add support for Samsung's S2MPS16 PMIC RTC, which has pretty much
> identical functionality to the existing S2MPS15 support, with the
> difference being the ST2 register.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> drivers/rtc/rtc-s5m.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> index a7220b4d0..910248731 100644
> --- a/drivers/rtc/rtc-s5m.c
> +++ b/drivers/rtc/rtc-s5m.c
> @@ -18,6 +18,7 @@
> #include <linux/mfd/samsung/irq.h>
> #include <linux/mfd/samsung/rtc.h>
> #include <linux/mfd/samsung/s2mps14.h>
> +#include <linux/mfd/samsung/s2mps16.h>
>
> /*
> * Maximum number of retries for checking changes in UDR field
> @@ -254,6 +255,11 @@ static int s5m_check_pending_alarm_interrupt(struct s5m_rtc_info *info,
> ret = regmap_read(info->regmap, S5M_RTC_STATUS, &val);
> val &= S5M_ALARM0_STATUS;
> break;
> + case S2MPS16X:
> + ret = regmap_read(info->s5m87xx->regmap_pmic, S2MPS16_REG_ST2,
> + &val);
> + val &= S2MPS_ALARM0_STATUS;
> + break;
> case S2MPG10:
> case S2MPS15X:
> case S2MPS14X:
> @@ -303,6 +309,7 @@ static int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
> udr_mask |= S5M_RTC_TIME_EN_MASK;
> break;
> case S2MPG10:
> + case S2MPS16X:
> case S2MPS15X:
> case S2MPS14X:
> case S2MPS13X:
Interesting, so we have here reversed alphabetical order within
S2MPSXXX... that is probably my achievement. Me minus 10 years would not
pass my current review, for sure.
Thanks for the patches, nice work.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators
2025-09-14 12:42 ` [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators Ivaylo Ivanov
2025-09-15 11:42 ` Mark Brown
@ 2025-10-10 13:08 ` Krzysztof Kozlowski
1 sibling, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10 13:08 UTC (permalink / raw)
To: Ivaylo Ivanov, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
On 14/09/2025 14:42, Ivaylo Ivanov wrote:
> S2MPS16 is a PMIC, manufactured by Samsung, particularly used in
> exynos8890 based devices, featuring 38 LDOs, of which 11 are used for
> CP, and 11 BUCKs, of which 1 is used for CP. Add driver support for
> controlling all BUCKs and LDOs, except the ones used for CP, as they are
> not documented enough and the vendor kernel doesn't handle them anyways.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic
2025-09-14 12:42 ` [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
2025-09-16 15:55 ` Lee Jones
@ 2025-10-10 13:12 ` Krzysztof Kozlowski
1 sibling, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10 13:12 UTC (permalink / raw)
To: Ivaylo Ivanov, André Draszik, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Rob Herring, Conor Dooley, Lee Jones, Liam Girdwood, Mark Brown,
Alexandre Belloni
Cc: linux-samsung-soc, devicetree, linux-clk, linux-rtc, linux-kernel
On 14/09/2025 14:42, Ivaylo Ivanov wrote:
> enum s2mpu02_irq {
> S2MPU02_IRQ_PWRONF,
> S2MPU02_IRQ_PWRONR,
> diff --git a/include/linux/mfd/samsung/s2mps16.h b/include/linux/mfd/samsung/s2mps16.h
> new file mode 100644
> index 000000000..d4394b054
> --- /dev/null
> +++ b/include/linux/mfd/samsung/s2mps16.h
> @@ -0,0 +1,195 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
Does the license 2.0+ (so 3.0 and so one) come from the downstream you
copied it? Or from other upstream? If not, thus it is your invention,
please keep only 2.0.
Anyway:
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2025-10-10 13:12 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-14 12:42 [PATCH v1 0/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
2025-09-14 12:42 ` [PATCH v1 1/7] regulator: dt-bindings: add documentation for s2mps16-pmic regulators Ivaylo Ivanov
2025-09-24 15:11 ` Rob Herring
2025-09-24 15:12 ` Rob Herring
2025-09-14 12:42 ` [PATCH v1 2/7] dt-bindings: mfd: samsung,s2mps11: add compatible for s2mps16-pmic Ivaylo Ivanov
2025-09-24 15:13 ` Rob Herring (Arm)
2025-09-14 12:42 ` [PATCH v1 3/7] dt-bindings: clock: samsung,s2mps11: document the S2MPS16 compatible Ivaylo Ivanov
2025-09-21 16:27 ` Stephen Boyd
2025-09-24 15:13 ` Rob Herring (Arm)
2025-09-14 12:42 ` [PATCH v1 4/7] mfd: sec: add support for s2mps16 pmic Ivaylo Ivanov
2025-09-16 15:55 ` Lee Jones
2025-10-10 13:12 ` Krzysztof Kozlowski
2025-09-14 12:42 ` [PATCH v1 5/7] clk: s2mps11: add the support for S2MPS16 PMIC clock Ivaylo Ivanov
2025-09-15 4:56 ` Peng Fan
2025-09-15 7:46 ` André Draszik
2025-09-21 16:28 ` Stephen Boyd
2025-10-10 13:05 ` Krzysztof Kozlowski
2025-09-14 12:42 ` [PATCH v1 6/7] rtc: s5m: add support for S2MPS16 RTC Ivaylo Ivanov
2025-09-14 16:35 ` Alexandre Belloni
2025-10-10 13:07 ` Krzysztof Kozlowski
2025-09-14 12:42 ` [PATCH v1 7/7] regulator: s2mps11: add support for S2MPS16 regulators Ivaylo Ivanov
2025-09-15 11:42 ` Mark Brown
2025-10-10 13:08 ` Krzysztof Kozlowski
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).