Unverified Commit 636bdb5f authored by Mark Brown's avatar Mark Brown
Browse files

Merge series "regulator/mfd/clock: dt-bindings: Samsung S2M and S5M to...

Merge series "regulator/mfd/clock: dt-bindings: Samsung S2M and S5M to dtschema" from Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>:

Hi All,

Changes since v2
================
1. Add Stephen's and Rob's tags.
2. Correct inb-supply description in patch 10/10.

Changes since v2
================
1. Add Rob's tags.
2. Remove "regulator-name" from properties (all regulator dtschema).
3. Move "unevaluatedProperties" higher to make code easier to read (all regulator dtschema).
4. Add ref-type to op-mode property (patch 6: s5m8767 regulators).

Changes since v1
================
1. Drop DTS patches - applied.
2. Fully remove bindings/regulator/samsung,s5m8767.txt .
3. Minor subject reformatting and few typos in text.

Intro
=====
This patchset converts all devicetree bindings of Samsung S2M and S5M
PMIC devices from txt to dtschema.

It includes also two fixes because later conversion depends on it
(contextually).

Merging/dependencies
====================
1. Regulator related binding changes depend on first two commits (the
   fixes), because of context.
2. The mfd bindings depend on clock and regulator bindings.

The fixes and bindings changes (patches 1-10) should go via the same
tree.  For example regulator or mfd tree.

Another alternative is that regulator patches (1-2, 4-6) go via Mark who
later gives MFD a stable branch/tag to pull. Then the clock and MFD
bindings would go on top via MFD tree. Or any other setup you would like
to have.

Overview of devices
===================
Essentially all Samsung S2M and S5M PMICs are very similar devices. They
provide the same functionality: regulators, RTC, 2 or 3 clocks and main
power management (e.g. power cut to SoC).

The differences are mostly in registers layout and number of regulators.

The drivers are built around one common part, mfd/sec-core.c, and share
some drivers between devices:
1. MFD sec-core for all devices,
1. one clock driver for most of devices,
2. one RTC driver for all devices,
3. three regulator drivers.

The regulator drivers were implementing slightly different features,
therefore one regulator binding for all devices does not make much
sense.  However the clock device binding can be shared.

The final dtschema bindings try to implement this - share only the clock
bindings.

Best regards,
Krzysztof

Krzysztof Kozlowski (10):
  regulator: s5m8767: do not use reset value as DVS voltage if GPIO DVS
    is disabled
  regulator: dt-bindings: samsung,s5m8767: correct
    s5m8767,pmic-buck-default-dvs-idx property
  dt-bindings: clock: samsung,s2mps11: convert to dtschema
  regulator: dt-bindings: samsung,s2m: convert to dtschema
  regulator: dt-bindings: samsung,s2mpa01: convert to dtschema
  regulator: dt-bindings: samsung,s5m8767: convert to dtschema
  dt-bindings: mfd: samsung,s2mps11: convert to dtschema
  dt-bindings: mfd: samsung,s2mpa01: convert to dtschema
  dt-bindings: mfd: samsung,s5m8767: convert to dtschema
  dt-bindings: mfd: samsung,s5m8767: document buck and LDO supplies

 .../bindings/clock/samsung,s2mps11.txt        |  49 ---
 .../bindings/clock/samsung,s2mps11.yaml       |  45 +++
 .../bindings/mfd/samsung,s2mpa01.yaml         |  91 ++++++
 .../bindings/mfd/samsung,s2mps11.yaml         | 267 +++++++++++++++
 .../bindings/mfd/samsung,s5m8767.yaml         | 307 ++++++++++++++++++
 .../bindings/mfd/samsung,sec-core.txt         |  86 -----
 .../bindings/regulator/samsung,s2mpa01.txt    |  79 -----
 .../bindings/regulator/samsung,s2mpa01.yaml   |  62 ++++
 .../bindings/regulator/samsung,s2mps11.txt    | 102 ------
 .../bindings/regulator/samsung,s2mps11.yaml   |  44 +++
 .../bindings/regulator/samsung,s2mps13.yaml   |  44 +++
 .../bindings/regulator/samsung,s2mps14.yaml   |  44 +++
 .../bindings/regulator/samsung,s2mps15.yaml   |  44 +++
 .../bindings/regulator/samsung,s2mpu02.yaml   |  44 +++
 .../bindings/regulator/samsung,s5m8767.txt    | 145 ---------
 .../bindings/regulator/samsung,s5m8767.yaml   |  74 +++++
 MAINTAINERS                                   |   9 +-
 drivers/regulator/s5m8767.c                   |  21 +-
 18 files changed, 1080 insertions(+), 477 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/samsung,s2mps11.txt
 create mode 100644 Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/samsung,s2mpa01.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml
 delete mode 100644 Documentation/devicetree/bindings/mfd/samsung,sec-core.txt
 delete mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mpa01.txt
 create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mpa01.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps11.txt
 create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps11.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps13.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps14.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mps15.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s2mpu02.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/samsung,s5m8767.txt
 create mode 100644 Documentation/devicetree/bindings/regulator/samsung,s5m8767.yaml

