Skip to content

Commit ea2be6f

Browse files
Hongbo Zhangenomsg
authored andcommitted
ab8500_bmdata: Export abx500_res_to_temp tables for hwmon
This patch exports the thermistor resistance-to-temperature tables, so that the hwmon driver can access them, and also adds the corresponding table size variables. Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
1 parent 2c89940 commit ea2be6f

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

‎drivers/power/ab8500_bmdata.c‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Note that the res_to_temp table must be strictly sorted by falling resistance
1212
* values to work.
1313
*/
14-
static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
14+
const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[] = {
1515
{-5, 53407},
1616
{ 0, 48594},
1717
{ 5, 43804},
@@ -28,8 +28,12 @@ static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
2828
{60, 13437},
2929
{65, 12500},
3030
};
31+
EXPORT_SYMBOL(ab8500_temp_tbl_a_thermistor);
3132

32-
static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
33+
const int ab8500_temp_tbl_a_size = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor);
34+
EXPORT_SYMBOL(ab8500_temp_tbl_a_size);
35+
36+
const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[] = {
3337
{-5, 200000},
3438
{ 0, 159024},
3539
{ 5, 151921},
@@ -46,6 +50,10 @@ static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
4650
{60, 85461},
4751
{65, 82869},
4852
};
53+
EXPORT_SYMBOL(ab8500_temp_tbl_b_thermistor);
54+
55+
const int ab8500_temp_tbl_b_size = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor);
56+
EXPORT_SYMBOL(ab8500_temp_tbl_b_size);
4957

5058
static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
5159
{4171, 100},
@@ -230,8 +238,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
230238
.maint_b_chg_timer_h = 200,
231239
.low_high_cur_lvl = 300,
232240
.low_high_vol_lvl = 4000,
233-
.n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_a_thermistor),
234-
.r_to_t_tbl = temp_tbl_a_thermistor,
241+
.n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor),
242+
.r_to_t_tbl = ab8500_temp_tbl_a_thermistor,
235243
.n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_a_thermistor),
236244
.v_to_cap_tbl = cap_tbl_a_thermistor,
237245
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
@@ -258,8 +266,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
258266
.maint_b_chg_timer_h = 200,
259267
.low_high_cur_lvl = 300,
260268
.low_high_vol_lvl = 4000,
261-
.n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_b_thermistor),
262-
.r_to_t_tbl = temp_tbl_b_thermistor,
269+
.n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor),
270+
.r_to_t_tbl = ab8500_temp_tbl_b_thermistor,
263271
.n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_b_thermistor),
264272
.v_to_cap_tbl = cap_tbl_b_thermistor,
265273
.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),

‎include/linux/power/ab8500.h‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (C) ST-Ericsson 2013
3+
* Author: Hongbo Zhang <hongbo.zhang@linaro.com>
4+
* License terms: GNU General Public License v2
5+
*/
6+
7+
#ifndef PWR_AB8500_H
8+
#define PWR_AB8500_H
9+
10+
extern const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[];
11+
extern const int ab8500_temp_tbl_a_size;
12+
13+
extern const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[];
14+
extern const int ab8500_temp_tbl_b_size;
15+
16+
#endif /* PWR_AB8500_H */

0 commit comments

Comments
 (0)