Commit dbac8f1a authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k IRQ API updates [14/20]

M68k char drivers: Update to the new irq API (from Roman Zippel and me) [14/20]
parent a07857ce
...@@ -490,7 +490,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info) ...@@ -490,7 +490,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
} }
} }
static void ser_vbl_int( int irq, void *data, struct pt_regs *regs) static irqreturn_t ser_vbl_int( int irq, void *data, struct pt_regs *regs)
{ {
/* vbl is just a periodic interrupt we tie into to update modem status */ /* vbl is just a periodic interrupt we tie into to update modem status */
struct async_struct * info = IRQ_ports; struct async_struct * info = IRQ_ports;
...@@ -500,9 +500,10 @@ static void ser_vbl_int( int irq, void *data, struct pt_regs *regs) ...@@ -500,9 +500,10 @@ static void ser_vbl_int( int irq, void *data, struct pt_regs *regs)
*/ */
if(info->IER & UART_IER_MSI) if(info->IER & UART_IER_MSI)
check_modem_status(info); check_modem_status(info);
return IRQ_HANDLED;
} }
static void ser_rx_int(int irq, void *dev_id, struct pt_regs * regs) static irqreturn_t ser_rx_int(int irq, void *dev_id, struct pt_regs * regs)
{ {
struct async_struct * info; struct async_struct * info;
...@@ -512,16 +513,17 @@ static void ser_rx_int(int irq, void *dev_id, struct pt_regs * regs) ...@@ -512,16 +513,17 @@ static void ser_rx_int(int irq, void *dev_id, struct pt_regs * regs)
info = IRQ_ports; info = IRQ_ports;
if (!info || !info->tty) if (!info || !info->tty)
return; return IRQ_NONE;
receive_chars(info); receive_chars(info);
info->last_active = jiffies; info->last_active = jiffies;
#ifdef SERIAL_DEBUG_INTR #ifdef SERIAL_DEBUG_INTR
printk("end.\n"); printk("end.\n");
#endif #endif
return IRQ_HANDLED;
} }
static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs) static irqreturn_t ser_tx_int(int irq, void *dev_id, struct pt_regs * regs)
{ {
struct async_struct * info; struct async_struct * info;
...@@ -532,7 +534,7 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs) ...@@ -532,7 +534,7 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs)
info = IRQ_ports; info = IRQ_ports;
if (!info || !info->tty) if (!info || !info->tty)
return; return IRQ_NONE;
transmit_chars(info); transmit_chars(info);
info->last_active = jiffies; info->last_active = jiffies;
...@@ -540,6 +542,7 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs) ...@@ -540,6 +542,7 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs)
printk("end.\n"); printk("end.\n");
#endif #endif
} }
return IRQ_HANDLED;
} }
/* /*
......
...@@ -116,7 +116,7 @@ static __inline__ volatile struct a2232memory *a2232mem (unsigned int board); ...@@ -116,7 +116,7 @@ static __inline__ volatile struct a2232memory *a2232mem (unsigned int board);
static __inline__ void a2232_receive_char( struct a2232_port *port, static __inline__ void a2232_receive_char( struct a2232_port *port,
int ch, int err ); int ch, int err );
/* The interrupt service routine */ /* The interrupt service routine */
static void a2232_vbl_inter(int irq, void *data, struct pt_regs *fp); static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp);
/* Initialize the port structures */ /* Initialize the port structures */
static void a2232_init_portstructs(void); static void a2232_init_portstructs(void);
/* Initialize and register TTY drivers. */ /* Initialize and register TTY drivers. */
...@@ -533,7 +533,7 @@ static __inline__ void a2232_receive_char( struct a2232_port *port, ...@@ -533,7 +533,7 @@ static __inline__ void a2232_receive_char( struct a2232_port *port,
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
} }
static void a2232_vbl_inter(int irq, void *data, struct pt_regs *fp) static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp)
{ {
#if A2232_IOBUFLEN != 256 #if A2232_IOBUFLEN != 256
#error "Re-Implement a2232_vbl_inter()!" #error "Re-Implement a2232_vbl_inter()!"
...@@ -673,6 +673,7 @@ int ch, err, n, p; ...@@ -673,6 +673,7 @@ int ch, err, n, p;
} // if events in CD queue } // if events in CD queue
} // for every completely initialized A2232 board } // for every completely initialized A2232 board
return IRQ_HANDLED;
} }
static void a2232_init_portstructs(void) static void a2232_init_portstructs(void)
......
...@@ -400,7 +400,7 @@ cy_sched_event(struct cyclades_port *info, int event) ...@@ -400,7 +400,7 @@ cy_sched_event(struct cyclades_port *info, int event)
whenever the card wants its hand held--chars whenever the card wants its hand held--chars
received, out buffer empty, modem change, etc. received, out buffer empty, modem change, etc.
*/ */
static void static irqreturn_t
cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{ {
struct tty_struct *tty; struct tty_struct *tty;
...@@ -418,7 +418,7 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -418,7 +418,7 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp)
if ((err = base_addr[CyRISR]) & CyTIMEOUT) { if ((err = base_addr[CyRISR]) & CyTIMEOUT) {
/* This is a receive timeout interrupt, ignore it */ /* This is a receive timeout interrupt, ignore it */
base_addr[CyREOIR] = CyNOTRANS; base_addr[CyREOIR] = CyNOTRANS;
return; return IRQ_HANDLED;
} }
/* Read a byte of data if there is any - assume the error /* Read a byte of data if there is any - assume the error
...@@ -432,13 +432,13 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -432,13 +432,13 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp)
/* if there is nowhere to put the data, discard it */ /* if there is nowhere to put the data, discard it */
if(info->tty == 0) { if(info->tty == 0) {
base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
return; return IRQ_HANDLED;
} }
else { /* there is an open port for this data */ else { /* there is an open port for this data */
tty = info->tty; tty = info->tty;
if(err & info->ignore_status_mask){ if(err & info->ignore_status_mask){
base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
return; return IRQ_HANDLED;
} }
if (tty->flip.count < TTY_FLIPBUF_SIZE){ if (tty->flip.count < TTY_FLIPBUF_SIZE){
tty->flip.count++; tty->flip.count++;
...@@ -488,9 +488,10 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -488,9 +488,10 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp)
queue_task(&tty->flip.tqueue, &tq_timer); queue_task(&tty->flip.tqueue, &tq_timer);
/* end of service */ /* end of service */
base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
return IRQ_HANDLED;
} /* cy_rxerr_interrupt */ } /* cy_rxerr_interrupt */
static void static irqreturn_t
cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp) cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{ {
struct cyclades_port *info; struct cyclades_port *info;
...@@ -543,9 +544,10 @@ cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -543,9 +544,10 @@ cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp)
} }
} }
base_addr[CyMEOIR] = 0; base_addr[CyMEOIR] = 0;
return IRQ_HANDLED;
} /* cy_modem_interrupt */ } /* cy_modem_interrupt */
static void static irqreturn_t
cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp) cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{ {
struct cyclades_port *info; struct cyclades_port *info;
...@@ -569,7 +571,7 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -569,7 +571,7 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
if( (channel < 0) || (NR_PORTS <= channel) ){ if( (channel < 0) || (NR_PORTS <= channel) ){
base_addr[CyIER] &= ~(CyTxMpty|CyTxRdy); base_addr[CyIER] &= ~(CyTxMpty|CyTxRdy);
base_addr[CyTEOIR] = CyNOTRANS; base_addr[CyTEOIR] = CyNOTRANS;
return; return IRQ_HANDLED;
} }
info->last_active = jiffies; info->last_active = jiffies;
if(info->tty == 0){ if(info->tty == 0){
...@@ -578,7 +580,7 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -578,7 +580,7 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP); cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP);
} }
base_addr[CyTEOIR] = CyNOTRANS; base_addr[CyTEOIR] = CyNOTRANS;
return; return IRQ_HANDLED;
} }
/* load the on-chip space available for outbound data */ /* load the on-chip space available for outbound data */
...@@ -662,9 +664,10 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -662,9 +664,10 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP); cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP);
} }
base_addr[CyTEOIR] = (char_count != saved_cnt) ? 0 : CyNOTRANS; base_addr[CyTEOIR] = (char_count != saved_cnt) ? 0 : CyNOTRANS;
return IRQ_HANDLED;
} /* cy_tx_interrupt */ } /* cy_tx_interrupt */
static void static irqreturn_t
cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{ {
struct tty_struct *tty; struct tty_struct *tty;
...@@ -722,6 +725,7 @@ cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) ...@@ -722,6 +725,7 @@ cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
} }
/* end of service */ /* end of service */
base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS; base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS;
return IRQ_HANDLED;
} /* cy_rx_interrupt */ } /* cy_rx_interrupt */
/* /*
......
...@@ -83,10 +83,10 @@ static int scc_ioctl(struct tty_struct * tty, struct file * filp, ...@@ -83,10 +83,10 @@ static int scc_ioctl(struct tty_struct * tty, struct file * filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
static void scc_throttle(struct tty_struct *tty); static void scc_throttle(struct tty_struct *tty);
static void scc_unthrottle(struct tty_struct *tty); static void scc_unthrottle(struct tty_struct *tty);
static void scc_tx_int(int irq, void *data, struct pt_regs *fp); static irqreturn_t scc_tx_int(int irq, void *data, struct pt_regs *fp);
static void scc_rx_int(int irq, void *data, struct pt_regs *fp); static irqreturn_t scc_rx_int(int irq, void *data, struct pt_regs *fp);
static void scc_stat_int(int irq, void *data, struct pt_regs *fp); static irqreturn_t scc_stat_int(int irq, void *data, struct pt_regs *fp);
static void scc_spcond_int(int irq, void *data, struct pt_regs *fp); static irqreturn_t scc_spcond_int(int irq, void *data, struct pt_regs *fp);
static void scc_setsignals(struct scc_port *port, int dtr, int rts); static void scc_setsignals(struct scc_port *port, int dtr, int rts);
static void scc_break_ctl(struct tty_struct *tty, int break_state); static void scc_break_ctl(struct tty_struct *tty, int break_state);
...@@ -448,7 +448,7 @@ int vme_scc_init(void) ...@@ -448,7 +448,7 @@ int vme_scc_init(void)
* Interrupt handlers * Interrupt handlers
*--------------------------------------------------------------------------*/ *--------------------------------------------------------------------------*/
static void scc_rx_int(int irq, void *data, struct pt_regs *fp) static irqreturn_t scc_rx_int(int irq, void *data, struct pt_regs *fp)
{ {
unsigned char ch; unsigned char ch;
struct scc_port *port = data; struct scc_port *port = data;
...@@ -459,7 +459,7 @@ static void scc_rx_int(int irq, void *data, struct pt_regs *fp) ...@@ -459,7 +459,7 @@ static void scc_rx_int(int irq, void *data, struct pt_regs *fp)
if (!tty) { if (!tty) {
printk(KERN_WARNING "scc_rx_int with NULL tty!\n"); printk(KERN_WARNING "scc_rx_int with NULL tty!\n");
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return; return IRQ_HANDLED;
} }
if (tty->flip.count < TTY_FLIPBUF_SIZE) { if (tty->flip.count < TTY_FLIPBUF_SIZE) {
*tty->flip.char_buf_ptr = ch; *tty->flip.char_buf_ptr = ch;
...@@ -476,16 +476,17 @@ static void scc_rx_int(int irq, void *data, struct pt_regs *fp) ...@@ -476,16 +476,17 @@ static void scc_rx_int(int irq, void *data, struct pt_regs *fp)
if (SCCread(INT_PENDING_REG) & if (SCCread(INT_PENDING_REG) &
(port->channel == CHANNEL_A ? IPR_A_RX : IPR_B_RX)) { (port->channel == CHANNEL_A ? IPR_A_RX : IPR_B_RX)) {
scc_spcond_int (irq, data, fp); scc_spcond_int (irq, data, fp);
return; return IRQ_HANDLED;
} }
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
return IRQ_HANDLED;
} }
static void scc_spcond_int(int irq, void *data, struct pt_regs *fp) static irqreturn_t scc_spcond_int(int irq, void *data, struct pt_regs *fp)
{ {
struct scc_port *port = data; struct scc_port *port = data;
struct tty_struct *tty = port->gs.tty; struct tty_struct *tty = port->gs.tty;
...@@ -498,7 +499,7 @@ static void scc_spcond_int(int irq, void *data, struct pt_regs *fp) ...@@ -498,7 +499,7 @@ static void scc_spcond_int(int irq, void *data, struct pt_regs *fp)
printk(KERN_WARNING "scc_spcond_int with NULL tty!\n"); printk(KERN_WARNING "scc_spcond_int with NULL tty!\n");
SCCwrite(COMMAND_REG, CR_ERROR_RESET); SCCwrite(COMMAND_REG, CR_ERROR_RESET);
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return; return IRQ_HANDLED;
} }
do { do {
stat = SCCread(SPCOND_STATUS_REG); stat = SCCread(SPCOND_STATUS_REG);
...@@ -532,10 +533,11 @@ static void scc_spcond_int(int irq, void *data, struct pt_regs *fp) ...@@ -532,10 +533,11 @@ static void scc_spcond_int(int irq, void *data, struct pt_regs *fp)
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
return IRQ_HANDLED;
} }
static void scc_tx_int(int irq, void *data, struct pt_regs *fp) static irqreturn_t scc_tx_int(int irq, void *data, struct pt_regs *fp)
{ {
struct scc_port *port = data; struct scc_port *port = data;
SCC_ACCESS_INIT(port); SCC_ACCESS_INIT(port);
...@@ -545,7 +547,7 @@ static void scc_tx_int(int irq, void *data, struct pt_regs *fp) ...@@ -545,7 +547,7 @@ static void scc_tx_int(int irq, void *data, struct pt_regs *fp)
SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0); SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET);
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return; return IRQ_HANDLED;
} }
while ((SCCread_NB(STATUS_REG) & SR_TX_BUF_EMPTY)) { while ((SCCread_NB(STATUS_REG) & SR_TX_BUF_EMPTY)) {
if (port->x_char) { if (port->x_char) {
...@@ -577,10 +579,11 @@ static void scc_tx_int(int irq, void *data, struct pt_regs *fp) ...@@ -577,10 +579,11 @@ static void scc_tx_int(int irq, void *data, struct pt_regs *fp)
} }
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return IRQ_HANDLED;
} }
static void scc_stat_int(int irq, void *data, struct pt_regs *fp) static irqreturn_t scc_stat_int(int irq, void *data, struct pt_regs *fp)
{ {
struct scc_port *port = data; struct scc_port *port = data;
unsigned channel = port->channel; unsigned channel = port->channel;
...@@ -612,6 +615,7 @@ static void scc_stat_int(int irq, void *data, struct pt_regs *fp) ...@@ -612,6 +615,7 @@ static void scc_stat_int(int irq, void *data, struct pt_regs *fp)
} }
SCCwrite(COMMAND_REG, CR_EXTSTAT_RESET); SCCwrite(COMMAND_REG, CR_EXTSTAT_RESET);
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment