[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240605091143.163789-2-wangshuaijie@awinic.com>
Date: Wed, 5 Jun 2024 09:11:39 +0000
From: wangshuaijie@...nic.com
To: dmitry.torokhov@...il.com,
robh@...nel.org,
krzk+dt@...nel.org,
conor+dt@...nel.org,
jeff@...undy.com,
linux-input@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: wangshuaijie@...nic.com,
liweilei@...nic.com,
kangjiajun@...nic.com
Subject: [PATCH V2 1/5] dt-bindings: input: Add YAML to Awinic sar sensor.
From: shuaijie wang <wangshuaijie@...nic.com>
Add the awinic,aw_sar.yaml file to adapt to the awinic sar sensor driver.
Signed-off-by: shuaijie wang <wangshuaijie@...nic.com>
---
.../bindings/input/awinic,aw_sar.yaml | 125 ++++++++++++++++++
1 file changed, 125 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/awinic,aw_sar.yaml
diff --git a/Documentation/devicetree/bindings/input/awinic,aw_sar.yaml b/Documentation/devicetree/bindings/input/awinic,aw_sar.yaml
new file mode 100644
index 000000000000..2560ef09d3d0
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/awinic,aw_sar.yaml
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/awinic,aw_sar.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Awinic sar sensor driver family
+
+maintainers:
+ - Shuaijie Wang <wangshuaijie@...nic.com>
+
+properties:
+ compatible:
+ enum:
+ - awinic,aw96103
+ - awinic,aw96105
+ - awinic,aw96303
+ - awinic,aw96305
+ - awinic,aw96308
+
+ reg:
+ maxItems: 1
+
+ irq-gpio:
+ maxItems: 1
+
+ awinic,sar-label:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Set the label of the SAR(Specific Absorption Rate) sensor.
+ It is set to 0 if one awinic sar chip is used.
+ If two awinic sar chips are used, awinic,sar-label in the first
+ awinic-sar should be set to 0 and awinic,sar-label in the second
+ awinic-sar should be set to 1.
+
+
+ awinic,regulator-power-supply:
+ description:
+ Choose if you want to use a regulator to power the chip. Then the
+ vccX-supply has to be set.
+
+ vcc0-supply:
+ description:
+ Optional regulator for chip, 1.7V-3.6V.
+ If two awinic sar chips are used, the first regulator
+ should set the ID to vcc0-supply and the second regulator
+ should set the ID to vcc1-supply.
+
+ awinic,channel-use-mask:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ The mask of channels used.
+ Configure according to the specific chip channel used.
+ Bit[31:0] Each bit represents a channel.
+ If the customer uses ch0 and ch2, then channel_use_mask=<0x05>
+ For a 3-channel chip, the maximum value is 0x07;
+ For a 5-channel chip, the maximum value is 0x1F;
+ For a 8-channel chip, the maximum value is 0xFF;
+
+ awinic,update-fw:
+ type: boolean
+ description:
+ Choose if you want to update the firmware.
+
+ awinic,monitor-esd:
+ type: boolean
+ description:
+ Choose if you want to monitor ESD.
+
+ awinic,pin-set-inter-pull-up:
+ type: boolean
+ description:
+ Choose if you want to set the interrupt pin to internal pull-up.
+
+ awinic,using-pm-ops:
+ type: boolean
+ description:
+ Choose if you want to change the chip mode on suppend and resume.
+
+ awinic,use-plug-cail:
+ type: boolean
+ description:
+ Choose If you want to perform calibration when plugging and unplugging the charger.
+
+ awinic,start-mode:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ You only need to set this configuration item if you are using AW963XX.
+ When connecting to AW963XX, select the location where the firmware starts.
+ Set 0 if start in rom.
+ Set 1 if start in ram
+
+ awinic,irq-mux:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ You only need to set this configuration item if you are using AW96308 adn AW96305BFOR.
+ If CS2 is used as the interrupt pin, this item should be set to 2.
+ If CS5 is used as the interrupt pin, this item should be set to 5.
+
+required:
+ - compatible
+ - reg
+ - irq-gpio
+ - awinic,sar-label
+ - awinic,channel-use-mask
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ awinic-sar@12 {
+ compatible = "awinic,aw96308";
+ reg = <0x12>;
+ irq-gpio = <&tlmm 72 0>;
+ awinic,sar-label = < 0 >;
+ awinic,channel-use-mask = <0xff>;
+ awinic,start-mode = < 0 >;
+ awinic,irq-mux = < 2 >;
+ };
+ };
--
2.45.1
Powered by blists - more mailing lists