Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
fe-pi-audio.dtbo \
fsm-demo.dtbo \
gc9a01.dtbo \
geekworm-x120x.dtbo \
ghost-amp.dtbo \
goodix.dtbo \
googlevoicehat-soundcard.dtbo \
Expand Down
9 changes: 9 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,15 @@ Params: speed Display SPI bus speed
debug Debug output level {0-7}


Name: geekworm-x120x
Info: Geekworm X120x UPS boards for the Raspberry Pi 5, such as the X1202
and X1206. Adds the MAX17040-compatible fuel gauge at I2C address
0x36 and a gpio-charger for the GPIO that reports input power, and
links the two so the battery can report whether it is charging.
Load: dtoverlay=geekworm-x120x,<param>=<val>
Params: gpio GPIO that reports input power (default 6)


Name: ghost-amp
Info: An overlay for the Ghost amplifier.
Load: dtoverlay=ghost-amp,<param>=<val>
Expand Down
44 changes: 44 additions & 0 deletions arch/arm/boot/dts/overlays/geekworm-x120x-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: GPL-2.0-only
// Definitions for Geekworm X120x UPS boards such as the X1202 and X1206:
// a MAX17040-compatible fuel gauge on I2C plus a GPIO that reports input
// power, linked so the battery knows its charger.
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/ {
compatible = "brcm,bcm2712";

fragment@0 {
target-path = "/";
__overlay__ {
x120x_charger: charger {
compatible = "gpio-charger";
gpios = <&gpio 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
charger-type = "mains";
status = "okay";
};
};
};

fragment@1 {
target = <&i2c_arm>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

x120x_battery: fuel-gauge@36 {
compatible = "maxim,max17040";
reg = <0x36>;
power-supplies = <&x120x_charger>;
status = "okay";
};
};
};

__overrides__ {
gpio = <&x120x_charger>,"gpios:4";
};
};