@@ -674,6 +674,12 @@ void power_supply_unregister(struct power_supply *psy)
}
EXPORT_SYMBOL_GPL(power_supply_unregister);
+void *power_supply_get_drvdata(struct power_supply *psy)
+{
+ return psy->drv_data;
+}
+EXPORT_SYMBOL_GPL(power_supply_get_drvdata);
+
static int __init power_supply_class_init(void)
{
power_supply_class = class_create(THIS_MODULE, "power_supply");
@@ -209,6 +209,9 @@ struct power_supply {
/* For APM emulation, think legacy userspace. */
int use_for_apm;
+ /* Driver private data */
+ void *drv_data;
+
/* private */
struct device *dev;
struct work_struct changed_work;
@@ -285,6 +288,7 @@ extern int devm_power_supply_register_no_ws(struct device *parent,
extern void power_supply_unregister(struct power_supply *psy);
extern int power_supply_powers(struct power_supply *psy, struct device *dev);
+extern void *power_supply_get_drvdata(struct power_supply *psy);
/* For APM emulation, think legacy userspace. */
extern struct class *power_supply_class;