13 #include <linux/kernel.h>
14 #include <linux/module.h>
56 static unsigned long collie_read_bat(
struct collie_bat *bat)
58 unsigned long value = 0;
75 static unsigned long collie_read_temp(
struct collie_bat *bat)
77 unsigned long value = 0;
115 val->
intval = collie_read_bat(bat);
130 val->
intval = collie_read_temp(bat);
142 static void collie_bat_external_power_changed(
struct power_supply *psy)
149 pr_info(
"collie_bat_gpio irq\n");
154 static void collie_bat_update(
struct collie_bat *bat)
197 collie_bat_update(&collie_bat_main);
226 .name =
"main-battery",
228 .properties = collie_bat_main_props,
229 .num_properties =
ARRAY_SIZE(collie_bat_main_props),
230 .get_property = collie_bat_get_property,
231 .external_power_changed = collie_bat_external_power_changed,
242 .adc_bat_divider = 155,
244 .bat_min = 1551 * 1000000 / 414,
248 .adc_temp_divider = 10000,
256 .name =
"backup-battery",
258 .properties = collie_bat_bu_props,
259 .num_properties =
ARRAY_SIZE(collie_bat_bu_props),
260 .get_property = collie_bat_get_property,
261 .external_power_changed = collie_bat_external_power_changed,
265 .gpio_charge_on = -1,
271 .adc_bat_divider = 155,
277 .adc_temp_divider = -1,
280 static struct gpio collie_batt_gpios[] = {
304 #define collie_bat_suspend NULL
305 #define collie_bat_resume NULL
312 if (!machine_is_collie())
328 goto err_psy_reg_main;
336 "main full", &collie_bat_main);
369 .add = collie_bat_probe,
375 static int __init collie_bat_init(
void)
380 static void __exit collie_bat_exit(
void)