diff options
Diffstat (limited to 'drivers/hwmon/g760a.c')
-rw-r--r-- | drivers/hwmon/g760a.c | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/drivers/hwmon/g760a.c b/drivers/hwmon/g760a.c index 781277ddbaa5..ebcd2698e4dc 100644 --- a/drivers/hwmon/g760a.c +++ b/drivers/hwmon/g760a.c | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | g760a - Driver for the Global Mixed-mode Technology Inc. G760A | 2 | * g760a - Driver for the Global Mixed-mode Technology Inc. G760A |
3 | fan speed PWM controller chip | 3 | * fan speed PWM controller chip |
4 | 4 | * | |
5 | Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org> | 5 | * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org> |
6 | 6 | * | |
7 | Complete datasheet is available at GMT's website: | 7 | * Complete datasheet is available at GMT's website: |
8 | http://www.gmt.com.tw/product/datasheet/EDS-760A.pdf | 8 | * http://www.gmt.com.tw/product/datasheet/EDS-760A.pdf |
9 | 9 | * | |
10 | This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
12 | the Free Software Foundation; either version 2 of the License, or | 12 | * the Free Software Foundation; either version 2 of the License, or |
13 | (at your option) any later version. | 13 | * (at your option) any later version. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
@@ -59,7 +59,8 @@ struct g760a_data { | |||
59 | u8 act_cnt; /* formula: cnt = (CLK * 30)/(rpm * P) */ | 59 | u8 act_cnt; /* formula: cnt = (CLK * 30)/(rpm * P) */ |
60 | u8 fan_sta; /* bit 0: set when actual fan speed more than 20% | 60 | u8 fan_sta; /* bit 0: set when actual fan speed more than 20% |
61 | * outside requested fan speed | 61 | * outside requested fan speed |
62 | * bit 1: set when fan speed below 1920 rpm */ | 62 | * bit 1: set when fan speed below 1920 rpm |
63 | */ | ||
63 | }; | 64 | }; |
64 | 65 | ||
65 | #define G760A_DEFAULT_CLK 32768 | 66 | #define G760A_DEFAULT_CLK 32768 |
@@ -99,7 +100,7 @@ static int g760a_write_value(struct i2c_client *client, enum g760a_regs reg, | |||
99 | return i2c_smbus_write_byte_data(client, reg, value); | 100 | return i2c_smbus_write_byte_data(client, reg, value); |
100 | } | 101 | } |
101 | 102 | ||
102 | /**************************************************************************** | 103 | /* |
103 | * sysfs attributes | 104 | * sysfs attributes |
104 | */ | 105 | */ |
105 | 106 | ||
@@ -192,7 +193,7 @@ static const struct attribute_group g760a_group = { | |||
192 | .attrs = g760a_attributes, | 193 | .attrs = g760a_attributes, |
193 | }; | 194 | }; |
194 | 195 | ||
195 | /**************************************************************************** | 196 | /* |
196 | * new-style driver model code | 197 | * new-style driver model code |
197 | */ | 198 | */ |
198 | 199 | ||
@@ -250,21 +251,8 @@ static int g760a_remove(struct i2c_client *client) | |||
250 | return 0; | 251 | return 0; |
251 | } | 252 | } |
252 | 253 | ||
253 | /* module management */ | 254 | module_i2c_driver(g760a_driver); |
254 | |||
255 | static int __init g760a_init(void) | ||
256 | { | ||
257 | return i2c_add_driver(&g760a_driver); | ||
258 | } | ||
259 | |||
260 | static void __exit g760a_exit(void) | ||
261 | { | ||
262 | i2c_del_driver(&g760a_driver); | ||
263 | } | ||
264 | 255 | ||
265 | MODULE_AUTHOR("Herbert Valerio Riedel <hvr@gnu.org>"); | 256 | MODULE_AUTHOR("Herbert Valerio Riedel <hvr@gnu.org>"); |
266 | MODULE_DESCRIPTION("GMT G760A driver"); | 257 | MODULE_DESCRIPTION("GMT G760A driver"); |
267 | MODULE_LICENSE("GPL"); | 258 | MODULE_LICENSE("GPL"); |
268 | |||
269 | module_init(g760a_init); | ||
270 | module_exit(g760a_exit); | ||