regulator: aw37503: add regulator driver for AWINIC AW37503
Subsystems (2)
cover regulator: aw37503: add regulator driver for AWINIC AW37503
From: Alec Li <[email protected]>
Add regulator driver for the device AWINIC AW37503 which is single inductor - dual output power supply device. AW37503 device is designed to support general positive/negative driven applications like TFT display panels.
Alec Li (2):
regulator: aw37503: add regulator driver for AWINIC AW37503
regulator: aw37503: add device-tree binding
.../bindings/regulator/awinic,aw37503.yaml | 73 ++++++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/aw37503-regulator.c | 246 ++++++++++++++++++ 4 files changed, 328 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml create mode 100644 drivers/regulator/aw37503-regulator.c
base-commit: 18b44bc5a67275641fb26f2c54ba7eef80ac5950
Signature · 1 line
2.41.0
PATCH 1/2 regulator: aw37503: add regulator driver for AWINIC AW37503
From: Alec Li <[email protected]>
Add regulator driver for the device AWINIC AW37503 which is single inductor - dual output power supply device. AW37503 device is designed to support general positive/negative driven applications like TFT display panels.
AW37503 regulator driver supports to enable/disable and set voltage on its output.
--- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/aw37503-regulator.c | 246 ++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 drivers/regulator/aw37503-regulator.c
drivers/regulator/Kconfig +8 -0
@@ -1618,4 +1618,12 @@ config REGULATOR_QCOM_LABIBB boost regulator and IBB can be used as a negative boost regulator for LCD display panel. +config REGULATOR_AW37503 + tristate "AWINIC AW37503 Dual Output Power regulators" + depends on I2C && GPIOLIB + select REGMAP_I2C + help + This driver supports AW37503 single inductor - dual output + power supply specifically designed for display panels. + endif
drivers/regulator/Makefile +1 -0
@@ -191,5 +191,6 @@ obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o +obj-$(CONFIG_REGULATOR_AW37503) += aw37503-regulator.o ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
drivers/regulator/aw37503-regulator.c new file +246 -0
246 lines not on this page · raw message
Signature · 1 line
2.41.0
Quoted 7 lines · On 26/07/2023 10:16, [email protected] wrote:
From: Alec Li <[email protected]>
Add regulator driver for the device AWINIC AW37503 which is single inductor - dual output power supply device. AW37503 device is designed to support general positive/negative driven applications like TFT display panels.
Thank you for your patch. There is something to discuss/improve.
Quoted 10 lines
drivers/regulator/aw37503-regulator.c new file +10
-0+ +static int aw37503_probe (struct i2c_client *client) +{ +struct device *dev = &client->dev; +struct aw37503_regulator *chip; +struct regulator_dev *rdev; +struct regmap *regmap; +struct regulator_config config = { }; +int id; +int ret;
drivers/regulator/aw37503-regulator.c line 197
Quoted 10 lines
drivers/regulator/aw37503-regulator.c new file +10
-0+ + chip =devm_kzalloc (dev,sizeof (*chip),GFP_KERNEL ); +if (!chip) +return -ENOMEM ; + + regmap =devm_regmap_init_i2c (client, &aw37503_regmap_config); +if (IS_ERR (regmap)) { + ret =PTR_ERR (regmap); +dev_err (dev,"regmap init failed: %d\n" , ret); +return ret;
return dev_err_probe
Quoted 7 lines
drivers/regulator/aw37503-regulator.c new file +7
-0+ } + +i2c_set_clientdata (client, chip); + chip->dev = dev; + +for (id =0 ; id <AW37503_MAX_REGULATORS ; ++id) { + config.regmap = regmap;
drivers/regulator/aw37503-regulator.c line 214
Quoted 10 lines
drivers/regulator/aw37503-regulator.c new file +10
-0+ config.dev = dev; + config.driver_data = chip; + + rdev =devm_regulator_register (dev, &aw_regs_desc[id], + &config); +if (IS_ERR (rdev)) { + ret =PTR_ERR (rdev); +dev_err (dev,"regulator %s register failed: %d\n" , + aw_regs_desc[id].name, ret); +return ret;
return dev_err_probe will be easier
Quoted 12 lines
drivers/regulator/aw37503-regulator.c new file +12
-0+ } + } +return 0 ; +} + +static const struct i2c_device_id aw37503_id[] = { + {.name ="aw37503" ,}, + {}, +}; +MODULE_DEVICE_TABLE (i2c, aw37503_id); + +static const struct of_device_id aw37503_dt_ids[] = {
drivers/regulator/aw37503-regulator.c line 236
Quoted 10 lines
drivers/regulator/aw37503-regulator.c new file +10
-0+ {.compatible = "awinic,aw37503",}, + { /* Sentinel */ }, +}; + +MODULE_DEVICE_TABLE (of, aw37503_dt_ids); + +static struct i2c_driver aw37503_i2c_driver = { + .driver = { + .name ="aw37503" , + .of_match_table =of_match_ptr (aw37503_dt_ids),
Drop of_match_ptr()
Best regards,
Krzysztof
Hello Krzysztof Kozlowski,
Thank you very much for your advice.
Quoted 26 lines · On 26/07/2023 10:16, [email protected] wrote:
Quoted 7 lines
From: Alec Li <[email protected]>
Add regulator driver for the device AWINIC AW37503 which is single inductor - dual output power supply device. AW37503 device is designed to support general positive/negative driven applications like TFT display panels.
Thank you for your patch. There is something to discuss/improve.
Quoted 14 lines
drivers/regulator/aw37503-regulator.c new file +14
-0+ +static int aw37503_probe (struct i2c_client *client) +{ +struct device *dev = &client->dev; +struct aw37503_regulator *chip; +struct regulator_dev *rdev; +struct regmap *regmap; +struct regulator_config config = { }; +int id; +int ret; + + chip =devm_kzalloc (dev,sizeof (*chip),GFP_KERNEL ); +if (!chip) +return -ENOMEM ;
Quoted 8 lines
drivers/regulator/aw37503-regulator.c line 197
Quoted 6 lines
drivers/regulator/aw37503-regulator.c new file +6
-0+ + regmap =devm_regmap_init_i2c (client, &aw37503_regmap_config); +if (IS_ERR (regmap)) { + ret =PTR_ERR (regmap); +dev_err (dev,"regmap init failed: %d\n" , ret); +return ret;return
dev_err_probe
I will modify it as suggested.
Quoted 11 lines
Quoted 11 lines
drivers/regulator/aw37503-regulator.c new file +11
-0+ } + +i2c_set_clientdata (client, chip); + chip->dev = dev; + +for (id =0 ; id <AW37503_MAX_REGULATORS ; ++id) { + config.regmap = regmap; + config.dev = dev; + config.driver_data = chip; + + rdev = devm_regulator_register(dev, &aw_regs_desc[id],
Quoted 8 lines
drivers/regulator/aw37503-regulator.c line 214
Quoted 6 lines
drivers/regulator/aw37503-regulator.c new file +6
-0+ &config); +if (IS_ERR (rdev)) { + ret =PTR_ERR (rdev); +dev_err (dev,"regulator %s register failed: %d\n" , + aw_regs_desc[id].name, ret); +return ret;return
dev_err_probewill be easier
I will modify it as suggested.
Quoted 16 lines
Quoted 16 lines
drivers/regulator/aw37503-regulator.c new file +16
-0+ } + } +return 0 ; +} + +static const struct i2c_device_id aw37503_id[] = { + {.name ="aw37503" ,}, + {}, +}; +MODULE_DEVICE_TABLE (i2c, aw37503_id); + +static const struct of_device_id aw37503_dt_ids[] = { + {.compatible ="awinic,aw37503" ,}, + {/* Sentinel */ }, +}; +
Quoted 8 lines
drivers/regulator/aw37503-regulator.c line 236
Quoted 6 lines
drivers/regulator/aw37503-regulator.c new file +6
-0+MODULE_DEVICE_TABLE (of, aw37503_dt_ids); + +static struct i2c_driver aw37503_i2c_driver = { + .driver = { + .name ="aw37503" , + .of_match_table =of_match_ptr (aw37503_dt_ids),Drop
of_match_ptr()
I will modify it as suggested.
Best regards,
Alec Li
Mark Brown
maintainerdrivers/regulator/Makefile obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o · line 195
Quoted 6 lines · On Wed, Jul 26, 2023 at 08:16:11AM +0000, [email protected] wrote:
drivers/regulator/Makefile +1
-0@@ -191,5 +191,6 @@ obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o +obj-$(CONFIG_REGULATOR_AW37503) += aw37503-regulator.o
Please keep the Kconfig and Makefile sorted.
drivers/regulator/aw37503-regulator.c line 174
Quoted 5 lines
drivers/regulator/aw37503-regulator.c new file +5
-0+static const struct regmap_config aw37503_regmap_config = { + .reg_bits =8 , + .val_bits =8 , + .max_register =AW37503_REG_WPRTEN , + .cache_type =REGCACHE_NONE ,
No need to specify no cache, it's the default.
Hello Mark Brown,
Thank you very much for your advice.
Quoted 10 lines · On Wed, Jul 26, 2023 at 08:16:11AM +0000, [email protected] wrote:
drivers/regulator/Makefile obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o · line 195
Quoted 7 lines
drivers/regulator/Makefile +1
-0@@ -191,5 +191,6 @@ obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o +obj-$(CONFIG_REGULATOR_AW37503) += aw37503-regulator.oPlease keep the
KconfigandMakefilesorted.
I will modify the sorting of AW37503 as suggested.
Quoted 7 lines
drivers/regulator/aw37503-regulator.c line 174
Quoted 5 lines
drivers/regulator/aw37503-regulator.c new file +5
-0+static const struct regmap_config aw37503_regmap_config = { + .reg_bits =8 , + .val_bits =8 , + .max_register =AW37503_REG_WPRTEN , + .cache_type =REGCACHE_NONE ,No need to specify no cache, it's the default.
I will modify it as suggested.
Best regards,
Alec Li
Le 26/07/2023 à 10:16, [email protected] a écrit :
Quoted 11 lines
From: Alec Li <[email protected]>
Add regulator driver for the device AWINIC AW37503 which is single inductor - dual output power supply device. AW37503 device is designed to support general positive/negative driven applications like TFT display panels.
AW37503 regulator driver supports to enable/disable and set voltage on its output.
Signed-off-by Alec Li <[email protected]>
[...]
Quoted 18 lines
drivers/regulator/aw37503-regulator.c new file +18
-0+static int aw37503_probe (struct i2c_client *client) +{ +struct device *dev = &client->dev; +struct aw37503_regulator *chip; +struct regulator_dev *rdev; +struct regmap *regmap; +struct regulator_config config = { }; +int id; +int ret; + + chip =devm_kzalloc (dev,sizeof (*chip),GFP_KERNEL ); +if (!chip) +return -ENOMEM ; + + regmap =devm_regmap_init_i2c (client, &aw37503_regmap_config); +if (IS_ERR (regmap)) { + ret =PTR_ERR (regmap); +dev_err (dev,"regmap init failed: %d\n" , ret);
drivers/regulator/aw37503-regulator.c line 206
Quoted 10 lines
drivers/regulator/aw37503-regulator.c new file +10
-0+return ret; + } + +i2c_set_clientdata (client, chip); + chip->dev = dev; + +for (id =0 ; id <AW37503_MAX_REGULATORS ; ++id) { + config.regmap = regmap; + config.dev = dev; + config.driver_data = chip;
I think that these 3 lines could be outside of the loop.
Quoted 12 lines
drivers/regulator/aw37503-regulator.c new file +12
-0+ + rdev =devm_regulator_register (dev, &aw_regs_desc[id], + &config); +if (IS_ERR (rdev)) { + ret =PTR_ERR (rdev); +dev_err (dev,"regulator %s register failed: %d\n" , + aw_regs_desc[id].name, ret); +return ret; + } + } +return 0 ; +}
[...]
Hello Christophe JAILLET,
Thank you very much for your advice.
Quoted 36 lines
Quoted 11 lines
From: Alec Li <[email protected]>
Add regulator driver for the device AWINIC AW37503 which is single inductor - dual output power supply device. AW37503 device is designed to support general positive/negative driven applications like TFT display panels.
AW37503 regulator driver supports to enable/disable and set voltage on its output.
Signed-off-by Alec Li <[email protected]>[...]
Quoted 22 lines
drivers/regulator/aw37503-regulator.c new file +22
-0+static int aw37503_probe (struct i2c_client *client) +{ +struct device *dev = &client->dev; +struct aw37503_regulator *chip; +struct regulator_dev *rdev; +struct regmap *regmap; +struct regulator_config config = { }; +int id; +int ret; + + chip =devm_kzalloc (dev,sizeof (*chip),GFP_KERNEL ); +if (!chip) +return -ENOMEM ; + + regmap =devm_regmap_init_i2c (client, &aw37503_regmap_config); +if (IS_ERR (regmap)) { + ret =PTR_ERR (regmap); +dev_err (dev,"regmap init failed: %d\n" , ret); +return ret; + } + +i2c_set_clientdata (client, chip);
Quoted 8 lines
drivers/regulator/aw37503-regulator.c line 206
Quoted 6 lines
drivers/regulator/aw37503-regulator.c new file +6
-0+ chip->dev = dev; + +for (id =0 ; id <AW37503_MAX_REGULATORS ; ++id) { + config.regmap = regmap; + config.dev = dev; + config.driver_data = chip;I think that these 3 lines could be outside of the loop.
I will modify it as suggested.
Quoted 4 lines
Quoted 4 lines
drivers/regulator/aw37503-regulator.c new file +4
-0+ + rdev =devm_regulator_register (dev, &aw_regs_desc[id], + &config); +if (IS_ERR (rdev)) {
Quoted 8 lines
drivers/regulator/aw37503-regulator.c line 218
Quoted 8 lines
drivers/regulator/aw37503-regulator.c new file +8
-0+ ret =PTR_ERR (rdev); +dev_err (dev,"regulator %s register failed: %d\n" , + aw_regs_desc[id].name, ret); +return ret; + } + } +return 0 ; +}
Best regards,
Alec Li
PATCH 2/2 regulator: aw37503: add device-tree binding
In reply to [email protected]From: Alec Li <[email protected]>
Add aw37503 regulator device-tree binding documentation
--- .../bindings/regulator/awinic,aw37503.yaml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +73 -0
@@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/awinic,aw37503.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Awinic AW37503 Voltage Regulator + +maintainers: + - Alec Li <[email protected]> + +description: | + The AW37503 is dual voltage regulator, designed to support positive/negative + supply for driving TFT-LCD panels. It support software-configurable output + switching and monitoring. The output voltages can be programmed via an I2C + compatible interface. + +properties: + compatible: + const: + - awinic,aw37503 + + reg: + maxItems: 1 + + patternProperties: + "^out[pn]$": + type: object + $ref: regulator.yaml# + unvaluatedproperties: false + + required: + - regulator-name + - enable-gpios + + additionalProperties: false + +required: + - compatible + - reg + - outp + - outn + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + aw37503@3e { + compatible = "awinic,aw37503"; + reg = <0x3e>; + + outp { + regulator-name = "outp"; + regulator-boot-on; + regulator-always-on; + enable-gpios = <&gpio 17 0>; + }; + + outn { + regulator-name = "outn"; + regulator-boot-on; + regulator-always-on; + enable-gpios = <&gpio 27 0>; + }; + }; + }; +...
Signature · 1 line
2.41.0
Rob Herring
maintainerRe: [PATCH V1 2/2] regulator: aw37503: add device-tree binding
Quoted 10 lines · On Wed, 26 Jul 2023 08:16:12 +0000, [email protected] wrote:
From: Alec Li <[email protected]>
Add aw37503 regulator device-tree binding documentation
Signed-off-by Alec Li <[email protected]>--- .../bindings/regulator/awinic,aw37503.yaml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties: 'patternProperties' should not be valid under {'$ref': '#/definitions/json-schema-prop-names'}
hint: A json-schema keyword was found instead of a DT property name.
from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties:compatible:const: ['awinic,aw37503'] is not of type 'integer', 'string'
from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties:patternProperties: 'anyOf' conditional failed, one must be fixed:
'^out[pn]$' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems'] 'type' was expected
from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties:compatible:const: ['awinic,aw37503'] is not of type 'string'
from schema $id: http://devicetree.org/meta-schemas/core.yaml#
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
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.
Re: [PATCH V1 2/2] regulator: aw37503: add device-tree binding
Hello Rob Herring,
Thank you very much for your advice.
Quoted 40 lines · On Wed, 26 Jul 2023 08:16:12 +0000, [email protected] wrote:
Quoted 10 lines
From: Alec Li <[email protected]>
Add aw37503 regulator device-tree binding documentation
Signed-off-by Alec Li <[email protected]>--- .../bindings/regulator/awinic,aw37503.yaml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yamlMy bot found errors running 'make DT_CHECKER_FLAGS=-m
dt_binding_check' on your patch (DT_CHECKER_FLAGSis new in v5.13):yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties: 'patternProperties' should not be valid under {'$ref': '#/definitions/json-schema-prop-names'}
hint: A json-schema keyword was found instead of a DT property name.
from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties:compatible:const: ['awinic,aw37503'] is not of type 'integer', 'string'
from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties:patternProperties: 'anyOf' conditional failed, one must be fixed:
'^out[pn]$' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems'] 'type' was expected
from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml: properties:compatible:const: ['awinic,aw37503'] is not of type 'string'
from schema $id: http://devicetree.org/meta-schemas/core.yaml#doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
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:
Quoted 5 lines
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that
DT_SCHEMA_FILEScan be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
It was my mistake. I will run the above command and correct this error on patch v2.
Best regards,
Alec Li
Re: [PATCH V1 2/2] regulator: aw37503: add device-tree binding
In reply to [email protected]Quoted 3 lines · On 26/07/2023 10:16, [email protected] wrote:
From: Alec Li <[email protected]>
Add aw37503 regulator device-tree binding documentation
subject rather like:
regulator: dt-bindings: Add Awinic aw37503
Quoted 15 lines
Signed-off-by Alec Li <[email protected]>--- .../bindings/regulator/awinic,aw37503.yaml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yamlDocumentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +2
-0@@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 12
Quoted 10 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +10
-0+--- +$id: http://devicetree.org/schemas/regulator/awinic,aw37503.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Awinic AW37503 Voltage Regulator + +maintainers: + - Alec Li <[email protected]> + +description: |
Do not need '|' unless you need to preserve formatting.
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 21
Quoted 9 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +9
-0+ The AW37503 is dual voltage regulator, designed to support positive/negative + supply for driving TFT-LCD panels. It support software-configurable output + switching and monitoring. The output voltages can be programmed via an I2C + compatible interface. + +properties: + compatible: + const: + - awinic,aw37503
This has to be in one line. As pointed out by Rob's bot: please test it before sending.
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +5
-0+ + reg: + maxItems: 1 + + patternProperties:
<sigh>
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 34
Quoted 8 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +8
-0+ "^out[pn]$": + type: object + $ref: regulator.yaml# + unvaluatedproperties: false + + required: + - regulator-name + - enable-gpios
regulator.yaml does not define enable-gpios, so you must define it in properties.
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 36
Quoted 2 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +2
-0+ + additionalProperties: false
Drop, you already have unevaluatedProperties.
Quoted 8 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +8
-0+ +required: + - compatible + - reg + - outp + - outn + +additionalProperties: false
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 54
Quoted 10 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +10
-0+ +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + aw37503@3e {
Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
Best regards,
Krzysztof
Re: [PATCH V1 2/2] regulator: aw37503: add device-tree binding
Hello Krzysztof Kozlowski,
Thank you very much for your advice.
Quoted 7 lines · On 26/07/2023 10:16, [email protected] wrote:
Quoted 3 lines
From: Alec Li <[email protected]>
Add aw37503 regulator device-tree binding documentation
subject rather like:
regulator: dt-bindings: Add Awinic aw37503
I will modify it as suggested.
Quoted 19 lines
Quoted 19 lines
Signed-off-by Alec Li <[email protected]>--- .../bindings/regulator/awinic,aw37503.yaml | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yamlDocumentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +6
-0@@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/awinic,aw37503.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# +
Quoted 8 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 12
Quoted 6 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +6
-0+title: Awinic AW37503 Voltage Regulator + +maintainers: + - Alec Li <[email protected]> + +description: |Do not need '|' unless you need to preserve formatting.
I will modify it as suggested.
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +4
-0+ The AW37503 is dual voltage regulator, designed to support positive/negative + supply for driving TFT-LCD panels. It support software-configurable output + switching and monitoring. The output voltages can be programmed via an I2C + compatible interface.
Quoted 8 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 21
Quoted 5 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +5
-0+ +properties: + compatible: + const: + - awinic,aw37503This has to be in one line. As pointed out by Rob's bot: please test it before sending.
I will test it before sending and modify it as suggested.
Quoted 17 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +5
-0+ + reg: + maxItems: 1 + + patternProperties:<sigh>
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 34
Quoted 8 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +8
-0+ "^out[pn]$": + type: object + $ref: regulator.yaml# + unvaluatedproperties: false + + required: + - regulator-name + - enable-gpios
Quoted 2 lines
regulator.yamldoes not define enable-gpios, so you must define it in properties.
I will modify it as suggested.
Quoted 4 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 36
Quoted 2 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +2
-0+ + additionalProperties: falseDrop, you already have unevaluatedProperties.
I will modify it as suggested.
Quoted 14 lines
Quoted 14 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +14
-0+ +required: + - compatible + - reg + - outp + - outn + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c {
Quoted 8 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 54
Quoted 4 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +4
-0+ #address-cells = <1>; + #size-cells = <0>; + + aw37503@3e {Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
I will modify it as suggested.
Best regards,
Alec Li