Skip to contentSkip to conversation

power: max17042_battery: Add support for max77693/843 chip

PATCH New [email protected] 1 participant 2 messages Mar 31, 2015 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 power: max17042_battery: Add support for max77693/843 chip

From: Beomho Seo <[email protected]>

Max77693/843 fuelgauge is similar to max17042 fuelgauge. This patch add supports max77693/843 fuelgague use max17042_battery.c fuel gauge driver.

Cc Sebastian Reichel <[email protected]>
---
 drivers/power/Kconfig                  |    6 +++---
 drivers/power/max17042_battery.c       |    8 ++++++++
 include/linux/power/max17042_battery.h |    2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
drivers/power/Kconfig +3 -3
index 4091fb0..887f28e 100644
@@ -222,7 +222,7 @@ config BATTERY_MAX17040
 	  to operate with a single lithium cell
 
 config BATTERY_MAX17042
-	tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge"
+	tristate "Maxim MAX17042/17047/17050/77693/77843/8997/8966 Fuel Gauge"
 	depends on I2C
 	select REGMAP_I2C
 	help
@@ -230,8 +230,8 @@ config BATTERY_MAX17042
 	  in handheld and portable equipment. The MAX17042 is configured
 	  to operate with a single lithium cell. MAX8997 and MAX8966 are
 	  multi-function devices that include fuel gauages that are compatible
-	  with MAX17042. This driver also supports max17047/50 chips which are
-	  improved version of max17042.
+	  with MAX17042. This driver also supports max17047/50 and max77693/843
+	  chips which are improved version of max17042.
 
 config BATTERY_Z2
 	tristate "Z2 battery driver"
drivers/power/max17042_battery.c +8 -0
index 1db87fd..806ac2e 100644
@@ -627,6 +627,8 @@ static int max17042_get_reg_type(struct max17042_chip *chip)
 
 	switch (chip->chip_type) {
 	case MAXIM_DEVICE_TYPE_MAX17042:
+	case MAXIM_DEVICE_TYPE_MAX77693:
+	case MAXIM_DEVICE_TYPE_MAX77843:
 		reg_type = MAXIM_REG_TYPE_MAX17042;
 		break;
 	case MAXIM_DEVICE_TYPE_MAX17047:
@@ -837,6 +839,9 @@ static const struct of_device_id max17042_dt_match[] = {
 	{ .compatible = "maxim,max17042" },
 	{ .compatible = "maxim,max17047" },
 	{ .compatible = "maxim,max17050" },
+	{ .compatible = "maxim,max77693" },
+	{ .compatible = "maxim,max77843" },
+
 	{ },
 };
 MODULE_DEVICE_TABLE(of, max17042_dt_match);
@@ -846,6 +851,9 @@ static const struct i2c_device_id max17042_id[] = {
 	{ "max17042", MAXIM_DEVICE_TYPE_MAX17042 },
 	{ "max17047", MAXIM_DEVICE_TYPE_MAX17047 },
 	{ "max17050", MAXIM_DEVICE_TYPE_MAX17050 },
+	{ "max77693", MAXIM_DEVICE_TYPE_MAX77693 },
+	{ "max77843", MAXIM_DEVICE_TYPE_MAX77843 },
+
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, max17042_id);
include/linux/power/max17042_battery.h +2 -0
index 8dd7b70..72de625 100644
@@ -131,6 +131,8 @@ enum max170xx_chip_type {
 	MAXIM_DEVICE_TYPE_MAX17042,
 	MAXIM_DEVICE_TYPE_MAX17047,
 	MAXIM_DEVICE_TYPE_MAX17050,
+	MAXIM_DEVICE_TYPE_MAX77693,
+	MAXIM_DEVICE_TYPE_MAX77843,
 
 	MAXIM_DEVICE_TYPE_NUM
 };
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 3/3 power: max17042_battery: add missed blank

From: Beomho Seo <[email protected]>

This patch add missed blank line after decalations.

Cc Sebastian Reichel <[email protected]>
---
 drivers/power/max17042_battery.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/power/max17042_battery.c +2 -0
index 806ac2e..c05f1e7 100644
@@ -269,6 +269,7 @@ static inline void max17042_override_por(struct regmap *map,
 static inline void max10742_unlock_model(struct max17042_chip *chip)
 {
 	struct regmap *map = chip->regmap;
+
 	regmap_write(map, MAX17042_MLOCKReg1, MODEL_UNLOCK1);
 	regmap_write(map, MAX17042_MLOCKReg2, MODEL_UNLOCK2);
 }
@@ -286,6 +287,7 @@ static inline void max17042_write_model_data(struct max17042_chip *chip,
 {
 	struct regmap *map = chip->regmap;
 	int i;
+
 	for (i = 0; i < size; i++)
 		regmap_write(map, addr + i,
 			chip->pdata->config_data->cell_char_tbl[i]);
Signature · 1 line
1.7.9.5