Skip to contentSkip to conversation

dt-bindings: rtc: add trickle-voltage-millivolt

PATCH Superseded Alexandre Belloni 2 participants 5 messages Oct 7, 2020 – Oct 13, 2020

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Alexandre Belloni

author maintainer
#0 lore raw

PATCH v2 1/3 dt-bindings: rtc: add trickle-voltage-millivolt

Some RTCs have a trickle charge that is able to output different voltages depending on the type of the connected auxiliary power (battery, supercap, ...). Add a property allowing to specify the necessary voltage.

---

Changes in v2:
- use millivolt suffix instead of mV

 Documentation/devicetree/bindings/rtc/rtc.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/rtc/rtc.yaml +7 -0
index ee237b2ed66a..93f04d5e5307 100644
@@ -42,6 +42,13 @@ properties:
       Selected resistor for trickle charger. Should be given
       if trickle charger should be enabled.
 
+  trickle-voltage-mV:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Selected voltage for trickle charger. Should be given
+      if trickle charger should be enabled and the trickle voltage is different
+      from the RTC main power supply.
+
   wakeup-source:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
Signature · 1 line
2.26.2
author maintainer
#1 lore raw

PATCH v2 2/3 dt-bindings: rtc: rv3032: add RV-3023 bindings

Document the Microcrystal RV-3032 device tree bindings

---
Changes in v2:
- use millivolt suffix instead of mV

 .../bindings/rtc/microcrystal,rv3032.yaml     | 64 +++++++++++++++++++
 .../devicetree/bindings/rtc/rtc.yaml          |  3 +-
 2 files changed, 65 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/microcrystal,rv3032.yaml
Documentation/devicetree/bindings/rtc/microcrystal,rv3032.yaml new file +64 -0
new file mode 100644
index 000000000000..a2c55303810d
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/microcrystal,rv3032.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip RV-3032 RTC Device Tree Bindings
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+maintainers:
+  - Alexandre Belloni <[email protected]>
+
+properties:
+  compatible:
+    const: microcrystal,rv3032
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  start-year: true
+
+  trickle-resistor-ohms:
+    enum:
+      - 1000
+      - 2000
+      - 7000
+      - 11000
+
+  trickle-voltage-millivolt:
+    enum:
+      - 1750
+      - 3000
+      - 4400
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtc@51 {
+            compatible = "microcrystal,rv3032";
+            reg = <0x51>;
+            status = "okay";
+            pinctrl-0 = <&rtc_nint_pins>;
+            interrupts-extended = <&gpio1 16 IRQ_TYPE_LEVEL_HIGH>;
+            trickle-resistor-ohms = <7000>;
+            trickle-voltage-millivolt = <1750>;
+        };
+    };
+
+...
Documentation/devicetree/bindings/rtc/rtc.yaml +1 -2
index 93f04d5e5307..538f3f9b29a2 100644
@@ -42,8 +42,7 @@ properties:
       Selected resistor for trickle charger. Should be given
       if trickle charger should be enabled.
 
-  trickle-voltage-mV:
-    $ref: /schemas/types.yaml#/definitions/uint32
+  trickle-voltage-millivolt:
     description:
       Selected voltage for trickle charger. Should be given
       if trickle charger should be enabled and the trickle voltage is different
Signature · 1 line
2.26.2
author maintainer
#2 lore raw

PATCH v2 3/3 rtc: rv3032: Add a driver for Microcrystal RV-3032

In reply to Alexandre Belloni

New driver for the Microcrystal RV-3032, including support for:
- Date/time
- Alarms
- Low voltage detection
- Trickle charge
- Trimming
- Clkout
- RAM
- EEPROM
- Temperature sensor

---

