aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamakrishna Pallala <ramakrishna.pallala@intel.com>2010-12-09 10:41:57 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:41:57 +0000
commit293bb4a952b36c7bd04650cbefb7fa9c1b384ed4 (patch)
tree0ba97b404cf983f61ef1ebc66e3cdbb34a48bb7f
parent6f538dea85eed5328cc88ff483b772628a23f28d (diff)
downloadmrst-s0i3-test-293bb4a952b36c7bd04650cbefb7fa9c1b384ed4.tar.gz
mrst-s0i3-test-293bb4a952b36c7bd04650cbefb7fa9c1b384ed4.tar.xz
mrst-s0i3-test-293bb4a952b36c7bd04650cbefb7fa9c1b384ed4.zip
Added Charger Type Support
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com>
-rw-r--r--drivers/power/intel_mdf_battery.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/power/intel_mdf_battery.c b/drivers/power/intel_mdf_battery.c
index d08cd035000..45f8e8ed4ac 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,
@@ -1529,6 +1530,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;
}
@@ -1573,6 +1582,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);