Added charger type support from power supply class to report the type of 
Charger(DCP/SDP/CDP..)

Signed-off-by: Ramakrishna Pallala <[email protected]>
---
 drivers/power/intel_mdf_battery.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/power/intel_mdf_battery.c 
b/drivers/power/intel_mdf_battery.c
index 9142cc6..a1e88f0 100644
--- a/drivers/power/intel_mdf_battery.c
+++ b/drivers/power/intel_mdf_battery.c
@@ -492,6 +492,7 @@ static DEVICE_ATTR(emrg_charge_enable, S_IWUGO | S_IRUGO,
  * msic usb properties
  */
 static enum power_supply_property msic_usb_props[] = {
+       POWER_SUPPLY_PROP_TYPE,
        POWER_SUPPLY_PROP_CHARGE_TYPE,
        POWER_SUPPLY_PROP_PRESENT,
        POWER_SUPPLY_PROP_HEALTH,
@@ -1528,6 +1529,14 @@ static int msic_batt_do_charging(struct 
msic_power_module_info *mbi,
                mbi->usb_chrg_props.charger_type =
                                        POWER_SUPPLY_CHARGE_TYPE_FAST;
 
+       if (mbi->ch_params.chrg_type == CHRG_CDP)
+               mbi->usb.type = POWER_SUPPLY_TYPE_USB_CDP;
+       else if (mbi->ch_params.chrg_type == CHRG_DCP)
+               mbi->usb.type = POWER_SUPPLY_TYPE_USB_DCP;
+       else if (mbi->ch_params.chrg_type == CHRG_ACA)
+               mbi->usb.type = POWER_SUPPLY_TYPE_USB_ACA;
+       else
+               mbi->usb.type = POWER_SUPPLY_TYPE_USB;
        mutex_unlock(&mbi->usb_chrg_lock);
        return 0;
 }
@@ -1572,6 +1581,7 @@ static void msic_update_disconn_status(struct 
msic_power_module_info *mbi)
                                        POWER_SUPPLY_CHARGE_TYPE_NONE;
                mbi->usb_chrg_props.charger_present =
                                        MSIC_USB_CHARGER_NOT_PRESENT;
+               mbi->usb.type = POWER_SUPPLY_TYPE_USB;
        }
        mutex_unlock(&mbi->usb_chrg_lock);
 
-- 
1.7.2.3

Attachment: 0002-Added-Charger-Type-Support.patch
Description: 0002-Added-Charger-Type-Support.patch

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to