Changes in v2:
- Improve user EEPROM handling
- Handle configuration properly and update EEPROM
- Fix trickle charger configuration
- Add temperature sensor support

 drivers/rtc/Kconfig      |  10 +
 drivers/rtc/Makefile     |   1 +
 drivers/rtc/rtc-rv3032.c | 905 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 916 insertions(+)
 create mode 100644 drivers/rtc/rtc-rv3032.c
drivers/rtc/Kconfig +10 -0
index b54d87d45c89..91faf74e188c 100644
@@ -668,6 +668,16 @@ config RTC_DRV_RV3028
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-rv3028.
 
+config RTC_DRV_RV3032
+	tristate "Micro Crystal RV3032"
+	select REGMAP_I2C
+	help
+	  If you say yes here you get support for the Micro Crystal
+	  RV3032.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-rv3032.
+
 config RTC_DRV_RV8803
 	tristate "Micro Crystal RV8803, Epson RX8900"
 	help
drivers/rtc/Makefile +1 -0
index 0721752c6ed4..7bb8367538db 100644
@@ -142,6 +142,7 @@ obj-$(CONFIG_RTC_DRV_RS5C372)	+= rtc-rs5c372.o
 obj-$(CONFIG_RTC_DRV_RTD119X)	+= rtc-rtd119x.o
 obj-$(CONFIG_RTC_DRV_RV3028)	+= rtc-rv3028.o
 obj-$(CONFIG_RTC_DRV_RV3029C2)	+= rtc-rv3029c2.o
+obj-$(CONFIG_RTC_DRV_RV3032)	+= rtc-rv3032.o
 obj-$(CONFIG_RTC_DRV_RV8803)	+= rtc-rv8803.o
 obj-$(CONFIG_RTC_DRV_RX4581)	+= rtc-rx4581.o
 obj-$(CONFIG_RTC_DRV_RX6110)	+= rtc-rx6110.o
drivers/rtc/rtc-rv3032.c new file +905 -0

905 lines not on this page · raw message

Signature · 1 line
2.26.2
maintainer
#3 lore raw
In reply to Alexandre Belloni
Quoted 9 lines · Alexandre Belloni

Some RTCs have a trickle charge that is able to output different voltages depending on the type of the connected auxiliary power (battery, supercap, ...). Add a property allowing to specify the necessary voltage.

---

Changes in v2:
- use millivolt suffix instead of mV

Try again...

Quoted 25 lines
 Documentation/devicetree/bindings/rtc/rtc.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/rtc/rtc.yaml +7 -0
index ee237b2ed66a..93f04d5e5307 100644
@@ -42,6 +42,13 @@ properties:
       Selected resistor for trickle charger. Should be given
       if trickle charger should be enabled.
 
+  trickle-voltage-mV:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Selected voltage for trickle charger. Should be given
+      if trickle charger should be enabled and the trickle voltage is different
+      from the RTC main power supply.
+
   wakeup-source:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
Signature · 1 line
2.26.2
author maintainer
#4 lore raw
Quoted 5 lines · Rob Herring
Quoted 4 lines · Alexandre Belloni

Some RTCs have a trickle charge that is able to output different voltages depending on the type of the connected auxiliary power (battery, supercap, ...). Add a property allowing to specify the necessary voltage.

Quoted 7 lines
Quoted 5 lines

---

Changes in v2:
- use millivolt suffix instead of mV

Try again...

Sorry, the change was wrongly squashed in patch 2/3, I've sent v3.

Quoted 26 lines
Quoted 26 lines

 Documentation/devicetree/bindings/rtc/rtc.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/rtc/rtc.yaml +7 -0
index ee237b2ed66a..93f04d5e5307 100644
@@ -42,6 +42,13 @@ properties:
       Selected resistor for trickle charger. Should be given
       if trickle charger should be enabled.
 
+  trickle-voltage-mV:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Selected voltage for trickle charger. Should be given
+      if trickle charger should be enabled and the trickle voltage is different
+      from the RTC main power supply.
+
   wakeup-source:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
Signature · 1 line
2.26.2
Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com