linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hongbo Zhang <hongbo.zhang@linaro.org>
To: linux@roeck-us.net, khali@linux-fr.org,
	lm-sensors@lm-sensors.org, cbou@mail.ru, dwmw2@infradead.org
Cc: linaro-kernel@lists.linaro.org,
	STEricsson_nomadik_linux@list.st.com,
	linux-kernel@vger.kernel.org,
	Hongbo Zhang <hongbo.zhang@linaro.org>
Subject: [PATCH v8 4/5] ab8500: power: export abx500_res_to_temp tables for hwmon
Date: Wed,  3 Apr 2013 20:18:11 +0800	[thread overview]
Message-ID: <1364991492-2421-5-git-send-email-hongbo.zhang@linaro.org> (raw)
In-Reply-To: <1364991492-2421-1-git-send-email-hongbo.zhang@linaro.org>

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>
---
 drivers/power/ab8500_bmdata.c | 20 ++++++++++++++------
 include/linux/power/ab8500.h  | 16 ++++++++++++++++
 2 files changed, 30 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 3cdcdcf..d298645 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},
@@ -28,8 +28,12 @@ static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
 	{60, 13437},
 	{65, 12500},
 };
+EXPORT_SYMBOL(ab8500_temp_tbl_a_thermistor);
 
-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);
+EXPORT_SYMBOL(ab8500_temp_tbl_a_size);
+
+const struct abx500_res_to_temp ab8500_temp_tbl_b_thermistor[] = {
 	{-5, 200000},
 	{ 0, 159024},
 	{ 5, 151921},
@@ -46,6 +50,10 @@ static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
 	{60,  85461},
 	{65,  82869},
 };
+EXPORT_SYMBOL(ab8500_temp_tbl_b_thermistor);
+
+const int ab8500_temp_tbl_b_size = ARRAY_SIZE(ab8500_temp_tbl_b_thermistor);
+EXPORT_SYMBOL(ab8500_temp_tbl_b_size);
 
 static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
 	{4171,	100},
@@ -230,8 +238,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 +266,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@linaro.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


  parent reply	other threads:[~2013-04-03 12:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03 12:18 [PATCH v8 0/5] Add ST-Ericsson AB8500 HWMON driver Hongbo Zhang
2013-04-03 12:18 ` [PATCH v8 1/5] ab8500_btemp: make ab8500_btemp_get* interfaces public Hongbo Zhang
2013-04-03 12:18 ` [PATCH v8 2/5] ab8500: power: eliminate CamelCase warning of some variables Hongbo Zhang
2013-04-03 12:18 ` [PATCH v8 3/5] ab8500: power: add const attributes to some data arrays Hongbo Zhang
2013-04-03 12:18 ` Hongbo Zhang [this message]
2013-04-03 16:32   ` [PATCH v8 4/5] ab8500: power: export abx500_res_to_temp tables for hwmon Guenter Roeck
2013-04-03 12:18 ` [PATCH v8 5/5] hwmon: add ST-Ericsson ABX500 hwmon driver Hongbo Zhang
2013-04-03 16:31   ` Guenter Roeck
2013-04-17  1:32     ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364991492-2421-5-git-send-email-hongbo.zhang@linaro.org \
    --to=hongbo.zhang@linaro.org \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=cbou@mail.ru \
    --cc=dwmw2@infradead.org \
    --cc=khali@linux-fr.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lm-sensors@lm-sensors.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).