Changeset 505

Show
Ignore:
Timestamp:
07/22/99 00:04:34 (9 years ago)
Author:
frodo
Message:

ISA changes

* i2c-isa simplified, by using the addr field in the client structure,

instead of a new field. This means we do not need `struct isa_*'
anymore

* All clients changed to reflect the new isa code. Many are much

simplified now.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/TODO

    r504 r505  
    77* Add code and supporting files to compile modules into the main kernel 
    88* Write a mkpatch script, as in the i2c tree 
    9 * Check the i2c-isa code, use 16 bit address field in i2c struct. 
     9* Check what happens if the ISA bus is selected by a force parameter; 
     10  I think the _detect procedures are called?!? 
    1011 
    1112KERNEL MODULES 
  • lm-sensors/trunk/kernel/busses/i2c-isa.c

    r496 r505  
    2828#include <linux/kernel.h> 
    2929 
    30 #include "compat.h" 
    31  
    3230#include <linux/i2c.h> 
    33 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,19) 
    34 #include <linux/sched.h> 
    35 #else 
    36 #include <asm/semaphore.h> 
    37 #endif 
    3831 
    3932#include "version.h" 
    4033#include "i2c-isa.h" 
    4134 
    42 static int isa_master_xfer (struct isa_adapter *adap, 
    43                             struct i2c_msg msgs[], int num); 
    44 static int isa_slave_send (struct isa_adapter *adap, char *data, int len); 
    45 static int isa_slave_recv (struct isa_adapter *adap, char *data, int len); 
    46 static int isa_algo_control (struct isa_adapter *adap, unsigned int cmd, 
    47                              unsigned long arg); 
    48 static int isa_client_register (struct isa_client *client); 
    49 static int isa_client_unregister (struct isa_client *client); 
     35static void isa_inc_use (struct i2c_adapter *adapter); 
     36static void isa_dec_use (struct i2c_adapter *adapter); 
    5037 
    5138static int isa_init(void); 
     
    5845 
    5946/* This is the actual algorithm we define */ 
    60 static struct isa_algorithm isa_algorithm = { 
    61   /* name */            "ISA bus adapter", 
    62   /* id */              ALGO_ISA, 
    63   /* master_xfer */     &isa_master_xfer, 
    64   /* slave_send */      &isa_slave_send, 
    65   /* slave_rcv */       &isa_slave_recv, 
    66   /* algo_control */    &isa_algo_control, 
    67   /* client_register */ &isa_client_register, 
    68   /* client_unregister*/&isa_client_unregister 
     47static struct i2c_algorithm isa_algorithm = { 
     48  /* name */            "ISA bus algorithm", 
     49  /* id */              I2C_ALGO_ISA, 
     50  /* master_xfer */     NULL, 
     51  /* slave_send */      NULL, 
     52  /* slave_rcv */       NULL, 
     53  /* algo_control */    NULL, 
    6954}; 
    7055 
    7156/* There can only be one... */ 
    72 static struct isa_adapter isa_adapter; 
     57static struct i2c_adapter isa_adapter = { 
     58  /* name */            "ISA main adapter", 
     59  /* id */              I2C_ALGO_ISA | I2C_HW_ISA, 
     60  /* algorithm */       &isa_algorithm, 
     61  /* algo_data */       NULL, 
     62  /* inc_use */         &isa_inc_use, 
     63  /* dec_use */         &isa_dec_use, 
     64  /* data */            NULL, 
     65  /* Other fields not initialized */ 
     66}; 
    7367 
    7468/* Used in isa_init/cleanup */ 
    7569static int isa_initialized; 
    7670 
    77 /* Algorithm master_xfer call-back implementation. Can't do that... */ 
    78 int isa_master_xfer (struct isa_adapter *adap, struct i2c_msg msgs[], 
    79                      int num) 
     71void isa_inc_use (struct i2c_adapter *adapter) 
    8072{ 
    81 #ifdef DEBUG 
    82   printk("i2c-isa.o: isa_master_xfer called for adapter `%s' " 
    83          "(no i2c level access possible!)\n", 
    84          adap->name); 
     73#ifdef MODULE 
     74  MOD_INC_USE_COUNT; 
    8575#endif 
    86   return -1; 
    8776} 
    8877 
    89 /* Algorithm slave_send call-back implementation. Can't do that... */ 
    90 int isa_slave_send (struct isa_adapter *adap, char *data, int len) 
     78void isa_dec_use (struct i2c_adapter *adapter) 
    9179{ 
    92 #ifdef DEBUG 
    93   printk("i2c-isa.o: isa_slave_send called for adapter `%s' " 
    94          "(no i2c level access possible!)\n", 
    95          adap->name); 
     80#ifdef MODULE 
     81  MOD_DEC_USE_COUNT; 
    9682#endif 
    97   return -1; 
    98 } 
    99  
    100 /* Algorithm slave_recv call-back implementation. Can't do that... */ 
    101 int isa_slave_recv (struct isa_adapter *adap, char *data, int len) 
    102 { 
    103 #ifdef DEBUG 
    104   printk("i2c-isa.o: isa_slave_recv called for adapter `%s' " 
    105          "(no i2c level access possible!)\n", 
    106          adap->name); 
    107 #endif 
    108   return -1; 
    109 } 
    110  
    111 /* Here we can put additional calls to modify the workings of the algorithm. 
    112    But right now, there is no need for that. */ 
    113 int isa_algo_control (struct isa_adapter *adap, unsigned int cmd, 
    114                        unsigned long arg) 
    115 { 
    116   return 0; 
    117 } 
    118  
    119 /* Ehm... This is called when a client is registered to an adapter. We could 
    120    do all kinds of neat stuff here like, ehm - returning success? */ 
    121 int isa_client_register (struct isa_client *client) 
    122 { 
    123   return 0; 
    124 } 
    125  
    126 int isa_client_unregister (struct isa_client *client) 
    127 { 
    128   return 0; 
    12983} 
    13084 
     
    13286{ 
    13387  int res; 
    134   printk("isa.o version %s (%s)\n",LM_VERSION,LM_DATE); 
     88  printk("i2c-isa.o version %s (%s)\n",LM_VERSION,LM_DATE); 
    13589#ifdef DEBUG 
    13690  if (isa_initialized) { 
     
    14094#endif 
    14195  isa_initialized = 0; 
    142   if ((res = isa_add_algorithm(&isa_algorithm))) { 
     96  if ((res = i2c_add_algorithm(&isa_algorithm))) { 
    14397    printk("i2c-isa.o: Algorithm registration failed, module not inserted.\n"); 
    14498    isa_cleanup(); 
     
    146100  } 
    147101  isa_initialized++; 
    148   strcpy(isa_adapter.name,"ISA main adapter"); 
    149   isa_adapter.id = ALGO_ISA | ISA_MAIN; 
    150   isa_adapter.algo = &isa_algorithm; 
    151   if ((res = isa_add_adapter(&isa_adapter))) { 
     102  if ((res = i2c_add_adapter(&isa_adapter))) { 
    152103    printk("i2c-isa.o: Adapter registration failed, " 
    153104           "module isa.o is not inserted\n."); 
     
    165116  if (isa_initialized >= 2) 
    166117  { 
    167     if ((res = isa_del_adapter(&isa_adapter))) { 
     118    if ((res = i2c_del_adapter(&isa_adapter))) { 
    168119      printk("i2c-isa.o: Adapter deregistration failed, module not removed.\n"); 
    169120      return res; 
     
    173124  if (isa_initialized >= 1) 
    174125  { 
    175     if ((res = isa_del_algorithm(&isa_algorithm))) { 
     126    if ((res = i2c_del_algorithm(&isa_algorithm))) { 
    176127      printk("i2c-isa.o: Algorithm deregistration failed, module not removed.\n"); 
    177128      return res; 
  • lm-sensors/trunk/kernel/chips/adm9240.c

    r499 r505  
    272272static struct i2c_client *adm9240_list[MAX_ADM9240_NR]; 
    273273 
    274 /* The driver. I choose to use type i2c_driver, as at is identical to both 
    275    smbus_driver and isa_driver, and clients could be of either kind */ 
    276274static struct i2c_driver adm9240_driver = { 
    277275  /* name */            "ADM9240 sensor driver", 
  • lm-sensors/trunk/kernel/chips/lm78.c

    r499 r505  
    232232static struct i2c_client *lm78_list[MAX_LM78_NR]; 
    233233 
    234 /* The driver. I choose to use type i2c_driver, as at is identical to both 
    235    smbus_driver and isa_driver, and clients could be of either kind */ 
    236234static struct i2c_driver lm78_driver = { 
    237235  /* name */            "LM78(-J) and LM79 sensor driver", 
     
    345343     But it allows us to access lm78_{read,write}_value. */ 
    346344 
    347   if (! (new_client = kmalloc((is_isa?sizeof(struct isa_client): 
     345  if (! (new_client = kmalloc((is_isa?sizeof(struct i2c_client): 
    348346                                      sizeof(struct i2c_client)) +  
    349347                              sizeof(struct lm78_data), 
     
    353351  } 
    354352 
    355   if (is_isa) { 
    356     data = (struct lm78_data *) (((struct isa_client *) new_client) + 1); 
    357     new_client->addr = 0; 
    358     ((struct isa_client *) new_client)->isa_addr = address; 
     353  data = (struct lm78_data *) (((struct i2c_client *) new_client) + 1); 
     354  if (is_isa)  
    359355    init_MUTEX(&data->lock); 
    360   } else { 
    361     data = (struct lm78_data *) (((struct i2c_client *) new_client) + 1); 
    362     new_client->addr = address; 
    363   } 
     356  new_client->addr = address; 
    364357  new_client->data = data; 
    365358  new_client->adapter = adapter; 
     
    486479 
    487480  if i2c_is_isa_client(client) 
    488     release_region(((struct isa_client *)client)->isa_addr,LM78_EXTENT); 
     481    release_region(client->addr,LM78_EXTENT); 
    489482  kfree(client); 
    490483 
     
    527520  if (i2c_is_isa_client(client)) { 
    528521    down(& (((struct lm78_data *) (client->data)) -> lock)); 
    529     outb_p(reg,(((struct isa_client *) client)->isa_addr) +  
     522    outb_p(reg,client->addr +  
    530523               LM78_ADDR_REG_OFFSET); 
    531     res = inb_p((((struct isa_client *) client)->isa_addr) +  
     524    res = inb_p(client->addr +  
    532525                LM78_DATA_REG_OFFSET); 
    533526    up( & (((struct lm78_data *) (client->data)) -> lock)); 
     
    548541  if (i2c_is_isa_client(client)) { 
    549542    down(&(((struct lm78_data *) (client->data)) -> lock)); 
    550     outb_p(reg,((struct isa_client *) client)->isa_addr + LM78_ADDR_REG_OFFSET); 
    551     outb_p(value,((struct isa_client *) client)->isa_addr + LM78_DATA_REG_OFFSET); 
     543    outb_p(reg,client->addr + LM78_ADDR_REG_OFFSET); 
     544    outb_p(value,client->addr + LM78_DATA_REG_OFFSET); 
    552545    up(&(((struct lm78_data *) (client->data)) -> lock)); 
    553546    return 0; 
  • lm-sensors/trunk/kernel/chips/lm80.c

    r499 r505  
    225225static struct i2c_client *lm80_list[MAX_LM80_NR]; 
    226226 
    227 /* The driver. I choose to use type i2c_driver, as at is identical to both 
    228    smbus_driver and isa_driver, and clients could be of either kind */ 
    229227static struct i2c_driver lm80_driver = { 
    230228  /* name */            "LM80 sensor driver", 
  • lm-sensors/trunk/kernel/chips/sis5595.c

    r499 r505  
    348348     But it allows us to access sis5595_{read,write}_value. */ 
    349349 
    350   if (! (new_client = kmalloc(sizeof(struct isa_client) + 
     350  if (! (new_client = kmalloc(sizeof(struct i2c_client) + 
    351351                              sizeof(struct sis5595_data), 
    352352                              GFP_KERNEL))) { 
     
    355355  } 
    356356 
    357   data = (struct sis5595_data *) (((struct isa_client *) new_client) + 1); 
    358   new_client->addr = 0; 
    359   ((struct isa_client *) new_client)->isa_addr = address; 
     357  data = (struct sis5595_data *) (new_client + 1); 
     358  new_client->addr = address; 
    360359  init_MUTEX(&data->lock); 
    361360  new_client->data = data; 
     
    458457  sis5595_list[i] = NULL; 
    459458 
    460   release_region(((struct isa_client *)client)->isa_addr,SIS5595_EXTENT); 
     459  release_region(client->addr,SIS5595_EXTENT); 
    461460  kfree(client); 
    462461 
     
    496495    down((struct semaphore *) (client->data)); 
    497496    down(& (((struct sis5595_data *) (client->data)) -> lock)); 
    498     outb_p(reg,(((struct isa_client *) client)->isa_addr) +  
    499                SIS5595_ADDR_REG_OFFSET); 
    500     res = inb_p((((struct isa_client *) client)->isa_addr) +  
    501                 SIS5595_DATA_REG_OFFSET); 
     497    outb_p(reg,client->addr + SIS5595_ADDR_REG_OFFSET); 
     498    res = inb_p(client->addr + SIS5595_DATA_REG_OFFSET); 
    502499    up( & (((struct sis5595_data *) (client->data)) -> lock)); 
    503500    return res; 
     
    510507{ 
    511508    down(& (((struct sis5595_data *) (client->data)) -> lock)); 
    512     outb_p(reg,((struct isa_client *) client)->isa_addr + SIS5595_ADDR_REG_OFFSET); 
    513     outb_p(value,((struct isa_client *) client)->isa_addr + SIS5595_DATA_REG_OFFSET); 
     509    outb_p(reg,client->addr + SIS5595_ADDR_REG_OFFSET); 
     510    outb_p(value,client->addr + SIS5595_DATA_REG_OFFSET); 
    514511    up( & (((struct sis5595_data *) (client->data)) -> lock)); 
    515512    return 0; 
  • lm-sensors/trunk/kernel/chips/w83781d.c

    r499 r505  
    398398static struct i2c_client *w83781d_list[MAX_W83781D_NR]; 
    399399 
    400 /* The driver. I choose to use type i2c_driver, as at is identical to both 
    401    smbus_driver and isa_driver, and clients could be of either kind */ 
    402400static struct i2c_driver w83781d_driver = { 
    403401  /* name */            "W83781D sensor driver", 
     
    677675     But it allows us to access w83781d_{read,write}_value. */ 
    678676 
    679   if (! (new_client = kmalloc((is_isa?sizeof(struct isa_client): 
    680                                       sizeof(struct i2c_client)) + 
     677  if (! (new_client = kmalloc(sizeof(struct i2c_client) + 
    681678                              sizeof(struct w83781d_data), 
    682679                              GFP_KERNEL))) { 
     
    685682  } 
    686683 
    687   if (is_isa) { 
    688     data = (struct w83781d_data *) (((struct isa_client *) new_client) + 1); 
    689     new_client->addr = 0; 
    690     ((struct isa_client *) new_client)->isa_addr = address; 
    691   } else { 
    692     data = (struct w83781d_data *) (((struct i2c_client *) new_client) + 1); 
    693     new_client->addr = address; 
    694   } 
     684  data = (struct w83781d_data *) (((struct i2c_client *) new_client) + 1); 
     685  new_client->addr = address; 
    695686  init_MUTEX(&data->lock); 
    696687  new_client->data = data; 
     
    838829 
    839830  if i2c_is_isa_client(client) 
    840     release_region(((struct isa_client *)client)->isa_addr,W83781D_EXTENT); 
     831    release_region(client->addr,W83781D_EXTENT); 
    841832  kfree(client); 
    842833 
     
    881872  if (i2c_is_isa_client(client)) { 
    882873    if (reg & 0xff00) { 
    883       outb_p(W83781D_REG_BANK,(((struct isa_client *) client)->isa_addr) + 
    884                               W83781D_ADDR_REG_OFFSET); 
    885       outb_p(reg >> 8,(((struct isa_client *) client)->isa_addr) + 
    886                       W83781D_DATA_REG_OFFSET); 
    887     } 
    888     outb_p(reg & 0xff,(((struct isa_client *) client)->isa_addr) + 
    889                       W83781D_ADDR_REG_OFFSET); 
    890     res = inb_p((((struct isa_client *) client)->isa_addr) + 
    891                 W83781D_DATA_REG_OFFSET); 
     874      outb_p(W83781D_REG_BANK,client->addr + W83781D_ADDR_REG_OFFSET); 
     875      outb_p(reg >> 8,client->addr + W83781D_DATA_REG_OFFSET); 
     876    } 
     877    outb_p(reg & 0xff,client->addr + W83781D_ADDR_REG_OFFSET); 
     878    res = inb_p(client->addr + W83781D_DATA_REG_OFFSET); 
    892879    if (word_sized) { 
    893       outb_p((reg & 0xff)+1,(((struct isa_client *) client)->isa_addr) + 
    894                         W83781D_ADDR_REG_OFFSET); 
    895       res = (res << 8) + inb_p((((struct isa_client *) client)->isa_addr) + 
    896                          W83781D_DATA_REG_OFFSET); 
     880      outb_p((reg & 0xff)+1,client->addr + W83781D_ADDR_REG_OFFSET); 
     881      res = (res << 8) + inb_p(client->addr + W83781D_DATA_REG_OFFSET); 
    897882    } 
    898883    if (reg & 0xff00) { 
    899       outb_p(W83781D_REG_BANK,(((struct isa_client *) client)->isa_addr) + 
    900                               W83781D_ADDR_REG_OFFSET); 
    901       outb_p(0,(((struct isa_client *) client)->isa_addr) + 
    902                W83781D_DATA_REG_OFFSET); 
     884      outb_p(W83781D_REG_BANK,client->addr + W83781D_ADDR_REG_OFFSET); 
     885      outb_p(0,client->addr + W83781D_DATA_REG_OFFSET); 
    903886    } 
    904887  } else { 
     
    934917  if (i2c_is_isa_client(client)) { 
    935918    if (reg & 0xff00) { 
    936       outb_p(W83781D_REG_BANK,(((struct isa_client *) client)->isa_addr) + 
    937                               W83781D_ADDR_REG_OFFSET); 
    938       outb_p(reg >> 8,(((struct isa_client *) client)->isa_addr) + 
    939                       W83781D_DATA_REG_OFFSET); 
    940     } 
    941     outb_p(reg & 0xff,(((struct isa_client *) client)->isa_addr) + 
    942                       W83781D_ADDR_REG_OFFSET); 
     919      outb_p(W83781D_REG_BANK,client->addr + W83781D_ADDR_REG_OFFSET); 
     920      outb_p(reg >> 8,client->addr + W83781D_DATA_REG_OFFSET); 
     921    } 
     922    outb_p(reg & 0xff,client->addr + W83781D_ADDR_REG_OFFSET); 
    943923    if (word_sized) { 
    944       outb_p(value >> 8,(((struct isa_client *) client)->isa_addr) + 
    945                         W83781D_DATA_REG_OFFSET); 
    946       outb_p((reg & 0xff)+1,(((struct isa_client *) client)->isa_addr) + 
    947                         W83781D_ADDR_REG_OFFSET); 
    948     } 
    949     outb_p(value &0xff,(((struct isa_client *) client)->isa_addr) + 
    950                        W83781D_DATA_REG_OFFSET); 
     924      outb_p(value >> 8,client->addr + W83781D_DATA_REG_OFFSET); 
     925      outb_p((reg & 0xff)+1,client->addr + W83781D_ADDR_REG_OFFSET); 
     926    } 
     927    outb_p(value &0xff,client->addr + W83781D_DATA_REG_OFFSET); 
    951928    if (reg & 0xff00) { 
    952       outb_p(W83781D_REG_BANK,(((struct isa_client *) client)->isa_addr) + 
    953                               W83781D_ADDR_REG_OFFSET); 
    954       outb_p(0,(((struct isa_client *) client)->isa_addr) + 
    955                W83781D_DATA_REG_OFFSET); 
     929      outb_p(W83781D_REG_BANK,client->addr + W83781D_ADDR_REG_OFFSET); 
     930      outb_p(0,client->addr + W83781D_DATA_REG_OFFSET); 
    956931    } 
    957932  } else { 
  • lm-sensors/trunk/kernel/include/i2c-isa.h

    r496 r505  
    2020 
    2121 
    22 #ifndef SENSORS_SENSOR_H 
    23 #define SENSORS_SENSOR_H 
     22#ifndef SENSORS_SENSORS_ISA_H 
     23#define SENSORS_SENSORS_ISA_H 
    2424 
    2525#ifdef __KERNEL__ 
    2626 
    27 /* This file must interface with Simon Vogl's i2c driver. Version 19981006 is 
    28    OK, earlier versions are not; later versions will probably give problems 
    29    too.  
    30 */ 
    31 #include <asm/types.h> 
    32  
    33 /* I2C_SPINLOCK is defined in i2c.h. */ 
    34 #ifdef I2C_SPINLOCK 
    35 #include <asm/spinlock.h> 
    36 #else 
    37 #if LINUX_VERSION_CODE < 0x020019 
    38 #include <linux/sched.h> 
    39 #else 
    40 #include <asm/semaphore.h> 
    41 #endif 
    42 #endif 
    43  
    4427#include <linux/i2c.h>                   
    4528 
    46 /* Note that this driver is *not* built upon smbus.c, but is parallel to it. 
    47    We do not need SMBus facilities if we are on the ISA bus, after all */ 
    48  
    49 /* Declarations, to keep the compiler happy */ 
    50 struct isa_driver; 
    51 struct isa_client; 
    52 struct isa_algorithm; 
    53 struct isa_adapter; 
    54  
    55 /* A driver tells us how we should handle a specific kind of chip. 
    56    A specific instance of such a chip is called a client.   
    57    This structure is essentially the same as i2c_driver. */ 
    58 struct isa_driver { 
    59   char name[32]; 
    60   int id; 
    61   unsigned int flags; 
    62   int (* attach_adapter) (struct isa_adapter *); 
    63   int (* detach_client) (struct isa_client *); 
    64   int (* command) (struct isa_client *, unsigned int cmd, void *arg); 
    65   void (* inc_use) (struct isa_client *); 
    66   void (* dec_use) (struct isa_client *); 
    67 }; 
    68  
    69 /* A client is a specifc instance of a chip: for each detected chip, there will 
    70    be a client. Its operation is controlled by a driver. 
    71    This structure is an extension of i2c_client. */ 
    72 struct isa_client { 
    73   char name[32]; 
    74   int id; 
    75   unsigned int flags; 
    76   unsigned char addr; 
    77   struct isa_adapter *adapter; 
    78   struct isa_driver *driver; 
    79   void *data; 
    80  
    81   /* Here ended i2c_client */ 
    82   unsigned int isa_addr; 
    83 }; 
    84  
    85 /* An algorithm describes how a certain class of busses can be accessed. 
    86    A specific instance of sucj a bus is called an adapter. 
    87    This structure is essentially the same as i2c_adapter. */ 
    88 struct isa_algorithm { 
    89   char name[32]; 
    90   unsigned int id; 
    91   int (* master_xfer) (struct isa_adapter *adap, struct i2c_msg msgs[], 
    92                        int num); 
    93   int (* slave_send) (struct isa_adapter *,char *, int); 
    94   int (* slave_recv) (struct isa_adapter *,char *, int); 
    95   int (* algo_control) (struct isa_adapter *, unsigned int, unsigned long); 
    96   int (* client_register) (struct isa_client *); 
    97   int (* client_unregister) (struct isa_client *); 
    98 }; 
    99  
    100 /* An adapter is a specifc instance of a bus: for each detected bus, there will 
    101    be an adapter. Its operation is controlled by an algorithm. 
    102    I2C_SPINLOCK must be the same as declared in i2c.h. 
    103    This structure is essentially the same as i2c_algorithm. */ 
    104 struct isa_adapter { 
    105   char name[32]; 
    106   unsigned int id; 
    107   struct isa_algorithm *algo; 
    108   void *data; 
    109 #ifdef I2C_SPINLOCK 
    110   spinlock_t lock; 
    111   unsigned long lockflags; 
    112 #else 
    113   struct semaphore lock; 
    114 #endif 
    115   unsigned int flags; 
    116   struct isa_client *clients[I2C_CLIENT_MAX]; 
    117   int client_count; 
    118   int timeout; 
    119   int retries; 
    120 }; 
    121  
    122  
    12329/* Detect whether we are on the isa bus. If this returns true, all i2c 
    124   access will fail! */ 
     30  access will fail! */ 
    12531#define i2c_is_isa_client(clientptr) \ 
    126         ((clientptr)->adapter->algo->id == ALGO_ISA) 
     32        ((clientptr)->adapter->algo->id == I2C_ALGO_ISA) 
    12733#define i2c_is_isa_adapter(adapptr) \ 
    128         ((adapptr)->algo->id == ALGO_ISA) 
    129  
    130 /* Next: define ISA variants of registering. */ 
    131 #define isa_add_algorithm(algoptr) \ 
    132         i2c_add_algorithm((struct i2c_algorithm *) (algoptr)) 
    133 #define isa_del_algorithm(algoptr) \ 
    134         i2c_del_algorithm((struct i2c_algorithm *) (algoptr)) 
    135  
    136 #define isa_add_adapter(adapptr) \ 
    137         i2c_add_adapter((struct i2c_adapter *) (adapptr)) 
    138 #define isa_del_adapter(adapptr) \ 
    139         i2c_del_adapter((struct i2c_adapter *) (adapptr)) 
    140  
    141 #define isa_add_driver(driverptr) \ 
    142         i2c_add_driver((struct i2c_driver *) (driverptr)) 
    143 #define isa_del_driver(driverptr) \ 
    144         i2c_add_driver((struct i2c_driver *) (driverptr)) 
    145  
    146 #define isa_attach_client(clientptr) \ 
    147         i2c_attach_client((struct i2c_client *) (clientptr)) 
    148 #define isa_detach_client(clientptr) \ 
    149         i2c_detach_client((struct i2c_client *) (clientptr)) 
     34        ((adapptr)->algo->id == I2C_ALGO_ISA) 
    15035 
    15136#endif /* def __KERNEL__ */ 
    15237 
    153 /* We need to mark ISA algorithms in the algorithm structure. */ 
    154 #define ALGO_ISA 0x50000 
    155  
    156 /* ISA Adapter ids */ 
    157 #define ISA_MAIN 1 
    158  
    15938#endif /* ndef SENSORS_ISA_H */ 
  • lm-sensors/trunk/kernel/sensors.c

    r499 r505  
    129129 
    130130  if ((res = sensors_create_name(&name,prefix,client->adapter, 
    131                                  i2c_is_isa_client(client)? 
    132                                  ((struct isa_client *) client)->isa_addr: 
    133131                                 client->addr))) 
    134132    return res; 
  • lm-sensors/trunk/prog/dump/isadump.c

    r434 r505  
    2525 
    2626/* To keep glibc2 happy */ 
    27 #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 0 
     27#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 0 
    2828#include <sys/perm.h> 
    2929#endif