--
2.30.2
parents 19cd2b14 fab58deb
Loading
Loading
Loading
Loading
+0 −49
Original line number Diff line number Diff line
Binding for Samsung S2M and S5M family clock generator block
============================================================

This is a part of device tree bindings for S2M and S5M family multi-function
devices.
More information can be found in bindings/mfd/sec-core.txt file.

The S2MPS11/13/15 and S5M8767 provide three(AP/CP/BT) buffered 32.768 kHz
outputs. The S2MPS14 provides two (AP/BT) buffered 32.768 KHz outputs.

To register these as clocks with common clock framework instantiate under
main device node a sub-node named "clocks".

It uses the common clock binding documented in:
 - Documentation/devicetree/bindings/clock/clock-bindings.txt


Required properties of the "clocks" sub-node:
 - #clock-cells: should be 1.
 - compatible: Should be one of: "samsung,s2mps11-clk", "samsung,s2mps13-clk",
               "samsung,s2mps14-clk", "samsung,s5m8767-clk"
   The S2MPS15 uses the same compatible as S2MPS13, as both provides similar
   clocks.


Each clock is assigned an identifier and client nodes use this identifier
to specify the clock which they consume.
    Clock               ID           Devices
    ----------------------------------------------------------
    32KhzAP		0            S2MPS11/13/14/15, S5M8767
    32KhzCP		1            S2MPS11/13/15, S5M8767
    32KhzBT		2            S2MPS11/13/14/15, S5M8767

Include dt-bindings/clock/samsung,s2mps11.h file to use preprocessor defines
in device tree sources.


Example:

	s2mps11_pmic@66 {
		compatible = "samsung,s2mps11-pmic";
		reg = <0x66>;

		s2m_osc: clocks {
			compatible = "samsung,s2mps11-clk";
			#clock-cells = <1>;
			clock-output-names = "xx", "yy", "zz";
		};
	};
+45 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/samsung,s2mps11.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung S2M and S5M family clock generator block

maintainers:
  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

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
  outputs. The S2MPS14 provides two (AP/BT) buffered 32.768 KHz outputs.

  All available clocks are defined as preprocessor macros in
  dt-bindings/clock/samsung,s2mps11.h header.

  See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
  additional information and example.

properties:
  compatible:
    enum:
      - samsung,s2mps11-clk
      - samsung,s2mps13-clk # S2MPS13 and S2MPS15
      - samsung,s2mps14-clk
      - samsung,s5m8767-clk

  "#clock-cells":
    const: 1

  clock-output-names:
    minItems: 3
    maxItems: 3
    description: Names for AP, CP and BT clocks.

required:
  - compatible
  - "#clock-cells"

additionalProperties: false
+0 −79
Original line number Diff line number Diff line
Binding for Samsung S2MPA01 regulator block
===========================================

This is a part of device tree bindings for S2M family multi-function devices.
More information can be found in bindings/mfd/sec-core.txt file.

The S2MPA01 device provide buck and LDO regulators.

To register these with regulator framework instantiate under main device node
a sub-node named "regulators" with more sub-nodes for each regulator using the
common regulator binding documented in:
 - Documentation/devicetree/bindings/regulator/regulator.txt


Names of regulators supported by S2MPA01 device:
	- LDOn
		  - valid values for n are 1 to 26
		  - Example: LDO1, LD02, LDO26
	- BUCKn
		  - valid values for n are 1 to 10.
		  - Example: BUCK1, BUCK2, BUCK9
Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
as per the datasheet of device.


Optional properties of buck regulator nodes under "regulators" sub-node:
 - regulator-ramp-delay: ramp delay in uV/us. May be 6250, 12500
   (default), 25000, or 50000. May be 0 for disabling the ramp delay on
   BUCK{1,2,3,4}.

   In the absence of the regulator-ramp-delay property, the default ramp
   delay will be used.

   Note: Some bucks share the ramp rate setting i.e. same ramp value
   will be set for a particular group of bucks so provide the same
   regulator-ramp-delay value for them.
   Groups sharing ramp rate:
    - buck{1,6},
    - buck{2,4},
    - buck{8,9,10}.

Example:

	s2mpa01_pmic@66 {
		compatible = "samsung,s2mpa01-pmic";
		reg = <0x66>;

		regulators {
			ldo1_reg: LDO1 {
				regulator-name = "VDD_ALIVE";
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
			};

			ldo2_reg: LDO2 {
				regulator-name = "VDDQ_MMC2";
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2800000>;
				regulator-always-on;
			};

			buck1_reg: BUCK1 {
				regulator-name = "vdd_mif";
				regulator-min-microvolt = <950000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
				regulator-boot-on;
			};

			buck2_reg: BUCK2 {
				regulator-name = "vdd_arm";
				regulator-min-microvolt = <950000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-ramp-delay = <50000>;
			};
		};
	};
