Skip to contentSkip to conversation

Add support for MT6315 regulator

PATCH In review Hsin-Hsiung Wang 3 participants 6 messages Feb 7, 2021 – Feb 8, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v4 cover Add support for MT6315 regulator

This patch series adds support for MediaTek PMIC MT6315 regulator driver, which adds MT6315 related buck voltage data to the driver. This series is based on below patch[1].

[1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=429385

changes since v3:
- fix the error of binding document.
- refine the mt6315 regulator for better code quality.
- update mt6315 regulator node in the mt8192-evb.dts.

Hsin-Hsiung Wang (3):
dt-bindings: regulator: document binding for MT6315 regulator
regulator: mt6315: Add support for MT6315 regulator
arm64: dts: mt8192: add mt6315 regulator nodes

 .../bindings/regulator/mt6315-regulator.yaml  |  69 ++++
 arch/arm64/boot/dts/mediatek/mt8192-evb.dts   |  46 +++
 drivers/regulator/Kconfig                     |  10 +
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/mt6315-regulator.c          | 299 ++++++++++++++++++
 include/linux/regulator/mt6315-regulator.h    |  44 +++
 6 files changed, 469 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml
 create mode 100644 drivers/regulator/mt6315-regulator.c
 create mode 100644 include/linux/regulator/mt6315-regulator.h
Signature · 1 line
2.18.0
#1 lore raw

PATCH v4 1/3 dt-bindings: regulator: document binding for MT6315 regulator

Add device tree binding information for MT6315 regulator driver. Example bindings for MT6315 are added.

---
changes since v3:
- correct the yaml file name.
- remove unused description.
- update the example.

---
 .../bindings/regulator/mt6315-regulator.yaml  | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml new file +69 -0
new file mode 100644
index 000000000000..61dd5af80db6
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mt6315-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek MT6315 Regulator
+
+maintainers:
+  - Hsin-Hsiung Wang <[email protected]>
+
+description: |
+  The MT6315 is a power management IC (PMIC) configurable with SPMI.
+  that contains 4 BUCKs output which can combine with each other
+  by different efuse settings.
+
+properties:
+  compatible:
+    const: mediatek,mt6315-regulator
+
+  reg:
+    maxItems: 1
+
+  regulators:
+    type: object
+    description: List of regulators and its properties
+
+    patternProperties:
+      "^vbuck[1-4]$":
+        type: object
+        $ref: "regulator.yaml#"
+
+        properties:
+          regulator-name:
+            pattern: "^vbuck[1-4]$"
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - regulators
+
+additionalProperties: false
+
+examples:
+  - |
+    pmic@6 {
+      compatible = "mediatek,mt6315-regulator";
+      reg = <0x6 0>;
+
+      regulators {
+        vbuck1 {
+          regulator-compatible = "vbuck1";
+          regulator-min-microvolt = <300000>;
+          regulator-max-microvolt = <1193750>;
+          regulator-enable-ramp-delay = <256>;
+          regulator-allowed-modes = <0 1 2 4>;
+        };
+
+        vbuck3 {
+          regulator-compatible = "vbuck3";
+          regulator-min-microvolt = <300000>;
+          regulator-max-microvolt = <1193750>;
+          regulator-enable-ramp-delay = <256>;
+          regulator-allowed-modes = <0 1 2 4>;
+        };
+      };
+    };
Signature · 5 lines
2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#2 lore raw

PATCH v4 2/3 regulator: mt6315: Add support for MT6315 regulator

In reply to Hsin-Hsiung Wang

The MT6315 is a regulator found on boards based on MediaTek MT8192 and probably other SoCs. It connects as a slave to SoC using SPMI.

---
changes since v3:
- refine the mt6315 regulator for better code quality.
- remove unused registers.

---
 drivers/regulator/Kconfig                  |  10 +
 drivers/regulator/Makefile                 |   1 +
 drivers/regulator/mt6315-regulator.c       | 299 +++++++++++++++++++++
 include/linux/regulator/mt6315-regulator.h |  44 +++
 4 files changed, 354 insertions(+)
 create mode 100644 drivers/regulator/mt6315-regulator.c
 create mode 100644 include/linux/regulator/mt6315-regulator.h
drivers/regulator/Kconfig +10 -0
index 53fa84f4d1e1..0787a5cd64e2 100644
@@ -732,6 +732,16 @@ config REGULATOR_MT6311
 	  This driver supports the control of different power rails of device
 	  through regulator interface.
 
+config REGULATOR_MT6315
+	tristate "MediaTek MT6315 PMIC"
+	depends on SPMI
+	select REGMAP_SPMI
+	help
+	  Say y here to select this option to enable the power regulator of
+	  MediaTek MT6315 PMIC.
+	  This driver supports the control of different power rails of device
+	  through regulator interface.
+
 config REGULATOR_MT6323
 	tristate "MediaTek MT6323 PMIC"
 	depends on MFD_MT6397
drivers/regulator/Makefile +1 -0
index 680e539f6579..c50797e5f1f8 100644
@@ -89,6 +89,7 @@ obj-$(CONFIG_REGULATOR_MP8859) += mp8859.o
 obj-$(CONFIG_REGULATOR_MP886X) += mp886x.o
 obj-$(CONFIG_REGULATOR_MPQ7920) += mpq7920.o
 obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
+obj-$(CONFIG_REGULATOR_MT6315) += mt6315-regulator.o
 obj-$(CONFIG_REGULATOR_MT6323)	+= mt6323-regulator.o
 obj-$(CONFIG_REGULATOR_MT6358)	+= mt6358-regulator.o
 obj-$(CONFIG_REGULATOR_MT6360) += mt6360-regulator.o
drivers/regulator/mt6315-regulator.c new file +299 -0

299 lines not on this page · raw message

include/linux/regulator/mt6315-regulator.h new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.18.0
#3 lore raw

PATCH v4 3/3 arm64: dts: mt8192: add mt6315 regulator nodes

In reply to Hsin-Hsiung Wang

Add MT6315 regulator nodes to MT8192 evaluation board.

---
changes since v3:
- update the dts node.

---
 arch/arm64/boot/dts/mediatek/mt8192-evb.dts | 46 +++++++++++++++++++++
 1 file changed, 46 insertions(+)
arch/arm64/boot/dts/mediatek/mt8192-evb.dts +46 -0
index 0205837fa698..83f26cd5f693 100644
@@ -24,6 +24,52 @@
 	};
 };
 
