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
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ patternProperties:
"^charger@[0-9a-f]+$":
type: object
oneOf:
- $ref: /schemas/power/supply/qcom,pm4125-charger.yaml#
- $ref: /schemas/power/supply/qcom,pm8916-lbc.yaml#
- $ref: /schemas/power/supply/qcom,pm8941-charger.yaml#
- $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml#
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/qcom,pm4125-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm PM4125 SMBLite Switch-Mode Battery Charger

maintainers:
- Raj Aryan <raj.aryan@oss.qualcomm.com>
- Rakesh Kota <rakesh.kota@oss.qualcomm.com>

description: |
The Qualcomm SMBLite is a switch-mode battery charger IP found on
the entry-level Qualcomm PM4125 PMIC. It exposes five separate
SPMI peripheral bases for CHGR, DCDC, USB, MISC and BATIF blocks and
supports USB input current limiting, JEITA temperature protection,
battery overvoltage detection and a hardware watchdog.

properties:
compatible:
const: qcom,pm4125-charger

reg:
maxItems: 1

interrupts:
maxItems: 4

interrupt-names:
items:
- const: usb-plugin
- const: bat-ov
- const: wdog-bark
- const: usbin-icl-change

io-channels:
maxItems: 1
description:
USB input voltage channel (ADC5_USB_IN_V_16).

io-channel-names:
items:
- const: usbin_v

monitored-battery: true

qcom,jeita-soft-thresholds:
$ref: /schemas/types.yaml#/definitions/uint32-array
items:
- description: COOL threshold as a raw ADC comparator value.
maximum: 0xffff
- description: WARM threshold as a raw ADC comparator value.
maximum: 0xffff
description: |
JEITA soft temperature thresholds (COOL, WARM) as raw 16-bit ADC
comparator values written to the BATIF ADC comparator registers.
Example: <0x5314 0x25e3> for COOL=15°C, WARM=45°C.

qcom,jeita-hard-thresholds:
$ref: /schemas/types.yaml#/definitions/uint32-array
items:
- description: COLD threshold as a raw ADC comparator value.
maximum: 0xffff
- description: HOT threshold as a raw ADC comparator value.
maximum: 0xffff
description: |
JEITA hard temperature thresholds (COLD, HOT) as raw 16-bit ADC
comparator values written to the BATIF ADC comparator registers.
Example: <0x58cd 0x20b8> for COLD=0°C, HOT=60°C.

required:
- compatible
- reg
- interrupts
- interrupt-names
- io-channels
- io-channel-names

dependencies:
qcom,jeita-soft-thresholds:
- qcom,jeita-hard-thresholds
qcom,jeita-hard-thresholds:
- qcom,jeita-soft-thresholds

allOf:
- $ref: power-supply.yaml#

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/iio/qcom,spmi-vadc.h>

pmic {
#address-cells = <1>;
#size-cells = <0>;

charger@1000 {
compatible = "qcom,pm4125-charger";
reg = <0x1000>;

interrupts = <0x0 0x13 0x0 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x12 0x3 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
<0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "usb-plugin",
"bat-ov",
"wdog-bark",
"usbin-icl-change";

io-channels = <&pm4125_vadc ADC5_USB_IN_V_16>;
io-channel-names = "usbin_v";

qcom,jeita-soft-thresholds = <0x5314 0x25e3>; /* COOL, WARM */
qcom,jeita-hard-thresholds = <0x58cd 0x20b8>; /* COLD, HOT */
};
};
20 changes: 20 additions & 0 deletions arch/arm64/boot/dts/qcom/pm4125.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
};
};

pm4125_charger: charger@1000 {
compatible = "qcom,pm4125-charger";
reg = <0x1000>;

interrupts = <0x0 0x13 0x0 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x12 0x3 IRQ_TYPE_EDGE_BOTH>,
<0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
<0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "usb-plugin",
"bat-ov",
"wdog-bark",
"usbin-icl-change";
io-channels = <&pm4125_adc ADC5_USB_IN_V_16>;
io-channel-names = "usbin_v";
qcom,jeita-soft-thresholds = <0x5314 0x25e3>; /* COOL, WARM */
qcom,jeita-hard-thresholds = <0x58cd 0x20b8>; /* COLD, HOT */

status = "disabled";
};

pm4125_vbus: usb-vbus-regulator@1100 {
compatible = "qcom,pm4125-vbus-reg";
reg = <0x1100>;
Expand Down
12 changes: 7 additions & 5 deletions arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
};

&pm4125_hs_in {
remote-endpoint = <&usb_1_dwc3_hs>;
remote-endpoint = <&usb_1_hsphy_connector>;
};

&pm4125_ss_in {
Expand Down Expand Up @@ -674,15 +674,13 @@
};
};

&usb_1_dwc3_hs {
remote-endpoint = <&pm4125_hs_in>;
};

&usb_1_hsphy {
vdd-supply = <&pm4125_l12>;
vdda-pll-supply = <&pm4125_l13>;
vdda-phy-dpdm-supply = <&pm4125_l21>;

usb-role-switch;

status = "okay";
};

Expand Down Expand Up @@ -712,6 +710,10 @@
status = "okay";
};

&usb_1_hsphy_connector {
remote-endpoint = <&pm4125_hs_in>;
};

&usb_qmpphy_out {
remote-endpoint = <&pm4125_ss_in>;
};
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@
};
};

&pm4125_charger {
status = "okay";
};

&pm4125_gpios {
pm4125_adc_gpio5_default: pm4125-adc-gpio5-state {
pins = "gpio5";
Expand Down
10 changes: 5 additions & 5 deletions arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
};

&pm4125_hs_in {
remote-endpoint = <&usb_1_dwc3_hs>;
remote-endpoint = <&usb_1_hsphy_connector>;
};

&pm4125_ss_in {
Expand Down Expand Up @@ -713,10 +713,6 @@
};
};

&usb_1_dwc3_hs {
remote-endpoint = <&pm4125_hs_in>;
};

&usb_1_hsphy {
vdd-supply = <&pm4125_l12>;
vdda-pll-supply = <&pm4125_l13>;
Expand Down Expand Up @@ -756,6 +752,10 @@
status = "okay";
};

&usb_1_hsphy_connector {
remote-endpoint = <&pm4125_hs_in>;
};

&usb_qmpphy_out {
remote-endpoint = <&pm4125_ss_in>;
};
Expand Down
21 changes: 21 additions & 0 deletions arch/arm64/boot/dts/qcom/shikra.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,26 @@
#phy-cells = <0>;

status = "disabled";

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;

usb_1_hsphy_connector: endpoint {
};
};

port@1 {
reg = <1>;

usb_1_hsphy_controller: endpoint {
remote-endpoint = <&usb_1_dwc3_hs>;
};
};
};
};

usb_qmpphy: phy@1615000 {
Expand Down Expand Up @@ -3134,6 +3154,7 @@
reg = <0>;

usb_1_dwc3_hs: endpoint {
remote-endpoint = <&usb_1_hsphy_controller>;
};
};

Expand Down
Loading