From: Yassine Oudjana <y.oudjana@xxxxxxxxxxxxxx> This series adds a driver for the switch-mode battery charger found on PMICs such as PMI8994, and referred to in the vendor kernel[1] as smbcharger or SMBCHG. More details on this block can be found in the last patch message. This driver currently supports the charger blocks of PMI8994 and PMI8996. PMI8950 was also to be supported, but it was dropped due to some last minute issues, to be brought back at a later time once ready. The OTG regulator remains unused on devices where the charger is enabled in this series due to lack of a consumer. Applying a patch[2] adding vbus-supply to DWC3 allows it to enable the OTG regulator making USB host without external power possible. [1] https://github.com/android-linux-stable/msm-3.18/blob/kernel.lnx.3.18.r34-rel/drivers/power/qpnp-smbcharger.c [2] https://lore.kernel.org/linux-usb/20200805061744.20404-1-mike.looijmans@xxxxxxxx/ Yassine Oudjana (8): dt-bindings: power: supply: Add DT schema for Qualcomm SMBCHG arm64: dts: qcom: pmi8994: Add SMBCHG arm64: dts: qcom: pmi8996: Add SMBCHG arm64: dts: qcom: msm8996-xiaomi-*: Add battery data arm64: dts: qcom: msm8996-xiaomi-*: Enable SMBCHG soc: qcom: Add PMIC secure register write helpers util_macros.h: Add macro to find closest smaller value in array power: supply: Add driver for Qualcomm SMBCHG .../bindings/power/supply/qcom,smbchg.yaml | 205 ++ MAINTAINERS | 16 + .../boot/dts/qcom/msm8996-xiaomi-common.dtsi | 15 + .../boot/dts/qcom/msm8996-xiaomi-gemini.dts | 5 + .../boot/dts/qcom/msm8996-xiaomi-natrium.dts | 5 + .../boot/dts/qcom/msm8996-xiaomi-scorpio.dts | 5 + arch/arm64/boot/dts/qcom/pmi8994.dtsi | 72 + arch/arm64/boot/dts/qcom/pmi8996.dtsi | 4 + drivers/power/supply/Kconfig | 11 + drivers/power/supply/Makefile | 1 + drivers/power/supply/qcom-smbchg.c | 1664 +++++++++++++++++ drivers/power/supply/qcom-smbchg.h | 428 +++++ drivers/soc/qcom/Kconfig | 4 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/pmic-sec-write.c | 82 + include/linux/util_macros.h | 22 + include/soc/qcom/pmic-sec-write.h | 9 + 17 files changed, 2549 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/qcom,smbchg.yaml create mode 100644 drivers/power/supply/qcom-smbchg.c create mode 100644 drivers/power/supply/qcom-smbchg.h create mode 100644 drivers/soc/qcom/pmic-sec-write.c create mode 100644 include/soc/qcom/pmic-sec-write.h -- 2.37.1