Lines Matching refs:psy
47 struct power_supply psy;
56 static struct gab *to_generic_bat(struct power_supply *psy)
58 return container_of(psy, struct gab, psy);
61 static void gab_ext_power_changed(struct power_supply *psy)
63 struct gab *adc_bat = to_generic_bat(psy);
143 static int gab_get_property(struct power_supply *psy,
152 adc_bat = to_generic_bat(psy);
154 dev_err(psy->dev, "no battery infos ?!\n");
213 is_plugged = power_supply_am_i_supplied(&adc_bat->psy);
224 power_supply_changed(&adc_bat->psy);
242 struct power_supply *psy;
255 psy = &adc_bat->psy;
256 psy->name = pdata->battery_info.name;
261 psy->type = POWER_SUPPLY_TYPE_BATTERY;
262 psy->get_property = gab_get_property;
263 psy->external_power_changed = gab_ext_power_changed;
270 psy->properties = kcalloc(ARRAY_SIZE(gab_props) +
272 sizeof(*psy->properties), GFP_KERNEL);
273 if (!psy->properties) {
278 memcpy(psy->properties, gab_props, sizeof(gab_props));
280 ((char *)psy->properties + sizeof(gab_props));
294 memcpy(properties + sizeof(*(psy->properties)) * index,
313 psy->num_properties = ARRAY_SIZE(gab_props) + index;
315 ret = power_supply_register(&pdev->dev, psy);
345 power_supply_unregister(psy);
352 kfree(psy->properties);
363 power_supply_unregister(&adc_bat->psy);
375 kfree(adc_bat->psy.properties);