Changeset 2713
- Timestamp:
- 10/08/04 20:42:07 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/kernel/chips/pc87360.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/chips/pc87360.c
r2629 r2713 79 79 */ 80 80 81 #define REG 0x2e /* The register to read/write */82 #define VAL 0x2f /* The value to read/write */83 84 81 #define DEV 0x07 /* Register: Logical device select */ 85 82 #define DEVID 0x20 /* Register: Device ID */ … … 96 93 #define LD_TEMP 2 97 94 98 static inline void superio_outb(int reg, int val)99 { 100 outb(reg, REG);101 outb(val, VAL);102 } 103 104 static inline int superio_inb(int reg)105 { 106 outb(reg, REG);107 return inb( VAL);108 } 109 110 static inline void superio_exit( void)111 { 112 outb(0x02, REG);113 outb(0x02, VAL);95 static inline void superio_outb(int sioaddr, int reg, int val) 96 { 97 outb(reg, sioaddr); 98 outb(val, sioaddr+1); 99 } 100 101 static inline int superio_inb(int sioaddr, int reg) 102 { 103 outb(reg, sioaddr); 104 return inb(sioaddr+1); 105 } 106 107 static inline void superio_exit(int sioaddr) 108 { 109 outb(0x02, sioaddr); 110 outb(0x02, sioaddr+1); 114 111 } 115 112 … … 242 239 static void pc87360_init_client(struct i2c_client *client, int use_thermistors); 243 240 static void pc87360_update_client(struct i2c_client *client); 244 static int pc87360_find(u8 *devid, int *address);245 241 246 242 … … 476 472 } 477 473 478 static int pc87360_find( u8 *devid, int *address)474 static int pc87360_find(int sioaddr, u8 *devid, int *address) 479 475 { 480 476 u16 val; … … 485 481 486 482 /* Identify device */ 487 val = superio_inb( DEVID);483 val = superio_inb(sioaddr, DEVID); 488 484 switch (val) { 489 485 case 0xE1: /* PC87360 */ … … 497 493 break; 498 494 default: 499 superio_exit( );495 superio_exit(sioaddr); 500 496 return -ENODEV; 501 497 } … … 505 501 for (i = 0; i < nrdev; i++) { 506 502 /* select logical device */ 507 superio_outb( DEV, logdev[i]);508 509 val = superio_inb( ACT);503 superio_outb(sioaddr, DEV, logdev[i]); 504 505 val = superio_inb(sioaddr, ACT); 510 506 if (!(val & 0x01)) { 511 507 printk(KERN_INFO "pc87360.o: Device 0x%02x not " … … 514 510 } 515 511 516 val = (superio_inb( BASE) << 8)517 | superio_inb( BASE + 1);512 val = (superio_inb(sioaddr, BASE) << 8) 513 | superio_inb(sioaddr, BASE + 1); 518 514 if (!val) { 519 515 printk(KERN_INFO "pc87360.o: Base address not set for " … … 525 521 526 522 if (i==0) { /* Fans */ 527 confreg[0] = superio_inb( 0xF0);528 confreg[1] = superio_inb( 0xF1);523 confreg[0] = superio_inb(sioaddr, 0xF0); 524 confreg[1] = superio_inb(sioaddr, 0xF1); 529 525 530 526 #ifdef DEBUG … … 545 541 specific, just that we won't need them if 546 542 we don't use the VLM device */ 547 confreg[2] = superio_inb( 0x2B);548 confreg[3] = superio_inb( 0x25);543 confreg[2] = superio_inb(sioaddr, 0x2B); 544 confreg[3] = superio_inb(sioaddr, 0x25); 549 545 550 546 if (confreg[2] & 0x40) { … … 562 558 } 563 559 564 superio_exit( );560 superio_exit(sioaddr); 565 561 return 0; 566 562 } … … 1319 1315 printk(KERN_INFO "pc87360.o version %s (%s)\n", LM_VERSION, LM_DATE); 1320 1316 1321 if (pc87360_find(&devid, extra_isa)) { 1317 if (pc87360_find(0x2e, &devid, extra_isa) 1318 && pc87360_find(0x4e, &devid, extra_isa)) { 1322 1319 printk(KERN_WARNING "pc87360.o: PC8736x not detected, " 1323 1320 "module not inserted.\n");
