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)
}
}
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 */
struct async_struct * info = IRQ_ports;
......@@ -500,9 +500,10 @@ static void ser_vbl_int( int irq, void *data, struct pt_regs *regs)
*/
if(info->IER & UART_IER_MSI)
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;
......@@ -512,16 +513,17 @@ static void ser_rx_int(int irq, void *dev_id, struct pt_regs * regs)
info = IRQ_ports;
if (!info || !info->tty)
return;
return IRQ_NONE;
receive_chars(info);
info->last_active = jiffies;
#ifdef SERIAL_DEBUG_INTR
printk("end.\n");
#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;
......@@ -532,7 +534,7 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs)
info = IRQ_ports;
if (!info || !info->tty)
return;
return IRQ_NONE;
transmit_chars(info);
info->last_active = jiffies;
......@@ -540,6 +542,7 @@ static void ser_tx_int(int irq, void *dev_id, struct pt_regs * regs)
printk("end.\n");
#endif
}
return IRQ_HANDLED;
}
/*
......
......@@ -116,7 +116,7 @@ static __inline__ volatile struct a2232memory *a2232mem (unsigned int board);
static __inline__ void a2232_receive_char( struct a2232_port *port,
int ch, int err );
/* 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 */
static void a2232_init_portstructs(void);
/* Initialize and register TTY drivers. */
......@@ -533,7 +533,7 @@ static __inline__ void a2232_receive_char( struct a2232_port *port,
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
#error "Re-Implement a2232_vbl_inter()!"
......@@ -673,6 +673,7 @@ int ch, err, n, p;
} // if events in CD queue
} // for every completely initialized A2232 board
return IRQ_HANDLED;
}
static void a2232_init_portstructs(void)
......
......@@ -400,7 +400,7 @@ cy_sched_event(struct cyclades_port *info, int event)
whenever the card wants its hand held--chars
received, out buffer empty, modem change, etc.
*/
static void
static irqreturn_t
cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{
struct tty_struct *tty;
......@@ -418,7 +418,7 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp)
if ((err = base_addr[CyRISR]) & CyTIMEOUT) {
/* This is a receive timeout interrupt, ignore it */
base_addr[CyREOIR] = CyNOTRANS;
return;
return IRQ_HANDLED;
}
/* 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)
/* if there is nowhere to put the data, discard it */
if(info->tty == 0) {
base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
return;
return IRQ_HANDLED;
}
else { /* there is an open port for this data */
tty = info->tty;
if(err & info->ignore_status_mask){
base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
return;
return IRQ_HANDLED;
}
if (tty->flip.count < TTY_FLIPBUF_SIZE){
tty->flip.count++;
......@@ -488,9 +488,10 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp)
queue_task(&tty->flip.tqueue, &tq_timer);
/* end of service */
base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
return IRQ_HANDLED;
} /* cy_rxerr_interrupt */
static void
static irqreturn_t
cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{
struct cyclades_port *info;
......@@ -543,9 +544,10 @@ cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp)
}
}
base_addr[CyMEOIR] = 0;
return IRQ_HANDLED;
} /* cy_modem_interrupt */
static void
static irqreturn_t
cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{
struct cyclades_port *info;
......@@ -569,7 +571,7 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
if( (channel < 0) || (NR_PORTS <= channel) ){
base_addr[CyIER] &= ~(CyTxMpty|CyTxRdy);
base_addr[CyTEOIR] = CyNOTRANS;
return;
return IRQ_HANDLED;
}
info->last_active = jiffies;
if(info->tty == 0){
......@@ -578,7 +580,7 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP);
}
base_addr[CyTEOIR] = CyNOTRANS;
return;
return IRQ_HANDLED;
}
/* 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)
cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP);
}
base_addr[CyTEOIR] = (char_count != saved_cnt) ? 0 : CyNOTRANS;
return IRQ_HANDLED;
} /* cy_tx_interrupt */
static void
static irqreturn_t
cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
{
struct tty_struct *tty;
......@@ -722,6 +725,7 @@ cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp)
}
/* end of service */
base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS;
return IRQ_HANDLED;
} /* cy_rx_interrupt */
/*
......
......@@ -83,10 +83,10 @@ static int scc_ioctl(struct tty_struct * tty, struct file * filp,
unsigned int cmd, unsigned long arg);
static void scc_throttle(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 void 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 void scc_spcond_int(int irq, void *data, struct pt_regs *fp);
static irqreturn_t scc_tx_int(int irq, void *data, struct pt_regs *fp);
static irqreturn_t scc_rx_int(int irq, void *data, struct pt_regs *fp);
static irqreturn_t scc_stat_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_break_ctl(struct tty_struct *tty, int break_state);
......@@ -448,7 +448,7 @@ int vme_scc_init(void)
* 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;
struct scc_port *port = data;
......@@ -459,7 +459,7 @@ static void scc_rx_int(int irq, void *data, struct pt_regs *fp)
if (!tty) {
printk(KERN_WARNING "scc_rx_int with NULL tty!\n");
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return;
return IRQ_HANDLED;
}
if (tty->flip.count < TTY_FLIPBUF_SIZE) {
*tty->flip.char_buf_ptr = ch;
......@@ -476,16 +476,17 @@ static void scc_rx_int(int irq, void *data, struct pt_regs *fp)
if (SCCread(INT_PENDING_REG) &
(port->channel == CHANNEL_A ? IPR_A_RX : IPR_B_RX)) {
scc_spcond_int (irq, data, fp);
return;
return IRQ_HANDLED;
}
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
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 tty_struct *tty = port->gs.tty;
......@@ -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");
SCCwrite(COMMAND_REG, CR_ERROR_RESET);
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return;
return IRQ_HANDLED;
}
do {
stat = SCCread(SPCOND_STATUS_REG);
......@@ -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);
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;
SCC_ACCESS_INIT(port);
......@@ -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);
SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET);
SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
return;
return IRQ_HANDLED;
}
while ((SCCread_NB(STATUS_REG) & SR_TX_BUF_EMPTY)) {
if (port->x_char) {
......@@ -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);
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;
unsigned channel = port->channel;
......@@ -612,6 +615,7 @@ static void scc_stat_int(int irq, void *data, struct pt_regs *fp)
}
SCCwrite(COMMAND_REG, CR_EXTSTAT_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