Skip to contentSkip to conversation

regulator: aw37503: add regulator driver for Awinic AW37503

PATCH Superseded [email protected] 2 participants 4 messages Aug 16, 2023 – Aug 19, 2023

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 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.

v3->v4: Correct yamllint warnings/errors

Alec Li (2):
regulator: aw37503: add regulator driver for Awinic AW37503
regulator: dt-bindings: Add Awinic AW37503

 .../bindings/regulator/awinic,aw37503.yaml    |  80 ++++++
 drivers/regulator/Kconfig                     |   8 +
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/aw37503-regulator.c         | 240 ++++++++++++++++++
 4 files changed, 329 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml
 create mode 100644 drivers/regulator/aw37503-regulator.c

base-commit: 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6

Signature · 1 line
2.41.0
#1 lore raw

PATCH v4 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 | 240 ++++++++++++++++++++++++++
 3 files changed, 249 insertions(+)
 create mode 100644 drivers/regulator/aw37503-regulator.c
drivers/regulator/Kconfig +8 -0
index 823f8e6e4801..6327201e8bb4 100644
@@ -178,6 +178,14 @@ config REGULATOR_ATC260X
 	  ATC260x PMICs. This will enable support for all the software
 	  controllable DCDC/LDO regulators.
 
+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.
+
 config REGULATOR_AXP20X
 	tristate "X-POWERS AXP20X PMIC Regulators"
 	depends on MFD_AXP20X
drivers/regulator/Makefile +1 -0
index 15e0d614ff66..f0e5cf7350a4 100644
@@ -27,6 +27,7 @@ obj-$(CONFIG_REGULATOR_ARM_SCMI) += scmi-regulator.o
 obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o
 obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o
 obj-$(CONFIG_REGULATOR_ATC260X) += atc260x-regulator.o
+obj-$(CONFIG_REGULATOR_AW37503) += aw37503-regulator.o
 obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o
 obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o
 obj-$(CONFIG_REGULATOR_BD71815)	+= bd71815-regulator.o
drivers/regulator/aw37503-regulator.c new file +240 -0

240 lines not on this page · raw message

Signature · 1 line
2.41.0
#2 lore raw

PATCH v4 2/2 regulator: dt-bindings: Add Awinic AW37503

In reply to [email protected]

From: Alec Li <[email protected]>

Add aw37503 regulator device-tree binding documentation.

---
 .../bindings/regulator/awinic,aw37503.yaml    | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +80 -0
new file mode 100644
index 000000000000..65a891505808
@@ -0,0 +1,80 @@
+# 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 are 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#
+    unevaluatedProperties: false
+    description: |
+      Properties for single regulator.
+
+    properties:
+      regulator-name: true
+      regulator-always-on: true
+      regulator-boot-on: true
+      enable-gpio:
+        maxItems: 1
+        description: |
+          GPIO specifier to enable the GPIO control (on/off) for regulator.
+
+    required:
+      - regulator-name
+
+required:
+  - compatible
+  - reg
+  - outp
+  - outn
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@3e {
+            compatible = "awinic,aw37503";
+            reg = <0x3e>;
+
+            outp {
+                regulator-name = "outp";
+                regulator-boot-on;
+                regulator-always-on;
+                enable-gpio = <&gpio 17 GPIO_ACTIVE_LOW>;
+            };
+
+            outn {
+                regulator-name = "outn";
+                regulator-boot-on;
+                regulator-always-on;
+                enable-gpio = <&gpio 27 GPIO_ACTIVE_LOW>;
+            };
+        };
+    };
+...
Signature · 1 line
2.41.0
#3 lore raw

Re: [PATCH v4 2/2] regulator: dt-bindings: Add Awinic AW37503

Quoted 18 lines · On 16/08/2023 10:17, [email protected] wrote:

From: Alec Li <[email protected]>

Add aw37503 regulator device-tree binding documentation.

---
 .../bindings/regulator/awinic,aw37503.yaml    | 80 +++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +2 -0
new file mode 100644
index 000000000000..65a891505808
@@ -0,0 +1,80 @@
+# 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.

Quoted 8 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +8 -0
+  The AW37503 are 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

Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 30

Quoted 10 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +10 -0
+
+  reg:
+    maxItems: 1
+
+patternProperties:
+  "^out[pn]$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+    description: |

Do not need '|' unless you need to preserve formatting.

Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 36

Quoted 6 lines
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +6 -0
+      Properties for single regulator.
+
+    properties:
+      regulator-name: true
+      regulator-always-on: true
+      regulator-boot-on: true

Drop all three above. They are not needed, because you use unevaluatedProperties:false.

Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml line 37

Quoted 1 line
Documentation/devicetree/bindings/regulator/awinic,aw37503.yaml new file +1 -0
+      enable-gpio:

I believe the name *everywhere* is enable-gpios.

Best regards,
Krzysztof