Exemple #1
0
static irqreturn_t msm_rx_irq(int irq, void *dev_id)
{
	struct uart_port *port = dev_id;
	struct msm_port *msm_port = UART_TO_MSM(port);
	int inject_wakeup = 0;

	spin_lock(&port->lock);

	if (msm_port->clk_state == MSM_CLK_OFF) {
		
		if (msm_port->wakeup.ignore)
			msm_port->wakeup.ignore = 0;
		else
			inject_wakeup = 1;
	}

	msm_serial_clock_on(port, 0);

	
	if (inject_wakeup) {
		struct tty_struct *tty = port->state->port.tty;
		tty_insert_flip_char(tty, WAKE_UP_IND, TTY_NORMAL);
		tty_flip_buffer_push(tty);
	}

	spin_unlock(&port->lock);
	return IRQ_HANDLED;
}
Exemple #2
0
static irqreturn_t msm_rx_irq(int irq, void *dev_id)
{
	struct uart_port *port = dev_id;
	struct msm_port *msm_port = UART_TO_MSM(port);
	int inject_wakeup = 0;

	spin_lock(&port->lock);

	if (msm_port->clk_state == MSM_CLK_OFF) {
		/* ignore the first irq - it is a pending irq that occured
		 * before enable_irq() */
		if (msm_port->wakeup.ignore)
			msm_port->wakeup.ignore = 0;
		else
			inject_wakeup = 1;
	}

	msm_serial_clock_on(port, 0);

	/* we missed an rx while asleep - it must be a wakeup indicator
	 */
	if (inject_wakeup) {
		struct tty_struct *tty = port->info->port.tty;
		tty_insert_flip_char(tty, msm_port->wakeup.rx_to_inject,
				     TTY_NORMAL);
		tty_flip_buffer_push(tty);
	}

	spin_unlock(&port->lock);
	return IRQ_HANDLED;
}
Exemple #3
0
static irqreturn_t msm_rx_irq(int irq, void *dev_id)
{
    struct uart_port *port = dev_id;
    struct msm_port *msm_port = UART_TO_MSM(port);
    int inject_wakeup = 0;

    spin_lock(&port->lock);

    if (msm_port->clk_state == MSM_CLK_OFF)
        inject_wakeup = 1;

    msm_serial_clock_on(port, 0);

    /* we missed an rx while asleep - it must be a wakeup indicator
     */
    if (inject_wakeup) {
        struct tty_struct *tty = port->info->port.tty;
        tty_insert_flip_char(tty, WAKE_UP_IND, TTY_NORMAL);
        tty_flip_buffer_push(tty);
    }

    spin_unlock(&port->lock);
    return IRQ_HANDLED;
}