BigW Consortium Gitlab

Commit b1f82628 by David Frey

Remove chip id from ltc294x platform data

parent e953ce03
......@@ -45,13 +45,12 @@ enum ltc294x_reg {
LTC2943_REG_TEMPERATURE_LSB = 0x15,
};
/*enum ltc294x_id {
enum ltc294x_id {
LTC2941_ID,
LTC2942_ID,
LTC2943_ID,
LTC2944_ID,
};
*/
#define LTC2941_REG_STATUS_CHIP_ID BIT(7)
......@@ -423,16 +422,15 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
u32 prescaler_exp;
u8 status;
info = devm_kzalloc(&client->dev, sizeof(*info), GFP_KERNEL);
if (info == NULL)
return -ENOMEM;
i2c_set_clientdata(client, info);
platform_data = client->dev.platform_data;
info->id = platform_data->chip_id;
info->id = (enum ltc294x_id)id->driver_data;
info->supply.name = platform_data->name;
/* r_sense can be negative, when sense+ is connected to the battery
......@@ -491,7 +489,6 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
info->supply.property_is_writeable = ltc294x_property_is_writeable;
info->supply.external_power_changed = NULL;
INIT_DELAYED_WORK(&info->work, ltc294x_work);
ret = ltc294x_reset(info, prescaler_exp);
......@@ -501,7 +498,7 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
}
ret = power_supply_register(&client->dev, &info->supply);
if (ret < 0) {
if (ret) {
dev_err(&client->dev, "failed to register ltc2941\n");
return ret;
} else {
......
#ifndef LTC294X_PLATFORM_DATA_H
#define LTC294X_PLATFORM_DATA_H
// TODO: duplicated between .c and .h - that's bad
enum ltc294x_id {
LTC2941_ID,
LTC2942_ID,
LTC2943_ID,
LTC2944_ID,
};
struct ltc294x_platform_data
{
enum ltc294x_id chip_id;
const char *name;
int r_sense;
u32 prescaler_exp;
const char *name;
};
#endif /* LTC294X_PLATFORM_DATA_H */
......
......@@ -159,7 +159,6 @@ static struct i2c_board_info mangoh_red_pressure_devinfo = {
};
static struct ltc294x_platform_data mangoh_red_battery_gauge_platform_data = {
.chip_id = LTC2942_ID,
.r_sense = 18,
.prescaler_exp = 32,
.name = "LTC2942",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment