Skip to content

Commit

Permalink
Merge tag 'for-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 "Nothing special for the power-supply subystem this time.

   - power-supply core: remove faulty cooling logic

   - convert all sysfs show() handlers from *printf() use sysfs_emit()

   - bq25890: add dual-charger support required by Lenovo Yoga Tab 3 Pro

   - bq27xxx: fix reporting critical level

   - syscon-reboot: add priority property support

   - new rt9467 charger driver

   - new rt9471 charger driver

   - new Odroid Go Ultra poweroff driver

   - misc minor fixes and cleanups"

* tag 'for-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (32 commits)
  power: reset: odroid-go-ultra: fix I2C dependency
  power: supply: leds: explicitly include linux/leds.h
  dt-bindings: power: supply: pm8941-coincell: Don't require charging properties
  dt-bindings: power: supply: pm8941-coincell: Add PM8998 compatible
  power: reset: add Odroid Go Ultra poweroff driver
  power: supply: rt9467: Fix spelling mistake "attache" -> "attach"
  power: supply: rt9471: fix using wrong ce_gpio in rt9471_probe()
  power: supply: max77650: Make max77650_charger_disable() return void
  Documentation: power: rt9467: Document exported sysfs entries
  power: supply: rt9467: Add Richtek RT9467 charger driver
  dt-bindings: power: supply: Add Richtek RT9467 battery charger
  Documentation: power: rt9471: Document exported sysfs entries
  power: supply: rt9471: Add Richtek RT9471 charger driver
  dt-bindings: power: supply: Add Richtek RT9471 battery charger
  power: supply: max1721x: Use strscpy() is more robust and safer
  power: supply: test-power: use strscpy() instead of strncpy()
  power: supply: bq27xxx: fix reporting critical level
  power: supply: bq256xx: Init ichg/vbat value with chip default value
  power: supply: collie_battery: Convert to GPIO descriptors (part 2)
  power: supply: remove faulty cooling logic
  ...
  • Loading branch information
torvalds committed Feb 25, 2023
2 parents 90ddb3f + c142872 commit 39f0134
Show file tree
Hide file tree
Showing 42 changed files with 2,909 additions and 233 deletions.
19 changes: 19 additions & 0 deletions Documentation/ABI/testing/sysfs-class-power-rt9467
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
What: /sys/class/power_supply/rt9467-*/sysoff_enable
Date: Feb 2023
KernelVersion: 6.3
Contact: ChiaEn Wu <[email protected]>
Description:
This entry allows enabling the sysoff mode of rt9467 charger
devices.
If enabled and the input is removed, the internal battery FET
is turned off to reduce the leakage from the BAT pin. See
device datasheet for details. It's commonly used when the
product enter shipping stage. After entering shipping mode,
only 'VBUS' or 'Power key" pressed can make it leave this mode.
'Disable' also can help to leave it, but it's more like to
abort the action before the device really enter shipping mode.

Access: Read, Write
Valid values:
- 1: enabled
- 0: disabled
32 changes: 32 additions & 0 deletions Documentation/ABI/testing/sysfs-class-power-rt9471
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
What: /sys/class/power_supply/rt9471-*/sysoff_enable
Date: Feb 2023
KernelVersion: 6.3
Contact: ChiYuan Huang <[email protected]>
Description:
This entry allows enabling the sysoff mode of rt9471 charger devices.
If enabled and the input is removed, the internal battery FET is turned
off to reduce the leakage from the BAT pin. See device datasheet for details.
It's commonly used when the product enter shipping stage. After entering
shipping mode, only 'VBUS' or 'Power key" pressed can make it leave this
mode. 'Disable' also can help to leave it, but it's more like to abort
the action before the device really enter shipping mode.

Access: Read, Write
Valid values:
- 1: enabled
- 0: disabled

What: /sys/class/power_supply/rt9471-*/port_detect_enable
Date: Feb 2023
KernelVersion: 6.3
Contact: ChiYuan Huang <[email protected]>
Description:
This entry allows enabling the USB BC12 port detect function of rt9471 charger
devices. If enabled and VBUS is inserted, device will start to do the BC12
port detect and report the usb port type when port detect is done. See
datasheet for details. Normally controlled when TypeC/USBPD port integrated.

Access: Read, Write
Valid values:
- 1: enabled
- 0: disabled
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint32
description: The reset value written to the reboot register (32 bit access).

priority:
default: 192

required:
- compatible
- offset

additionalProperties: false

allOf:
- $ref: restart-handler.yaml#
- if:
not:
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,30 @@ maintainers:

properties:
compatible:
const: qcom,pm8941-coincell
oneOf:
- items:
- enum:
- qcom,pm8998-coincell
- const: qcom,pm8941-coincell

- const: qcom,pm8941-coincell

reg:
maxItems: 1

qcom,rset-ohms:
description: resistance (in ohms) for current-limiting resistor
description: |
Resistance (in ohms) for current-limiting resistor. If unspecified,
inherit the previous configuration (e.g. from bootloader or hardware
default value).
enum: [ 800, 1200, 1700, 2100 ]

qcom,vset-millivolts:
$ref: /schemas/types.yaml#/definitions/uint32
description: voltage (in millivolts) to apply for charging
description: |
Voltage (in millivolts) to apply for charging. If unspecified, inherit
the previous configuration (e.g. from bootloader or hardware default
value).
enum: [ 2500, 3000, 3100, 3200 ]

