ab8500: make res_to_temp tables public
PATCH v3 2/3 ab8500: make res_to_temp tables public
These NTC resistance to temperature tables should be public, so others such as ab8500 hwmon driver can look up these tables to convert NTC resistance to temperature.
--- drivers/power/ab8500_bmdata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/power/ab8500_bmdata.c +6 -2
@@ -11,7 +11,7 @@* Note that the res_to_temp table must be strictly sorted by falling resistance * values to work. */ -static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { +struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {-5 ,53407 }, {0 ,48594 }, {5 ,43804 },
@@ -29,7 +29,9 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {65, 12500}, }; -static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { +int temp_tbl_A_size =ARRAY_SIZE (temp_tbl_A_thermistor); + +struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {-5 ,200000 }, {0 ,159024 }, { 5, 151921},
@@ -47,6 +49,8 @@ static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {65, 82869}, }; +int temp_tbl_B_size =ARRAY_SIZE (temp_tbl_B_thermistor); +static struct abx500_v_to_cap cap_tbl_A_thermistor[] = { {4171 ,100 }, {4114, 95},
Signature · 7 lines
1.8.0 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 6 lines · Hongbo Zhang
These NTC resistance to temperature tables should be public, so others such as ab8500 hwmon driver can look up these tables to convert NTC resistance to temperature.
Signed-off-by Hongbo Zhang <[email protected]>---
For 1/3 and 2/3 patches:
(Do you need EXPORT_SYMBOL()? You don't use this from modules?)
Thanks.
Quoted 38 lines
drivers/power/ab8500_bmdata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/power/ab8500_bmdata.c +6
-2@@ -11,7 +11,7 @@* Note that the res_to_temp table must be strictly sorted by falling resistance * values to work. */ -static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { +struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {-5 ,53407 }, {0 ,48594 }, {5 ,43804 },@@ -29,7 +29,9 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {65, 12500}, }; -static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { +int temp_tbl_A_size =ARRAY_SIZE (temp_tbl_A_thermistor); + +struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {-5 ,200000 }, {0 ,159024 }, { 5, 151921},@@ -47,6 +49,8 @@ static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {65, 82869}, }; +int temp_tbl_B_size =ARRAY_SIZE (temp_tbl_B_thermistor); +static struct abx500_v_to_cap cap_tbl_A_thermistor[] = { {4171 ,100 }, {4114, 95},Signature · 1 line
1.8.0
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Anton Vorontsov
Quoted 4 lines · Hongbo Zhang
These NTC resistance to temperature tables should be public, so others such as ab8500 hwmon driver can look up these tables to convert NTC resistance to temperature.
Quoted 9 lines
Quoted 2 lines
Signed-off-by Hongbo Zhang <[email protected]>---
For 1/3 and 2/3 patches:
Acked-by Anton Vorontsov <[email protected]>(Do you need
EXPORT_SYMBOL()? You don't use this from modules?)
I would think so. Also, the variables should be exported through an include file.
The variable names are quite generic for global variables; we need to find something more specific/descriptive.
There is also some overlap with functionality in drivers/hwmon/ntc_thermistor.c. Wonder if it would be possible to unify the code.
Guenter
Quoted 33 lines
Thanks.
Quoted 31 lines
drivers/power/ab8500_bmdata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/power/ab8500_bmdata.c +4
-2@@ -11,7 +11,7 @@* Note that the res_to_temp table must be strictly sorted by falling resistance * values to work. */ -static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { +struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {-5 ,53407 }, {0 ,48594 }, {5 ,43804 },@@ -29,7 +29,9 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {65, 12500}, }; -static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { +int temp_tbl_A_size =ARRAY_SIZE (temp_tbl_A_thermistor); + +struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {-5 ,200000 }, {0 ,159024 }, { 5, 151921},@@ -47,6 +49,8 @@ static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {65, 82869}, };
Quoted 8 lines
Quoted 7 lines
drivers/power/ab8500_bmdata.c +2
-0+int temp_tbl_B_size =ARRAY_SIZE (temp_tbl_B_thermistor); +static struct abx500_v_to_cap cap_tbl_A_thermistor[] = { {4171 ,100 }, {4114 ,95 },Signature · 1 line
1.8.0
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Anton Vorontsov
Quoted 4 lines · Hongbo Zhang
These NTC resistance to temperature tables should be public, so others such as ab8500 hwmon driver can look up these tables to convert NTC resistance to temperature.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Hongbo Zhang <[email protected]>---
For 1/3 and 2/3 patches:
Acked-by Anton Vorontsov <[email protected]>(Do you need
EXPORT_SYMBOL()? You don't use this from modules?)
Thanks, will export them.
Quoted 34 lines
Thanks.
Quoted 31 lines
drivers/power/ab8500_bmdata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/power/ab8500_bmdata.c +4
-2@@ -11,7 +11,7 @@* Note that the res_to_temp table must be strictly sorted by falling resistance * values to work. */ -static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { +struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {-5 ,53407 }, {0 ,48594 }, {5 ,43804 },@@ -29,7 +29,9 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {65, 12500}, }; -static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { +int temp_tbl_A_size =ARRAY_SIZE (temp_tbl_A_thermistor); + +struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {-5 ,200000 }, {0 ,159024 }, { 5, 151921},@@ -47,6 +49,8 @@ static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {65, 82869}, };
Quoted 7 lines
Quoted 7 lines
drivers/power/ab8500_bmdata.c +2
-1+int temp_tbl_B_size =ARRAY_SIZE (temp_tbl_B_thermistor); +static struct abx500_v_to_cap cap_tbl_A_thermistor[] = { {4171 ,100 }, {4114 ,95 }, --1.8.0
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Guenter Roeck
Quoted 8 lines · Anton Vorontsov
Quoted 6 lines · Hongbo Zhang
These NTC resistance to temperature tables should be public, so others such as ab8500 hwmon driver can look up these tables to convert NTC resistance to temperature.
Signed-off-by Hongbo Zhang <[email protected]>---
Quoted 9 lines
Quoted 6 lines
For 1/3 and 2/3 patches:
Acked-by Anton Vorontsov <[email protected]>(Do you need
EXPORT_SYMBOL()? You don't use this from modules?)I would think so. Also, the variables should be exported through an include file.
I have these two lines in drivers/hwmon/ab8500.h, extern struct abx500_res_to_temp temp_tbl_A_thermistor[]; extern int temp_tbl_A_size;
Do you mean this?
Or do you mean we should create a public header file holding all the tables? Where to place these tables really baffled me, if the current hwmon driver is acceptable, I will talk to the ab8500_bmdata.c author to discuss how to re-arrange all the tables, that should be another patch in future if possible.
Quoted 3 lines
The variable names are quite generic for global variables; we need to find something more specific/descriptive.
I noticed this too, this original naming isn't so good, there are also other names like this.
I will rename these two tables I am using this time.
Quoted 3 lines
There is also some overlap with functionality in
drivers/hwmon/ntc_thermistor.c. Wonder if it would be possible to unify the code.
It seems not so easy to unify the code for me, if necessary and possible, that should be another dedicated patch I think.
Quoted 43 lines
Guenter
Quoted 41 lines
Thanks.
Quoted 38 lines
drivers/power/ab8500_bmdata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/power/ab8500_bmdata.c +6
-3@@ -11,7 +11,7 @@* Note that the res_to_temp table must be strictly sorted by falling resistance * values to work. */ -static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { +struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {-5 ,53407 }, {0 ,48594 }, {5 ,43804 },@@ -29,7 +29,9 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {65, 12500}, }; -static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { +int temp_tbl_A_size =ARRAY_SIZE (temp_tbl_A_thermistor); + +struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {-5 ,200000 }, {0 ,159024 }, { 5, 151921},@@ -47,6 +49,8 @@ static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {65, 82869}, }; +int temp_tbl_B_size =ARRAY_SIZE (temp_tbl_B_thermistor); +static struct abx500_v_to_cap cap_tbl_A_thermistor[] = { {4171 ,100 }, {4114, 95}, --1.8.0
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 16 lines · Hongbo Zhang
Quoted 15 lines · Guenter Roeck
Quoted 14 lines · Anton Vorontsov
Quoted 6 lines · Hongbo Zhang
These NTC resistance to temperature tables should be public, so others such as ab8500 hwmon driver can look up these tables to convert NTC resistance to temperature.
Signed-off-by Hongbo Zhang <[email protected]>---
For 1/3 and 2/3 patches:
Acked-by Anton Vorontsov <[email protected]>(Do you need
EXPORT_SYMBOL()? You don't use this from modules?)
Quoted 8 lines
Quoted 3 lines
I would think so. Also, the variables should be exported through an include file.
I have these two lines in
drivers/hwmon/ab8500.h, extern structabx500_res_to_temptemp_tbl_A_thermistor[]; extern inttemp_tbl_A_size;
Do you mean this?
Yes, but it should be declared by the exporting driver, not by the importing driver.
Quoted 1 line
Or do you mean we should create a public header file holding all the tables?
I don't see another option.
Quoted 12 lines
Where to place these tables really baffled me, if the current hwmon driver is acceptable, I will talk to the
ab8500_bmdata.cauthor to discuss how to re-arrange all the tables, that should be another patch in future if possible.Quoted 3 lines
The variable names are quite generic for global variables; we need to find something more specific/descriptive.
I noticed this too, this original naming isn't so good, there are also other names like this.
I will rename these two tables I am using this time.
Quoted 6 lines
Quoted 3 lines
There is also some overlap with functionality in
drivers/hwmon/ntc_thermistor.c. Wonder if it would be possible to unify the code.It seems not so easy to unify the code for me, if necessary and possible, that should be another dedicated patch I think.
Agreed.
Guenter
Quoted 35 lines
Quoted 35 lines
Guenter
Quoted 33 lines
Thanks.
Quoted 31 lines
drivers/power/ab8500_bmdata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/power/ab8500_bmdata.c +4
-2@@ -11,7 +11,7 @@* Note that the res_to_temp table must be strictly sorted by falling resistance * values to work. */ -static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { +struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {-5 ,53407 }, {0 ,48594 }, {5 ,43804 },@@ -29,7 +29,9 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = { {65, 12500}, }; -static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { +int temp_tbl_A_size =ARRAY_SIZE (temp_tbl_A_thermistor); + +struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {-5 ,200000 }, {0 ,159024 }, { 5, 151921},@@ -47,6 +49,8 @@ static struct abx500_res_to_temp temp_tbl_B_thermistor[] = { {65, 82869}, };
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
drivers/power/ab8500_bmdata.c +2
-1+int temp_tbl_B_size =ARRAY_SIZE (temp_tbl_B_thermistor); +static struct abx500_v_to_cap cap_tbl_A_thermistor[] = { {4171 ,100 }, {4114 ,95 }, --1.8.0
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors