aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongbo Zhang <hongbo.zhang@linaro.org>2013-04-03 08:18:11 -0400
committerAnton Vorontsov <anton@enomsg.org>2013-04-16 20:38:10 -0400
commitea2be6f21071b4af3b765a0f228be2bef08515e9 (patch)
tree1293fb20bdaa9a6925a5da0b92573be8b3d93910
parent2c89940786ef8c6e4dbcd2960142ce513e289f1e (diff)
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>
-rw-r--r--drivers/power/ab8500_bmdata.c20
-rw-r--r--include/linux/power/ab8500.h16
2 files changed, 30 insertions, 6 deletions
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 3cdcdcff4dd1..d29864533093 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -11,7 +11,7 @@
11 * Note that the res_to_temp table must be strictly sorted by falling resistance 11 * Note that the res_to_temp table must be strictly sorted by falling resistance
12 * values to work. 12 * values to work.
13 */ 13 */
14static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = { 14const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[] = {
15 {-5, 53407}, 15 {-5, 53407},
16 { 0, 48594}, 16 { 0, 48594},
17 { 5, 43804}, 17 { 5, 43804},
@@ -28,8 +28,12 @@ static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
28 {60, 13437}, 28 {60, 13437},
29 {65, 12500}, 29 {65, 12500},
30}; 30};
31EXPORT_SYMBOL(ab8500_temp_tbl_a_thermistor);
31 32
32static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = { 33const int ab8500_temp_tbl_a_size = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor);
34EXPORT_SYMBOL(ab8500_temp_tbl_a_size);
35
36const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[] = {
33 {-5, 200000}, 37 {-5, 200000},
34 { 0, 159024}, 38 { 0, 159024},
35 { 5, 151921}, 39 { 5, 151921},
@@ -46,6 +50,10 @@ static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
46 {60, 85461}, 50 {60, 85461},
47 {65, 82869}, 51 {65, 82869},
48}; 52};
53EXPORT_SYMBOL(ab8500_temp_tbl_b_thermistor);
54
55const int ab8500_temp_tbl_b_size = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor);
56EXPORT_SYMBOL(ab8500_temp_tbl_b_size);
49 57
50static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = { 58static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
51 {4171, 100}, 59 {4171, 100},
@@ -230,8 +238,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
230 .maint_b_chg_timer_h = 200, 238 .maint_b_chg_timer_h = 200,
231 .low_high_cur_lvl = 300, 239 .low_high_cur_lvl = 300,
232 .low_high_vol_lvl = 4000, 240 .low_high_vol_lvl = 4000,
233 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_a_thermistor), 241 .n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor),
234 .r_to_t_tbl = temp_tbl_a_thermistor, 242 .r_to_t_tbl = ab8500_temp_tbl_a_thermistor,
235 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_a_thermistor), 243 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_a_thermistor),
236 .v_to_cap_tbl = cap_tbl_a_thermistor, 244 .v_to_cap_tbl = cap_tbl_a_thermistor,
237 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 245 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
@@ -258,8 +266,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
258 .maint_b_chg_timer_h = 200, 266 .maint_b_chg_timer_h = 200,
259 .low_high_cur_lvl = 300, 267 .low_high_cur_lvl = 300,
260 .low_high_vol_lvl = 4000, 268 .low_high_vol_lvl = 4000,
261 .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_b_thermistor), 269 .n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor),
262 .r_to_t_tbl = temp_tbl_b_thermistor, 270 .r_to_t_tbl = ab8500_temp_tbl_b_thermistor,
263 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_b_thermistor), 271 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_b_thermistor),
264 .v_to_cap_tbl = cap_tbl_b_thermistor, 272 .v_to_cap_tbl = cap_tbl_b_thermistor,
265 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), 273 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
diff --git a/include/linux/power/ab8500.h b/include/linux/power/ab8500.h
new file mode 100644
index 000000000000..cdbb6c2a8c51
--- /dev/null
+++ b/include/linux/power/ab8500.h
@@ -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
10extern const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[];
11extern const int ab8500_temp_tbl_a_size;
12
13extern const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[];
14extern const int ab8500_temp_tbl_b_size;
15
16#endif /* PWR_AB8500_H */