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

Commit ecba9013 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb358-charger: Add smb358 charger driver"

parents 15e1a206 b2c2c8c1
Loading
Loading
Loading
Loading
+71 −0
Original line number Diff line number Diff line
Summit smb358 battery charger

SMB358 is a single-cell battery charger. It can charge
the battery and power the system via the USB/AC adapter input.

The smb358 interface is via I2C bus.

Required Properties:
- compatible			Must be "qcom,smb358-charger".
- reg				The device 7-bit I2C address.
- interrupt-parent		parent of interrupt.
- interrupts			This indicates the IRQ number of the GPIO
				connected to the STAT pin.
- qcom,irq-gpio			GPIO which receives interrupts from STAT output.
- qcom,bms-psy-name		This is a string and it points to the bms
				power supply name.
- qcom,float-voltage-mv		Float Voltage in mV - the maximum voltage up to which
				the battery is charged. Supported range 3500mV to 4500mV
- qcom,vcc-i2c-supply		Power source required to power up i2c bus.
- qcom,chg-vadc			Corresponding VADC device's phandle.

Optional Properties:

- qcom,fastchg-current-max-ma	Fast Charging current in mA. Supported range is
				from 200mA to 2000mA.
- qcom,chg-valid-gpio		GPIO which indicates the charger presence.
				This GPIO is connected to the SYSOK pin.
- qcom,chg-autonomous-mode	This is a bool property and it indicates that the
				charger is configured for autonomous operation and
				does not require any software configuration.
- qcom,disable-apsd		This is a bool property which disables automatic
				power source detection (APSD). If this is set
				charger detection is done by DCIN UV irq.
- qcom,charger-disabled		This is a bool property which disables charging.
- qcom,using-pmic-therm		This property indicates thermal pin connected to pmic or smb.
- qcom,iterm-ma			Specifies the termination current to indicate end-of-charge.
				Possible values in mA - 30, 40, 60, 80, 100, 125, 150, 200.
- qcom,iterm-disabled		Disables the termination current feature. This is a bool
				property.
- qcom,recharge-mv		Recharge threshold in mV - the offset from the float-volatge
				as which the charger restarts charging. Possible
				values are 50mV to 300mV.
- qcom,recharge-disabled	Boolean value which disables the auto-recharge.
- qcom,chg-adc_tm		phandle to the corresponding VADC device to read the ADC channels.
- qcom,cold-bat-decidegc	Cold battery temperature in decidegC.
- qcom,hot-bat-decidegc		Hot battery temperature in decidegC.
- qcom,bat-present-decidegc	This is a property indicating battery present temperature, if
				higher than it, battery should exist. Default value is negative,
				if this property is 200, it stands for -200 decidegC.

Example:
	i2c@f9967000 {
		smb358-charger@1b {
			compatible = "qcom,smb358-charger";
			reg = <0x1b>;
			interrupt-parent = <&msmgpio>;
			interrupts = <17 0x0>;
			qcom,irq-gpio = <&msmgpio 17 0x00>;
			qcom,vcc-i2c-supply = <&pm8226_lvs1>;
			qcom,float-voltage-mv = <4350>;
			qcom,disable-apsd;
			qcom,fastchg-current-max-ma = <1500>;
			qcom,bms-psy-name = "bms";
			qcom,chg-vadc = <&pm8226_vadc>;
			qcom,chg-adc_tm = <&pm8226_adc_tm>;
			qcom,hot-bat-decidegc = <500>;
			qcom,cold-bat-decidegc = <0>;
			qcom,bat-present-decidegc = <200>;
		};
	};
+11 −0
Original line number Diff line number Diff line
@@ -404,6 +404,17 @@ config SMB1360_CHARGER_FG
	  The driver reports the status via the power supply framework.
	  A status change triggers an IRQ via the device STAT pin.

config SMB358_CHARGER
	tristate "SMB358 Battery Charger"
	depends on I2C
	help
	  Say Y to include support for SMB358 Battery Charger.
	  SMB358 is a single path switching mode charger capable of charging
	  the battery with 2Amps of current.
	  The driver supports charger enable/disable.
	  The driver reports the charger status via the power supply framework.
	  A charger status change triggers an IRQ via the device STAT pin.

config BQ27520_TEST_ENABLE
	bool "Enable BQ27520 Fuel Gauge Chip Test"
	depends on BATTERY_BQ27520
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ obj-$(CONFIG_SMB349_USB_CHARGER) += smb349-charger.o
obj-$(CONFIG_SMB350_CHARGER)   += smb350_charger.o
obj-$(CONFIG_SMB135X_CHARGER)   += smb135x-charger.o
obj-$(CONFIG_SMB1360_CHARGER_FG) += smb1360-charger-fg.o
obj-$(CONFIG_SMB358_CHARGER)	+= smb358-charger.o
obj-$(CONFIG_BATTERY_BQ28400)	+= bq28400_battery.o
obj-$(CONFIG_SMB137C_CHARGER)	+= smb137c-charger.o
obj-$(CONFIG_QPNP_BMS)		+= qpnp-bms.o batterydata-lib.o
+2489 −0

File added.

Preview size limit exceeded, changes collapsed.