for I/O ports. Used resource_size_t for physical memory regions.
static int subdev_8255_cb(int dir,int port,int data,unsigned long arg)
{
- int iobase=arg;
+ unsigned long iobase=arg;
if(dir){
outb(data,iobase+port);
static int dev_8255_attach(comedi_device *dev,comedi_devconfig *it)
{
int ret;
- int iobase;
+ unsigned long iobase;
int i;
printk("comedi%d: 8255:",dev->minor);
for(i=0;i<dev->n_subdevices;i++){
iobase=it->options[i];
- printk(" 0x%04x",iobase);
+ printk(" 0x%04lx",iobase);
if(!request_region(iobase,_8255_SIZE,"8255")){
printk(" (I/O port conflict)");
static int dev_8255_detach(comedi_device *dev)
{
- int i,iobase;
+ int i;
+ unsigned long iobase;
comedi_subdevice *s;
printk("comedi%d: 8255: remove\n",dev->minor);
static int
pci6208_find_device(comedi_device *dev, int bus, int slot);
static int
-pci6208_pci_setup(struct pci_dev *pci_dev, int *io_base_ptr, int dev_minor);
+pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr, int dev_minor);
/*read/write functions*/
static int pci6208_ao_winsn(comedi_device *dev,comedi_subdevice *s,
static int pci6208_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
- int retval, io_base;
+ int retval;
+ unsigned long io_base;
printk("comedi%d: pci6208: ", dev->minor);
}
static int
-pci6208_pci_setup(struct pci_dev *pci_dev, int *io_base_ptr, int dev_minor)
+pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr, int dev_minor)
{
- int io_base, io_range, lcr_io_base, lcr_io_range;
+ unsigned long io_base, io_range, lcr_io_base, lcr_io_range;
// Enable PCI device
if (pci_enable_device(pci_dev) < 0) {
// Read local configuration register base address [PCI_BASE_ADDRESS #1].
lcr_io_base = pci_resource_start(pci_dev, 1);
- lcr_io_range = pci_resource_end(pci_dev, 1) - lcr_io_base +1;
+ lcr_io_range = pci_resource_len(pci_dev, 1);
- printk("comedi%d: local config registers at address 0x%4x [0x%4x]\n",
+ printk("comedi%d: local config registers at address 0x%4lx [0x%4lx]\n",
dev_minor,
lcr_io_base,
lcr_io_range);
io_base = pci_resource_start (pci_dev, 2);
io_range = pci_resource_end (pci_dev, 2) - io_base +1;
- printk ("comedi%d: 6208 registers at address 0x%4x [0x%4x]\n",
+ printk ("comedi%d: 6208 registers at address 0x%4lx [0x%4lx]\n",
dev_minor,
io_base,
io_range);
typedef struct
{
struct pci_dev* pci_device;
- int io_range; // PCI6503 io range
+ unsigned long io_range; // PCI6503 io range
- int lcr_io_base; // Local configuration register base address
- int lcr_io_range;
+ unsigned long lcr_io_base; // Local configuration register base address
+ unsigned long lcr_io_range;
int stop_counter;
int stop_is_none;
#define PLX9050_PCI_INTERRUPT_ENABLE (1 << 6)
#define PLX9050_SOFTWARE_INTERRUPT (1 << 7)
-static void plx9050_interrupt_control (int io_base,
+static void plx9050_interrupt_control (unsigned long io_base,
bool LINTi1_enable,
bool LINTi1_active_high,
bool LINTi2_enable,
static int pci9111_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *subdevice;
- int io_base, io_range, lcr_io_base, lcr_io_range;
+ unsigned long io_base, io_range, lcr_io_base, lcr_io_range;
struct pci_dev* pci_device;
int error,i;
pci9111_board_struct* board;
// Read local configuration register base address [PCI_BASE_ADDRESS #1].
lcr_io_base = pci_resource_start (pci_device, 1);
- lcr_io_range = pci_resource_end (pci_device, 1) - lcr_io_base +1;
+ lcr_io_range = pci_resource_len (pci_device, 1);
- printk ("comedi%d: local configuration registers at address 0x%4x [0x%4x]\n",
+ printk ("comedi%d: local configuration registers at address 0x%4lx [0x%4lx]\n",
dev->minor,
lcr_io_base,
lcr_io_range);
// Read PCI6308 register base address [PCI_BASE_ADDRESS #2].
io_base = pci_resource_start (pci_device, 2);
- io_range = pci_resource_end (pci_device, 2) - io_base +1;
+ io_range = pci_resource_len (pci_device, 2);
- printk ("comedi%d: 6503 registers at address 0x%4x [0x%4x]\n",
+ printk ("comedi%d: 6503 registers at address 0x%4lx [0x%4lx]\n",
dev->minor,
io_base,
io_range);
PCI9111_DRIVER_NAME,
dev)!=0)
{
- printk ("comedi%d: unable to allocate irq %d\n", dev->minor, pci_device->irq);
+ printk ("comedi%d: unable to allocate irq %u\n", dev->minor, pci_device->irq);
return -EINVAL;
}
}
COMEDI_INITCLEANUP(driver_pci9118);
typedef struct{
- int iobase_a; // base+size for AMCC chip
+ unsigned long iobase_a; // base+size for AMCC chip
unsigned int master; // master capable
struct pci_dev *pcidev; // ptr to actual pcidev
unsigned int usemux; // we want to use external multiplexor!
{
comedi_subdevice *s;
int ret,pages,i;
- unsigned short master,irq;
- unsigned int iobase_a,iobase_9;
+ unsigned short master;
+ unsigned int irq;
+ unsigned long iobase_a,iobase_9;
struct pci_dev *pcidev;
int opt_bus, opt_slot;
const char *errstr;
iobase_a = pci_resource_start(pcidev, 0);
iobase_9 = pci_resource_start(pcidev, 2);
- rt_printk(", b:s:f=%d:%d:%d, io=0x%4x, 0x%4x",pci_bus,pci_slot,pci_func,iobase_9,iobase_a);
+ rt_printk(", b:s:f=%d:%d:%d, io=0x%4lx, 0x%4lx",pci_bus,pci_slot,pci_func,iobase_9,iobase_a);
dev->iobase=iobase_9;
dev->board_name = this_board->name;
rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq);
irq=0; /* Can't use IRQ */
} else {
- rt_printk(", irq=%d", irq);
+ rt_printk(", irq=%u", irq);
}
} else {
rt_printk(", IRQ disabled");
{
comedi_subdevice *s;
int ret,subdev,n_subdevices;
- unsigned short irq;
- unsigned int iobase;
+ unsigned int irq;
+ unsigned long iobase;
struct pci_dev *pcidev;
int opt_bus, opt_slot;
const char *errstr;
irq = pcidev->irq;
iobase = pci_resource_start(pcidev, 2);
- rt_printk(", b:s:f=%d:%d:%d, io=0x%4x",pci_bus,pci_slot,pci_func,iobase);
+ rt_printk(", b:s:f=%d:%d:%d, io=0x%4lx",pci_bus,pci_slot,pci_func,iobase);
dev->iobase=iobase;
rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq);
irq=0; /* Can't use IRQ */
} else {
- rt_printk(", irq=%d", irq);
+ rt_printk(", irq=%u", irq);
}
} else {
rt_printk(", IRQ disabled");
static int pci_dio_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int ret, subdev, n_subdevices, i, j, iobase, found=0;
+ int ret, subdev, n_subdevices, i, j, found=0;
+ unsigned long iobase;
struct pci_dev* pcidev;
rt_printk("comedi%d: adv_pci_dio: board=%s",
return -EIO;
}
iobase=pci_resource_start(pcidev, this_board->main_pci_region);
- rt_printk(", b:s:f=%d:%d:%d, io=0x%4x",
+ rt_printk(", b:s:f=%d:%d:%d, io=0x%4lx",
pcidev->bus->number, PCI_SLOT(pcidev->devfn), PCI_FUNC(pcidev->devfn),
iobase);
{
comedi_subdevice *s;
struct pci_dev *pci_dev = NULL;
- int iobase = 0, irq = 0;
+ unsigned long iobase = 0;
+ unsigned int irq = 0;
int bus = 0, slot = 0;
dio200_layout *layout;
int share_irq = 0;
DIO200_DRIVER_NAME, dev) >= 0) {
dev->irq = irq;
} else {
- printk(KERN_WARNING "comedi%d: warning! irq %d unavailable!\n",
+ printk(KERN_WARNING "comedi%d: warning! irq %u unavailable!\n",
dev->minor, irq);
}
}
printk(KERN_INFO "comedi%d: %s ", dev->minor, dev->board_name);
if (thisboard->bustype == isa_bustype) {
- printk("(base %#x) ", iobase);
+ printk("(base %#lx) ", iobase);
} else {
printk("(pci %02x:%02x.%x) ", pci_dev->bus->number,
PCI_SLOT(pci_dev->devfn),
PCI_FUNC(pci_dev->devfn));
}
if (irq) {
- printk("(irq %d%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
+ printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
} else {
printk("(no irq) ");
}
typedef struct{
/* PCI device */
struct pci_dev *pci_dev;
- int lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */
+ unsigned long lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */
int enable_irq;
}pc236_private;
{
comedi_subdevice *s;
struct pci_dev *pci_dev = NULL;
- int iobase = 0, irq = 0;
+ unsigned long iobase = 0;
+ unsigned int irq = 0;
int bus = 0, slot = 0;
struct pci_device_id *pci_id;
int share_irq = 0;
}
}
if (thisboard->bustype == isa_bustype) {
- printk("(base %#x) ", iobase);
+ printk("(base %#lx) ", iobase);
} else {
printk("(pci %02x:%02x.%x) ", pci_dev->bus->number,
PCI_SLOT(pci_dev->devfn),
PCI_FUNC(pci_dev->devfn));
}
if (irq) {
- printk("(irq %d%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
+ printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
} else {
printk("(no irq) ");
}
{
comedi_subdevice *s;
struct pci_dev *pci_dev = NULL;
- int iobase = 0;
+ unsigned long iobase = 0;
int bus = 0, slot = 0;
struct pci_device_id *pci_id;
int ret;
s->state = s->state | (inb(dev->iobase) << 8);
if (thisboard->bustype == isa_bustype) {
- printk("(base %#x) ", iobase);
+ printk("(base %#lx) ", iobase);
} else {
printk("(pci %02x:%02x.%x) ", pci_dev->bus->number,
PCI_SLOT(pci_dev->devfn),
{
comedi_subdevice *s;
struct pci_dev *pci_dev;
- int irq;
+ unsigned int irq;
int bus = 0, slot = 0;
unsigned n;
int ret;
DRIVER_NAME, dev);
if (ret < 0) {
printk(KERN_ERR "comedi%d: error! "
- "unable to allocate irq %d\n",
+ "unable to allocate irq %u\n",
dev->minor, irq);
return ret;
} else {
PCI_SLOT(pci_dev->devfn),
PCI_FUNC(pci_dev->devfn));
if (irq) {
- printk("(irq %d%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
+ printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
} else {
printk("(no irq) ");
}
struct pci230_private{
struct pci_dev *pci_dev;
lsampl_t ao_readback[2]; /* Used for AO readback */
- unsigned int pci_iobase; /* PCI230's I/O space 1 */
+ unsigned long pci_iobase; /* PCI230's I/O space 1 */
/* Divisors for 8254 counter/timer. */
unsigned int clk_src0; /* which clock to use for the counter/timers: 10MHz, 1MHz, 100kHz etc */
unsigned int clk_src1;
static int pci230_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
- int pci_iobase, iobase = 0; /* PCI230's I/O spaces 1 and 2 respectively. */
+ unsigned long pci_iobase, iobase; /* PCI230's I/O spaces 1 and 2 respectively. */
struct pci_dev *pci_dev;
int i=0,irq_hdl;
return -EIO;
}
- printk("comedi%d: amplc_pci230: I/O region 1 0x%04x I/O region 2 0x%04x\n",dev->minor, pci_iobase, iobase);
+ printk("comedi%d: amplc_pci230: I/O region 1 0x%04lx I/O region 2 0x%04lx\n",dev->minor, pci_iobase, iobase);
devpriv->pci_iobase = pci_iobase;
dev->iobase = iobase;
}
else {
dev->irq = devpriv->pci_dev->irq;
- printk("comedi%d: amplc_pci230: registered irq %d\n", dev->minor, devpriv->pci_dev->irq);
+ printk("comedi%d: amplc_pci230: registered irq %u\n", dev->minor, devpriv->pci_dev->irq);
}
/*
#include <linux/comedidev.h>
#include <linux/pnp.h>
-static u8 ReadByteFromHwPort(int addr)
+static u8 ReadByteFromHwPort(unsigned long addr)
{
u8 result = inb(addr);
return result;
}
-static void WriteByteToHwPort(int addr, u8 val)
+static void WriteByteToHwPort(unsigned long addr, u8 val)
{
outb_p(val, addr);
}
detach: c6xdigio_detach,
};
-static void C6X_pwmInit( unsigned baseAddr ) {
+static void C6X_pwmInit( unsigned long baseAddr ) {
int timeout=0;
//printk("Inside C6X_pwmInit\n");
}
-static void C6X_pwmOutput( unsigned baseAddr, unsigned channel, int value )
+static void C6X_pwmOutput( unsigned long baseAddr, unsigned channel, int value )
{
unsigned ppcmd;
union pwmcmdtype pwm;
}
-static int C6X_encInput( unsigned baseAddr, unsigned channel)
+static int C6X_encInput( unsigned long baseAddr, unsigned channel)
{
unsigned ppcmd;
union encvaluetype enc;
return(enc.value ^ 0x800000);
}
-static void C6X_encResetAll( unsigned baseAddr )
+static void C6X_encResetAll( unsigned long baseAddr )
{
unsigned timeout=0;
static int c6xdigio_attach(comedi_device * dev, comedi_devconfig * it)
{
int result = 0;
- int iobase;
- int irq;
+ unsigned long iobase;
+ unsigned int irq;
comedi_subdevice *s;
iobase = it->options[0];
- printk("comedi%d: c6xdigio: 0x%04x\n", dev->minor, iobase);
+ printk("comedi%d: c6xdigio: 0x%04lx\n", dev->minor, iobase);
if (!request_region(iobase, C6XDIGIO_SIZE, "c6xdigio")) {
printk("comedi%d: I/O port conflict\n", dev->minor);
return -EIO;
irq = it->options[1];
if (irq > 0) {
- printk("comedi%d: irq = %d ignored\n", dev->minor, irq);
+ printk("comedi%d: irq = %u ignored\n", dev->minor, irq);
} else if(irq == 0) {
printk("comedi%d: no irq\n", dev->minor);
}
return ret;
}
dev->irq = link->irq.AssignedIRQ;
- printk("irq=%d ",dev->irq);
+ printk("irq=%u ",dev->irq);
dev->board_ptr = das16cs_probe(dev, link);
if(!dev->board_ptr)return -EIO;
if (link->conf.Vpp1)
printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %d", link->irq.AssignedIRQ);
+ printk(", irq %u", link->irq.AssignedIRQ);
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1+link->io.NumPorts1-1);
/* would be useful for a PCI device */
struct pci_dev *pci_dev;
// base addresses
- unsigned int s5933_config;
- unsigned int control_status;
- unsigned int adc_fifo;
- unsigned int pacer_counter_dio;
- unsigned int ao_registers;
+ unsigned long s5933_config;
+ unsigned long control_status;
+ unsigned long adc_fifo;
+ unsigned long pacer_counter_dio;
+ unsigned long ao_registers;
// divisors of master clock for analog input pacing
unsigned int divisor1;
unsigned int divisor2;
/* 8255 */
s = dev->subdevices + 2;
- subdev_8255_init(dev, s, NULL,
- (unsigned long)(devpriv->pacer_counter_dio + DIO_8255));
+ subdev_8255_init(dev, s, NULL, devpriv->pacer_counter_dio + DIO_8255);
// serial EEPROM,
s = dev->subdevices + 3;
{
struct pci_dev *hw_dev; // pointer to board's pci_dev struct
// base addresses (physical)
- unsigned long plx9080_phys_iobase;
- unsigned long main_phys_iobase;
- unsigned long dio_counter_phys_iobase;
+ resource_size_t plx9080_phys_iobase;
+ resource_size_t main_phys_iobase;
+ resource_size_t dio_counter_phys_iobase;
// base addresses (ioremapped)
void *plx9080_iobase;
void *main_iobase;
return -ENOMEM;
}
- DEBUG_PRINT(" plx9080 remapped to 0x%lx\n", priv(dev)->plx9080_iobase);
- DEBUG_PRINT(" main remapped to 0x%lx\n", priv(dev)->main_iobase);
- DEBUG_PRINT(" diocounter remapped to 0x%lx\n", priv(dev)->dio_counter_iobase);
+ DEBUG_PRINT(" plx9080 remapped to 0x%p\n", priv(dev)->plx9080_iobase);
+ DEBUG_PRINT(" main remapped to 0x%p\n", priv(dev)->main_iobase);
+ DEBUG_PRINT(" diocounter remapped to 0x%p\n", priv(dev)->dio_counter_iobase);
// figure out what local addresses are
local_range = readl(priv(dev)->plx9080_iobase + PLX_LAS0RNG_REG) & LRNG_MEM_MASK;
local_decode = readl(priv(dev)->plx9080_iobase + PLX_LAS0MAP_REG) & local_range & LMAP_MEM_MASK ;
- priv(dev)->local0_iobase = (priv(dev)->main_phys_iobase & ~local_range) | local_decode;
+ priv(dev)->local0_iobase = ((uint32_t)priv(dev)->main_phys_iobase & ~local_range) | local_decode;
local_range = readl(priv(dev)->plx9080_iobase + PLX_LAS1RNG_REG) & LRNG_MEM_MASK;
local_decode = readl(priv(dev)->plx9080_iobase + PLX_LAS1MAP_REG) & local_range & LMAP_MEM_MASK ;
- priv(dev)->local1_iobase = (priv(dev)->dio_counter_phys_iobase & ~local_range) | local_decode;
+ priv(dev)->local1_iobase = ((uint32_t)priv(dev)->dio_counter_phys_iobase & ~local_range) | local_decode;
DEBUG_PRINT(" local 0 io addr 0x%x\n", priv(dev)->local0_iobase);
DEBUG_PRINT(" local 1 io addr 0x%x\n", priv(dev)->local1_iobase);
// get irq
if(comedi_request_irq(pcidev->irq, handle_interrupt, SA_SHIRQ, "cb_pcidas64", dev ))
{
- printk(" unable to allocate irq %d\n", pcidev->irq);
+ printk(" unable to allocate irq %u\n", pcidev->irq);
return -EINVAL;
}
dev->irq = pcidev->irq;
- printk(" irq %i\n", dev->irq);
+ printk(" irq %u\n", dev->irq);
init_plx9080(dev);
init_stc_registers( dev );
// two 8255 digital io subdevices
s = dev->subdevices + 1;
- subdev_8255_init(dev, s, NULL, (unsigned long)(devpriv->digitalio));
+ subdev_8255_init(dev, s, NULL, devpriv->digitalio);
s = dev->subdevices + 2;
- subdev_8255_init(dev, s, NULL,
- (unsigned long)(devpriv->digitalio + PORT2A));
+ subdev_8255_init(dev, s, NULL, devpriv->digitalio + PORT2A);
printk(" eeprom:");
for(index = 0; index < EEPROM_SIZE; index++)
struct pci_dev *pci_dev;
//base addresses
- unsigned int BADR0;
- unsigned int BADR1;
- unsigned int BADR2;
- unsigned int BADR3;
- unsigned int BADR4;
+ unsigned long BADR0;
+ unsigned long BADR1;
+ unsigned long BADR2;
+ unsigned long BADR3;
+ unsigned long BADR4;
/* Used for AO readback */
lsampl_t ao_readback[2];
devpriv->BADR4 = pci_resource_start(devpriv->pci_dev, 4);
#ifdef CBPCIMDAS_DEBUG
- printk("devpriv->BADR0 = %d\n",devpriv->BADR0);
- printk("devpriv->BADR1 = %d\n",devpriv->BADR1);
- printk("devpriv->BADR2 = %d\n",devpriv->BADR2);
- printk("devpriv->BADR3 = %d\n",devpriv->BADR3);
- printk("devpriv->BADR4 = %d\n",devpriv->BADR4);
+ printk("devpriv->BADR0 = 0x%lx\n",devpriv->BADR0);
+ printk("devpriv->BADR1 = 0x%lx\n",devpriv->BADR1);
+ printk("devpriv->BADR2 = 0x%lx\n",devpriv->BADR2);
+ printk("devpriv->BADR3 = 0x%lx\n",devpriv->BADR3);
+ printk("devpriv->BADR4 = 0x%lx\n",devpriv->BADR4);
#endif
// // get irq
// if(comedi_request_irq(devpriv->pci_dev->irq, cb_pcimdas_interrupt, SA_SHIRQ, "cb_pcimdas", dev ))
// {
-// printk(" unable to allocate irq %d\n", devpriv->pci_dev->irq);
+// printk(" unable to allocate irq %u\n", devpriv->pci_dev->irq);
// return -EINVAL;
// }
// dev->irq = devpriv->pci_dev->irq;
s = dev->subdevices + 2;
/* digital i/o subdevice */
if(thisboard->has_dio){
- subdev_8255_init(dev, s, NULL,
- (unsigned long)(devpriv->BADR4));
+ subdev_8255_init(dev, s, NULL, devpriv->BADR4);
}else{
s->type = COMEDI_SUBD_UNUSED;
}
#ifdef CBPCIMDAS_DEBUG
if(devpriv)
{
- printk("devpriv->BADR0 = %d\n",devpriv->BADR0);
- printk("devpriv->BADR1 = %d\n",devpriv->BADR1);
- printk("devpriv->BADR2 = %d\n",devpriv->BADR2);
- printk("devpriv->BADR3 = %d\n",devpriv->BADR3);
- printk("devpriv->BADR4 = %d\n",devpriv->BADR4);
+ printk("devpriv->BADR0 = 0x%lx\n",devpriv->BADR0);
+ printk("devpriv->BADR1 = 0x%lx\n",devpriv->BADR1);
+ printk("devpriv->BADR2 = 0x%lx\n",devpriv->BADR2);
+ printk("devpriv->BADR3 = 0x%lx\n",devpriv->BADR3);
+ printk("devpriv->BADR4 = 0x%lx\n",devpriv->BADR4);
}
#endif
printk("comedi%d: cb_pcimdas: remove\n",dev->minor);
several hardware drivers keep similar information in this structure,
feel free to suggest moving the variable to the comedi_device struct. */
typedef struct {
- int registers; /* set by probe */
- int dio_registers;
+ unsigned long registers; /* set by probe */
+ unsigned long dio_registers;
char attached_to_8255; /* boolean */
char attached_successfully; /* boolean */
/* would be useful for a PCI device */
switch(thisboard->dio_method) {
case DIO_8255:
/* this is a straight 8255, so register us with the 8255 driver */
- subdev_8255_init(dev, s, NULL,
- (unsigned long)(devpriv->dio_registers));
+ subdev_8255_init(dev, s, NULL, devpriv->dio_registers);
devpriv->attached_to_8255 = 1;
break;
case DIO_INTERNAL:
{
int i;
int chan = CR_CHAN(insn->chanspec);
- int offset = devpriv->registers + chan*2;
+ unsigned long offset = devpriv->registers + chan*2;
/* Writing a list of values to an AO channel is probably not
* very useful, but that's how the interface is defined. */
*/
static int probe(comedi_device *dev, const comedi_devconfig *it)
{
- struct pci_dev *pcidev;
- int index, registers;
+ struct pci_dev *pcidev;
+ int index;
+ unsigned long registers;
for(pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); pcidev != NULL ;
pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev))
static int parport_attach(comedi_device *dev,comedi_devconfig *it)
{
int ret;
- int irq;
- int iobase;
+ unsigned int irq;
+ unsigned long iobase;
comedi_subdevice *s;
iobase=it->options[0];
- printk("comedi%d: parport: 0x%04x ",dev->minor,iobase);
+ printk("comedi%d: parport: 0x%04lx ",dev->minor,iobase);
if(!request_region(iobase,PARPORT_SIZE,"parport (comedi)")){
printk("I/O port conflict\n");
return -EIO;
irq=it->options[1];
if(irq){
- printk(" irq=%d",irq);
+ printk(" irq=%u",irq);
ret = comedi_request_irq(irq,parport_interrupt,0,
"comedi_parport",dev);
if(ret<0){
if (link->conf.Vpp1)
printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %d", link->irq.AssignedIRQ);
+ printk(", irq %u", link->irq.AssignedIRQ);
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1+link->io.NumPorts1-1);
static int das16_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int ret, irq;
- int iobase;
- int dma_chan;
+ int ret;
+ unsigned int irq;
+ unsigned long iobase;
+ unsigned int dma_chan;
int timer_mode;
unsigned long flags;
comedi_krange *user_ai_range, *user_ao_range;
return ret;
if(thisboard->size<0x400){
- printk(" 0x%04x-0x%04x\n", iobase, iobase+thisboard->size);
+ printk(" 0x%04lx-0x%04lx\n", iobase, iobase+thisboard->size);
if(!request_region(iobase,thisboard->size,"das16")){
printk(" I/O port conflict\n");
return -EIO;
}
}else{
- printk(" 0x%04x-0x%04x 0x%04x-0x%04x\n",
+ printk(" 0x%04lx-0x%04lx 0x%04lx-0x%04lx\n",
iobase,iobase+0x0f,
iobase+0x400,iobase+0x400+(thisboard->size&0x3ff));
if(!request_region(iobase,0x10,"das16")){
- printk(" I/O port conflict: 0x%04x-0x%04x\n",
+ printk(" I/O port conflict: 0x%04lx-0x%04lx\n",
iobase,iobase+0x0f);
return -EIO;
}
if(!request_region(iobase+0x400,thisboard->size&0x3ff,"das16")){
release_region(iobase, 0x10);
- printk(" I/O port conflict: 0x%04x-0x%04x\n",
+ printk(" I/O port conflict: 0x%04lx-0x%04lx\n",
iobase+0x400,
iobase+0x400+(thisboard->size&0x3ff));
return -EIO;
if((ret=comedi_request_irq(irq, das16_dma_interrupt, 0, "das16",dev)) < 0)
return ret;
dev->irq = irq;
- printk(" ( irq = %d )",irq);
+ printk(" ( irq = %u )",irq);
}else if(irq == 0){
printk(" ( no irq )");
}else
disable_dma(devpriv->dma_chan);
set_dma_mode(devpriv->dma_chan, DMA_MODE_READ);
release_dma_lock(flags);
- printk(" ( dma = %d)\n", dma_chan);
+ printk(" ( dma = %u)\n", dma_chan);
}else if(dma_chan == 0){
printk(" ( no dma )\n");
}else
s = dev->subdevices + 4;
/* 8255 */
if(thisboard->i8255_offset!=0){
- subdev_8255_init(dev,s,NULL,(unsigned long)(dev->iobase+
+ subdev_8255_init(dev,s,NULL,(dev->iobase+
thisboard->i8255_offset));
}else{
s->type = COMEDI_SUBD_UNUSED;
static int das16m1_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int ret, irq;
- int iobase;
+ int ret;
+ unsigned int irq;
+ unsigned long iobase;
iobase = it->options[0];
dev->board_name = thisboard->name;
- printk(" io 0x%x-0x%x 0x%x-0x%x",
+ printk(" io 0x%lx-0x%lx 0x%lx-0x%lx",
iobase, iobase + DAS16M1_SIZE,
iobase + DAS16M1_82C55, iobase + DAS16M1_82C55 + DAS16M1_SIZE2);
if(!request_region(iobase, DAS16M1_SIZE, driver_das16m1.driver_name)) {
return ret;
}
dev->irq = irq;
- printk(", irq %d\n", irq);
+ printk(", irq %u\n", irq);
}else if(irq == 0){
printk(", no irq\n");
}else {
s = dev->subdevices + 3;
/* 8255 */
- subdev_8255_init(dev, s, NULL, (unsigned long)(dev->iobase + DAS16M1_82C55));
+ subdev_8255_init(dev, s, NULL, 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);
uint16_t *ai_buf1;
uint16_t *dma_current_buf; /* pointer to dma buffer currently being used */
unsigned int dma_transfer_size; /* size of transfer currently used, in bytes */
- int iobase2; /* secondary io address used for analog out on 'ao' boards */
+ unsigned long iobase2; /* secondary io address used for analog out on 'ao' boards */
short ao_update_bits; /* remembers the last write to the 'update' dac */
}das1800_private;
static int das1800_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase = it->options[0];
- int irq = it->options[1];
- int dma0 = it->options[2];
- int dma1 = it->options[3];
- int iobase2;
+ unsigned long iobase = it->options[0];
+ unsigned int irq = it->options[1];
+ unsigned int dma0 = it->options[2];
+ unsigned int dma1 = it->options[3];
+ unsigned long iobase2;
int board;
int retval;
if(alloc_private(dev, sizeof(das1800_private)) < 0)
return -ENOMEM;
- printk("comedi%d: %s: io 0x%x", dev->minor, driver_das1800.driver_name, iobase);
+ printk("comedi%d: %s: io 0x%lx", dev->minor, driver_das1800.driver_name, iobase);
if(irq)
{
- printk(", irq %i", irq);
+ printk(", irq %u", irq);
if(dma0)
{
- printk(", dma %i", dma0);
- if(dma1) printk(" and %i", dma1);
+ printk(", dma %u", dma0);
+ if(dma1) printk(" and %u", dma1);
}
}
printk("\n");
/* check if io addresses are available */
if(!request_region(iobase, DAS1800_SIZE, driver_das1800.driver_name))
{
- printk(" I/O port conflict: failed to allocate ports 0x%x to 0x%x\n",
+ printk(" I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
iobase, iobase + DAS1800_SIZE - 1);
return -EIO;
}
iobase2 = iobase + IOBASE2;
if(!request_region(iobase2, DAS1800_SIZE, driver_das1800.driver_name))
{
- printk(" I/O port conflict: failed to allocate ports 0x%x to 0x%x\n",
+ printk(" I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
iobase2, iobase2 + DAS1800_SIZE - 1);
return -EIO;
}
{
if(comedi_request_irq( irq, das1800_interrupt, 0, driver_das1800.driver_name, dev ))
{
- printk(" unable to allocate irq %d\n", irq);
+ printk(" unable to allocate irq %u\n", irq);
return -EINVAL;
}
}
static int das6402_attach(comedi_device *dev,comedi_devconfig *it)
{
- int irq;
- int iobase;
+ unsigned int irq;
+ unsigned long iobase;
int ret;
comedi_subdevice *s;
/* should do a probe here */
irq=it->options[0];
- printk(" ( irq = %d )", irq);
+ printk(" ( irq = %u )", irq);
ret=comedi_request_irq(irq, intr_handler, 0, "das6402", dev);
if(ret<0){
printk("irq conflict\n");
static int das800_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase = it->options[0];
- int irq = it->options[1];
+ unsigned long iobase = it->options[0];
+ unsigned int irq = it->options[1];
unsigned long irq_flags;
int board;
- printk("comedi%d: das800: io 0x%x", dev->minor, iobase);
+ printk("comedi%d: das800: io 0x%lx", dev->minor, iobase);
if(irq)
{
- printk(", irq %i", irq);
+ printk(", irq %u", irq);
}
printk("\n");
dev->board_ptr = das800_boards + board;
/* grab our IRQ */
- if(irq == 1 || irq > 7 || irq < 0)
+ if(irq == 1 || irq > 7)
{
printk("irq out of range\n");
return -EINVAL;
{
if(comedi_request_irq( irq, das800_interrupt, 0, "das800", dev ))
{
- printk( "unable to allocate irq %d\n", irq);
+ printk( "unable to allocate irq %u\n", irq);
return -EINVAL;
}
}
static int dt2801_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
int board_code,type;
int ret=0;
int n_ai_chans;
havetype:
dev->board_ptr = boardtypes+type;
- printk("dt2801: %s at port 0x%x",boardtype.name,iobase);
+ printk("dt2801: %s at port 0x%lx",boardtype.name,iobase);
n_ai_chans=probe_number_of_ai_chans(dev);
printk(" (ai channels = %d)",n_ai_chans);
static int dt2811_attach(comedi_device * dev, comedi_devconfig * it)
{
- //int i, irq, irqs;
+ //int i, irq;
+ //unsigned long irqs;
//long flags;
int ret;
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase = it->options[0];
- printk("comedi%d: dt2811: base=0x%04x\n", dev->minor, iobase);
+ printk("comedi%d: dt2811: base=0x%04lx\n", dev->minor, iobase);
if (!request_region(iobase, DT2811_SIZE, driver_name)) {
printk("I/O port conflict\n");
int i,irq;
int ret;
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase=it->options[0];
- printk("comedi%d: dt2814: 0x%04lx ",dev->minor,dev->iobase);
+ printk("comedi%d: dt2814: 0x%04lx ",dev->minor,iobase);
if(!request_region(iobase,DT2814_SIZE,"dt2814")){
printk("I/O port conflict\n");
return -EIO;
}else if(irq==0){
printk("(no irq)\n");
}else{
+#if 0
printk("(probe returned multiple irqs--bad)\n");
+#else
+ printk("(irq probe not implemented)\n");
+#endif
}
if((ret=alloc_subdevices(dev, 1))<0)
comedi_subdevice *s;
int i;
comedi_lrange *current_range_type, *voltage_range_type;
- int iobase;
+ unsigned long iobase;
iobase = it->options[0];
- printk("comedi%d: dt2815: 0x%04x ", dev->minor, iobase);
+ printk("comedi%d: dt2815: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, DT2815_SIZE, "dt2815")) {
printk("I/O port conflict\n");
return -EIO;
{
int ret;
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase=it->options[0];
- printk("comedi%d: dt2817: 0x%04x ",dev->minor,iobase);
+ printk("comedi%d: dt2817: 0x%04lx ",dev->minor,iobase);
if(!request_region(iobase,DT2817_SIZE,"dt2817")){
printk("I/O port conflict\n");
return -EIO;
int i, irq;
int ret;
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
dev->board_name = this_board->name;
iobase = it->options[opt_iobase];
if(!iobase)iobase = 0x240;
- printk("comedi%d: dt282x: 0x%04x", dev->minor, iobase);
+ printk("comedi%d: dt282x: 0x%04lx", dev->minor, iobase);
if (!request_region(iobase, DT2821_SIZE, "dt282x")) {
printk(" I/O port conflict\n");
return -EBUSY;
} else if (irq == 0) {
printk(" (no irq)");
} else {
+#if 0
printk(" (probe returned multiple irqs--bad)");
+#else
+ printk(" (irq probe not implemented)");
+#endif
}
if((ret=alloc_private(dev,sizeof(dt282x_private)))<0)
typedef struct{
struct pci_dev *pci_dev;
- unsigned long phys_addr;
+ resource_size_t phys_addr;
void *io_addr;
unsigned int lock;
lsampl_t ao_readback[2];
if(comedi_request_irq(devpriv->pci_dev->irq, dt3k_interrupt,
SA_SHIRQ, "dt3000", dev)){
- printk(" unable to allocate IRQ %d\n", devpriv->pci_dev->irq);
+ printk(" unable to allocate IRQ %u\n", devpriv->pci_dev->irq);
return -EINVAL;
}
dev->irq = devpriv->pci_dev->irq;
static int setup_pci(comedi_device *dev)
{
- u32 addr;
+ resource_size_t addr;
int ret;
ret = pci_enable_device(devpriv->pci_dev);
devpriv->io_addr = ioremap(devpriv->phys_addr, DT3000_SIZE);
if(!devpriv->io_addr) return -ENOMEM;
#if DEBUG
- printk("0x%08lx mapped to %p, ",devpriv->phys_addr,devpriv->io_addr);
+ printk("0x%08llx mapped to %p, ",(unsigned long long)devpriv->phys_addr,devpriv->io_addr);
#endif
return 0;
int n;
unsigned int lo_byte, hi_byte;
char chan = CR_CHAN(insn->chanspec);
- int iobase = dev->iobase;
+ unsigned long iobase = dev->iobase;
for(n=0; n<insn->n; n++) { /* sample n times on selected channel */
/* XXX probably can move next step out of for() loop -- will make
{
int n;
int chan = CR_CHAN(insn->chanspec); /* get chan to write */
- int iobase = dev->iobase; /* get base address */
+ unsigned long iobase = dev->iobase; /* get base address */
for (n=0; n<insn->n; n++) { /* write n data set */
outb(data[n] & 0x0ff, iobase+4+2*chan); /* write low byte */
*/
static int fl512_attach(comedi_device *dev,comedi_devconfig *it)
{
- int iobase;
+ unsigned long iobase;
comedi_subdevice *s; /* pointer to the subdevice:
Analog in, Analog out, ( not made ->and Digital IO) */
iobase = it->options[0];
- printk("comedi:%d fl512: 0x%04x",dev->minor,iobase);
+ printk("comedi:%d fl512: 0x%04lx",dev->minor,iobase);
if (!request_region(iobase, FL512_SIZE, "fl512")) {
printk(" I/O port conflict\n");
return -EIO;
{
struct pci_dev *hw_dev; // pointer to board's pci_dev struct
// base addresses (physical)
- unsigned long plx9080_phys_iobase;
- unsigned long hpdi_phys_iobase;
+ resource_size_t plx9080_phys_iobase;
+ resource_size_t hpdi_phys_iobase;
// base addresses (ioremapped)
void *plx9080_iobase;
void *hpdi_iobase;
return -ENOMEM;
}
- DEBUG_PRINT(" plx9080 remapped to 0x%lx\n", priv(dev)->plx9080_iobase);
- DEBUG_PRINT(" hpdi remapped to 0x%lx\n", priv(dev)->hpdi_iobase);
+ DEBUG_PRINT(" plx9080 remapped to 0x%p\n", priv(dev)->plx9080_iobase);
+ DEBUG_PRINT(" hpdi remapped to 0x%p\n", priv(dev)->hpdi_iobase);
// get irq
if( comedi_request_irq( pcidev->irq, handle_interrupt, SA_SHIRQ, driver_hpdi.driver_name,
dev ) )
{
- printk( " unable to allocate irq %d\n", pcidev->irq );
+ printk( " unable to allocate irq %u\n", pcidev->irq );
return -EINVAL;
}
dev->irq = pcidev->irq;
- printk(" irq %i\n", dev->irq);
+ printk(" irq %u\n", dev->irq);
init_plx9080(dev);
struct pcilst_struct *card; // pointer to card
char valid; // card is usable
void *io_addr; // Pointer to mapped io address
- unsigned long phys_iobase; // Physical io address
+ resource_size_t phys_iobase; // Physical io address
unsigned int AdcCmdStatus; // ADC Command/Status register
unsigned int DacCmdStatus; // DAC Command/Status register
unsigned int IntEnable; // Interrupt Enable register
{
comedi_subdevice *s;
int ret, subdev, n_subdevices;
- unsigned short master,irq;
+ unsigned short master;
+ unsigned int irq;
struct pcilst_struct *card=NULL;
- unsigned long io_addr[5], iobase;
+ resource_size_t io_addr[5], iobase;
unsigned char pci_bus, pci_slot, pci_func;
printk("icp_multi EDBG: BGN: icp_multi_attach(...)\n");
iobase=io_addr[2];
devpriv->phys_iobase = iobase;
- printk(", b:s:f=%d:%d:%d, io=0x%8lx \n", pci_bus, pci_slot, pci_func, iobase);
+ printk(", b:s:f=%d:%d:%d, io=0x%8llx \n", pci_bus, pci_slot, pci_func,
+ (unsigned long long)iobase);
devpriv->io_addr = ioremap(iobase, ICP_MULTI_SIZE);
}
#ifdef ICP_MULTI_EXTDEBUG
- printk("0x%08lx mapped to %p, ", iobase, devpriv->io_addr);
+ printk("0x%08llx mapped to %p, ", (unsigned long long)iobase, devpriv->io_addr);
#endif
dev->board_name = this_board->name;
if (this_board->have_irq) {
if (irq) {
if (comedi_request_irq(irq, interrupt_service_icp_multi, SA_SHIRQ, "Inova Icp Multi", dev)) {
- printk(", unable to allocate IRQ %d, DISABLING IT", irq);
+ printk(", unable to allocate IRQ %u, DISABLING IT", irq);
irq=0; /* Can't use IRQ */
}
else
- printk(", irq=%d", irq);
+ printk(", irq=%u", irq);
}
else
printk(", IRQ disabled");
unsigned char pci_bus;
unsigned char pci_slot;
unsigned char pci_func;
- unsigned long io_addr[5];
+ resource_size_t io_addr[5];
unsigned int irq;
};
static void pci_card_list_display(void);
static int pci_card_data(struct pcilst_struct *amcc,
unsigned char *pci_bus, unsigned char *pci_slot, unsigned char *pci_func,
- unsigned long *io_addr, unsigned short *irq, unsigned short *master);
+ resource_size_t *io_addr, unsigned int *irq, unsigned short *master);
/****************************************************************************/
for (inova=inova_devices; inova; inova=next) {
next=inova->next;
- printk("%2d %2d %2d 0x%4x 0x%4x %3s 0x%8lx 0x%8lx %2d %2d\n",
+ printk("%2d %2d %2d 0x%4x 0x%4x %3s 0x%8llx 0x%8llx %2u %2d\n",
inova->pci_bus,inova->pci_slot,inova->pci_func,inova->vendor,inova->device,inova->master?"yes":"no",
- inova->io_addr[0],inova->io_addr[2],inova->irq,inova->used);
+ (unsigned long long)inova->io_addr[0],(unsigned long long)inova->io_addr[2],inova->irq,inova->used);
}
}
/* return all card information for driver */
static int pci_card_data(struct pcilst_struct *inova,
unsigned char *pci_bus, unsigned char *pci_slot, unsigned char *pci_func,
- unsigned long *io_addr, unsigned short *irq, unsigned short *master)
+ resource_size_t *io_addr, unsigned int *irq, unsigned short *master)
{
int i;
comedi_subdevice *subdevice;
struct pci_dev *pci_device;
cnt_board_struct *board;
- int io_base;
+ unsigned long io_base;
int error, i;
/* allocate device private structure */
/* read register base address [PCI_BASE_ADDRESS #0] */
io_base = pci_resource_start(pci_device, 0);
- dev->iobase = io_base & PCI_BASE_ADDRESS_IO_MASK;
+ dev->iobase = io_base;
/* allocate the subdevice structures */
if((error = alloc_subdevices(dev, 1)) < 0)
struct pci_dev *pci_dev_p; // General PCI information
- char irq; // IRQ assigned from the PCI BIOS
+ unsigned int irq; // IRQ assigned from the PCI BIOS
struct me4000_ai_context ai_context; // Analog input specific context
struct me4000_ao_context ao_context[4]; // Vector with analog output specific context
struct pci_dev* pci_device;
void *plx_regbase; // PLX configuration base address
void *me_regbase; // Base address of the Meilhaus card
- unsigned int plx_regbase_size; // Size of PLX configuration space
- unsigned int me_regbase_size; // Size of Meilhaus space
+ unsigned long plx_regbase_size; // Size of PLX configuration space
+ unsigned long me_regbase_size; // Size of Meilhaus space
unsigned short control_1; // Mirror of CONTROL_1 register
unsigned short control_2; // Mirror of CONTROL_2 register
struct pci_dev* pci_device;
comedi_subdevice *subdevice;
me_board_struct* board;
- unsigned int plx_regbase_tmp;
- unsigned int plx_regbase_size_tmp;
- unsigned int me_regbase_tmp;
- unsigned int me_regbase_size_tmp;
- unsigned int swap_regbase_tmp;
- unsigned int swap_regbase_size_tmp;
- unsigned int regbase_tmp;
+ resource_size_t plx_regbase_tmp;
+ unsigned long plx_regbase_size_tmp;
+ resource_size_t me_regbase_tmp;
+ unsigned long me_regbase_size_tmp;
+ resource_size_t swap_regbase_tmp;
+ unsigned long swap_regbase_size_tmp;
+ resource_size_t regbase_tmp;
int result, error, i;
// Allocate private memory
// Read PLX register base address [PCI_BASE_ADDRESS #0].
plx_regbase_tmp = pci_resource_start(pci_device, 0);
- plx_regbase_size_tmp = pci_resource_end(pci_device, 0) - plx_regbase_tmp + 1;
+ plx_regbase_size_tmp = pci_resource_len(pci_device, 0);
dev_private->plx_regbase = ioremap(plx_regbase_tmp, plx_regbase_size_tmp);
dev_private->plx_regbase_size = plx_regbase_size_tmp;
if(!dev_private->plx_regbase)
// Read Swap base address [PCI_BASE_ADDRESS #5].
swap_regbase_tmp = pci_resource_start(pci_device, 5);
- swap_regbase_size_tmp = pci_resource_end(pci_device, 5) - swap_regbase_tmp + 1;
+ swap_regbase_size_tmp = pci_resource_len(pci_device, 5);
if(!swap_regbase_tmp)
{
// Read Meilhaus register base address [PCI_BASE_ADDRESS #2].
me_regbase_tmp = pci_resource_start(pci_device, 2);
- me_regbase_size_tmp = pci_resource_end(pci_device, 2) - me_regbase_tmp + 1;
+ me_regbase_size_tmp = pci_resource_len(pci_device, 2);
dev_private->me_regbase_size = me_regbase_size_tmp;
dev_private->me_regbase = ioremap(me_regbase_tmp, me_regbase_size_tmp);
if(!dev_private->me_regbase)
int mite_setup(struct mite_struct *mite)
{
unsigned long length;
- u32 addr;
+ resource_size_t addr;
int i;
u32 csigr_bits;
printk("failed to remap mite io memory address\n");
return -ENOMEM;
}
- printk("MITE:0x%08lx mapped to %p ",mite->mite_phys_addr,mite->mite_io_addr);
+ printk("MITE:0x%08llx mapped to %p ",(unsigned long long)mite->mite_phys_addr,mite->mite_io_addr);
addr=pci_resource_start(mite->pcidev, 1);
mite->daq_phys_addr=addr;
printk("failed to remap daq io memory address\n");
return -ENOMEM;
}
- printk("DAQ:0x%08lx mapped to %p\n",mite->daq_phys_addr,mite->daq_io_addr);
+ printk("DAQ:0x%08llx mapped to %p\n",(unsigned long long)mite->daq_phys_addr,mite->daq_io_addr);
// The 6602 board needs different initalisation, see the
// _updated_ (nov 2002) reg. Level Manual (filename 370505b.pdf) p. 3.55
int used;
struct pci_dev *pcidev;
- unsigned long mite_phys_addr;
+ resource_size_t mite_phys_addr;
void *mite_io_addr;
- unsigned long daq_phys_addr;
+ resource_size_t daq_phys_addr;
void *daq_io_addr;
struct mite_channel channels[MAX_MITE_DMA_CHANNELS];
static int mpc624_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase = it->options[0];
- rt_printk("comedi%d: mpc624 [0x%04x, ", dev->minor, iobase);
+ rt_printk("comedi%d: mpc624 [0x%04lx, ", dev->minor, iobase);
if(request_region(iobase, MPC624_SIZE, "mpc624") == NULL)
{
rt_printk("I/O port(s) in use\n");
static int multiq3_attach(comedi_device * dev, comedi_devconfig * it)
{
int result = 0;
- int iobase;
- int irq;
+ unsigned long iobase;
+ unsigned int irq;
comedi_subdevice *s;
iobase = it->options[0];
- printk("comedi%d: multiq3: 0x%04x ", dev->minor, iobase);
+ printk("comedi%d: multiq3: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, MULTIQ3_SIZE, "multiq3")) {
printk("comedi%d: I/O port conflict\n", dev->minor);
return -EIO;
dev->iobase = iobase;
irq = it->options[1];
- if (irq > 0) {
- printk("comedi%d: irq = %d ignored\n", dev->minor, irq);
- } else if(irq == 0) {
+ if (irq) {
+ printk("comedi%d: irq = %u ignored\n", dev->minor, irq);
+ } else {
printk("comedi%d: no irq\n", dev->minor);
}
dev->board_name = "multiq3";
static int a2150_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase = it->options[0];
- int irq = it->options[1];
- int dma = it->options[2];
+ unsigned long iobase = it->options[0];
+ unsigned int irq = it->options[1];
+ unsigned int dma = it->options[2];
static const int timeout = 2000;
int i;
- printk("comedi%d: %s: io 0x%x", dev->minor, driver_a2150.driver_name, iobase);
+ printk("comedi%d: %s: io 0x%lx", dev->minor, driver_a2150.driver_name, iobase);
if(irq)
{
- printk(", irq %i", irq);
+ printk(", irq %u", irq);
}else
{
printk(", no irq");
}
if(dma)
{
- printk(", dma %i", dma);
+ printk(", dma %u", dma);
}else
{
printk(", no dma");
// check that irq is supported
if(irq < 3 || irq == 8 || irq == 13 || irq > 15)
{
- printk(" invalid irq line\n");
+ printk(" invalid irq line %u\n", irq);
return -EINVAL;
}
if(comedi_request_irq( irq, a2150_interrupt, 0, driver_a2150.driver_name, dev ))
{
- printk( "unable to allocate irq %d\n", irq);
+ printk( "unable to allocate irq %u\n", irq);
return -EINVAL;
}
devpriv->irq_dma_bits |= IRQ_LVL_BITS(irq);
// initialize dma
if(dma)
{
- if(dma < 0 || dma == 4 || dma > 7)
+ if(dma == 4 || dma > 7)
{
- printk(" invalid dma channel %i\n", dma);
+ printk(" invalid dma channel %u\n", dma);
return -EINVAL;
}
if(request_dma(dma, driver_a2150.driver_name))
{
- printk(" failed to allocate dma channel %i\n", dma);
+ printk(" failed to allocate dma channel %u\n", dma);
return -EINVAL;
}
devpriv->dma = dma;
{
struct pnp_dev *isapnp_dev;
int ret;
- int iobase;
+ unsigned long iobase;
int board;
- int irq;
+ unsigned int irq;
/* allocate private area */
if((ret = ni_alloc_private(dev)) < 0)
/* reserve our I/O region */
- printk("comedi%d: ni_atmio: 0x%04x",dev->minor,iobase);
+ printk("comedi%d: ni_atmio: 0x%04lx",dev->minor,iobase);
if(!request_region(iobase,NI_SIZE,"ni_atmio")){
printk(" I/O port conflict\n");
return -EIO;
/* irq stuff */
if(irq!=0){
- if(irq<0 || irq>15 || ni_irqpin[irq]==-1){
- printk(" invalid irq\n");
+ if(irq>15 || ni_irqpin[irq]==-1){
+ printk(" invalid irq %u\n",irq);
return -EINVAL;
}
- printk(" ( irq = %d )",irq);
+ printk(" ( irq = %u )",irq);
if( (ret=comedi_request_irq(irq,ni_E_interrupt,NI_E_IRQ_FLAGS,"ni_atmio",dev))<0 ){
printk(" irq not available\n");
return -EINVAL;
static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it)
{
- int irq;
- int iobase;
+ unsigned int irq;
+ unsigned long iobase;
int ret;
comedi_subdevice *s;
/* make sure the address range is free and allocate it */
iobase = it->options[0];
- printk("comedi%d: atmio16d: 0x%04x ", dev->minor, iobase);
+ printk("comedi%d: atmio16d: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, ATMIO16D_SIZE, "ni_atmio16d")) {
printk("I/O port conflict\n");
return -EIO;
/* check if our interrupt is available and get it */
irq=it->options[1];
- if(irq>0){
+ if(irq){
if((ret=comedi_request_irq(irq,atmio16d_interrupt,
0, "atmio16d", dev))<0)
{
- printk("failed to allocate irq %d\n", irq);
+ printk("failed to allocate irq %u\n", irq);
return ret;
}
dev->irq=irq;
- printk("( irq = %d )\n",irq);
- } else if(irq == 0){
+ printk("( irq = %u )\n",irq);
+ } else {
printk("( no irq )");
}
/* 8255 subdevice */
s++;
if(boardtype->has_8255){
- subdev_8255_init(dev,s,NULL,(unsigned long)dev->iobase);
+ subdev_8255_init(dev,s,NULL,dev->iobase);
}else{
s->type=COMEDI_SUBD_UNUSED;
}
static int dio24_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase = 0;
+ unsigned long iobase = 0;
#ifdef incomplete
- int irq = 0;
+ unsigned int irq = 0;
#endif
dev_link_t *link;
return -EINVAL;
break;
}
- printk("comedi%d: ni_daq_dio24: %s, io 0x%x", dev->minor, thisboard->name, iobase);
+ printk("comedi%d: ni_daq_dio24: %s, io 0x%lx", dev->minor, thisboard->name, iobase);
#ifdef incomplete
if(irq)
{
- printk(", irq %i", irq);
+ printk(", irq %u", irq);
}
#endif
#ifdef incomplete
/* grab our IRQ */
- if(irq < 0)
- {
- printk("irq out of range\n");
- return -EINVAL;
- }
dev->irq = irq;
#endif
}
int labpc_common_attach( comedi_device *dev, unsigned long iobase,
- int irq, int dma_chan )
+ unsigned int irq, unsigned int dma_chan )
{
comedi_subdevice *s;
int i;
printk("comedi%d: ni_labpc: %s, io 0x%lx", dev->minor, thisboard->name, iobase);
if(irq)
{
- printk(", irq %i", irq);
+ printk(", irq %u", irq);
}
if(dma_chan)
{
- printk(", dma %i", dma_chan);
+ printk(", dma %u", dma_chan);
}
printk("\n");
}
/* grab our IRQ */
- if(irq < 0)
- {
- printk("irq out of range\n");
- return -EINVAL;
- }
if(irq)
{
isr_flags = 0;
isr_flags |= SA_SHIRQ;
if(comedi_request_irq( irq, labpc_interrupt, isr_flags, driver_labpc.driver_name, dev))
{
- printk( "unable to allocate irq %d\n", irq);
+ printk( "unable to allocate irq %u\n", irq);
return -EINVAL;
}
}
dev->irq = irq;
// grab dma channel
- if(dma_chan < 0 || dma_chan > 3)
+ if(dma_chan > 3)
{
- printk(" invalid dma channel\n");
+ printk(" invalid dma channel %u\n", dma_chan);
return -EINVAL;
}else if(dma_chan)
{
}
if(request_dma(dma_chan, driver_labpc.driver_name))
{
- printk(" failed to allocate dma channel %i\n", dma_chan);
+ printk(" failed to allocate dma channel %u\n", dma_chan);
return -EINVAL;
}
devpriv->dma_chan = dma_chan;
static int labpc_attach(comedi_device *dev, comedi_devconfig *it)
{
unsigned long iobase = 0;
- int irq = 0;
- int dma_chan = 0;
+ unsigned int irq = 0;
+ unsigned int dma_chan = 0;
int ret;
/* allocate and initialize dev->private */
extern labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS];
int labpc_common_attach( comedi_device *dev, unsigned long iobase,
- int irq, int dma );
+ unsigned int irq, unsigned int dma );
int labpc_common_detach( comedi_device *dev );
static int labpc_attach(comedi_device *dev, comedi_devconfig *it)
{
unsigned long iobase = 0;
- int irq = 0;
+ unsigned int irq = 0;
dev_link_t *link;
/* allocate and initialize dev->private */
static int mio_cs_attach(comedi_device *dev,comedi_devconfig *it)
{
dev_link_t *link;
- int irq;
+ unsigned int irq;
int ret;
DPRINTK("mio_cs_attach(dev=%p,it=%p)\n",dev,it);
irq=link->irq.AssignedIRQ;
- printk("comedi%d: %s: DAQCard: io 0x%04lx, irq %d, ",
+ printk("comedi%d: %s: DAQCard: io 0x%04lx, irq %u, ",
dev->minor,dev->driver->driver_name,dev->iobase,
irq);
int i;
int ret;
int n_subdevices;
- int irq;
+ unsigned int irq;
printk("comedi%d: nidio:",dev->minor);
if(dev->irq==0){
printk(" unknown irq (bad)\n");
}else{
- printk(" ( irq = %d )",dev->irq);
+ printk(" ( irq = %u )",dev->irq);
if( (ret=comedi_request_irq(dev->irq,ni_E_interrupt,NI_E_IRQ_FLAGS,"ni_pcimio",dev))<0 ){
printk(" irq not available\n");
dev->irq=0;
static int pcl711_attach(comedi_device * dev, comedi_devconfig * it)
{
int ret;
- int iobase;
- int irq;
+ unsigned long iobase;
+ unsigned int irq;
comedi_subdevice *s;
/* claim our I/O space */
iobase = it->options[0];
- printk("comedi%d: pcl711: 0x%04x ", dev->minor, iobase);
+ printk("comedi%d: pcl711: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, PCL711_SIZE, "pcl711")) {
printk("I/O port conflict\n");
return -EIO;
/* grab our IRQ */
irq = it->options[1];
- if (irq < 0 || irq > this_board->maxirq) {
+ if (irq > this_board->maxirq) {
printk("irq out of range\n");
return -EINVAL;
}
if (irq) {
if (comedi_request_irq(irq, pcl711_interrupt, 0, "pcl711", dev)) {
- printk("unable to allocate irq %d\n", irq);
+ printk("unable to allocate irq %u\n", irq);
return -EINVAL;
} else {
- printk("( irq = %d )\n", irq);
+ printk("( irq = %u )\n", irq);
}
}
dev->irq = irq;
int dio; // num of DIO
int numofports; // num of 8255 subdevices
unsigned int IRQbits; // allowed interrupts
- int io_range; // len of IO space
+ unsigned int io_range; // len of IO space
char can_have96;
char is_pet48;
} boardtype;
static int subdev_8255_cb(int dir,int port,int data,unsigned long arg)
{
- int iobase=arg;
+ unsigned long iobase=arg;
if(dir){
outb(data,iobase+port);
static int pcl724_attach(comedi_device *dev,comedi_devconfig *it)
{
- int iobase,iorange;
+ unsigned long iobase;
+ unsigned int iorange;
int ret,i,n_subdevices;
+#ifdef PCL724_IRQ
+ unsigned int irq;
+#endif
iobase=it->options[0];
iorange=this_board->io_range;
if ((this_board->can_have96)&&((it->options[1]==1)||(it->options[1]==96)))
iorange=PCL722_96_SIZE; // PCL-724 in 96 DIO configuration
- printk("comedi%d: pcl724: board=%s, 0x%03x ",dev->minor,
+ printk("comedi%d: pcl724: board=%s, 0x%03lx ",dev->minor,
this_board->name,iobase);
if(!request_region(iobase, iorange, "pcl724")){
printk("I/O port conflict\n");
irq=0;
if (this_board->IRQbits!=0) { /* board support IRQ */
irq=it->options[1];
- if (irq>0) {/* we want to use IRQ */
+ if (irq) {/* we want to use IRQ */
if (((1<<irq)&this_board->IRQbits)==0) {
- rt_printk(", IRQ %d is out of allowed range, DISABLING IT",irq);
+ rt_printk(", IRQ %u is out of allowed range, DISABLING IT",irq);
irq=0; /* Bad IRQ */
} else {
if (comedi_request_irq(irq, interrupt_pcl724, 0, "pcl724", dev)) {
- rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq);
+ rt_printk(", unable to allocate IRQ %u, DISABLING IT", irq);
irq=0; /* Can't use IRQ */
} else {
- rt_printk(", irq=%d", irq);
+ rt_printk(", irq=%u", irq);
}
}
}
static int pcl725_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase=it->options[0];
- printk("comedi%d: pcl725: 0x%04x ",dev->minor,iobase);
+ printk("comedi%d: pcl725: 0x%04lx ",dev->minor,iobase);
if(!request_region(iobase,PCL725_SIZE,"pcl725")){
printk("I/O port conflict\n");
return -EIO;
int n_aochan; // num of D/A chans
int num_of_ranges; // num of ranges
unsigned int IRQbits; // allowed interrupts
- int io_range; // len of IO space
+ unsigned int io_range; // len of IO space
char have_dio; // 1=card have DI/DO ports
int di_hi; // ports for DI/DO operations
int di_lo;
static int pcl726_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase,iorange;
+ unsigned long iobase;
+ unsigned int iorange;
int ret,i;
+#ifdef ACL6126_IRQ
+ unsigned int irq;
+#endif
iobase=it->options[0];
iorange=this_board->io_range;
- printk("comedi%d: pcl726: board=%s, 0x%03x ",dev->minor,this_board->name,iobase);
+ printk("comedi%d: pcl726: board=%s, 0x%03lx ",dev->minor,this_board->name,iobase);
if(!request_region(iobase, iorange, "pcl726")){
printk("I/O port conflict\n");
return -EIO;
if (boardtypes[board].IRQbits!=0) { /* board support IRQ */
irq=it->options[1];
devpriv->first_chan=2;
- if (irq>0) {/* we want to use IRQ */
+ if (irq) {/* we want to use IRQ */
if (((1<<irq)&boardtypes[board].IRQbits)==0) {
rt_printk(", IRQ %d is out of allowed range, DISABLING IT",irq);
irq=0; /* Bad IRQ */
typedef struct {
char *name; // driver name
- int io_range; // len of I/O space
+ unsigned int io_range; // len of I/O space
} boardtype;
static boardtype boardtypes[] =
static int pcl730_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase, iorange;
+ unsigned long iobase;
+ unsigned int iorange;
iobase=it->options[0];
iorange=this_board->io_range;
- printk("comedi%d: pcl730: board=%s 0x%04x ", dev->minor,
+ printk("comedi%d: pcl730: board=%s 0x%04lx ", dev->minor,
this_board->name, iobase);
if( !request_region(iobase, iorange, "pcl730") ) {
printk("I/O port conflict\n");
static int pcl812_attach(comedi_device * dev, comedi_devconfig * it)
{
int ret,subdev;
- int iobase;
- int irq;
- int dma;
+ unsigned long iobase;
+ unsigned int irq;
+ unsigned int dma;
unsigned long pages;
comedi_subdevice *s;
int n_subdevices;
iobase = it->options[0];
- printk("comedi%d: pcl812: board=%s, ioport=0x%03x", dev->minor,
+ printk("comedi%d: pcl812: board=%s, ioport=0x%03lx", dev->minor,
this_board->name, iobase);
if (!request_region(iobase, this_board->io_range, "pcl812")) {
irq = it->options[1];
if (irq) { /* we want to use IRQ */
if (((1 << irq) & this_board->IRQbits) == 0) {
- printk(", IRQ %d is out of allowed range, DISABLING IT", irq);
+ printk(", IRQ %u is out of allowed range, DISABLING IT", irq);
irq = 0; /* Bad IRQ */
} else {
if (comedi_request_irq(irq, interrupt_pcl812, 0, "pcl812", dev)) {
- printk(", unable to allocate IRQ %d, DISABLING IT", irq);
+ printk(", unable to allocate IRQ %u, DISABLING IT", irq);
irq = 0; /* Can't use IRQ */
} else {
- printk(", irq=%d", irq);
+ printk(", irq=%u", irq);
}
}
}
}
ret = request_dma(dma, "pcl812");
if (ret) {
- printk(", unable to allocate DMA %d, FAIL!\n", dma);
+ printk(", unable to allocate DMA %u, FAIL!\n", dma);
return -EBUSY; /* DMA isn't free */
}
devpriv->dma = dma;
- printk(", dma=%d", dma);
+ printk(", dma=%u", dma);
pages = 1; /* we want 8KB */
devpriv->dmabuf[0] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[0]) {
int n_dochan; // num of DO chans
comedi_lrange *ai_range_type; // default A/D rangelist
comedi_lrange *ao_range_type; // dafault D/A rangelist
- int io_range; // len of IO space
+ unsigned int io_range; // len of IO space
unsigned int IRQbits; // allowed interrupts
unsigned int DMAbits; // allowed DMA chans
int ai_maxdata; // maxdata for A/D
typedef struct
{
- int dma; // used DMA, 0=don't use DMA
+ unsigned int dma; // used DMA, 0=don't use DMA
int dma_rtc; // 1=RTC used with DMA, 0=no RTC alloc
#ifdef unused
- unsigned int rtc_iobase; // RTC port region
+ unsigned long rtc_iobase; // RTC port region
unsigned int rtc_iosize;
unsigned int rtc_irq;
#endif
==============================================================================
chech for PCL816
*/
-static int pcl816_check (int iobase)
+static int pcl816_check (unsigned long iobase)
{
outb (0x00, iobase + PCL816_MUX);
comedi_udelay (1);
pcl816_attach (comedi_device * dev, comedi_devconfig * it)
{
int ret;
- int iobase;
- int irq, dma;
+ unsigned long iobase;
+ unsigned int irq, dma;
unsigned long pages;
//int i;
comedi_subdevice *s;
/* claim our I/O space */
iobase = it->options[0];
- printk("comedi%d: pcl816: board=%s, ioport=0x%03x", dev->minor,
+ printk("comedi%d: pcl816: board=%s, ioport=0x%03lx", dev->minor,
this_board->name, iobase);
if (!request_region (iobase, this_board->io_range, "pcl816")) {
irq = 0;
if (this_board->IRQbits != 0) { /* board support IRQ */
irq = it->options[1];
- if (irq > 0)
+ if (irq)
{ /* we want to use IRQ */
if (((1 << irq) & this_board->IRQbits) == 0)
{
- rt_printk (", IRQ %d is out of allowed range, DISABLING IT", irq);
+ rt_printk (", IRQ %u is out of allowed range, DISABLING IT", irq);
irq = 0; /* Bad IRQ */
}
else
{
if (comedi_request_irq(irq, interrupt_pcl816, 0, "pcl816", dev)) {
- rt_printk (", unable to allocate IRQ %d, DISABLING IT",irq);
+ rt_printk (", unable to allocate IRQ %u, DISABLING IT",irq);
irq = 0; /* Can't use IRQ */
}
else {
- rt_printk (", irq=%d", irq);
+ rt_printk (", irq=%u", irq);
}
}
}
0, "pcl816 DMA (RTC)", dev)) {
devpriv->dma_rtc = 1;
devpriv->rtc_irq = RTC_IRQ;
- rt_printk (", dma_irq=%d", devpriv->rtc_irq);
+ rt_printk (", dma_irq=%u", devpriv->rtc_irq);
} else {
RTC_lock--;
if (RTC_lock == 0)
}
ret = request_dma (dma, "pcl816");
if (ret) {
- rt_printk (", unable to allocate DMA %d, FAIL!\n", dma);
+ rt_printk (", unable to allocate DMA %u, FAIL!\n", dma);
return -EBUSY; /* DMA isn't free */
}
devpriv->dma = dma;
- rt_printk (", dma=%d", dma);
+ rt_printk (", dma=%u", dma);
pages = 2; /* we need 16KB */
devpriv->dmabuf[0] = __get_dma_pages (GFP_KERNEL, pages);
int n_dochan; // num of DO chans
comedi_lrange *ai_range_type; // default A/D rangelist
comedi_lrange *ao_range_type; // default D/A rangelist
- int io_range; // len of IO space
+ unsigned int io_range; // len of IO space
unsigned int IRQbits; // allowed interrupts
unsigned int DMAbits; // allowed DMA chans
int ai_maxdata; // maxdata for A/D
typedef struct {
- int dma; // used DMA, 0=don't use DMA
+ unsigned int dma; // used DMA, 0=don't use DMA
int dma_rtc; // 1=RTC used with DMA, 0=no RTC alloc
- int io_range;
+ unsigned int io_range;
#ifdef unused
- unsigned int rtc_iobase; // RTC port region
+ unsigned long rtc_iobase; // RTC port region
unsigned int rtc_iosize;
unsigned int rtc_irq;
struct timer_list rtc_irq_timer;// timer for RTC sanity check
==============================================================================
chech for PCL818
*/
-static int pcl818_check(int iobase)
+static int pcl818_check(unsigned long iobase)
{
outb(0x00, iobase + PCL818_MUX);
comedi_udelay(1);
static int pcl818_attach(comedi_device * dev, comedi_devconfig * it)
{
int ret;
- int iobase;
- int irq,dma;
+ unsigned long iobase;
+ unsigned int irq,dma;
unsigned long pages;
comedi_subdevice *s;
/* claim our I/O space */
iobase = it->options[0];
- printk("comedi%d: pcl818: board=%s, ioport=0x%03x",
+ printk("comedi%d: pcl818: board=%s, ioport=0x%03lx",
dev->minor, this_board->name, iobase);
devpriv->io_range=this_board->io_range;
if ((this_board->fifo)&&(it->options[2]==-1)) { // we've board with FIFO and we want to use FIFO
irq=0;
if (this_board->IRQbits!=0) { /* board support IRQ */
irq=it->options[1];
- if (irq>0) {/* we want to use IRQ */
+ if (irq) {/* we want to use IRQ */
if (((1<<irq)&this_board->IRQbits)==0) {
- rt_printk(", IRQ %d is out of allowed range, DISABLING IT",irq);
+ rt_printk(", IRQ %u is out of allowed range, DISABLING IT",irq);
irq=0; /* Bad IRQ */
} else {
if (comedi_request_irq(irq, interrupt_pcl818, 0, "pcl818", dev)) {
- rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq);
+ rt_printk(", unable to allocate IRQ %u, DISABLING IT", irq);
irq=0; /* Can't use IRQ */
} else {
- rt_printk(", irq=%d", irq);
+ rt_printk(", irq=%u", irq);
}
}
}
if (!comedi_request_irq(RTC_IRQ, interrupt_pcl818_ai_mode13_dma_rtc, 0, "pcl818 DMA (RTC)", dev)) {
devpriv->dma_rtc=1;
devpriv->rtc_irq=RTC_IRQ;
- rt_printk(", dma_irq=%d", devpriv->rtc_irq);
+ rt_printk(", dma_irq=%u", devpriv->rtc_irq);
} else {
RTC_lock--;
if (RTC_lock==0) {
}
ret=request_dma(dma, "pcl818");
if (ret) {
- rt_printk(", unable to allocate DMA %d, FAIL!\n",dma);
+ rt_printk(", unable to allocate DMA %u, FAIL!\n",dma);
return -EBUSY; /* DMA isn't free */
}
devpriv->dma=dma;
- rt_printk(", dma=%d", dma);
+ rt_printk(", dma=%u", dma);
pages=2; /* we need 16KB */
devpriv->dmabuf[0]=__get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[0]) {
int dio; // num of DIO
int numofports; // num of 8255 subdevices
unsigned int IRQbits; // allowed interrupts
- int io_range; // len of IO space
+ unsigned int io_range; // len of IO space
} boardtype;
//used to track configured dios
static int subdev_8255_cb(int dir,int port,int data,unsigned long arg)
{
- int iobase=arg;
+ unsigned long iobase=arg;
unsigned char inbres;
- //printk("8255cb %d %d %d %x\n", dir,port,data,arg);
+ //printk("8255cb %d %d %d %lx\n", dir,port,data,arg);
if(dir){
- //printk("8255 cb outb(%x, %x)\n", data, iobase+port);
+ //printk("8255 cb outb(%x, %lx)\n", data, iobase+port);
outb(data,iobase+port);
return 0;
}else{
inbres = inb(iobase+port);
- //printk("8255 cb inb(%x) = %x\n", iobase+port, inbres);
+ //printk("8255 cb inb(%lx) = %x\n", iobase+port, inbres);
return inbres;
}
}
{
int config;
int buffer_config;
- int port_8255_cfg;
+ unsigned long port_8255_cfg;
config=CR_CW;
buffer_config = 0;
port_8255_cfg = dev->iobase + SIZE_8255 + _8255_CR;
}
outb(buffer_config, dev->iobase + 8); /* update buffer register */
- //printk("pcm3724 buffer_config (%x) %d, %x\n", dev->iobase + _8255_CR, chanspec, buffer_config);
+ //printk("pcm3724 buffer_config (%lx) %d, %x\n", dev->iobase + _8255_CR, chanspec, buffer_config);
outb(config, port_8255_cfg);
}
static int pcm3724_attach(comedi_device *dev,comedi_devconfig *it)
{
- int iobase,iorange;
+ unsigned long iobase;
+ unsigned int iorange;
int ret,i,n_subdevices;
iobase=it->options[0];
((priv_pcm3724*)(dev->private))->dio_1 = 0;
((priv_pcm3724*)(dev->private))->dio_2 = 0;
- printk("comedi%d: pcm3724: board=%s, 0x%03x ",dev->minor,
+ printk("comedi%d: pcm3724: board=%s, 0x%03lx ",dev->minor,
this_board->name,iobase);
if(!iobase || !request_region(iobase, iorange, "pcm3724")){
printk("I/O port conflict\n");
static int pcm3730_attach(comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase=it->options[0];
- printk("comedi%d: pcm3730: 0x%04x ",dev->minor,iobase);
+ printk("comedi%d: pcm3730: 0x%04lx ",dev->minor,iobase);
if(!request_region(iobase,PCM3730_SIZE,"pcm3730")){
printk("I/O port conflict\n");
return -EIO;
{
int ret;
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase=it->options[0];
- printk("comedi%d: pcmad: 0x%04x ",dev->minor,iobase);
+ printk("comedi%d: pcmad: 0x%04lx ",dev->minor,iobase);
if(!request_region(iobase,PCMAD_SIZE,"pcmad")){
printk("I/O port conflict\n");
return -EIO;
static int pcmda12_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iobase;
+ unsigned long iobase;
iobase = it->options[0];
- printk("comedi%d: %s: io: %x %s ", dev->minor, driver.driver_name, iobase, it->options[1] ? "simultaneous xfer mode enabled" : "");
+ printk("comedi%d: %s: io: %lx %s ", dev->minor, driver.driver_name, iobase, it->options[1] ? "simultaneous xfer mode enabled" : "");
if ( !request_region(iobase,
IOSIZE,
unsigned char enab[NUM_PAGED_REGS]; /* shadow of ENABx registers */
int num;
unsigned long iobase;
- int irq;
+ unsigned int irq;
spinlock_t spinlock;
} asics[MAX_ASICS];
pcmuio_subdev_private *sprivs;
static int pcmuio_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int sdev_no, chans_left, n_subdevs, iobase, irq[MAX_ASICS], port, asic, thisasic_chanct = 0;
+ int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0;
+ unsigned long iobase;
+ unsigned int irq[MAX_ASICS];
iobase = it->options[0];
irq[0] = it->options[1];
irq[1] = it->options[2];
- printk("comedi%d: %s: io: %x ", dev->minor, driver.driver_name, iobase);
+ printk("comedi%d: %s: io: %lx ", dev->minor, driver.driver_name, iobase);
dev->iobase = iobase;
irqs.. */
if (irq[0]) {
- printk("irq: %d ", irq[0]);
+ printk("irq: %u ", irq[0]);
if (irq[1] && thisboard->num_asics == 2)
- printk("second ASIC irq: %d ", irq[1]);
+ printk("second ASIC irq: %u ", irq[1]);
} else {
printk("(IRQ mode disabled) ");
}
for (byte_no = 0; byte_no < s->n_chan/CHANS_PER_PORT; ++byte_no) {
/* address of 8-bit port */
- int ioaddr = subpriv->iobases[byte_no],
+ unsigned long ioaddr = subpriv->iobases[byte_no],
/* bit offset of port in 32-bit doubleword */
offset = byte_no * 8;
/* this 8-bit port's data */
static int pcmuio_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- int chan = CR_CHAN(insn->chanspec), byte_no = chan/8, bit_no = chan % 8, ioaddr;
+ int chan = CR_CHAN(insn->chanspec), byte_no = chan/8, bit_no = chan % 8;
+ unsigned long ioaddr;
unsigned char byte;
/* Compute ioaddr for this channel */
for (asic = 0; asic < thisboard->num_asics; ++asic)
{
int port, page;
- int baseaddr = dev->iobase + asic*ASIC_IOSIZE;
+ unsigned long baseaddr = dev->iobase + asic*ASIC_IOSIZE;
switch_page(dev, asic, 0); /* switch back to page 0 */
if (irq == devpriv->asics[asic].irq) {
unsigned long flags;
unsigned triggered = 0;
- int iobase = devpriv->asics[asic].iobase;
+ unsigned long iobase = devpriv->asics[asic].iobase;
/* it is an interrupt for ASIC #asic */
unsigned char int_pend;
struct boarddef_struct{
char *name;
- int iosize;
+ unsigned int iosize;
int (*setup)(comedi_device *);
int type;
int n_chan;
static int poc_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iosize, iobase;
+ unsigned long iobase;
+ unsigned int iosize;
iobase = it->options[0];
- printk("comedi%d: poc: using %s iobase 0x%x\n", dev->minor,
+ printk("comedi%d: poc: using %s iobase 0x%lx\n", dev->minor,
this_board->name, iobase);
dev->board_name = this_board->name;
/* check if io addresses are available */
if(!request_region(iobase, iosize, "dac02"))
{
- printk("I/O port conflict: failed to allocate ports 0x%x to 0x%x\n",
+ printk("I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
iobase, iobase + iosize - 1);
return -EIO;
}
if (link->conf.Vpp1)
printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
if (link->conf.Attributes & CONF_ENABLE_IRQ)
- printk(", irq %d", link->irq.AssignedIRQ);
+ printk(", irq %u", link->irq.AssignedIRQ);
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,
link->io.BasePort1+link->io.NumPorts1-1);
comedi_subdevice *s;
struct pci_dev* pcidev;
int ret;
- unsigned long physLas0; /* configuation */
- unsigned long physLas1; /* data area */
- unsigned long physLcfg; /* PLX9080 */
+ resource_size_t physLas0; /* configuation */
+ resource_size_t physLas1; /* data area */
+ resource_size_t physLcfg; /* PLX9080 */
#ifdef USE_DMA
int index;
#endif
return -ENOMEM;
}
- DPRINTK ("%s: LAS0=%lx, LAS1=%lx, CFG=%lx.\n", dev->board_name,
- physLas0, physLas1, physLcfg);
+ DPRINTK ("%s: LAS0=%llx, LAS1=%llx, CFG=%llx.\n", dev->board_name,
+ (unsigned long long)physLas0, (unsigned long long)physLas1,
+ (unsigned long long)physLcfg);
{ /* The RTD driver does this */
unsigned char pci_latency;
u16 revision;
/* check if our interrupt is available and get it */
if((ret=comedi_request_irq (devpriv->pci_dev->irq, rtd_interrupt,
SA_SHIRQ, "rtd520", dev)) < 0) {
- printk("Could not get interrupt! (%d)\n", devpriv->pci_dev->irq);
+ printk("Could not get interrupt! (%u)\n", devpriv->pci_dev->irq);
return ret;
}
dev->irq = devpriv->pci_dev->irq;
- printk("( irq=%d )", dev->irq);
+ printk("( irq=%u )", dev->irq);
#ifdef USE_DMA
if (dev->irq > 0) {
static int rti800_attach(comedi_device * dev, comedi_devconfig * it)
{
- int irq;
- int iobase;
+ unsigned int irq;
+ unsigned long iobase;
int ret;
comedi_subdevice *s;
iobase = it->options[0];
- printk("comedi%d: rti800: 0x%04x ", dev->minor, iobase);
+ printk("comedi%d: rti800: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, RTI800_SIZE, "rti800")) {
printk("I/O port conflict\n");
return -EIO;
outb(0,dev->iobase+RTI800_CLRFLAGS);
irq=it->options[1];
- if(irq>0){
- printk("( irq = %d )\n",irq);
- if((ret=comedi_request_irq(irq,rti800_interrupt, 0, "rti800", dev))<0)
+ if(irq){
+ printk("( irq = %u )",irq);
+ if((ret=comedi_request_irq(irq,rti800_interrupt, 0, "rti800", dev))<0){
+ printk(" Failed to allocate IRQ\n");
return ret;
+ }
dev->irq=irq;
- }else if(irq == 0){
+ }else{
printk("( no irq )");
}
{
comedi_subdevice *s;
int i;
- int iobase;
+ unsigned long iobase;
iobase = it->options[0];
- printk("comedi%d: rti802: 0x%04x ", dev->minor, iobase);
+ printk("comedi%d: rti802: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, RTI802_SIZE, "rti802")) {
printk("I/O port conflict\n");
return -EIO;
int result;
int i;
int ret;
- uint64_t resourceStart;
+ resource_size_t resourceStart;
dma_addr_t appdma;
comedi_subdevice *s;
struct pci_dev *pdev;
}
devpriv->got_regions = 1;
- resourceStart=(uint64_t)pci_resource_start(devpriv->pdev,0);
+ resourceStart=pci_resource_start(devpriv->pdev,0);
devpriv->base_addr=ioremap(resourceStart, SIZEOF_ADDRESS_SPACE);
if (devpriv->base_addr==NULL) {
if(alloc_subdevices(dev, 6)<0)
return -ENOMEM;
- dev->iobase = (int)devpriv->base_addr;
+ dev->iobase = (unsigned long)devpriv->base_addr;
dev->irq = devpriv->pdev->irq;
//set up interrupt handler
/* dumb */
unsigned long iobase;
- int irq;
+ unsigned int irq;
comedi_subdevice *read_subdev;
wait_queue_head_t read_wait;