Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hongbo Zhang and committed by
Anton Vorontsov
ea2be6f2 2c899407

+30 -6
+14 -6
drivers/power/ab8500_bmdata.c
··· 11 11 * Note that the res_to_temp table must be strictly sorted by falling resistance 12 12 * values to work. 13 13 */ 14 - static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = { 14 + const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[] = { 15 15 {-5, 53407}, 16 16 { 0, 48594}, 17 17 { 5, 43804}, ··· 28 28 {60, 13437}, 29 29 {65, 12500}, 30 30 }; 31 + EXPORT_SYMBOL(ab8500_temp_tbl_a_thermistor); 31 32 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[] = { 33 37 {-5, 200000}, 34 38 { 0, 159024}, 35 39 { 5, 151921}, ··· 50 46 {60, 85461}, 51 47 {65, 82869}, 52 48 }; 49 + EXPORT_SYMBOL(ab8500_temp_tbl_b_thermistor); 50 + 51 + const int ab8500_temp_tbl_b_size = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor); 52 + EXPORT_SYMBOL(ab8500_temp_tbl_b_size); 53 53 54 54 static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = { 55 55 {4171, 100}, ··· 238 230 .maint_b_chg_timer_h = 200, 239 231 .low_high_cur_lvl = 300, 240 232 .low_high_vol_lvl = 4000, 241 - .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_a_thermistor), 242 - .r_to_t_tbl = temp_tbl_a_thermistor, 233 + .n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor), 234 + .r_to_t_tbl = ab8500_temp_tbl_a_thermistor, 243 235 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_a_thermistor), 244 236 .v_to_cap_tbl = cap_tbl_a_thermistor, 245 237 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor), ··· 266 258 .maint_b_chg_timer_h = 200, 267 259 .low_high_cur_lvl = 300, 268 260 .low_high_vol_lvl = 4000, 269 - .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_b_thermistor), 270 - .r_to_t_tbl = temp_tbl_b_thermistor, 261 + .n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor), 262 + .r_to_t_tbl = ab8500_temp_tbl_b_thermistor, 271 263 .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_b_thermistor), 272 264 .v_to_cap_tbl = cap_tbl_b_thermistor, 273 265 .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+16
include/linux/power/ab8500.h
··· 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 */