Commit e7a5f6d5 authored by Philip Rakity's avatar Philip Rakity Committed by Anton Vorontsov

max8925_power: Enable power change notifications

The power core infrastructure allow external power change
events to be passed to drivers what are listed in the
supplied_to call back field.  Enable this feature by
allowing the supplied_to field to be passed to the driver.

This feature will enable drivers named in the supplied_to
field that have a external_power_changed callback to be
notified when power was been turned on or off.
Signed-off-by: default avatarPhilip Rakity <prakity@marvell.com>
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent 72af5a4b
...@@ -441,6 +441,8 @@ static __devinit int max8925_power_probe(struct platform_device *pdev) ...@@ -441,6 +441,8 @@ static __devinit int max8925_power_probe(struct platform_device *pdev)
info->ac.properties = max8925_ac_props; info->ac.properties = max8925_ac_props;
info->ac.num_properties = ARRAY_SIZE(max8925_ac_props); info->ac.num_properties = ARRAY_SIZE(max8925_ac_props);
info->ac.get_property = max8925_ac_get_prop; info->ac.get_property = max8925_ac_get_prop;
info->ac.supplied_to = pdata->supplied_to;
info->ac.num_supplicants = pdata->num_supplicants;
ret = power_supply_register(&pdev->dev, &info->ac); ret = power_supply_register(&pdev->dev, &info->ac);
if (ret) if (ret)
goto out; goto out;
...@@ -451,6 +453,9 @@ static __devinit int max8925_power_probe(struct platform_device *pdev) ...@@ -451,6 +453,9 @@ static __devinit int max8925_power_probe(struct platform_device *pdev)
info->usb.properties = max8925_usb_props; info->usb.properties = max8925_usb_props;
info->usb.num_properties = ARRAY_SIZE(max8925_usb_props); info->usb.num_properties = ARRAY_SIZE(max8925_usb_props);
info->usb.get_property = max8925_usb_get_prop; info->usb.get_property = max8925_usb_get_prop;
info->usb.supplied_to = pdata->supplied_to;
info->usb.num_supplicants = pdata->num_supplicants;
ret = power_supply_register(&pdev->dev, &info->usb); ret = power_supply_register(&pdev->dev, &info->usb);
if (ret) if (ret)
goto out_usb; goto out_usb;
......
...@@ -222,6 +222,8 @@ struct max8925_power_pdata { ...@@ -222,6 +222,8 @@ struct max8925_power_pdata {
unsigned fast_charge:3; /* charge current */ unsigned fast_charge:3; /* charge current */
unsigned no_temp_support:1; /* set if no temperature detect */ unsigned no_temp_support:1; /* set if no temperature detect */
unsigned no_insert_detect:1; /* set if no ac insert detect */ unsigned no_insert_detect:1; /* set if no ac insert detect */
char **supplied_to;
int num_supplicants;
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment