aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/via686a.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-03-13 19:40:39 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-04-08 00:16:40 -0400
commit088ce2ac9ebac5c74faf4d39083627875fa6f0f0 (patch)
tree4e62aa545bf3fc762ec35538799dcfc24751e769 /drivers/hwmon/via686a.c
parent236d9039480059f97dc9d3cd75e3651582b62997 (diff)
hwmon: Fix CamelCase checkpatch warnings
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/via686a.c')
-rw-r--r--drivers/hwmon/via686a.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c
index 3123b30208c5..9427e95f7903 100644
--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -125,7 +125,7 @@ static const u8 VIA686A_REG_TEMP_HYST[] = { 0x3a, 0x3e, 0x1e };
125 * (These conversions were contributed by Jonathan Teh Soon Yew 125 * (These conversions were contributed by Jonathan Teh Soon Yew
126 * <j.teh@iname.com>) 126 * <j.teh@iname.com>)
127 */ 127 */
128static inline u8 IN_TO_REG(long val, int inNum) 128static inline u8 IN_TO_REG(long val, int in_num)
129{ 129{
130 /* 130 /*
131 * To avoid floating point, we multiply constants by 10 (100 for +12V). 131 * To avoid floating point, we multiply constants by 10 (100 for +12V).
@@ -134,29 +134,29 @@ static inline u8 IN_TO_REG(long val, int inNum)
134 * by an additional 10000 (100000 for +12V): 1000 for val and 10 (100) 134 * by an additional 10000 (100000 for +12V): 1000 for val and 10 (100)
135 * for the constants. 135 * for the constants.
136 */ 136 */
137 if (inNum <= 1) 137 if (in_num <= 1)
138 return (u8) clamp_val((val * 21024 - 1205000) / 250000, 0, 255); 138 return (u8) clamp_val((val * 21024 - 1205000) / 250000, 0, 255);
139 else if (inNum == 2) 139 else if (in_num == 2)
140 return (u8) clamp_val((val * 15737 - 1205000) / 250000, 0, 255); 140 return (u8) clamp_val((val * 15737 - 1205000) / 250000, 0, 255);
141 else if (inNum == 3) 141 else if (in_num == 3)
142 return (u8) clamp_val((val * 10108 - 1205000) / 250000, 0, 255); 142 return (u8) clamp_val((val * 10108 - 1205000) / 250000, 0, 255);
143 else 143 else
144 return (u8) clamp_val((val * 41714 - 12050000) / 2500000, 0, 144 return (u8) clamp_val((val * 41714 - 12050000) / 2500000, 0,
145 255); 145 255);
146} 146}
147 147
148static inline long IN_FROM_REG(u8 val, int inNum) 148static inline long IN_FROM_REG(u8 val, int in_num)
149{ 149{
150 /* 150 /*
151 * To avoid floating point, we multiply constants by 10 (100 for +12V). 151 * To avoid floating point, we multiply constants by 10 (100 for +12V).
152 * We also multiply them by 1000 because we want 0.001V/bit for the 152 * We also multiply them by 1000 because we want 0.001V/bit for the
153 * output value. Rounding is done. 153 * output value. Rounding is done.
154 */ 154 */
155 if (inNum <= 1) 155 if (in_num <= 1)
156 return (long) ((250000 * val + 1330000 + 21024 / 2) / 21024); 156 return (long) ((250000 * val + 1330000 + 21024 / 2) / 21024);
157 else if (inNum == 2) 157 else if (in_num == 2)
158 return (long) ((250000 * val + 1330000 + 15737 / 2) / 15737); 158 return (long) ((250000 * val + 1330000 + 15737 / 2) / 15737);
159 else if (inNum == 3) 159 else if (in_num == 3)
160 return (long) ((250000 * val + 1330000 + 10108 / 2) / 10108); 160 return (long) ((250000 * val + 1330000 + 10108 / 2) / 10108);
161 else 161 else
162 return (long) ((2500000 * val + 13300000 + 41714 / 2) / 41714); 162 return (long) ((2500000 * val + 13300000 + 41714 / 2) / 41714);
@@ -210,10 +210,10 @@ static inline u8 FAN_TO_REG(long rpm, int div)
210 * VIA register values 0-255. I *10 before rounding, so we get tenth-degree 210 * VIA register values 0-255. I *10 before rounding, so we get tenth-degree
211 * precision. (I could have done all 1024 values for our 10-bit readings, 211 * precision. (I could have done all 1024 values for our 10-bit readings,
212 * but the function is very linear in the useful range (0-80 deg C), so 212 * but the function is very linear in the useful range (0-80 deg C), so
213 * we'll just use linear interpolation for 10-bit readings.) So, tempLUT 213 * we'll just use linear interpolation for 10-bit readings.) So, temp_lut
214 * is the temp at via register values 0-255: 214 * is the temp at via register values 0-255:
215 */ 215 */
216static const s16 tempLUT[] = { 216static const s16 temp_lut[] = {
217 -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519, 217 -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
218 -503, -487, -471, -456, -442, -428, -414, -400, -387, -375, 218 -503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
219 -362, -350, -339, -327, -316, -305, -295, -285, -275, -265, 219 -362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
@@ -261,7 +261,7 @@ static const s16 tempLUT[] = {
261 * - 2.525453e-04*val^3 + 1.424593e-02*val^2 + 2.148941e+00*val +7.275808e+01) 261 * - 2.525453e-04*val^3 + 1.424593e-02*val^2 + 2.148941e+00*val +7.275808e+01)
262 * Note that n=161: 262 * Note that n=161:
263 */ 263 */
264static const u8 viaLUT[] = { 264static const u8 via_lut[] = {
265 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23, 265 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23,
266 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 39, 40, 266 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 39, 40,
267 41, 43, 45, 46, 48, 49, 51, 53, 55, 57, 59, 60, 62, 64, 66, 267 41, 43, 45, 46, 48, 49, 51, 53, 55, 57, 59, 60, 62, 64, 66,
@@ -284,26 +284,26 @@ static const u8 viaLUT[] = {
284 */ 284 */
285static inline u8 TEMP_TO_REG(long val) 285static inline u8 TEMP_TO_REG(long val)
286{ 286{
287 return viaLUT[val <= -50000 ? 0 : val >= 110000 ? 160 : 287 return via_lut[val <= -50000 ? 0 : val >= 110000 ? 160 :
288 (val < 0 ? val - 500 : val + 500) / 1000 + 50]; 288 (val < 0 ? val - 500 : val + 500) / 1000 + 50];
289} 289}
290 290
291/* for 8-bit temperature hyst and over registers */ 291/* for 8-bit temperature hyst and over registers */
292#define TEMP_FROM_REG(val) ((long)tempLUT[val] * 100) 292#define TEMP_FROM_REG(val) ((long)temp_lut[val] * 100)
293 293
294/* for 10-bit temperature readings */ 294/* for 10-bit temperature readings */
295static inline long TEMP_FROM_REG10(u16 val) 295static inline long TEMP_FROM_REG10(u16 val)
296{ 296{
297 u16 eightBits = val >> 2; 297 u16 eight_bits = val >> 2;
298 u16 twoBits = val & 3; 298 u16 two_bits = val & 3;
299 299
300 /* no interpolation for these */ 300 /* no interpolation for these */
301 if (twoBits == 0 || eightBits == 255) 301 if (two_bits == 0 || eight_bits == 255)
302 return TEMP_FROM_REG(eightBits); 302 return TEMP_FROM_REG(eight_bits);
303 303
304 /* do some linear interpolation */ 304 /* do some linear interpolation */
305 return (tempLUT[eightBits] * (4 - twoBits) + 305 return (temp_lut[eight_bits] * (4 - two_bits) +
306 tempLUT[eightBits + 1] * twoBits) * 25; 306 temp_lut[eight_bits + 1] * two_bits) * 25;
307} 307}
308 308
309#define DIV_FROM_REG(val) (1 << (val)) 309#define DIV_FROM_REG(val) (1 << (val))