.../devicetree/bindings/mfd/sprd,sc2731.yaml | 124 ++++++++++++++++++ .../bindings/mfd/sprd,sc27xx-pmic.txt | 40 ------ 2 files changed, 124 insertions(+), 40 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml delete mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
Convert the Spreadtrum SC27xx PMIC bindings to DT schema. Adjust the
filename to match the compatible of the only in-tree user, SC2731.
Change #interrupt-cells value to 1, as according to [1] that is the
correct value.
[1] https://lore.kernel.org/lkml/b6a32917d1e231277d240a4084bebb6ad91247e3.1550060544.git.baolin.wang@linaro.org/
Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
---
Depends on:
- eFuse YAML conversion: https://lore.kernel.org/lkml/9fba73ce66f1f3b7b2a8f46e7c21f60cff5a85f0.1721199034.git.stano.jakubek@gmail.com/
- RTC YAML conversion: https://lore.kernel.org/lkml/ZrBzmQI0IAL7LI3e@standask-GA-A55M-S2HP/
.../devicetree/bindings/mfd/sprd,sc2731.yaml | 124 ++++++++++++++++++
.../bindings/mfd/sprd,sc27xx-pmic.txt | 40 ------
2 files changed, 124 insertions(+), 40 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
delete mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
diff --git a/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml b/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
new file mode 100644
index 000000000000..59df02e1e53b
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
@@ -0,0 +1,124 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/sprd,sc2731.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Spreadtrum SC27xx PMIC
+
+maintainers:
+ - Orson Zhai <orsonzhai@gmail.com>
+ - Baolin Wang <baolin.wang7@gmail.com>
+ - Chunyan Zhang <zhang.lyra@gmail.com>
+
+description: |
+ Spreadtrum PMICs belonging to the SC27xx series integrate all mobile handset
+ power management, audio codec, battery management and user interface support
+ functions in a single chip. They have 6 major functional blocks:
+ - DCDCs to support CPU, memory
+ - LDOs to support both internal and external requirements
+ - Battery management system, such as charger, fuel gauge
+ - Audio codec
+ - User interface functions, such as indicator, flash LED and so on
+ - IC level interface, such as power on/off control, RTC, typec and so on
+
+properties:
+ $nodename:
+ pattern: '^pmic@[0-9a-f]+$'
+
+ compatible:
+ enum:
+ - sprd,sc2720
+ - sprd,sc2721
+ - sprd,sc2723
+ - sprd,sc2730
+ - sprd,sc2731
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ interrupt-controller: true
+ spi-max-frequency: true
+
+ '#address-cells':
+ const: 1
+
+ '#interrupt-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ regulators:
+ type: object
+ $ref: /schemas/regulator/sprd,sc2731-regulator.yaml#
+
+patternProperties:
+ "^adc@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/iio/adc/sprd,sc2720-adc.yaml#
+
+ "^charger@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/power/supply/sc2731-charger.yaml#
+
+ "^efuse@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/nvmem/sprd,sc2731-efuse.yaml#
+
+ "^fuel-gauge@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/power/supply/sc27xx-fg.yaml#
+
+ "^gpio@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/gpio/sprd,gpio-eic.yaml#
+
+ "^led-controller@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/leds/sprd,sc2731-bltc.yaml#
+
+ "^rtc@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/rtc/sprd,sc2731-rtc.yaml#
+
+ "^vibrator@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/input/sprd,sc27xx-vibrator.yaml#
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-controller
+ - spi-max-frequency
+ - '#address-cells'
+ - '#interrupt-cells'
+ - '#size-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pmic@0 {
+ compatible = "sprd,sc2731";
+ reg = <0>;
+ interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-controller;
+ spi-max-frequency = <26000000>;
+ #address-cells = <1>;
+ #interrupt-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt b/Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
deleted file mode 100644
index 21b9a897fca5..000000000000
--- a/Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-Spreadtrum SC27xx Power Management Integrated Circuit (PMIC)
-
-The Spreadtrum SC27xx series PMICs contain SC2720, SC2721, SC2723, SC2730
-and SC2731. The Spreadtrum PMIC belonging to SC27xx series integrates all
-mobile handset power management, audio codec, battery management and user
-interface support function in a single chip. It has 6 major functional
-blocks:
-- DCDCs to support CPU, memory.
-- LDOs to support both internal and external requirement.
-- Battery management system, such as charger, fuel gauge.
-- Audio codec.
-- User interface function, such as indicator, flash LED and so on.
-- IC level interface, such as power on/off control, RTC and typec and so on.
-
-Required properties:
-- compatible: Should be one of the following:
- "sprd,sc2720"
- "sprd,sc2721"
- "sprd,sc2723"
- "sprd,sc2730"
- "sprd,sc2731"
-- reg: The address of the device chip select, should be 0.
-- spi-max-frequency: Typically set to 26000000.
-- interrupts: The interrupt line the device is connected to.
-- interrupt-controller: Marks the device node as an interrupt controller.
-- #interrupt-cells: The number of cells to describe an PMIC IRQ, must be 2.
-- #address-cells: Child device offset number of cells, must be 1.
-- #size-cells: Child device size number of cells, must be 0.
-
-Example:
-pmic@0 {
- compatible = "sprd,sc2731";
- reg = <0>;
- spi-max-frequency = <26000000>;
- interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-controller;
- #interrupt-cells = <2>;
- #address-cells = <1>;
- #size-cells = <0>;
-};
--
2.34.1
On Thu, Aug 15, 2024 at 12:26:29PM +0200, Stanislav Jakubek wrote:
> Convert the Spreadtrum SC27xx PMIC bindings to DT schema. Adjust the
> filename to match the compatible of the only in-tree user, SC2731.
> Change #interrupt-cells value to 1, as according to [1] that is the
> correct value.
>
> [1] https://lore.kernel.org/lkml/b6a32917d1e231277d240a4084bebb6ad91247e3.1550060544.git.baolin.wang@linaro.org/
>
> Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
> ---
> Depends on:
> - eFuse YAML conversion: https://lore.kernel.org/lkml/9fba73ce66f1f3b7b2a8f46e7c21f60cff5a85f0.1721199034.git.stano.jakubek@gmail.com/
> - RTC YAML conversion: https://lore.kernel.org/lkml/ZrBzmQI0IAL7LI3e@standask-GA-A55M-S2HP/
These either have to be sent as 1 series for 1 maintainer to apply (Lee)
or you'll have to wait a cycle for the dependencies.
>
> .../devicetree/bindings/mfd/sprd,sc2731.yaml | 124 ++++++++++++++++++
> .../bindings/mfd/sprd,sc27xx-pmic.txt | 40 ------
> 2 files changed, 124 insertions(+), 40 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
> delete mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
>
> diff --git a/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml b/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
> new file mode 100644
> index 000000000000..59df02e1e53b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
> @@ -0,0 +1,124 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/sprd,sc2731.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Spreadtrum SC27xx PMIC
> +
> +maintainers:
> + - Orson Zhai <orsonzhai@gmail.com>
> + - Baolin Wang <baolin.wang7@gmail.com>
> + - Chunyan Zhang <zhang.lyra@gmail.com>
> +
> +description: |
> + Spreadtrum PMICs belonging to the SC27xx series integrate all mobile handset
> + power management, audio codec, battery management and user interface support
> + functions in a single chip. They have 6 major functional blocks:
> + - DCDCs to support CPU, memory
> + - LDOs to support both internal and external requirements
> + - Battery management system, such as charger, fuel gauge
> + - Audio codec
> + - User interface functions, such as indicator, flash LED and so on
> + - IC level interface, such as power on/off control, RTC, typec and so on
> +
> +properties:
> + $nodename:
> + pattern: '^pmic@[0-9a-f]+$'
> +
> + compatible:
> + enum:
> + - sprd,sc2720
> + - sprd,sc2721
> + - sprd,sc2723
> + - sprd,sc2730
> + - sprd,sc2731
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + interrupt-controller: true
> + spi-max-frequency: true
> +
> + '#address-cells':
> + const: 1
> +
> + '#interrupt-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + regulators:
> + type: object
> + $ref: /schemas/regulator/sprd,sc2731-regulator.yaml#
> +
> +patternProperties:
> + "^adc@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/iio/adc/sprd,sc2720-adc.yaml#
> +
> + "^charger@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/power/supply/sc2731-charger.yaml#
> +
> + "^efuse@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/nvmem/sprd,sc2731-efuse.yaml#
> +
> + "^fuel-gauge@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/power/supply/sc27xx-fg.yaml#
> +
> + "^gpio@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/gpio/sprd,gpio-eic.yaml#
> +
> + "^led-controller@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/leds/sprd,sc2731-bltc.yaml#
> +
> + "^rtc@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/rtc/sprd,sc2731-rtc.yaml#
> +
> + "^vibrator@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/input/sprd,sc27xx-vibrator.yaml#
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-controller
> + - spi-max-frequency
> + - '#address-cells'
> + - '#interrupt-cells'
> + - '#size-cells'
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> +
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + pmic@0 {
> + compatible = "sprd,sc2731";
> + reg = <0>;
> + interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-controller;
> + spi-max-frequency = <26000000>;
> + #address-cells = <1>;
> + #interrupt-cells = <1>;
> + #size-cells = <0>;
The preference is one complete example here and drop any partial
examples of the child nodes in the child node schemas.
> + };
> + };
> +...
> diff --git a/Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt b/Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
> deleted file mode 100644
> index 21b9a897fca5..000000000000
> --- a/Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -Spreadtrum SC27xx Power Management Integrated Circuit (PMIC)
> -
> -The Spreadtrum SC27xx series PMICs contain SC2720, SC2721, SC2723, SC2730
> -and SC2731. The Spreadtrum PMIC belonging to SC27xx series integrates all
> -mobile handset power management, audio codec, battery management and user
> -interface support function in a single chip. It has 6 major functional
> -blocks:
> -- DCDCs to support CPU, memory.
> -- LDOs to support both internal and external requirement.
> -- Battery management system, such as charger, fuel gauge.
> -- Audio codec.
> -- User interface function, such as indicator, flash LED and so on.
> -- IC level interface, such as power on/off control, RTC and typec and so on.
> -
> -Required properties:
> -- compatible: Should be one of the following:
> - "sprd,sc2720"
> - "sprd,sc2721"
> - "sprd,sc2723"
> - "sprd,sc2730"
> - "sprd,sc2731"
> -- reg: The address of the device chip select, should be 0.
> -- spi-max-frequency: Typically set to 26000000.
> -- interrupts: The interrupt line the device is connected to.
> -- interrupt-controller: Marks the device node as an interrupt controller.
> -- #interrupt-cells: The number of cells to describe an PMIC IRQ, must be 2.
> -- #address-cells: Child device offset number of cells, must be 1.
> -- #size-cells: Child device size number of cells, must be 0.
> -
> -Example:
> -pmic@0 {
> - compatible = "sprd,sc2731";
> - reg = <0>;
> - spi-max-frequency = <26000000>;
> - interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
> - interrupt-controller;
> - #interrupt-cells = <2>;
> - #address-cells = <1>;
> - #size-cells = <0>;
> -};
> --
> 2.34.1
>
Hi Rob, [skip] > > --- > > Depends on: > > - eFuse YAML conversion: https://lore.kernel.org/lkml/9fba73ce66f1f3b7b2a8f46e7c21f60cff5a85f0.1721199034.git.stano.jakubek@gmail.com/ > > - RTC YAML conversion: https://lore.kernel.org/lkml/ZrBzmQI0IAL7LI3e@standask-GA-A55M-S2HP/ > > These either have to be sent as 1 series for 1 maintainer to apply (Lee) > or you'll have to wait a cycle for the dependencies. I've had this patch sitting on my harddrive for over a month now. Both of the dependencies have been sitting on the mailing lists pretty much unchanged for about a month as well... Also, there are technically more dependencies, but they're in linux-next already, so I didn't include them here. Just wanted to get this out to get some feedback (and hope that it would move the dependencies along). [skip] > The preference is one complete example here and drop any partial > examples of the child nodes in the child node schemas. I can add a more complete example here, sure. But I don't understand the point of removing the examples in child node bindings. Seems to me like all that would do is provide less documentation. Cheers, Stanislav
On Thu, Aug 15, 2024 at 8:38 AM Stanislav Jakubek <stano.jakubek@gmail.com> wrote: > > Hi Rob, > > [skip] > > > > --- > > > Depends on: > > > - eFuse YAML conversion: https://lore.kernel.org/lkml/9fba73ce66f1f3b7b2a8f46e7c21f60cff5a85f0.1721199034.git.stano.jakubek@gmail.com/ > > > - RTC YAML conversion: https://lore.kernel.org/lkml/ZrBzmQI0IAL7LI3e@standask-GA-A55M-S2HP/ > > > > These either have to be sent as 1 series for 1 maintainer to apply (Lee) > > or you'll have to wait a cycle for the dependencies. > > I've had this patch sitting on my harddrive for over a month now. > Both of the dependencies have been sitting on the mailing lists > pretty much unchanged for about a month as well... > Also, there are technically more dependencies, but they're in linux-next > already, so I didn't include them here. From who's tree? That affects who can apply this as well. I guess those are other child nodes. > Just wanted to get this out to get some feedback (and hope that it would > move the dependencies along). And now you have. > > [skip] > > > The preference is one complete example here and drop any partial > > examples of the child nodes in the child node schemas. > > I can add a more complete example here, sure. > But I don't understand the point of removing the examples in child node > bindings. Seems to me like all that would do is provide less documentation. It's not less, it's just 1 copy instead of 2 (or more). The problem typically (in the old bindings) is that the parent node is shown, but is incomplete which is a problem once the schemas check the examples. And if some of the child nodes are required by the schema, then every child schema ends up with a complete example of the MFD. And then when we have to fix something later, there's more places to go fix it. Rob
On Thu, 15 Aug 2024 12:26:29 +0200, Stanislav Jakubek wrote: > Convert the Spreadtrum SC27xx PMIC bindings to DT schema. Adjust the > filename to match the compatible of the only in-tree user, SC2731. > Change #interrupt-cells value to 1, as according to [1] that is the > correct value. > > [1] https://lore.kernel.org/lkml/b6a32917d1e231277d240a4084bebb6ad91247e3.1550060544.git.baolin.wang@linaro.org/ > > Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com> > --- > Depends on: > - eFuse YAML conversion: https://lore.kernel.org/lkml/9fba73ce66f1f3b7b2a8f46e7c21f60cff5a85f0.1721199034.git.stano.jakubek@gmail.com/ > - RTC YAML conversion: https://lore.kernel.org/lkml/ZrBzmQI0IAL7LI3e@standask-GA-A55M-S2HP/ > > .../devicetree/bindings/mfd/sprd,sc2731.yaml | 124 ++++++++++++++++++ > .../bindings/mfd/sprd,sc27xx-pmic.txt | 40 ------ > 2 files changed, 124 insertions(+), 40 deletions(-) > create mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml > delete mode 100644 Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml: Error in referenced schema matching $id: http://devicetree.org/schemas/nvmem/sprd,sc2731-efuse.yaml doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/Zr3X1RoQs7ElTnlJ@standask-GA-A55M-S2HP The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
© 2016 - 2026 Red Hat, Inc.