11
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
* GNU General Public License for more details.
14
+ *
15
+ * The ATXP1 can reside on I2C addresses 0x37 or 0x4e. The chip is
16
+ * not auto-detected by the driver and must be instantiated explicitly.
17
+ * See Documentation/i2c/instantiating-devices for more information.
14
18
*/
15
19
16
20
#include <linux/kernel.h>
38
42
#define ATXP1_VIDMASK 0x1f
39
43
#define ATXP1_GPIO1MASK 0x0f
40
44
41
- static const unsigned short normal_i2c [] = { 0x37 , 0x4e , I2C_CLIENT_END };
42
-
43
45
struct atxp1_data {
44
46
struct i2c_client * client ;
45
47
struct mutex update_lock ;
@@ -254,48 +256,6 @@ static struct attribute *atxp1_attrs[] = {
254
256
};
255
257
ATTRIBUTE_GROUPS (atxp1 );
256
258
257
- /* Return 0 if detection is successful, -ENODEV otherwise */
258
- static int atxp1_detect (struct i2c_client * new_client ,
259
- struct i2c_board_info * info )
260
- {
261
- struct i2c_adapter * adapter = new_client -> adapter ;
262
-
263
- u8 temp ;
264
-
265
- if (!i2c_check_functionality (adapter , I2C_FUNC_SMBUS_BYTE_DATA ))
266
- return - ENODEV ;
267
-
268
- /* Detect ATXP1, checking if vendor ID registers are all zero */
269
- if (!((i2c_smbus_read_byte_data (new_client , 0x3e ) == 0 ) &&
270
- (i2c_smbus_read_byte_data (new_client , 0x3f ) == 0 ) &&
271
- (i2c_smbus_read_byte_data (new_client , 0xfe ) == 0 ) &&
272
- (i2c_smbus_read_byte_data (new_client , 0xff ) == 0 )))
273
- return - ENODEV ;
274
-
275
- /*
276
- * No vendor ID, now checking if registers 0x10,0x11 (non-existent)
277
- * showing the same as register 0x00
278
- */
279
- temp = i2c_smbus_read_byte_data (new_client , 0x00 );
280
-
281
- if (!((i2c_smbus_read_byte_data (new_client , 0x10 ) == temp ) &&
282
- (i2c_smbus_read_byte_data (new_client , 0x11 ) == temp )))
283
- return - ENODEV ;
284
-
285
- /* Get VRM */
286
- temp = vid_which_vrm ();
287
-
288
- if ((temp != 90 ) && (temp != 91 )) {
289
- dev_err (& adapter -> dev , "atxp1: Not supporting VRM %d.%d\n" ,
290
- temp / 10 , temp % 10 );
291
- return - ENODEV ;
292
- }
293
-
294
- strlcpy (info -> type , "atxp1" , I2C_NAME_SIZE );
295
-
296
- return 0 ;
297
- }
298
-
299
259
static int atxp1_probe (struct i2c_client * client ,
300
260
const struct i2c_device_id * id )
301
261
{
@@ -309,6 +269,11 @@ static int atxp1_probe(struct i2c_client *client,
309
269
310
270
/* Get VRM */
311
271
data -> vrm = vid_which_vrm ();
272
+ if (data -> vrm != 90 && data -> vrm != 91 ) {
273
+ dev_err (dev , "atxp1: Not supporting VRM %d.%d\n" ,
274
+ data -> vrm / 10 , data -> vrm % 10 );
275
+ return - ENODEV ;
276
+ }
312
277
313
278
data -> client = client ;
314
279
mutex_init (& data -> update_lock );
@@ -337,8 +302,6 @@ static struct i2c_driver atxp1_driver = {
337
302
},
338
303
.probe = atxp1_probe ,
339
304
.id_table = atxp1_id ,
340
- .detect = atxp1_detect ,
341
- .address_list = normal_i2c ,
342
305
};
343
306
344
307
module_i2c_driver (atxp1_driver );
0 commit comments