13 #include <linux/kernel.h>
14 #include <linux/device.h>
16 #include <linux/slab.h>
22 static void power_supply_update_bat_leds(
struct power_supply *psy)
25 unsigned long delay_on = 0;
26 unsigned long delay_off = 0;
46 &delay_on, &delay_off);
58 static int power_supply_create_bat_triggers(
struct power_supply *psy)
63 "%s-charging-or-full", psy->
name);
64 if (!psy->charging_full_trig_name)
65 goto charging_full_failed;
68 "%s-charging", psy->
name);
69 if (!psy->charging_trig_name)
73 if (!psy->full_trig_name)
77 "%s-charging-blink-full-solid", psy->
name);
78 if (!psy->charging_blink_full_solid_trig_name)
79 goto charging_blink_full_solid_failed;
82 &psy->charging_full_trig);
88 &psy->charging_blink_full_solid_trig);
92 charging_blink_full_solid_failed:
93 kfree(psy->full_trig_name);
95 kfree(psy->charging_trig_name);
97 kfree(psy->charging_full_trig_name);
104 static void power_supply_remove_bat_triggers(
struct power_supply *psy)
110 kfree(psy->charging_blink_full_solid_trig_name);
111 kfree(psy->full_trig_name);
112 kfree(psy->charging_trig_name);
113 kfree(psy->charging_full_trig_name);
118 static void power_supply_update_gen_leds(
struct power_supply *psy)
133 static int power_supply_create_gen_triggers(
struct power_supply *psy)
138 if (!psy->online_trig_name)
151 static void power_supply_remove_gen_triggers(
struct power_supply *psy)
154 kfree(psy->online_trig_name);
162 power_supply_update_bat_leds(psy);
164 power_supply_update_gen_leds(psy);
170 return power_supply_create_bat_triggers(psy);
171 return power_supply_create_gen_triggers(psy);
177 power_supply_remove_bat_triggers(psy);
179 power_supply_remove_gen_triggers(psy);