Lines Matching refs:bat
75 static int twl4030_madc_bat_voltscale(struct twl4030_madc_battery *bat, in twl4030_madc_bat_voltscale() argument
82 if (twl4030_madc_bat_get_charging_status(bat)) in twl4030_madc_bat_voltscale()
83 calibration = bat->pdata->charging; in twl4030_madc_bat_voltscale()
85 calibration = bat->pdata->discharging; in twl4030_madc_bat_voltscale()
111 struct twl4030_madc_battery *bat = power_supply_get_drvdata(psy); in twl4030_madc_bat_get_property() local
115 if (twl4030_madc_bat_voltscale(bat, in twl4030_madc_bat_get_property()
116 twl4030_madc_bat_get_voltage(bat)) > 95) in twl4030_madc_bat_get_property()
119 if (twl4030_madc_bat_get_charging_status(bat)) in twl4030_madc_bat_get_property()
126 val->intval = twl4030_madc_bat_get_voltage(bat) * 1000; in twl4030_madc_bat_get_property()
132 val->intval = twl4030_madc_bat_get_current(bat); in twl4030_madc_bat_get_property()
139 int percent = twl4030_madc_bat_voltscale(bat, in twl4030_madc_bat_get_property()
140 twl4030_madc_bat_get_voltage(bat)); in twl4030_madc_bat_get_property()
141 val->intval = (percent * bat->pdata->capacity) / 100; in twl4030_madc_bat_get_property()
145 val->intval = twl4030_madc_bat_voltscale(bat, in twl4030_madc_bat_get_property()
146 twl4030_madc_bat_get_voltage(bat)); in twl4030_madc_bat_get_property()
149 val->intval = bat->pdata->capacity; in twl4030_madc_bat_get_property()
152 val->intval = twl4030_madc_bat_get_temp(bat); in twl4030_madc_bat_get_property()
155 int percent = twl4030_madc_bat_voltscale(bat, in twl4030_madc_bat_get_property()
156 twl4030_madc_bat_get_voltage(bat)); in twl4030_madc_bat_get_property()
158 int chg = (percent * (bat->pdata->capacity/1000))/100; in twl4030_madc_bat_get_property()
255 struct twl4030_madc_battery *bat = platform_get_drvdata(pdev); in twl4030_madc_battery_remove() local
257 power_supply_unregister(bat->psy); in twl4030_madc_battery_remove()
259 iio_channel_release(bat->channel_vbat); in twl4030_madc_battery_remove()
260 iio_channel_release(bat->channel_ichg); in twl4030_madc_battery_remove()
261 iio_channel_release(bat->channel_temp); in twl4030_madc_battery_remove()