ab8500_btemp: Fix crazy tabbing implementation
Simple patch to rectify incorrect tabbing. Also adds some coding style clean-ups to make it easier to read. Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
f6271b4fb1
commit
43dc4470e3
@ -182,7 +182,7 @@ static struct batres_vs_temp temp_to_batres_tbl_9100[] = {
|
||||
};
|
||||
|
||||
static struct abx500_battery_type bat_type_thermistor[] = {
|
||||
[BATTERY_UNKNOWN] = {
|
||||
[BATTERY_UNKNOWN] = {
|
||||
/* First element always represent the UNKNOWN battery */
|
||||
.name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN,
|
||||
.resis_high = 0,
|
||||
@ -209,8 +209,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
|
||||
.v_to_cap_tbl = cap_tbl,
|
||||
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
|
||||
.batres_tbl = temp_to_batres_tbl_thermistor,
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
.name = POWER_SUPPLY_TECHNOLOGY_LIPO,
|
||||
.resis_high = 53407,
|
||||
.resis_low = 12500,
|
||||
@ -237,8 +237,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
|
||||
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
|
||||
.batres_tbl = temp_to_batres_tbl_thermistor,
|
||||
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
.name = POWER_SUPPLY_TECHNOLOGY_LIPO,
|
||||
.resis_high = 200000,
|
||||
.resis_low = 82869,
|
||||
@ -264,11 +264,11 @@ static struct abx500_battery_type bat_type_thermistor[] = {
|
||||
.v_to_cap_tbl = cap_tbl_B_thermistor,
|
||||
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
|
||||
.batres_tbl = temp_to_batres_tbl_thermistor,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static struct abx500_battery_type bat_type_ext_thermistor[] = {
|
||||
[BATTERY_UNKNOWN] = {
|
||||
[BATTERY_UNKNOWN] = {
|
||||
/* First element always represent the UNKNOWN battery */
|
||||
.name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN,
|
||||
.resis_high = 0,
|
||||
@ -295,13 +295,13 @@ static struct abx500_battery_type bat_type_ext_thermistor[] = {
|
||||
.v_to_cap_tbl = cap_tbl,
|
||||
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
|
||||
.batres_tbl = temp_to_batres_tbl_thermistor,
|
||||
},
|
||||
},
|
||||
/*
|
||||
* These are the batteries that doesn't have an internal NTC resistor to measure
|
||||
* its temperature. The temperature in this case is measure with a NTC placed
|
||||
* near the battery but on the PCB.
|
||||
*/
|
||||
{
|
||||
{
|
||||
.name = POWER_SUPPLY_TECHNOLOGY_LIPO,
|
||||
.resis_high = 76000,
|
||||
.resis_low = 53000,
|
||||
@ -327,8 +327,8 @@ static struct abx500_battery_type bat_type_ext_thermistor[] = {
|
||||
.v_to_cap_tbl = cap_tbl,
|
||||
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
|
||||
.batres_tbl = temp_to_batres_tbl_thermistor,
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
.name = POWER_SUPPLY_TECHNOLOGY_LION,
|
||||
.resis_high = 30000,
|
||||
.resis_low = 10000,
|
||||
@ -354,8 +354,8 @@ static struct abx500_battery_type bat_type_ext_thermistor[] = {
|
||||
.v_to_cap_tbl = cap_tbl,
|
||||
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
|
||||
.batres_tbl = temp_to_batres_tbl_thermistor,
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
.name = POWER_SUPPLY_TECHNOLOGY_LION,
|
||||
.resis_high = 95000,
|
||||
.resis_low = 76001,
|
||||
@ -381,7 +381,7 @@ static struct abx500_battery_type bat_type_ext_thermistor[] = {
|
||||
.v_to_cap_tbl = cap_tbl,
|
||||
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
|
||||
.batres_tbl = temp_to_batres_tbl_thermistor,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static const struct abx500_bm_capacity_levels cap_levels = {
|
||||
@ -452,8 +452,7 @@ struct abx500_bm_data ab8500_bm_data = {
|
||||
.fg_params = &fg,
|
||||
};
|
||||
|
||||
int __devinit
|
||||
bmdevs_of_probe(struct device *dev,
|
||||
int __devinit bmdevs_of_probe(struct device *dev,
|
||||
struct device_node *np,
|
||||
struct abx500_bm_data **battery)
|
||||
{
|
||||
@ -471,8 +470,8 @@ bmdevs_of_probe(struct device *dev,
|
||||
dev_err(dev, "missing property battery\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (of_property_read_bool(np_bat_supply,
|
||||
"thermistor-on-batctrl"))
|
||||
|
||||
if (of_property_read_bool(np_bat_supply, "thermistor-on-batctrl"))
|
||||
thermistor = NTC_INTERNAL;
|
||||
else
|
||||
thermistor = NTC_EXTERNAL;
|
||||
@ -483,8 +482,8 @@ bmdevs_of_probe(struct device *dev,
|
||||
bat->bat_type = bat_type_ext_thermistor;
|
||||
bat->adc_therm = ABx500_ADC_THERM_BATTEMP;
|
||||
}
|
||||
btech = of_get_property(np_bat_supply,
|
||||
"stericsson,battery-type", NULL);
|
||||
|
||||
btech = of_get_property(np_bat_supply, "stericsson,battery-type", NULL);
|
||||
if (!btech) {
|
||||
dev_warn(dev, "missing property battery-name/type\n");
|
||||
return -EINVAL;
|
||||
@ -498,6 +497,7 @@ bmdevs_of_probe(struct device *dev,
|
||||
bat->bat_type[BATTERY_UNKNOWN].normal_cur_lvl = 520;
|
||||
bat->bat_type[BATTERY_UNKNOWN].normal_vol_lvl = 4200;
|
||||
}
|
||||
|
||||
/* select the battery resolution table */
|
||||
for (i = 0; i < bat->n_btypes; ++i) {
|
||||
btype = (bat->bat_type + i);
|
||||
@ -513,5 +513,6 @@ bmdevs_of_probe(struct device *dev,
|
||||
}
|
||||
}
|
||||
of_node_put(np_bat_supply);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user