@@ -430,6 +430,21 @@ struct gpio_charger_mapping chrg_fault_mapping[] = {
},
};
+struct gpio_charger_mapping stat12_mapping[] = {
+ {
+ POWER_SUPPLY_PROP_STATUS,
+ POWER_SUPPLY_STATUS_NOT_CHARGING,
+ MAP(0x03,
+ { 0x01, POWER_SUPPLY_STATUS_CHARGING },
+ { 0x02, POWER_SUPPLY_STATUS_FULL }),
+ }, {
+ POWER_SUPPLY_PROP_HEALTH,
+ POWER_SUPPLY_HEALTH_GOOD,
+ MAP(0x03,
+ { 0x03, POWER_SUPPLY_HEALTH_DEAD }),
+ },
+};
+
static const struct gpio_charger_config ltc3651_cfg = {
MAPPING(chrg_fault_mapping),
{
@@ -440,12 +455,25 @@ static const struct gpio_charger_config ltc3651_cfg = {
},
};
+static const struct gpio_charger_config lm3658_cfg = {
+ MAPPING(stat12_mapping),
+ {
+ { "ti,stat1", 0 },
+ { "ti,stat2", 0 },
+ { NULL, 0 },
+ },
+};
+
static const struct of_device_id gpio_charger_match[] = {
{ .compatible = "gpio-charger" },
{
.compatible = "lltc,ltc3651-charger",
.data = (void *) <c3651_cfg,
},
+ {
+ .compatible = "ti,lm3658",
+ .data = (void *) &lm3658_cfg,
+ },
{ }
};
MODULE_DEVICE_TABLE(of, gpio_charger_match);
Just a proof of concept... Signed-off-by: Ladislav Michl <ladis@linux-mips.org> --- Changelog: - v2: Rebased on top of another round of cleanup patches drivers/power/supply/gpio-charger.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)