+&spmi {
+	grpid = <11>;
+	mt6315_6: pmic@6 {
+		compatible = "mediatek,mt6315-regulator";
+		reg = <0x6 0>;
+
+		regulators {
+			mt6315_6_vbuck1: vbuck1 {
+				regulator-compatible = "vbuck1";
+				regulator-name = "Vbcpu";
+				regulator-min-microvolt = <300000>;
+				regulator-max-microvolt = <1193750>;
+				regulator-enable-ramp-delay = <256>;
+				regulator-allowed-modes = <0 1 2 4>;
+				regulator-always-on;
+			};
+
+			mt6315_6_vbuck3: vbuck3 {
+				regulator-compatible = "vbuck3";
+				regulator-name = "Vlcpu";
+				regulator-min-microvolt = <300000>;
+				regulator-max-microvolt = <1193750>;
+				regulator-enable-ramp-delay = <256>;
+				regulator-allowed-modes = <0 1 2 4>;
+				regulator-always-on;
+			};
+		};
+	};
+
+	mt6315_7: pmic@7 {
+		compatible = "mediatek,mt6315-regulator";
+		reg = <0x7 0>;
+
+		regulators {
+			mt6315_7_vbuck1: vbuck1 {
+				regulator-compatible = "vbuck1";
+				regulator-name = "Vgpu";
+				regulator-min-microvolt = <300000>;
+				regulator-max-microvolt = <1193750>;
+				regulator-enable-ramp-delay = <256>;
+				regulator-allowed-modes = <0 1 2 4>;
+			};
+		};
+	};
+};
+
 &uart0 {
 	status = "okay";
 };
Signature · 5 lines
2.18.0
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#4 lore raw

Re: [PATCH v4 3/3] arm64: dts: mt8192: add mt6315 regulator nodes

Thank you for the patch! Yet something to improve:

Hi Hsin-Hsiung,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on regulator/for-next]
[also build test ERROR on robh/for-next v5.11-rc6 next-20210125] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Hsin-Hsiung-Wang/Add-support-for-MT6315-regulator/20210207-141936
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/5aee905781d6cc30a55e1a34a224f1194660b2d0
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hsin-Hsiung-Wang/Add-support-for-MT6315-regulator/20210207-141936 git checkout 5aee905781d6cc30a55e1a34a224f1194660b2d0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

>> Error: arch/arm64/boot/dts/mediatek/mt8192-evb.dts:27.1-6 Label or path spmi not found

FATAL ERROR: Syntax error parsing input tree

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

maintainer
#5 lore raw

Re: (subset) [PATCH v4 0/3] Add support for MT6315 regulator

In reply to Hsin-Hsiung Wang
Quoted 4 lines · Hsin-Hsiung Wang

This patch series adds support for MediaTek PMIC MT6315 regulator driver, which adds MT6315 related buck voltage data to the driver. This series is based on below patch[1].

Quoted 8 lines

[1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=429385

changes since v3:
- fix the error of binding document.
- refine the mt6315 regulator for better code quality.
- update mt6315 regulator node in the mt8192-evb.dts.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/3] dt-bindings: regulator: document binding for MT6315 regulator

      commit: 977fb5b58469c1367aa075e7e913c03cba7d466f
[2/3] regulator: mt6315: Add support for MT6315 regulator
      commit: 7aa382cfe714f61b0c29f02c31d389c506b4e2ae

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek