Lines Matching refs:battery

17 	struct rt5033_battery *battery = i2c_get_clientdata(client);  in rt5033_battery_get_capacity()  local
20 regmap_read(battery->regmap, RT5033_FUEL_REG_SOC_H, &msb); in rt5033_battery_get_capacity()
27 struct rt5033_battery *battery = i2c_get_clientdata(client); in rt5033_battery_get_present() local
30 regmap_read(battery->regmap, RT5033_FUEL_REG_CONFIG_L, &val); in rt5033_battery_get_present()
38 struct rt5033_battery *battery = i2c_get_clientdata(client); in rt5033_battery_get_watt_prop() local
60 regmap_read(battery->regmap, regh, &msb); in rt5033_battery_get_watt_prop()
61 regmap_read(battery->regmap, regl, &lsb); in rt5033_battery_get_watt_prop()
72 struct rt5033_battery *battery = power_supply_get_drvdata(psy); in rt5033_battery_get_property() local
78 val->intval = rt5033_battery_get_watt_prop(battery->client, in rt5033_battery_get_property()
82 val->intval = rt5033_battery_get_present(battery->client); in rt5033_battery_get_property()
85 val->intval = rt5033_battery_get_capacity(battery->client); in rt5033_battery_get_property()
120 struct rt5033_battery *battery; in rt5033_battery_probe() local
126 battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL); in rt5033_battery_probe()
127 if (!battery) in rt5033_battery_probe()
130 battery->client = client; in rt5033_battery_probe()
131 battery->regmap = devm_regmap_init_i2c(client, in rt5033_battery_probe()
133 if (IS_ERR(battery->regmap)) { in rt5033_battery_probe()
138 i2c_set_clientdata(client, battery); in rt5033_battery_probe()
139 psy_cfg.drv_data = battery; in rt5033_battery_probe()
141 battery->psy = power_supply_register(&client->dev, in rt5033_battery_probe()
143 if (IS_ERR(battery->psy)) { in rt5033_battery_probe()
145 ret = PTR_ERR(battery->psy); in rt5033_battery_probe()
154 struct rt5033_battery *battery = i2c_get_clientdata(client); in rt5033_battery_remove() local
156 power_supply_unregister(battery->psy); in rt5033_battery_remove()