2022-04-16 00:47:30

by Markuss Broks

[permalink] [raw]
Subject: [PATCH v2 0/4] Add support for Silicon Mitus SM5703 MFD

This series adds support for Silicon Mitus SM5703 MFD and the
appropriate device-tree bindings. This only adds support for the
regulator module, leaving room for other modules implemented in
future (code for other modules is really not ready for submission
right now). Silicon Mitus SM5703 is used on various mobile phones,
mostly Samsung Galaxy (J5 (2015, 2016), On7, J7 (2015, 2016) ...).

Markuss Broks (4):
dt-bindings: regulator: Add bindings for Silicon Mitus SM5703
regulators
dt-bindings: mfd: Add bindings for Silicon Mitus SM5703 MFD
mfd: sm5703: Add support for SM5703 MFD
regulator: sm5703-regulator: Add regulators support for SM5703 MFD

.../bindings/mfd/siliconmitus,sm5703.yaml | 91 ++++++++++
.../siliconmitus,sm5703-regulator.yaml | 48 ++++++
MAINTAINERS | 8 +
drivers/mfd/Kconfig | 12 ++
drivers/mfd/Makefile | 1 +
drivers/mfd/sm5703.c | 81 +++++++++
drivers/regulator/Kconfig | 7 +
drivers/regulator/Makefile | 1 +
drivers/regulator/sm5703-regulator.c | 162 ++++++++++++++++++
include/linux/mfd/sm5703.h | 105 ++++++++++++
10 files changed, 516 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
create mode 100644 Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml
create mode 100644 drivers/mfd/sm5703.c
create mode 100644 drivers/regulator/sm5703-regulator.c
create mode 100644 include/linux/mfd/sm5703.h

--
2.35.1


2022-04-16 02:24:20

by Markuss Broks

[permalink] [raw]
Subject: [PATCH v2 1/4] dt-bindings: regulator: Add bindings for Silicon Mitus SM5703 regulators

This patch adds device-tree bindings for regulators on Silicon Mitus
SM5703 MFD.

Signed-off-by: Markuss Broks <[email protected]>
---
.../siliconmitus,sm5703-regulator.yaml | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml

diff --git a/Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml b/Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml
new file mode 100644
index 000000000000..560df4c020ca
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/siliconmitus,sm5703-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Silicon Mitus SM5703 multi function device regulators
+
+maintainers:
+ - Markuss Broks <[email protected]>
+
+description: |
+ SM5703 regulators node should be a sub node of the SM5703 MFD node. See SM5703 MFD
+ bindings at Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
+ Regulator nodes should be named as USBLDO_<number>, BUCK, VBUS, LDO_<number>.
+ The definition for each of these nodes is defined using the standard
+ binding for regulators at Documentation/devicetree/bindings/regulator/regulator.txt.
+
+properties:
+ compatible:
+ const: siliconmitus,sm5703-regulator
+
+ buck:
+ type: object
+ $ref: regulator.yaml#
+ description:
+ Properties for the BUCK regulator.
+
+ vbus:
+ type: object
+ $ref: regulator.yaml#
+ description:
+ Properties for the VBUS regulator.
+
+patternProperties:
+ "^ldo[1-3]$":
+ type: object
+ $ref: regulator.yaml#
+ description:
+ Properties for single LDO regulator.
+
+ "^usbldo[1-2]$":
+ type: object
+ $ref: regulator.yaml#
+ description:
+ Properties for a single USBLDO regulator.
+
+additionalProperties: false
--
2.35.1

2022-04-16 02:43:20

by Markuss Broks

[permalink] [raw]
Subject: [PATCH v2 2/4] dt-bindings: mfd: Add bindings for Silicon Mitus SM5703 MFD

This patch adds device-tree bindings for the Silicon Mitus
SM5703 MFD.

Signed-off-by: Markuss Broks <[email protected]>
---
.../bindings/mfd/siliconmitus,sm5703.yaml | 96 +++++++++++++++++++
1 file changed, 96 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml

diff --git a/Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml b/Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
new file mode 100644
index 000000000000..6665409bd541
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/siliconmitus,sm5703.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Silicon Mitus SM5703 multi-function device bindings
+
+maintainers:
+ - Markuss Broks <[email protected]>
+
+description: |
+ Silicon Mitus SM5703 is a multi-function device, that consists of several
+ modules, designed for a mobile phone use. It consists of
+ LDO, Buck, USBLDO and VBUS regulators, a flash LED driver, a MUIC unit,
+ a fuel gauge and a battery charger circuit. The MUIC and Fuel-Gauge units
+ are separate from the main MFD, having their own i2c lines, while the
+ LED driver, regulators and charger are sharing the main i2c bus of the MFD.
+
+properties:
+ compatible:
+ const: siliconmitus,sm5703-mfd
+
+ reg:
+ description:
+ I2C slave address.
+ maxItems: 1
+
+ regulators:
+ $ref: ../regulator/siliconmitus,sm5703-regulator.yaml
+ description:
+ List of child nodes that specify the regulators.
+
+ reset-gpio:
+ description:
+ GPIO which is connected to the MRSTB pin.
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - regulators
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ mfd@49 {
+ compatible = "siliconmitus,sm5703-mfd";
+ reg = <0x49>;
+
+ reset-gpio = <&msmgpio 24 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&mrstb_default>;
+
+ regulator {
+ compatible = "siliconmitus,sm5703-regulator";
+
+ regulators {
+ sm5703_ldo1: ldo1 {
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ };
+
+ sm5703_ldo2: ldo2 {
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ sm5703_ldo3: ldo3 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ sm5703_usbldo1: usbldo1 {
+ regulator-min-microvolt = <4800000>;
+ regulator-max-microvolt = <4800000>;
+ };
+
+ sm5703_usbldo2: usbldo2 {
+ regulator-min-microvolt = <4800000>;
+ regulator-max-microvolt = <4800000>;
+ };
+
+ sm5703_vbus: vbus {
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ };
+ };
+ };
+ };
+ };
+...
--
2.35.1