示例#1
0
static void nb85e_uart_tty_getserial (void *driver_data, struct serial_struct *s)
{
	struct nb85e_uart_tty_port *port = driver_data;
	s->line = port->chan;
	s->xmit_fifo_size = 1;
	s->irq = IRQ_INTSR (port->chan); /* actually have TX irq too, but... */
}
示例#2
0
static void nb85e_uart_tty_shutdown_port (void *driver_data)
{
	struct nb85e_uart_tty_port *port = driver_data;

	port->gs.flags &= ~ GS_ACTIVE;

	/* Disable port interrupts.  */
	free_irq (IRQ_INTST (port->chan), port);
	free_irq (IRQ_INTSR (port->chan), port);

	/* Turn off xmit/recv enable bits.  */
	NB85E_UART_ASIM (port->chan) &= ~(NB85E_UART_ASIM_TXE | NB85E_UART_ASIM_RXE);
	/* Then reset the channel.  */
	NB85E_UART_ASIM (port->chan) = 0;
}
示例#3
0
文件: teg.c 项目: 12019/hg556a_source
void __init mach_sched_init (struct irqaction *timer_action)
{
	/* Select timer interrupt instead of external pin.  */
	TEG_ISS |= 0x1;
	/* Start hardware timer.  */
	v850e_timer_d_configure (0, HZ);
	/* Install timer interrupt handler.  */
	setup_irq (IRQ_INTCMD(0), timer_action);
}

static struct v850e_intc_irq_init irq_inits[] = {
	{ "IRQ", 0,		NUM_CPU_IRQS,	1, 7 },
	{ "CMD", IRQ_INTCMD(0),	IRQ_INTCMD_NUM,	1, 5 },
	{ "SER", IRQ_INTSER(0),	IRQ_INTSER_NUM,	1, 3 },
	{ "SR",	 IRQ_INTSR(0),	IRQ_INTSR_NUM,	1, 4 },
	{ "ST",	 IRQ_INTST(0),	IRQ_INTST_NUM,	1, 5 },
	{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)

static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];

/* Initialize MA chip interrupts.  */
void __init teg_init_irqs (void)
{
	v850e_intc_init_irq_types (irq_inits, hw_itypes);
}

/* Called before configuring an on-chip UART.  */
void teg_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
示例#4
0
int nb85e_uart_tty_open (struct tty_struct *tty, struct file *filp)
{
	int err;
	struct nb85e_uart_tty_port *port;
	unsigned chan = MINOR (tty->device) - NB85E_UART_MINOR_BASE;

	if (chan >= NB85E_UART_NUM_CHANNELS)
		return -ENODEV;

	port = &nb85e_uart_tty_ports[chan];

	tty->driver_data = port;
	port->gs.tty = tty;
	port->gs.count++;

	port->tqueue.routine = gs_do_softint;
	port->tqueue.data = &port->gs;

	/*
	 * Start up serial port
	 */
	err = gs_init_port (&port->gs);
	if (err)
		goto failed_1;

	port->gs.flags |= GS_ACTIVE;

	if (port->gs.count == 1) {
		MOD_INC_USE_COUNT;

		/* Alloc RX irq.  */
		err = request_irq (IRQ_INTSR (chan), nb85e_uart_tty_rx_irq,
				   SA_INTERRUPT, "nb85e_uart", port);
		if (err)
			goto failed_2;

		/* Alloc TX irq.  */
		err = request_irq (IRQ_INTST (chan), nb85e_uart_tty_tx_irq,
				   SA_INTERRUPT, "nb85e_uart", port);
		if (err) {
			free_irq (IRQ_INTSR (chan), port);
			goto failed_2;
		}
	}

	err = gs_block_til_ready (port, filp);
	if (err)
		goto failed_3;

	*tty->termios = port->gs.normal_termios;

	nb85e_uart_tty_enable_rx_interrupts (port);

	port->gs.session = current->session;
	port->gs.pgrp = current->pgrp;

	return 0;

failed_3:
	free_irq (IRQ_INTST (chan), port);
	free_irq (IRQ_INTSR (chan), port);
failed_2:
	MOD_DEC_USE_COUNT;
failed_1:
	port->gs.count--;

	return err;
}
示例#5
0
static void nb85e_uart_tty_enable_rx_interrupts (void *driver_data)
{
	struct nb85e_uart_tty_port *port = driver_data;
	nb85e_intc_enable_irq (IRQ_INTSR (port->chan));
}