diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/hwmon/gl520sm.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/hwmon/gl520sm.c')
-rw-r--r-- | drivers/hwmon/gl520sm.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c index 19616f2242b0..ec588026f0a9 100644 --- a/drivers/hwmon/gl520sm.c +++ b/drivers/hwmon/gl520sm.c | |||
@@ -41,9 +41,6 @@ MODULE_PARM_DESC(extra_sensor_type, "Type of extra sensor (0=autodetect, 1=tempe | |||
41 | /* Addresses to scan */ | 41 | /* Addresses to scan */ |
42 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 42 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
43 | 43 | ||
44 | /* Insmod parameters */ | ||
45 | I2C_CLIENT_INSMOD_1(gl520sm); | ||
46 | |||
47 | /* Many GL520 constants specified below | 44 | /* Many GL520 constants specified below |
48 | One of the inputs can be configured as either temp or voltage. | 45 | One of the inputs can be configured as either temp or voltage. |
49 | That's why _TEMP2 and _IN4 access the same register | 46 | That's why _TEMP2 and _IN4 access the same register |
@@ -81,8 +78,7 @@ static const u8 GL520_REG_TEMP_MAX_HYST[] = { 0x06, 0x18 }; | |||
81 | 78 | ||
82 | static int gl520_probe(struct i2c_client *client, | 79 | static int gl520_probe(struct i2c_client *client, |
83 | const struct i2c_device_id *id); | 80 | const struct i2c_device_id *id); |
84 | static int gl520_detect(struct i2c_client *client, int kind, | 81 | static int gl520_detect(struct i2c_client *client, struct i2c_board_info *info); |
85 | struct i2c_board_info *info); | ||
86 | static void gl520_init_client(struct i2c_client *client); | 82 | static void gl520_init_client(struct i2c_client *client); |
87 | static int gl520_remove(struct i2c_client *client); | 83 | static int gl520_remove(struct i2c_client *client); |
88 | static int gl520_read_value(struct i2c_client *client, u8 reg); | 84 | static int gl520_read_value(struct i2c_client *client, u8 reg); |
@@ -91,7 +87,7 @@ static struct gl520_data *gl520_update_device(struct device *dev); | |||
91 | 87 | ||
92 | /* Driver data */ | 88 | /* Driver data */ |
93 | static const struct i2c_device_id gl520_id[] = { | 89 | static const struct i2c_device_id gl520_id[] = { |
94 | { "gl520sm", gl520sm }, | 90 | { "gl520sm", 0 }, |
95 | { } | 91 | { } |
96 | }; | 92 | }; |
97 | MODULE_DEVICE_TABLE(i2c, gl520_id); | 93 | MODULE_DEVICE_TABLE(i2c, gl520_id); |
@@ -105,7 +101,7 @@ static struct i2c_driver gl520_driver = { | |||
105 | .remove = gl520_remove, | 101 | .remove = gl520_remove, |
106 | .id_table = gl520_id, | 102 | .id_table = gl520_id, |
107 | .detect = gl520_detect, | 103 | .detect = gl520_detect, |
108 | .address_data = &addr_data, | 104 | .address_list = normal_i2c, |
109 | }; | 105 | }; |
110 | 106 | ||
111 | /* Client data */ | 107 | /* Client data */ |
@@ -681,8 +677,7 @@ static const struct attribute_group gl520_group_opt = { | |||
681 | */ | 677 | */ |
682 | 678 | ||
683 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 679 | /* Return 0 if detection is successful, -ENODEV otherwise */ |
684 | static int gl520_detect(struct i2c_client *client, int kind, | 680 | static int gl520_detect(struct i2c_client *client, struct i2c_board_info *info) |
685 | struct i2c_board_info *info) | ||
686 | { | 681 | { |
687 | struct i2c_adapter *adapter = client->adapter; | 682 | struct i2c_adapter *adapter = client->adapter; |
688 | 683 | ||
@@ -691,13 +686,11 @@ static int gl520_detect(struct i2c_client *client, int kind, | |||
691 | return -ENODEV; | 686 | return -ENODEV; |
692 | 687 | ||
693 | /* Determine the chip type. */ | 688 | /* Determine the chip type. */ |
694 | if (kind < 0) { | 689 | if ((gl520_read_value(client, GL520_REG_CHIP_ID) != 0x20) || |
695 | if ((gl520_read_value(client, GL520_REG_CHIP_ID) != 0x20) || | 690 | ((gl520_read_value(client, GL520_REG_REVISION) & 0x7f) != 0x00) || |
696 | ((gl520_read_value(client, GL520_REG_REVISION) & 0x7f) != 0x00) || | 691 | ((gl520_read_value(client, GL520_REG_CONF) & 0x80) != 0x00)) { |
697 | ((gl520_read_value(client, GL520_REG_CONF) & 0x80) != 0x00)) { | 692 | dev_dbg(&client->dev, "Unknown chip type, skipping\n"); |
698 | dev_dbg(&client->dev, "Unknown chip type, skipping\n"); | 693 | return -ENODEV; |
699 | return -ENODEV; | ||
700 | } | ||
701 | } | 694 | } |
702 | 695 | ||
703 | strlcpy(info->type, "gl520sm", I2C_NAME_SIZE); | 696 | strlcpy(info->type, "gl520sm", I2C_NAME_SIZE); |