lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1364281619-13208-5-git-send-email-hongbo.zhang@linaro.org>
Date:	Tue, 26 Mar 2013 15:06:58 +0800
From:	Hongbo Zhang <hongbo.zhang@...aro.org>
To:	linux@...ck-us.net, khali@...ux-fr.org, lm-sensors@...sensors.org,
	cbou@...l.ru, dwmw2@...radead.org
Cc:	linaro-kernel@...ts.linaro.org,
	STEricsson_nomadik_linux@...t.st.com, linus.walleij@...aro.org,
	lee.jones@...aro.org, linux-kernel@...r.kernel.org,
	Hongbo Zhang <hongbo.zhang@...aro.org>
Subject: [PATCH v6 4/5] ab8500: power: 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@...aro.org>
---
 drivers/power/ab8500_bmdata.c | 16 ++++++++++------
 include/linux/power/ab8500.h  | 16 ++++++++++++++++
 2 files changed, 26 insertions(+), 6 deletions(-)
 create mode 100644 include/linux/power/ab8500.h

diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 9c25ca8..d9f1f25 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -11,7 +11,7 @@
  * Note that the res_to_temp table must be strictly sorted by falling resistance
  * values to work.
  */
-static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
+const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[] = {
 	{-5, 53407},
 	{ 0, 48594},
 	{ 5, 43804},
@@ -29,7 +29,9 @@ static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
 	{65, 12500},
 };
 
-static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
+const int ab8500_temp_tbl_a_size = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor);
+
+const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[] = {
 	{-5, 200000},
 	{ 0, 159024},
 	{ 5, 151921},
@@ -47,6 +49,8 @@ static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
 	{65,  82869},
 };
 
+const int ab8500_temp_tbl_b_size = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor);
+
 static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
 	{4171,	100},
 	{4114,	 95},
@@ -230,8 +234,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
 	.maint_b_chg_timer_h = 200,
 	.low_high_cur_lvl = 300,
 	.low_high_vol_lvl = 4000,
-	.n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_a_thermistor),
-	.r_to_t_tbl = temp_tbl_a_thermistor,
+	.n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_a_thermistor),
+	.r_to_t_tbl = ab8500_temp_tbl_a_thermistor,
 	.n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_a_thermistor),
 	.v_to_cap_tbl = cap_tbl_a_thermistor,
 	.n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
@@ -258,8 +262,8 @@ static struct abx500_battery_type bat_type_thermistor[] = {
 	.maint_b_chg_timer_h = 200,
 	.low_high_cur_lvl = 300,
 	.low_high_vol_lvl = 4000,
-	.n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_b_thermistor),
-	.r_to_t_tbl = temp_tbl_b_thermistor,
+	.n_temp_tbl_elements = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor),
+	.r_to_t_tbl = ab8500_temp_tbl_b_thermistor,
 	.n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_b_thermistor),
 	.v_to_cap_tbl = cap_tbl_b_thermistor,
 	.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 0000000..cdbb6c2
--- /dev/null
+++ b/include/linux/power/ab8500.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) ST-Ericsson 2013
+ * Author: Hongbo Zhang <hongbo.zhang@...aro.com>
+ * License terms: GNU General Public License v2
+ */
+
+#ifndef PWR_AB8500_H
+#define PWR_AB8500_H
+
+extern const struct abx500_res_to_temp ab8500_temp_tbl_a_thermistor[];
+extern const int ab8500_temp_tbl_a_size;
+
+extern const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[];
+extern const int ab8500_temp_tbl_b_size;
+
+#endif /* PWR_AB8500_H */
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