aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorHongbo Zhang <hongbo.zhang@linaro.org>2013-04-03 08:18:10 -0400
committerAnton Vorontsov <anton@enomsg.org>2013-04-16 20:34:36 -0400
commit2c89940786ef8c6e4dbcd2960142ce513e289f1e (patch)
treeeb4d30ffd6b03b99bf8f5da49ceadd2277c15ff6 /drivers/power
parent6c1f8e02ccccd413012a64b6a15779120f27b734 (diff)
ab8500_{bmdata,fg}: Add const attributes to some data arrays
This patch adds const attributes to AB8500 power and temperature related read-only data arrays. Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/ab8500_bmdata.c20
-rw-r--r--drivers/power/ab8500_fg.c4
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 05ad9664b05d..3cdcdcff4dd1 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 struct abx500_res_to_temp temp_tbl_a_thermistor[] = { 14static const struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
15 {-5, 53407}, 15 {-5, 53407},
16 { 0, 48594}, 16 { 0, 48594},
17 { 5, 43804}, 17 { 5, 43804},
@@ -29,7 +29,7 @@ static struct abx500_res_to_temp temp_tbl_a_thermistor[] = {
29 {65, 12500}, 29 {65, 12500},
30}; 30};
31 31
32static struct abx500_res_to_temp temp_tbl_b_thermistor[] = { 32static const struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
33 {-5, 200000}, 33 {-5, 200000},
34 { 0, 159024}, 34 { 0, 159024},
35 { 5, 151921}, 35 { 5, 151921},
@@ -47,7 +47,7 @@ static struct abx500_res_to_temp temp_tbl_b_thermistor[] = {
47 {65, 82869}, 47 {65, 82869},
48}; 48};
49 49
50static struct abx500_v_to_cap cap_tbl_a_thermistor[] = { 50static const struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
51 {4171, 100}, 51 {4171, 100},
52 {4114, 95}, 52 {4114, 95},
53 {4009, 83}, 53 {4009, 83},
@@ -70,7 +70,7 @@ static struct abx500_v_to_cap cap_tbl_a_thermistor[] = {
70 {3247, 0}, 70 {3247, 0},
71}; 71};
72 72
73static struct abx500_v_to_cap cap_tbl_b_thermistor[] = { 73static const struct abx500_v_to_cap cap_tbl_b_thermistor[] = {
74 {4161, 100}, 74 {4161, 100},
75 {4124, 98}, 75 {4124, 98},
76 {4044, 90}, 76 {4044, 90},
@@ -93,7 +93,7 @@ static struct abx500_v_to_cap cap_tbl_b_thermistor[] = {
93 {3250, 0}, 93 {3250, 0},
94}; 94};
95 95
96static struct abx500_v_to_cap cap_tbl[] = { 96static const struct abx500_v_to_cap cap_tbl[] = {
97 {4186, 100}, 97 {4186, 100},
98 {4163, 99}, 98 {4163, 99},
99 {4114, 95}, 99 {4114, 95},
@@ -124,7 +124,7 @@ static struct abx500_v_to_cap cap_tbl[] = {
124 * Note that the res_to_temp table must be strictly sorted by falling 124 * Note that the res_to_temp table must be strictly sorted by falling
125 * resistance values to work. 125 * resistance values to work.
126 */ 126 */
127static struct abx500_res_to_temp temp_tbl[] = { 127static const struct abx500_res_to_temp temp_tbl[] = {
128 {-5, 214834}, 128 {-5, 214834},
129 { 0, 162943}, 129 { 0, 162943},
130 { 5, 124820}, 130 { 5, 124820},
@@ -146,7 +146,7 @@ static struct abx500_res_to_temp temp_tbl[] = {
146 * Note that the batres_vs_temp table must be strictly sorted by falling 146 * Note that the batres_vs_temp table must be strictly sorted by falling
147 * temperature values to work. 147 * temperature values to work.
148 */ 148 */
149static struct batres_vs_temp temp_to_batres_tbl_thermistor[] = { 149static const struct batres_vs_temp temp_to_batres_tbl_thermistor[] = {
150 { 40, 120}, 150 { 40, 120},
151 { 30, 135}, 151 { 30, 135},
152 { 20, 165}, 152 { 20, 165},
@@ -160,7 +160,7 @@ static struct batres_vs_temp temp_to_batres_tbl_thermistor[] = {
160 * Note that the batres_vs_temp table must be strictly sorted by falling 160 * Note that the batres_vs_temp table must be strictly sorted by falling
161 * temperature values to work. 161 * temperature values to work.
162 */ 162 */
163static struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = { 163static const struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = {
164 { 60, 300}, 164 { 60, 300},
165 { 30, 300}, 165 { 30, 300},
166 { 20, 300}, 166 { 20, 300},
@@ -171,7 +171,7 @@ static struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = {
171}; 171};
172 172
173/* battery resistance table for LI ION 9100 battery */ 173/* battery resistance table for LI ION 9100 battery */
174static struct batres_vs_temp temp_to_batres_tbl_9100[] = { 174static const struct batres_vs_temp temp_to_batres_tbl_9100[] = {
175 { 60, 180}, 175 { 60, 180},
176 { 30, 180}, 176 { 30, 180},
177 { 20, 180}, 177 { 20, 180},
@@ -547,7 +547,7 @@ int ab8500_bm_of_probe(struct device *dev,
547 struct device_node *np, 547 struct device_node *np,
548 struct abx500_bm_data *bm) 548 struct abx500_bm_data *bm)
549{ 549{
550 struct batres_vs_temp *tmp_batres_tbl; 550 const struct batres_vs_temp *tmp_batres_tbl;
551 struct device_node *battery_node; 551 struct device_node *battery_node;
552 const char *btech; 552 const char *btech;
553 int i; 553 int i;
diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index 1601d27ce5d4..c5391f5c372d 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -863,7 +863,7 @@ static int ab8500_fg_bat_voltage(struct ab8500_fg *di)
863static int ab8500_fg_volt_to_capacity(struct ab8500_fg *di, int voltage) 863static int ab8500_fg_volt_to_capacity(struct ab8500_fg *di, int voltage)
864{ 864{
865 int i, tbl_size; 865 int i, tbl_size;
866 struct abx500_v_to_cap *tbl; 866 const struct abx500_v_to_cap *tbl;
867 int cap = 0; 867 int cap = 0;
868 868
869 tbl = di->bm->bat_type[di->bm->batt_id].v_to_cap_tbl, 869 tbl = di->bm->bat_type[di->bm->batt_id].v_to_cap_tbl,
@@ -915,7 +915,7 @@ static int ab8500_fg_uncomp_volt_to_capacity(struct ab8500_fg *di)
915static int ab8500_fg_battery_resistance(struct ab8500_fg *di) 915static int ab8500_fg_battery_resistance(struct ab8500_fg *di)
916{ 916{
917 int i, tbl_size; 917 int i, tbl_size;
918 struct batres_vs_temp *tbl; 918 const struct batres_vs_temp *tbl;
919 int resist = 0; 919 int resist = 0;
920 920
921 tbl = di->bm->bat_type[di->bm->batt_id].batres_tbl; 921 tbl = di->bm->bat_type[di->bm->batt_id].batres_tbl;