power_supply: Add new LED trigger charging-blink-solid-full
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / power_supply.h
index 7d7325685c421a8b7da8746ea47583396bb61b8c..20f23fef63cce918eeed46b40e767f6f4bb35881 100644 (file)
@@ -173,6 +173,8 @@ struct power_supply {
        char *full_trig_name;
        struct led_trigger *online_trig;
        char *online_trig_name;
+       struct led_trigger *charging_blink_full_solid_trig;
+       char *charging_blink_full_solid_trig_name;
 #endif
 };
 
@@ -213,4 +215,48 @@ extern void power_supply_unregister(struct power_supply *psy);
 /* For APM emulation, think legacy userspace. */
 extern struct class *power_supply_class;
 
+static inline bool power_supply_is_amp_property(enum power_supply_property psp)
+{
+       switch (psp) {
+       case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
+       case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
+       case POWER_SUPPLY_PROP_CHARGE_FULL:
+       case POWER_SUPPLY_PROP_CHARGE_EMPTY:
+       case POWER_SUPPLY_PROP_CHARGE_NOW:
+       case POWER_SUPPLY_PROP_CHARGE_AVG:
+       case POWER_SUPPLY_PROP_CHARGE_COUNTER:
+       case POWER_SUPPLY_PROP_CURRENT_MAX:
+       case POWER_SUPPLY_PROP_CURRENT_NOW:
+       case POWER_SUPPLY_PROP_CURRENT_AVG:
+               return 1;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+static inline bool power_supply_is_watt_property(enum power_supply_property psp)
+{
+       switch (psp) {
+       case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
+       case POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN:
+       case POWER_SUPPLY_PROP_ENERGY_FULL:
+       case POWER_SUPPLY_PROP_ENERGY_EMPTY:
+       case POWER_SUPPLY_PROP_ENERGY_NOW:
+       case POWER_SUPPLY_PROP_ENERGY_AVG:
+       case POWER_SUPPLY_PROP_VOLTAGE_MAX:
+       case POWER_SUPPLY_PROP_VOLTAGE_MIN:
+       case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
+       case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN:
+       case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+       case POWER_SUPPLY_PROP_VOLTAGE_AVG:
+               return 1;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
 #endif /* __LINUX_POWER_SUPPLY_H__ */