summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/power/max8903_charger.c8
-rw-r--r--include/linux/power/max8903_charger.h4
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/power/max8903_charger.c b/drivers/power/max8903_charger.c
index 33ff0e37809e..19ca5fb3713a 100644
--- a/drivers/power/max8903_charger.c
+++ b/drivers/power/max8903_charger.c
@@ -40,6 +40,7 @@ static enum power_supply_property max8903_charger_props[] = {
POWER_SUPPLY_PROP_STATUS, /* Charger status output */
POWER_SUPPLY_PROP_ONLINE, /* External power source */
POWER_SUPPLY_PROP_HEALTH, /* Fault or OK */
+ POWER_SUPPLY_PROP_CAPACITY,
};
static int max8903_get_property(struct power_supply *psy,
@@ -211,9 +212,14 @@ static __devinit int max8903_probe(struct platform_device *pdev)
gpio = pdata->dcm; /* Output */
gpio_set_value(gpio, ta_in);
+ } else if (pdata->dok && gpio_is_valid(pdata->dok) &&
+ pdata->dcm_always_high) {
+ ta_in = pdata->dok; /* PULL_UPed Interrupt */
+ ta_in = gpio_get_value(gpio) ? 0 : 1;
} else {
dev_err(dev, "When DC is wired, DOK and DCM should"
- " be wired as well.\n");
+ " be wired as well."
+ " or set dcm always high\n");
ret = -EINVAL;
goto err;
}
diff --git a/include/linux/power/max8903_charger.h b/include/linux/power/max8903_charger.h
index 24f51db8a83f..ea5b6267ed14 100644
--- a/include/linux/power/max8903_charger.h
+++ b/include/linux/power/max8903_charger.h
@@ -38,6 +38,10 @@ struct max8903_pdata {
int dcm; /* Current-Limit Mode input (1: DC, 2: USB) */
int usus; /* USB Suspend Input (1: suspended) */
+ /* DCM wired to Logic High
+ Set this true when DCM pin connect to Logic high.*/
+ bool dcm_always_high;
+
/*
* DC(Adapter/TA) is wired
* When dc_valid is true,