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

Commit e0f1abeb authored by Rajanikanth H.V's avatar Rajanikanth H.V Committed by Anton Vorontsov
Browse files

ab8500: Add devicetree support for fuelgauge



- This patch adds device tree support for fuelgauge driver
- optimize bm devices platform_data usage and of_probe(...)
  Note: of_probe() routine for battery managed devices is made
  common across all bm drivers.
- test status:
  - interrupt numbers assigned differs between legacy and FDT mode.

Signed-off-by: default avatarRajanikanth H.V <rajanikanth.hv@stericsson.com>
Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
parent e9f14c18
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -24,7 +24,12 @@ ab8500-bm : : : Battery Manager
ab8500-btemp             :                      :              : Battery Temperature
ab8500-charger           :                      :              : Battery Charger
ab8500-codec             :                      :              : Audio Codec
ab8500-fg                :                      :              : Fuel Gauge
ab8500-fg                : 			: vddadc       : Fuel Gauge
			 : NCONV_ACCU           :	       : Accumulate N Sample Conversion
			 : BATT_OVV		:	       : Battery Over Voltage
			 : LOW_BAT_F		:	       : LOW threshold battery voltage
			 : CC_INT_CALIB		:	       : Coulomb Counter Internal Calibration
			 : CCEOC		:	       : Coulomb Counter End of Conversion
ab8500-gpadc             : HW_CONV_END          : vddadc       : Analogue to Digital Converter
                           SW_CONV_END          :              :
ab8500-gpio              :                      :              : GPIO Controller
+58 −0
Original line number Diff line number Diff line
=== AB8500 Fuel Gauge Driver ===

AB8500 is a mixed signal multimedia and power management
device comprising: power and energy-management-module,
wall-charger, usb-charger, audio codec, general purpose adc,
tvout, clock management and sim card interface.

Fuelgauge support is part of energy-management-modules, other
components of this module are:
main-charger, usb-combo-charger and battery-temperature-monitoring.

The properties below describes the node for fuelgauge driver.

Required Properties:
- compatible = This shall be: "stericsson,ab8500-fg"
- battery = Shall be battery specific information
	Example:
	ab8500_fg {
		compatible = "stericsson,ab8500-fg";
		battery	   = <&ab8500_battery>;
	};

dependent node:
	ab8500_battery: ab8500_battery {
	};
	This node will provide information on 'thermistor interface' and
	'battery technology type' used.

Properties of this node are:
thermistor-on-batctrl:
	A boolean value indicating thermistor interface	to battery

	Note:
	'btemp' and 'batctrl' are the pins interfaced for battery temperature
	measurement, 'btemp' signal is used when NTC(negative temperature
	coefficient) resister is interfaced external to battery whereas
	'batctrl' pin is used when NTC resister is internal to battery.

	Example:
	ab8500_battery: ab8500_battery {
		thermistor-on-batctrl;
	};
	indicates: NTC resister is internal to battery, 'batctrl' is used
		for thermal measurement.

	The absence of property 'thermal-on-batctrl' indicates
	NTC resister is external to battery and  'btemp' signal is used
	for thermal measurement.

battery-type:
	This shall be the battery manufacturing technology type,
	allowed types are:
		"UNKNOWN" "NiMH" "LION" "LIPO" "LiFe" "NiCd" "LiMn"
	Example:
	ab8500_battery: ab8500_battery {
		stericsson,battery-type = "LIPO";
	}
+11 −1
Original line number Diff line number Diff line
@@ -352,7 +352,17 @@
					vddadc-supply = <&ab8500_ldo_tvout_reg>;
				};

				ab8500-usb {
				ab8500_battery: ab8500_battery {
					stericsson,battery-type = "LIPO";
					thermistor-on-batctrl;
				};

				ab8500_fg {
					compatible = "stericsson,ab8500-fg";
					battery	   = <&ab8500_battery>;
				};

				ab8500_usb {
					compatible = "stericsson,ab8500-usb";
					interrupts = < 90 0x4
						       96 0x4
+5 −0
Original line number Diff line number Diff line
@@ -1051,8 +1051,13 @@ static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
	},
	{
		.name = "ab8500-fg",
		.of_compatible = "stericsson,ab8500-fg",
		.num_resources = ARRAY_SIZE(ab8500_fg_resources),
		.resources = ab8500_fg_resources,
#ifndef CONFIG_OF
		.platform_data = &ab8500_bm_data,
		.pdata_size = sizeof(ab8500_bm_data),
#endif
	},
	{
		.name = "ab8500-chargalg",
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
obj-$(CONFIG_BATTERY_JZ4740)	+= jz4740-battery.o
obj-$(CONFIG_BATTERY_INTEL_MID)	+= intel_mid_battery.o
obj-$(CONFIG_BATTERY_RX51)	+= rx51_battery.o
obj-$(CONFIG_AB8500_BM)		+= ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
obj-$(CONFIG_CHARGER_ISP1704)	+= isp1704_charger.o
obj-$(CONFIG_CHARGER_MAX8903)	+= max8903_charger.o
obj-$(CONFIG_CHARGER_TWL4030)	+= twl4030_charger.o
Loading