qcom,charger-disable:
Expand All @@ -37,8 +49,6 @@ properties:
required:
- compatible
- reg
- qcom,rset-ohms
- qcom,vset-millivolts

additionalProperties: false

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt9467-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Richtek RT9467 Switching Battery Charger with Power Path Management

maintainers:
- ChiYuan Huang <[email protected]>
- ChiaEn Wu <[email protected]>

description: |
RT9467 is a switch-mode single cell Li-Ion/Li-Polymer battery charger for
portable applications. It integrates a synchronous PWM controller, power
MOSFETs, input current sensing and regulation, high-accuracy voltage
regulation, and charge termination. The charge current is regulated through
integrated sensing resistors.
The RT9467 also features USB On-The-Go (OTG) support. It also integrates
D+/D- pin for USB host/charging port detection.
Datasheet is available at
https://www.richtek.com/assets/product_file/RT9467/DS9467-01.pdf
properties:
compatible:
const: richtek,rt9467-charger

reg:
maxItems: 1

wakeup-source: true

interrupts:
maxItems: 1

charge-enable-gpios:
description: GPIO is used to turn on and off charging.
maxItems: 1

usb-otg-vbus-regulator:
type: object
description: OTG boost regulator.
unevaluatedProperties: false
$ref: /schemas/regulator/regulator.yaml#

properties:
enable-gpios: true

required:
- compatible
- reg
- wakeup-source
- interrupts

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@5b {
compatible = "richtek,rt9467-charger";
reg = <0x5b>;
wakeup-source;
interrupts-extended = <&gpio_intc 32 IRQ_TYPE_LEVEL_LOW>;
charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_LOW>;
rt9467_otg_vbus: usb-otg-vbus-regulator {
regulator-name = "rt9467-usb-otg-vbus";
regulator-min-microvolt = <4425000>;
regulator-max-microvolt = <5825000>;
regulator-min-microamp = <500000>;
regulator-max-microamp = <3000000>;
};
};
};
73 changes: 73 additions & 0 deletions Documentation/devicetree/bindings/power/supply/richtek,rt9471.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/richtek,rt9471.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Richtek RT9471 3A Single Cell Switching Battery charger

maintainers:
- Alina Yu <[email protected]>
- ChiYuan Huang <[email protected]>

description: |
RT9471 is a switch-mode single cell Li-Ion/Li-Polymer battery charger for
portable applications. It supports USB BC1.2 port detection, current and
voltage regulations in both charging and boost mode.
Datasheet is available at
https://www.richtek.com/assets/product_file/RT9471=RT9471D/DS9471D-02.pdf
properties:
compatible:
const: richtek,rt9471

reg:
maxItems: 1

charge-enable-gpios:
description: GPIO used to turn on and off charging.
maxItems: 1

wakeup-source: true

interrupts:
maxItems: 1

usb-otg-vbus-regulator:
type: object
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false

required:
- compatible
- reg
- wakeup-source
- interrupts

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
charger@53 {
compatible = "richtek,rt9471";
reg = <0x53>;
charge-enable-gpios = <&gpio26 1 GPIO_ACTIVE_LOW>;
wakeup-source;
interrupts-extended = <&gpio_intc 32 IRQ_TYPE_EDGE_FALLING>;
usb-otg-vbus-regulator {
regulator-name = "usb-otg-vbus";
regulator-min-microvolt = <4850000>;
regulator-max-microvolt = <5300000>;
regulator-min-microamp = <500000>;
regulator-max-microamp = <1200000>;
};
};
};
2 changes: 1 addition & 1 deletion drivers/platform/x86/x86-android-tablets.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct x86_dev_info {
/* Generic / shared charger / battery settings */
static const char * const tusb1211_chg_det_psy[] = { "tusb1211-charger-detect" };
static const char * const bq24190_psy[] = { "bq24190-charger" };
static const char * const bq25890_psy[] = { "bq25890-charger" };
static const char * const bq25890_psy[] = { "bq25890-charger-0" };

static const struct property_entry fg_bq24190_supply_props[] = {
PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_psy),
Expand Down
7 changes: 7 additions & 0 deletions drivers/power/reset/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ config POWER_RESET_OCELOT_RESET
help
This driver supports restart for Microsemi Ocelot SoC and similar.

config POWER_RESET_ODROID_GO_ULTRA_POWEROFF
bool "Odroid Go Ultra power-off driver"
depends on ARCH_MESON || COMPILE_TEST
depends on I2C=y && OF
help
This driver supports Power off for Odroid Go Ultra device.

config POWER_RESET_OXNAS
bool "OXNAS SoC restart driver"
depends on ARCH_OXNAS
Expand Down
1 change: 1 addition & 0 deletions drivers/power/reset/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ obj-$(CONFIG_POWER_RESET_MT6323) += mt6323-poweroff.o
obj-$(CONFIG_POWER_RESET_OXNAS) += oxnas-restart.o
obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o
obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o
obj-$(CONFIG_POWER_RESET_ODROID_GO_ULTRA_POWEROFF) += odroid-go-ultra-poweroff.o
obj-$(CONFIG_POWER_RESET_PIIX4_POWEROFF) += piix4-poweroff.o
obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o
obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
Expand Down
Loading

0 comments on commit 39f0134

Please sign in to comment.