summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Jiejing <jiejing.zhang@freescale.com>2012-02-09 17:08:32 +0800
committerZhang Jiejing <jiejing.zhang@freescale.com>2012-02-14 15:18:56 +0800
commit59444728ea3e1dae78c343c6f38531b9e09205f8 (patch)
tree53af2af6e0170bbd14f4930aef4b2473857c4763
parent69bf4d4cdb533b7c78a8ad2ada9f4aa9c519eb49 (diff)
ENGR00174121-1 power: max8903 add support for dcm always high.
add this to support MX6Q_SABRESD board hardware design. Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
-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,