Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da167e08 authored by Jishnu Prakash's avatar Jishnu Prakash
Browse files

power: supply: qcom: Add support to make SMB5 charger GKI compliant



SMB5 charger drivers and their helper files use several power supply
properties on msm-4.19 which cannot be supported on msm-5.4 due to the
need for GKI compliance. Add support for main charger to register
as an IIO device with individual channels under it corresponding to
missing power supply properties from msm-4.19.

Change-Id: I7182160258fa2ebd4af36b0531b11d988cffdbd3
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent 2e61611b
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
# SPDX-License-Identifier: GPL-2.0-only


menuconfig QCOM_POWER_SUPPLY
menuconfig QCOM_POWER_SUPPLY
	tristate "Support for Qualcomm Technologies, Inc. power supply"
	bool "Support for Qualcomm Technologies, Inc. power supply"
	depends on ARCH_QCOM
	depends on ARCH_QCOM


if QCOM_POWER_SUPPLY
if QCOM_POWER_SUPPLY
@@ -17,17 +17,20 @@ config QPNP_QG


config QPNP_SMB5
config QPNP_SMB5
	tristate "SMB5 Battery Charger"
	tristate "SMB5 Battery Charger"
	depends on MFD_SPMI_PMIC
	depends on MFD_SPMI_PMIC && IIO
	help
	help
	  Say Y to enables support for the SMB5 charging peripheral.
	  Say Y to enables support for the SMB5 charging peripheral.
	  The QPNP SMB5 charger driver supports the charger peripheral
	  The QPNP SMB5 charger driver supports the charger peripheral
	  present in the chip.
	  present in the chip.
	  The power supply framework is used to communicate battery and
	  The power supply and iio frameworks are used to communicate battery
	  usb properties to userspace and other driver consumers such
	  and usb properties to userspace and other driver consumers such
	  as fuel gauge, USB, and USB-PD.
	  as fuel gauge, USB, and USB-PD.
	  VBUS and VCONN regulators are registered for supporting OTG,
	  VBUS and VCONN regulators are registered for supporting OTG,
	  and powered Type-C cables respectively.
	  and powered Type-C cables respectively.


	  To compile this driver as a module, choose M here: the
	  module will be called qpnp-smb5-main.

config SMB1398_CHARGER
config SMB1398_CHARGER
	tristate "SMB1398 power supply framework based driver"
	tristate "SMB1398 power supply framework based driver"
	depends on MFD_I2C_PMIC
	depends on MFD_I2C_PMIC
+2 −1
Original line number Original line Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
# SPDX-License-Identifier: GPL-2.0-only


obj-$(CONFIG_QPNP_SMB5) += qpnp-smb5-main.o
qpnp-smb5-main-y += step-chg-jeita.o battery.o qpnp-smb5.o smb5-lib.o pmic-voter.o storm-watch.o schgm-flash.o battery-profile-loader.o smb5-iio.o
obj-$(CONFIG_QPNP_QG)	+= qpnp-qg.o battery-profile-loader.o pmic-voter.o qg-util.o qg-soc.o qg-sdam.o qg-battery-profile.o qg-profile-lib.o fg-alg.o
obj-$(CONFIG_QPNP_QG)	+= qpnp-qg.o battery-profile-loader.o pmic-voter.o qg-util.o qg-soc.o qg-sdam.o qg-battery-profile.o qg-profile-lib.o fg-alg.o
obj-$(CONFIG_QPNP_SMB5)	+= step-chg-jeita.o battery.o qpnp-smb5.o smb5-lib.o pmic-voter.o storm-watch.o schgm-flash.o
obj-$(CONFIG_SMB1398_CHARGER)		+= smb1398-charger.o pmic-voter.o
obj-$(CONFIG_SMB1398_CHARGER)		+= smb1398-charger.o pmic-voter.o
obj-$(CONFIG_SMB1355_SLAVE_CHARGER)	+= smb1355-charger.o pmic-voter.o
obj-$(CONFIG_SMB1355_SLAVE_CHARGER)	+= smb1355-charger.o pmic-voter.o
+336 −240

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Original line Diff line number Diff line
@@ -12,8 +12,10 @@ struct charger_param {
	u32 hvdcp2_max_icl_ua;
	u32 hvdcp2_max_icl_ua;
	u32 hvdcp3_max_icl_ua;
	u32 hvdcp3_max_icl_ua;
	u32 forced_main_fcc;
	u32 forced_main_fcc;
	int (*iio_read)(struct device *dev, int iio_chan, int *val);
	int (*iio_write)(struct device *dev, int iio_chan, int val);
};
};


int qcom_batt_init(struct charger_param *param);
int qcom_batt_init(struct device *dev, struct charger_param *param);
void qcom_batt_deinit(void);
void qcom_batt_deinit(void);
#endif /* __BATTERY_H */
#endif /* __BATTERY_H */
+300 −828

File changed.

Preview size limit exceeded, changes collapsed.

Loading