DEBUGMSG("Resetting msmcan hardware ...\n");
/* we don't use template_write_register because we don't use the two first
registers of the card but the third in order to make a hard reset */
- /* outb (1, msmcan_base + candev->res_addr); */
+ /* can_outb (1, msmcan_base + candev->res_addr); */
/* terrible MSMCAN reset design - best to comment out */
i82527_fill_chipspecops(candev->chip[chipnr]);
/* device uses indexed access */
candev->chip[chipnr]->chip_base_addr=
- candev->io_addr << 16;
+ can_ioport2ioptr(candev->io_addr << 16);
candev->chip[chipnr]->clock = 16000000;
/* The CLKOUT has to be enabled to reset MSMCAN MAX1232 watchdog */
candev->chip[chipnr]->int_cpu_reg = iCPU_DSC | iCPU_CEN;
* on the CAN chip. You should only have to edit this function if your hardware
* uses some specific write process.
*/
-void msmcan_write_register(unsigned data, unsigned long address)
+void msmcan_write_register(unsigned data, can_ioptr_t address)
{
/* address is combination of base address shifted left by 16 and index */
can_spin_irqflags_t flags;
+ unsigned long addr=can_ioptr2ulong(address);
/* the msmcan card has two registers, the data register at 0x0
and the address register at 0x01 */
can_spin_lock_irqsave(&msmcan_port_lock,flags);
- outb(address & 0xff, (address>>16)+1);
- outb(data, address>>16);
+ can_outb(addr & 0xff, (addr>>16)+1);
+ can_outb(data, addr>>16);
can_spin_unlock_irqrestore(&msmcan_port_lock,flags);
}
* on the CAN chip. You should only have to edit this function if your hardware
* uses some specific read process.
*/
-unsigned msmcan_read_register(unsigned long address)
+unsigned msmcan_read_register(can_ioptr_t address)
{
/* this is the same thing that the function write_register.
We use the two register, we write the address where we
data */
unsigned char ret;
can_spin_irqflags_t flags;
-
+ unsigned long addr=can_ioptr2ulong(address);
can_spin_lock_irqsave(&msmcan_port_lock,flags);
- outb(address & 0xff, (address>>16)+1);
- ret=inb(address>>16);
+ can_outb(addr & 0xff, (addr>>16)+1);
+ ret=can_inb(addr>>16);
can_spin_unlock_irqrestore(&msmcan_port_lock,flags);
return ret;
}