xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSpreadtrum SC27XX PMICs Fuel Gauge Unit Power Supply Bindings
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunRequired properties:
4*4882a593Smuzhiyun- compatible: Should be one of the following:
5*4882a593Smuzhiyun  "sprd,sc2720-fgu",
6*4882a593Smuzhiyun  "sprd,sc2721-fgu",
7*4882a593Smuzhiyun  "sprd,sc2723-fgu",
8*4882a593Smuzhiyun  "sprd,sc2730-fgu",
9*4882a593Smuzhiyun  "sprd,sc2731-fgu".
10*4882a593Smuzhiyun- reg: The address offset of fuel gauge unit.
11*4882a593Smuzhiyun- battery-detect-gpios: GPIO for battery detection.
12*4882a593Smuzhiyun- io-channels: Specify the IIO ADC channels to get temperature and charge voltage.
13*4882a593Smuzhiyun- io-channel-names: Should be "bat-temp" or "charge-vol".
14*4882a593Smuzhiyun- nvmem-cells: A phandle to the calibration cells provided by eFuse device.
15*4882a593Smuzhiyun- nvmem-cell-names: Should be "fgu_calib".
16*4882a593Smuzhiyun- sprd,calib-resistance-micro-ohms: Specify the real resistance of coulomb counter
17*4882a593Smuzhiyun  chip in micro Ohms.
18*4882a593Smuzhiyun- monitored-battery: Phandle of battery characteristics devicetree node.
19*4882a593Smuzhiyun  See Documentation/devicetree/bindings/power/supply/battery.txt
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunExample:
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun	bat: battery {
24*4882a593Smuzhiyun		compatible = "simple-battery";
25*4882a593Smuzhiyun		charge-full-design-microamp-hours = <1900000>;
26*4882a593Smuzhiyun		constant-charge-voltage-max-microvolt = <4350000>;
27*4882a593Smuzhiyun		ocv-capacity-celsius = <20>;
28*4882a593Smuzhiyun		ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>,
29*4882a593Smuzhiyun					<4022000 85>, <3983000 80>, <3949000 75>,
30*4882a593Smuzhiyun					<3917000 70>, <3889000 65>, <3864000 60>,
31*4882a593Smuzhiyun					<3835000 55>, <3805000 50>, <3787000 45>,
32*4882a593Smuzhiyun					<3777000 40>, <3773000 35>, <3770000 30>,
33*4882a593Smuzhiyun					<3765000 25>, <3752000 20>, <3724000 15>,
34*4882a593Smuzhiyun					<3680000 10>, <3605000 5>, <3400000 0>;
35*4882a593Smuzhiyun		......
36*4882a593Smuzhiyun	};
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun	sc2731_pmic: pmic@0 {
39*4882a593Smuzhiyun		compatible = "sprd,sc2731";
40*4882a593Smuzhiyun		reg = <0>;
41*4882a593Smuzhiyun		spi-max-frequency = <26000000>;
42*4882a593Smuzhiyun		interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
43*4882a593Smuzhiyun		interrupt-controller;
44*4882a593Smuzhiyun		#interrupt-cells = <2>;
45*4882a593Smuzhiyun		#address-cells = <1>;
46*4882a593Smuzhiyun		#size-cells = <0>;
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun		fgu@a00 {
49*4882a593Smuzhiyun			compatible = "sprd,sc2731-fgu";
50*4882a593Smuzhiyun			reg = <0xa00>;
51*4882a593Smuzhiyun			battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
52*4882a593Smuzhiyun			io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
53*4882a593Smuzhiyun			io-channel-names = "bat-temp", "charge-vol";
54*4882a593Smuzhiyun			nvmem-cells = <&fgu_calib>;
55*4882a593Smuzhiyun			nvmem-cell-names = "fgu_calib";
56*4882a593Smuzhiyun			monitored-battery = <&bat>;
57*4882a593Smuzhiyun			sprd,calib-resistance-micro-ohms = <21500>;
58*4882a593Smuzhiyun		};
59*4882a593Smuzhiyun	};
60