summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2016-08-16 01:17:42 +0200
committerSebastian Reichel <sre@kernel.org>2016-08-16 01:17:42 +0200
commitf7c8f1de03eafae8f11818a185cebd82d1043302 (patch)
treecde8cfe13c41e252c987a0304716283c53e5e577 /drivers/power/supply
parentb732ace40a1d5ea643ee9c28116e829ae950fe8f (diff)
parent33e7664a0af6e9a516f01014f39737aaa119b6d9 (diff)
downloadop-kernel-dev-f7c8f1de03eafae8f11818a185cebd82d1043302.zip
op-kernel-dev-f7c8f1de03eafae8f11818a185cebd82d1043302.tar.gz
Merge tag 'for-v4.8-rc' into psy-next
Power Supply Fixes for 4.8 cycle
Diffstat (limited to 'drivers/power/supply')
-rw-r--r--drivers/power/supply/max17042_battery.c15
-rw-r--r--drivers/power/supply/tps65217_charger.c1
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index 9c65f13..da7a75f 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -457,13 +457,16 @@ static inline void max17042_write_model_data(struct max17042_chip *chip,
}
static inline void max17042_read_model_data(struct max17042_chip *chip,
- u8 addr, u32 *data, int size)
+ u8 addr, u16 *data, int size)
{
struct regmap *map = chip->regmap;
int i;
+ u32 tmp;
- for (i = 0; i < size; i++)
- regmap_read(map, addr + i, &data[i]);
+ for (i = 0; i < size; i++) {
+ regmap_read(map, addr + i, &tmp);
+ data[i] = (u16)tmp;
+ }
}
static inline int max17042_model_data_compare(struct max17042_chip *chip,
@@ -486,7 +489,7 @@ static int max17042_init_model(struct max17042_chip *chip)
{
int ret;
int table_size = ARRAY_SIZE(chip->pdata->config_data->cell_char_tbl);
- u32 *temp_data;
+ u16 *temp_data;
temp_data = kcalloc(table_size, sizeof(*temp_data), GFP_KERNEL);
if (!temp_data)
@@ -501,7 +504,7 @@ static int max17042_init_model(struct max17042_chip *chip)
ret = max17042_model_data_compare(
chip,
chip->pdata->config_data->cell_char_tbl,
- (u16 *)temp_data,
+ temp_data,
table_size);
max10742_lock_model(chip);
@@ -514,7 +517,7 @@ static int max17042_verify_model_lock(struct max17042_chip *chip)
{
int i;
int table_size = ARRAY_SIZE(chip->pdata->config_data->cell_char_tbl);
- u32 *temp_data;
+ u16 *temp_data;
int ret = 0;
temp_data = kcalloc(table_size, sizeof(*temp_data), GFP_KERNEL);
diff --git a/drivers/power/supply/tps65217_charger.c b/drivers/power/supply/tps65217_charger.c
index c8c4a0c..9fd019f 100644
--- a/drivers/power/supply/tps65217_charger.c
+++ b/drivers/power/supply/tps65217_charger.c
@@ -209,6 +209,7 @@ static int tps65217_charger_probe(struct platform_device *pdev)
if (!charger)
return -ENOMEM;
+ platform_set_drvdata(pdev, charger);
charger->tps = tps;
charger->dev = &pdev->dev;
OpenPOWER on IntegriCloud