Add Richtek RT9759 smart cap divider charger support
Subsystems (2)
v4 cover Add Richtek RT9759 smart cap divider charger support
From: ChiYuan Huang <[email protected]>
This patch set is to add Richtek RT9759 smart cap divider charger.
The RT9759 is a high efficiency and high charge current charger. The efficiency is up to 97.8% when VBAT=4.2V, IBAT=2.5A, and the maximum charge current is up to 8A. The device integrates smart cap divider topology with a dual-phase charge pump core and 9 channel high speed ADCs to monitor the charging process.
Since v4:
- Since it's 2023 now, change date from 2022 to 2023 for source code and ABI.
Since v3:
- Fix 0002 patch title typo (from 'rt9471' to 'rt9759')
- Remove unused R_VAC_OVP range.
- Refer to ABI document, use 'status' to control battery charging, not 'online'
- Refer to ABI document, use 'online' to indicate bus state
Since v2:
- Add Reviewed-by tag for dt-binding patch
- Change ABI document date from Oct 2022 to Nov 2022 and KernelVersion from 6.1 to 6.2
ChiYuan Huang (3):
dt-bindings: power: supply: Add Richtek RT9759 smart cap divider
charger
power: supply: Add Richtek RT9759 smart cap divider charger
Documentation: power: rt9759: Document exported sysfs entries
.../ABI/testing/sysfs-class-power-rt9759 | 37 ++ .../bindings/power/supply/richtek,rt9759.yaml | 61 ++ drivers/power/supply/Kconfig | 15 + drivers/power/supply/Makefile | 1 + drivers/power/supply/rt9759.c | 613 ++++++++++++++++++ 5 files changed, 727 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-power-rt9759 create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml create mode 100644 drivers/power/supply/rt9759.c
base-commit: a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451
Signature · 1 line
2.40.1
PATCH RESEND v4 1/3 dt-bindings: power: supply: Add Richtek RT9759 smart cap divider charger
From: ChiYuan Huang <[email protected]>
Add bindings for the Richtek RT9759 smart cap divider charger.
---
Since v2
- Add Reviewed-by tag for dt-binding patch
--- .../bindings/power/supply/richtek,rt9759.yaml | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml
Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml new file +61 -0
@@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/richtek,rt9759.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Richtek RT9759 Smart Cap Divider Charger + +maintainers: + - ChiYuan Huang <[email protected]> + +description: | + The RT9759 is a high efficiency and high charge current charger. + The efficiency is up to 97.8% when VBAT = 4.2V, IBAT = 2.5A and the maximum + charge current is up to 8A. The device integrates smart cap divider topology + with dual phase charge pump core. The ADCs provide input and output voltage, + current and temperature information to monitor the whole charging process. + + Datasheet is available at + https://www.richtek.com/assets/product_file/RT9759/DS9759-02.pdf + +properties: + compatible: + enum: + - richtek,rt9759 + + reg: + maxItems: 1 + + wakeup-source: true + + interrupts: + maxItems: 1 + + shunt-resistor-micro-ohms: + description: Battery current sense resistor mounted. + default: 2000 + +required: + - compatible + - reg + - wakeup-source + - interrupts + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + charger@66 { + compatible = "richtek,rt9759"; + reg = <0x66>; + wakeup-source; + interrupts-extended = <&gpio_intc 32 IRQ_TYPE_EDGE_FALLING>; + shunt-resistor-micro-ohms = <5000>; + }; + };
Signature · 1 line
2.40.1
PATCH RESEND v4 2/3 power: supply: Add Richtek RT9759 smart cap divider charger
In reply to [email protected]From: ChiYuan Huang <[email protected]>
Add support for RT9759 smart cap divider charger.
The RT9759 is a high efficiency and high charge current charger. The maximum charge current is up to 8A. It integrates a dual-phase charge pump core with ADC monitoring.
---
Since v4:
- Modify year from 2022 to 2023 for the license string.
Since v3:
- Fix patch title typo (from 'rt9471' to 'rt9759')
- Remove unused R_VAC_OVP range.
- Refer to ABI document, use 'status' to control battery charging, not 'online'
- Refer to ABI document, use 'online' to indicate bus state
Since v2:
No change
--- drivers/power/supply/Kconfig | 15 + drivers/power/supply/Makefile | 1 + drivers/power/supply/rt9759.c | 613 ++++++++++++++++++++++++++++++++++ 3 files changed, 629 insertions(+) create mode 100644 drivers/power/supply/rt9759.c
drivers/power/supply/Kconfig +15 -0
@@ -766,6 +766,21 @@ config BATTERY_RT5033 The fuelgauge calculates and determines the battery state of charge according to battery open circuit voltage. +config CHARGER_RT9759 + tristate "Richtek RT9759 smart cap divider charger driver" + depends on I2C + select REGMAP_I2C + select LINEAR_RANGES + help + This adds support for Richtek RT9759 smart cap divider charger driver. + It's a high efficiency and high charge current charger. the device + integrates smart cap divider topology with 9-channel high speed + ADCs that can provide input and output voltage, current and + temperature monitoring. + + This driver can also be built as a module. If so, the module will be + called rt9759. + config CHARGER_RT9455 tristate "Richtek RT9455 battery charger driver" depends on I2C
drivers/power/supply/Makefile +1 -0
@@ -54,6 +54,7 @@ obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o obj-$(CONFIG_BATTERY_MAX17042) += max17042_battery.o obj-$(CONFIG_BATTERY_MAX1721X) += max1721x_battery.o obj-$(CONFIG_BATTERY_RT5033) += rt5033_battery.o +obj-$(CONFIG_CHARGER_RT9759) += rt9759.o obj-$(CONFIG_CHARGER_RT9455) += rt9455_charger.o obj-$(CONFIG_CHARGER_RT9467) += rt9467-charger.o obj-$(CONFIG_CHARGER_RT9471) += rt9471.o
drivers/power/supply/rt9759.c new file +613 -0
613 lines not on this page · raw message
Signature · 1 line
2.40.1
PATCH RESEND v4 3/3 Documentation: power: rt9759: Document exported sysfs entries
In reply to [email protected]From: ChiYuan Huang <[email protected]>
Document the settings exported by rt9759 charger driver through sysfs entries:
- watchdog_timer
- battery_voltage
- battery_current
---
Since v4:
- Modify date to 'Mar 2023' and kernelversion to next '6.3'.
Since v3:
No change
Since v2:
- Change ABI document date from Oct 2022 to Nov 2022 and KernelVersion from 6.1 to 6.2
--- .../ABI/testing/sysfs-class-power-rt9759 | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-power-rt9759
Documentation/ABI/testing/sysfs-class-power-rt9759 new file +37 -0
@@ -0,0 +1,37 @@ +What: /sys/class/power_supply/rt9759-*/watchdog_timer +Date: Mar 2023 +KernelVersion: 6.3 +Contact: ChiYuan Huang <[email protected]> +Description: + This entry shows and sets the watchdog timer when rt9759 charger + operates in charging mode. When the timer expires, the device + will disable the charging. To prevent the timer expires, any + host communication can make the timer restarted. + + Access: Read, Write + + Valid values: + - 500, 1000, 5000 or 30000 (milliseconds), + - 0: disabled + +What: /sys/class/power_supply/rt9759-*/battery_voltage +Date: Mar 2023 +KernelVersion: 6.3 +Contact: ChiYuan Huang <[email protected]> +Description: + Reports the current BAT voltage. + + Access: Read-Only + + Valid values: Represented in microvolts + +What: /sys/class/power_supply/rt9759-*/battery_current +Date: Mar 2023 +KernelVersion: 6.3 +Contact: ChiYuan Huang <[email protected]> +Description: + Reports the current BAT current. + + Access: Read-Only + + Valid values: Represented in microamps
Signature · 1 line
2.40.1
Quoted 10 lines · On Mon, Jul 03, 2023 at 04:00:26PM +0800, [email protected] wrote:
From: ChiYuan Huang <[email protected]>
This patch set is to add Richtek RT9759 smart cap divider charger.
The RT9759 is a high efficiency and high charge current charger. The efficiency is up to 97.8% when VBAT=4.2V, IBAT=2.5A, and the maximum charge current is up to 8A. The device integrates smart cap divider topology with a dual-phase charge pump core and 9 channel high speed ADCs to monitor the charging process.
Hi,
Did I miss to mail loop any reviewer or cc mailing list?
I trace the mail record. This patch series is already pending above one half year.
Do I need to still resend the patch series or restart a new one from v1?
Quoted 35 lines
Since v4:
- Since it's 2023 now, change date from 2022 to 2023 for source code and ABI.Since v3:
- Fix 0002 patch title typo (from 'rt9471' to 'rt9759')
- Remove unusedR_VAC_OVPrange.
- Refer to ABI document, use 'status' to control battery charging, not 'online'
- Refer to ABI document, use 'online' to indicate bus stateSince v2:
- Add Reviewed-by tag for dt-binding patch
- Change ABI document date from Oct 2022 to Nov 2022 and KernelVersion from 6.1 to 6.2ChiYuan Huang (3):
dt-bindings: power: supply: Add Richtek RT9759 smart cap divider
charger
power: supply: Add Richtek RT9759 smart cap divider charger
Documentation: power: rt9759: Document exported sysfs entries.../ABI/testing/sysfs-class-power-rt9759 | 37 ++ .../bindings/power/supply/richtek,rt9759.yaml | 61 ++ drivers/power/supply/Kconfig | 15 + drivers/power/supply/Makefile | 1 + drivers/power/supply/rt9759.c | 613 ++++++++++++++++++ 5 files changed, 727 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-power-rt9759 create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt9759.yaml create mode 100644 drivers/power/supply/rt9759.cbase-commit:
a901a3568fd26ca9c4a82d8bc5ed5b3ed844d451Signature · 1 line
2.40.1