15 #include <linux/module.h>
19 #include <linux/slab.h>
97 if (power->
on != res->
plu) {
106 static const int bat_init[] = {
111 static void get_bat_mfg_data(
struct nvec_power *power)
114 char buf[] = {
'\x02',
'\x00' };
117 buf[1] = bat_init[
i];
123 unsigned long event_type,
void *data)
128 int status_changed = 0;
135 if (res->
plc[0] & 1) {
138 get_bat_mfg_data(power);
143 switch ((res->
plc[0] >> 1) & 3) {
222 static int nvec_power_get_property(
struct power_supply *psy,
237 static int nvec_battery_get_property(
struct power_supply *psy,
319 static char *nvec_power_supplied_to[] = {
326 .properties = nvec_battery_props,
327 .num_properties =
ARRAY_SIZE(nvec_battery_props),
328 .get_property = nvec_battery_get_property,
334 .supplied_to = nvec_power_supplied_to,
335 .num_supplicants =
ARRAY_SIZE(nvec_power_supplied_to),
336 .properties = nvec_power_props,
337 .num_properties =
ARRAY_SIZE(nvec_power_props),
338 .get_property = nvec_power_get_property,
342 static int const bat_iter[] = {
351 char buf[] = {
'\x01',
'\x00' };
365 buf[1] = bat_iter[counter++];
388 power->
notifier.notifier_call = nvec_power_notifier;
396 power->
notifier.notifier_call = nvec_power_bat_notifier;
405 get_bat_mfg_data(power);
412 struct nvec_power *power = platform_get_drvdata(pdev);
427 .probe = nvec_power_probe,
430 .name =
"nvec-power",