it more 64-bit friendly.
#define CR_CW 0x80
struct subdev_8255_struct{
- void *cb_arg;
- int (*cb_func)(int,int,int,void *);
+ unsigned long cb_arg;
+ int (*cb_func)(int,int,int,unsigned long);
};
#define CALLBACK_ARG (((struct subdev_8255_struct *)s->private)->cb_arg)
static void do_config(comedi_device *dev,comedi_subdevice *s);
-static int subdev_8255_cb(int dir,int port,int data,void *arg)
+static int subdev_8255_cb(int dir,int port,int data,unsigned long arg)
{
- int iobase=(unsigned long)arg;
+ int iobase=arg;
if(dir){
outb(data,iobase+port);
}
-int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,int (*cb)(int,int,int,void *),void *arg)
+int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,int (*cb)(int,int,int,unsigned long),unsigned long arg)
{
s->type=COMEDI_SUBD_DIO;
s->subdev_flags=SDF_READABLE|SDF_WRITEABLE|SDF_RT;
}else{
request_region(iobase,_8255_SIZE,"8255");
- subdev_8255_init(dev,dev->subdevices+i,NULL,(void *)iobase);
+ subdev_8255_init(dev,dev->subdevices+i,NULL,iobase);
}
}
for(i=0;i<dev->n_subdevices;i++){
s=dev->subdevices+i;
if(s->type!=COMEDI_SUBD_UNUSED){
- iobase=(int)CALLBACK_ARG;
+ iobase=CALLBACK_ARG;
release_region(iobase,_8255_SIZE);
}
subdev_8255_cleanup(dev,s);
#if defined(CONFIG_COMEDI_8255) || defined(CONFIG_COMEDI_8255_MODULE)
-int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,int (*cb)(int,int,int,void *),void *arg);
+int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,
+ int (*cb)(int,int,int,unsigned long),unsigned long arg);
void subdev_8255_cleanup(comedi_device *dev,comedi_subdevice *s);
#else
-static inline int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,void *x,void *y)
+static inline int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,void *x,unsigned long y)
{
printk("8255 support not configured -- disabling subdevice\n");
s=dev->subdevices+2;
/* digital i/o subdevice */
if(thisboard->have_dio){
- subdev_8255_init(dev,s,NULL,(void *)(devpriv->pci_iobase + PCI230_PPI_X_A));
+ subdev_8255_init(dev,s,NULL,(devpriv->pci_iobase + PCI230_PPI_X_A));
}else{
s->type = COMEDI_SUBD_UNUSED;
}
/* 8255 */
s = dev->subdevices + 2;
subdev_8255_init(dev, s, NULL,
- (void *)(devpriv->pacer_counter_dio + DIO_8255));
+ (unsigned long)(devpriv->pacer_counter_dio + DIO_8255));
/* Set bits to enable incoming mailbox interrupts on amcc s5933.
* They don't actually get sent here, but in cmd code. */
static void handle_interrupt(int irq, void *d, struct pt_regs *regs);
static int ai_cancel(comedi_device *dev, comedi_subdevice *s);
//static int ao_cancel(comedi_device *dev, comedi_subdevice *s);
-static int dio_callback(int dir, int port, int data, void *arg);
+static int dio_callback(int dir, int port, int data, unsigned long arg);
static int di_rbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static void check_adc_timing(comedi_cmd *cmd);
/* 8255 */
s = dev->subdevices + 4;
subdev_8255_init(dev, s, dio_callback,
- (void*) (devpriv->dio_counter_iobase + DIO_8255_OFFSET));
+ (unsigned long) (devpriv->dio_counter_iobase + DIO_8255_OFFSET));
// user counter subd XXX
s = dev->subdevices + 5;
return 1;
}
-static int dio_callback(int dir, int port, int data, void *arg)
+static int dio_callback(int dir, int port, int data, unsigned long iobase)
{
- unsigned long iobase = (int)arg;
-
if(dir)
{
writeb(data, iobase + port);
// two 8255 digital io subdevices
s = dev->subdevices + 1;
- subdev_8255_init(dev, s, NULL, (void *)(devpriv->digitalio));
+ subdev_8255_init(dev, s, NULL, (unsigned long)(devpriv->digitalio));
s = dev->subdevices + 2;
subdev_8255_init(dev, s, NULL,
- (void *)(devpriv->digitalio + PORT2A));
+ (unsigned long)(devpriv->digitalio + PORT2A));
printk(" eeprom:");
for(index = 0; index < EEPROM_SIZE; index++)
rmmod daqboard2000 ; rmmod comedi; make install ; modprobe daqboard2000; /usr/sbin/comedi_config /dev/comedi0 daqboard/2000 ; tail -40 /var/log/messages
*/
-static int daqboard2000_8255_cb(int dir, int port, int data, void *arg)
+static int daqboard2000_8255_cb(int dir, int port, int data, unsigned long ioaddr)
{
int result = 0;
- unsigned long ioaddr=(unsigned long)arg;
if(dir){
writew(data,ioaddr+port*2);
result = 0;
s = dev->subdevices + 2;
result = subdev_8255_init(dev,s,daqboard2000_8255_cb,
- (void *)(dev->iobase+0x40));
+ (unsigned long)(dev->iobase+0x40));
printk("\n");
out:
s=dev->subdevices+4;
/* 8255 */
if(thisboard->i8255_offset!=0){
- subdev_8255_init(dev,s,NULL,(void *)(dev->iobase+
+ subdev_8255_init(dev,s,NULL,(unsigned long)(dev->iobase+
thisboard->i8255_offset));
}else{
s->type=COMEDI_SUBD_UNUSED;
s = dev->subdevices + 4;
/* 8255 */
if(thisboard->i8255_offset!=0){
- subdev_8255_init(dev,s,NULL,(void *)(dev->iobase+
+ subdev_8255_init(dev,s,NULL,(unsigned long)(dev->iobase+
thisboard->i8255_offset));
}else{
s->type = COMEDI_SUBD_UNUSED;
s = dev->subdevices + 3;
/* 8255 */
- subdev_8255_init(dev, s, NULL, (void*)(dev->iobase + DAS16M1_82C55));
+ subdev_8255_init(dev, s, NULL, (unsigned long)(dev->iobase + DAS16M1_82C55));
// disable upper half of hardware conversion counter so it doesn't mess with us
outb(TOTAL_CLEAR, dev->iobase + DAS16M1_8254_FIRST_CNTRL);
/* 8255 subdevice */
s++;
if(boardtype->has_8255){
- subdev_8255_init(dev,s,NULL,(void *)dev->iobase);
+ subdev_8255_init(dev,s,NULL,(unsigned long)dev->iobase);
}else{
s->type=COMEDI_SUBD_UNUSED;
}
s = dev->subdevices + 2;
// if board uses io memory we have to give a custom callback function to the 8255 driver
if(thisboard->write_byte == labpc_writeb)
- subdev_8255_init(dev, s, labpc_dio_mem_callback, (void*)(dev->iobase + DIO_BASE_REG));
+ subdev_8255_init(dev, s, labpc_dio_mem_callback, (unsigned long)(dev->iobase + DIO_BASE_REG));
else
subdev_8255_init(dev, s, NULL, (void*)(dev->iobase + DIO_BASE_REG));
writeb(byte, address);
}
-static int labpc_dio_mem_callback(int dir, int port, int data, void *arg)
+static int labpc_dio_mem_callback(int dir, int port, int data, unsigned long iobase)
{
- unsigned long iobase = (int)arg;
-
if(dir)
{
writeb(data, iobase + port);
static int ni_ao_fifo_half_empty(comedi_device *dev,comedi_subdevice *s);
-static int ni_8255_callback(int dir,int port,int data,void *arg);
+static int ni_8255_callback(int dir,int port,int data,unsigned long arg);
static int ni_ns_to_timer(int *nanosec,int round_mode);
/* 8255 device */
s=dev->subdevices+3;
if(boardtype.has_8255){
- subdev_8255_init(dev,s,ni_8255_callback,dev);
+ subdev_8255_init(dev,s,ni_8255_callback,(unsigned long)dev);
}else{
s->type=COMEDI_SUBD_UNUSED;
}
-static int ni_8255_callback(int dir,int port,int data,void *arg)
+static int ni_8255_callback(int dir,int port,int data,unsigned long arg)
{
- comedi_device *dev=arg;
+ comedi_device *dev=(comedi_device *)arg;
if(dir){
ni_writeb(data,Port_A+2*port);
static int setup_mite(comedi_device *dev);
#endif
-static int nidio96_8255_cb(int dir,int port,int data,void *arg)
+static int nidio96_8255_cb(int dir,int port,int data,unsigned long iobase)
{
- int iobase=(int)arg;
-
if(dir){
writeb(data,iobase+port);
return 0;
if(!this_board->is_diodaq){
for(i=0;i<this_board->n_8255;i++){
subdev_8255_init(dev,dev->subdevices+i,
- nidio96_8255_cb,(void *)(dev->iobase+NIDIO_8255_BASE(i)));
+ nidio96_8255_cb,(unsigned long)(dev->iobase+NIDIO_8255_BASE(i)));
}
}else{
COMEDI_INITCLEANUP(driver_pcl724);
-static int subdev_8255_cb(int dir,int port,int data,void *arg)
+static int subdev_8255_cb(int dir,int port,int data,unsigned long arg)
{
- int iobase=(int)arg;
+ int iobase=arg;
if(dir){
outb(data,iobase+port);
}
}
-static int subdev_8255mapped_cb(int dir,int port,int data,void *arg)
+static int subdev_8255mapped_cb(int dir,int port,int data,unsigned long iobase)
{
- int iobase=(int)arg;
int movport=SIZE_8255*(iobase>>12);
iobase&=0x0fff;
for(i=0;i<dev->n_subdevices;i++){
if (this_board->is_pet48) {
subdev_8255_init(dev,dev->subdevices+i,
- subdev_8255mapped_cb,(void *)(dev->iobase+i*0x1000));
+ subdev_8255mapped_cb,(unsigned long)(dev->iobase+i*0x1000));
} else
subdev_8255_init(dev,dev->subdevices+i,
- subdev_8255_cb,(void *)(dev->iobase+SIZE_8255*i));
+ subdev_8255_cb,(unsigned long)(dev->iobase+SIZE_8255*i));
};
return 0;