+62 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/samsung,s2mpa01.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung S2MPA01 Power Management IC regulators

maintainers:
  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

description: |
  This is a part of device tree bindings for S2M and S5M family of Power
  Management IC (PMIC).

  The S2MPA01 provides buck and LDO regulators.

  See also Documentation/devicetree/bindings/mfd/samsung,s2mpa01.yaml for
  additional information and example.

patternProperties:
  # 26 LDOs
  "^LDO([1-9]|1[0-9]|2[0-6])$":
    type: object
    $ref: regulator.yaml#
    unevaluatedProperties: false
    description:
      Properties for single LDO regulator.

    required:
      - regulator-name

  # 10 bucks
  "^BUCK([1-9]|10)$":
    type: object
    $ref: regulator.yaml#
    unevaluatedProperties: false
    description:
      Properties for single BUCK regulator.

    properties:
      regulator-ramp-delay:
        enum: [0, 6250, 12500, 25000, 50000]
        default: 12500
        description: |
          May be 0 for disabling the ramp delay on BUCK{1,2,3,4}.

          In the absence of the regulator-ramp-delay property, the default ramp
          delay will be used.

          Note: Some bucks share the ramp rate setting i.e. same ramp value
          will be set for a particular group of bucks so provide the same
          regulator-ramp-delay value for them.
          Groups sharing ramp rate:
            * buck{1,6},
            * buck{2,4},
            * buck{8,9,10}.

    required:
      - regulator-name

additionalProperties: false
+0 −102
Original line number Diff line number Diff line
Binding for Samsung S2M family regulator block
==============================================

This is a part of device tree bindings for S2M family multi-function devices.
More information can be found in bindings/mfd/sec-core.txt file.

The S2MPS11/13/14/15 and S2MPU02 devices provide buck and LDO regulators.

To register these with regulator framework instantiate under main device node
a sub-node named "regulators" with more sub-nodes for each regulator using the
common regulator binding documented in:
 - Documentation/devicetree/bindings/regulator/regulator.txt


Names of regulators supported by different devices:
	- LDOn
		  - valid values for n are:
			- S2MPS11: 1 to 38
			- S2MPS13: 1 to 40
			- S2MPS14: 1 to 25
			- S2MPS15: 1 to 27
			- S2MPU02: 1 to 28
		  - Example: LDO1, LDO2, LDO28
	- BUCKn
		  - valid values for n are:
			- S2MPS11: 1 to 10
			- S2MPS13: 1 to 10
			- S2MPS14: 1 to 5
			- S2MPS15: 1 to 10
			- S2MPU02: 1 to 7
		  - Example: BUCK1, BUCK2, BUCK9
Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
as per the datasheet of device.


Optional properties of the nodes under "regulators" sub-node:
 - regulator-ramp-delay: ramp delay in uV/us. May be 6250, 12500,
   25000 (default) or 50000.

   Additionally S2MPS11 supports disabling ramp delay for BUCK{2,3,4,6}
   by setting it to <0>.

   Note: On S2MPS11 some bucks share the ramp rate setting i.e. same ramp value
   will be set for a particular group of bucks so provide the same
   regulator-ramp-delay value for them.
   Groups sharing ramp rate:
    - buck{1,6},
    - buck{3,4},
    - buck{7,8,10}.

 - samsung,ext-control-gpios: On S2MPS14 the LDO10, LDO11 and LDO12 can be
   configured to external control over GPIO. To turn this feature on this
   property must be added to the regulator sub-node:
    - samsung,ext-control-gpios: GPIO specifier for one GPIO
                                 controlling this regulator (enable/disable)
  Example:
	LDO12 {
		regulator-name = "V_EMMC_2.8V";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		samsung,ext-control-gpios = <&gpk0 2 0>;
	};


Example:

	s2mps11_pmic@66 {
		compatible = "samsung,s2mps11-pmic";
		reg = <0x66>;

		regulators {
			ldo1_reg: LDO1 {
				regulator-name = "VDD_ABB_3.3V";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

			ldo2_reg: LDO2 {
				regulator-name = "VDD_ALIVE_1.1V";
				regulator-min-microvolt = <1100000>;
				regulator-max-microvolt = <1100000>;
				regulator-always-on;
			};

			buck1_reg: BUCK1 {
				regulator-name = "vdd_mif";
				regulator-min-microvolt = <950000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
				regulator-boot-on;
			};

			buck2_reg: BUCK2 {
				regulator-name = "vdd_arm";
				regulator-min-microvolt = <950000>;
				regulator-max-microvolt = <1350000>;
				regulator-always-on;
				regulator-boot-on;
				regulator-ramp-delay = <50000>;
			};
		};
	};
Loading