Skip to content
Open
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
61 changes: 61 additions & 0 deletions Documentation/devicetree/bindings/soc/google/google,gs201-bcl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/google/google,gs201-bcl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Google gs201 battery current limiter

maintainers:
- Ángel René <17342133+angelrenefm@users.noreply.github.com>

description:
On Google Tensor G2 (gs201) phones the charger PMIC (MAX77759) and the main
PMIC (S2MPG12) raise lines when the battery voltage droops or its current
goes over the limit. While a line is asserted the CPU clusters and the GPU
are capped, so a load peak doesn't take the battery under the level where
the phone shuts down.

properties:
compatible:
const: google,gs201-bcl

smpl-warn-gpios:
maxItems: 1
description: The S2MPG12's SMPL_WARN, asserted when the battery falls
under its warning voltage.

vdroop1-gpios:
maxItems: 1
description: The MAX77759's SYS_UVLO1, the first system voltage level.

vdroop2-gpios:
maxItems: 1
description: The MAX77759's SYS_UVLO2 or BAT_OILO, which share one pin,
the second system voltage level or battery over-current.

google,gpu:
$ref: /schemas/types.yaml#/definitions/phandle
description: The GPU, whose maximum frequency is capped with the CPUs'.

required:
- compatible

anyOf:
- required: [smpl-warn-gpios]
- required: [vdroop1-gpios]
- required: [vdroop2-gpios]

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>

battery-current-limiter {
compatible = "google,gs201-bcl";
smpl-warn-gpios = <&gpa5 0 GPIO_ACTIVE_LOW>;
vdroop1-gpios = <&gpa5 5 GPIO_ACTIVE_HIGH>;
vdroop2-gpios = <&gpa5 6 GPIO_ACTIVE_HIGH>;
google,gpu = <&gpu>;
};
14 changes: 14 additions & 0 deletions arch/arm64/boot/dts/exynos/google/gs201-panther.dts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@
*/
soc_id = <0x09855001 0x0>;

/*
* The battery current limiter's lines, as Google's
* gs201-cloudripper-bcl.dtsi: the MAX77759's vdroop1 (SYS_UVLO1) and
* vdroop2 (SYS_UVLO2 or BAT_OILO) on gpa5-5/6, the S2MPG12's
* SMPL_WARN on gpa5-0.
*/
battery-current-limiter {
compatible = "google,gs201-bcl";
smpl-warn-gpios = <&gpa5 0 GPIO_ACTIVE_LOW>;
vdroop1-gpios = <&gpa5 5 GPIO_ACTIVE_HIGH>;
vdroop2-gpios = <&gpa5 6 GPIO_ACTIVE_HIGH>;
google,gpu = <&gpu>;
};

chosen {
/* ABL requires bootargs to exist; it appends its own after these. */
bootargs = "console=tty0 panic=10 reboot=warm clk_ignore_unused pd_ignore_unused rdinit=/init omamobile.ufs-probe mem_sleep_default=s2idle";
Expand Down
14 changes: 14 additions & 0 deletions drivers/soc/samsung/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ config SAMSUNG_PM_CHECK_CHUNKSIZE
the CRC data block will take more memory, but will identify any
faults with better precision.

config GS201_BCL
tristate "Google Tensor G2 battery current limiter"
depends on ARCH_EXYNOS || COMPILE_TEST
depends on CPU_FREQ && GPIOLIB
help
Caps the CPU clusters and the GPU of Google Tensor G2 (gs201)
phones while the MAX77759 or the S2MPG12 report a battery
voltage droop or over-current, and lifts the caps when it ends,
so a load peak doesn't take the battery under the level where
the phone shuts down.

To compile this driver as a module, choose M here: the module
will be called gs201-bcl.

config EXYNOS_REGULATOR_COUPLER
bool "Exynos SoC Regulator Coupler" if COMPILE_TEST
depends on ARCH_EXYNOS || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/soc/samsung/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exynos_pmu-y += exynos-pmu.o gs101-pmu.o

obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \
exynos5250-pmu.o exynos5420-pmu.o
obj-$(CONFIG_GS201_BCL) += gs201-bcl.o
obj-$(CONFIG_EXYNOS_REGULATOR_COUPLER) += exynos-regulator-coupler.o

obj-$(CONFIG_SAMSUNG_PM_CHECK) += s3c-pm-check.o
Loading