当前位置: 首页>>代码示例>>C++>>正文


C++ serial_omap_port_enable函数代码示例

本文整理汇总了C++中serial_omap_port_enable函数的典型用法代码示例。如果您正苦于以下问题:C++ serial_omap_port_enable函数的具体用法?C++ serial_omap_port_enable怎么用?C++ serial_omap_port_enable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了serial_omap_port_enable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: serial_omap_stop_tx

static void serial_omap_stop_tx(struct uart_port *port)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;

	if (up->use_dma &&
		up->uart_dma.tx_dma_channel != OMAP_UART_DMA_CH_FREE) {
		/*
		 * Check if dma is still active. If yes do nothing,
		 * return. Else stop dma
		 */
		if (omap_get_dma_active_status(up->uart_dma.tx_dma_channel))
			return;
		omap_stop_dma(up->uart_dma.tx_dma_channel);
		omap_free_dma(up->uart_dma.tx_dma_channel);
		up->uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE;
		serial_omap_port_disable(up);
	}

	serial_omap_port_enable(up);
	if (up->ier & UART_IER_THRI) {
		up->ier &= ~UART_IER_THRI;
		serial_out(up, UART_IER, up->ier);
	}

	serial_omap_port_disable(up);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:26,代码来源:omap-serial.c

示例2: serial_omap_pm

static void
serial_omap_pm(struct uart_port *port, unsigned int state,
	       unsigned int oldstate)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;
	unsigned char efr;
	unsigned char lcr;

	dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->pdev->id);

	serial_omap_port_enable(up);
	lcr = serial_in(up, UART_LCR);
	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
	efr = serial_in(up, UART_EFR);
	serial_out(up, UART_EFR, efr | UART_EFR_ECB);
	serial_out(up, UART_LCR, 0);

	serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0);
	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
	serial_out(up, UART_EFR, efr);
	serial_out(up, UART_LCR, lcr);
	if (state)
		pm_runtime_put_sync(&up->pdev->dev);
	else
		serial_omap_port_disable(up);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:26,代码来源:omap-serial.c

示例3: serial_omap_start_rxdma

static int serial_omap_start_rxdma(struct uart_omap_port *up)
{
	int ret = 0;

	if (up->uart_dma.rx_dma_channel == -1) {
		serial_omap_port_enable(up);
		ret = omap_request_dma(up->uart_dma.uart_dma_rx,
				"UART Rx DMA",
				(void *)uart_rx_dma_callback, up,
				&(up->uart_dma.rx_dma_channel));
		if (ret < 0)
			return ret;

		omap_set_dma_src_params(up->uart_dma.rx_dma_channel, 0,
				OMAP_DMA_AMODE_CONSTANT,
				up->uart_dma.uart_base, 0, 0);
		omap_set_dma_dest_params(up->uart_dma.rx_dma_channel, 0,
				OMAP_DMA_AMODE_POST_INC,
				up->uart_dma.rx_buf_dma_phys, 0, 0);
		omap_set_dma_transfer_params(up->uart_dma.rx_dma_channel,
				OMAP_DMA_DATA_TYPE_S8,
				up->uart_dma.rx_buf_size, 1,
				OMAP_DMA_SYNC_ELEMENT,
				up->uart_dma.uart_dma_rx, 0);
	}
	up->uart_dma.prev_rx_dma_pos = up->uart_dma.rx_buf_dma_phys;
	/* FIXME: Cache maintenance needed here? */
	omap_start_dma(up->uart_dma.rx_dma_channel);
	mod_timer(&up->uart_dma.rx_timer, jiffies +
				usecs_to_jiffies(up->uart_dma.rx_poll_rate));
	up->uart_dma.rx_dma_used = true;
	return ret;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:33,代码来源:omap-serial.c

示例4: serial_omap_poll_put_char

static void serial_omap_poll_put_char(struct uart_port *port, unsigned char ch)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;

	serial_omap_port_enable(up);
	wait_for_xmitr(up);
	serial_out(up, UART_TX, ch);
	serial_omap_port_disable(up);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:9,代码来源:omap-serial.c

示例5: serial_omap_enable_ms

static void serial_omap_enable_ms(struct uart_port *port)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;

	dev_dbg(up->port.dev, "serial_omap_enable_ms+%d\n", up->pdev->id);

	serial_omap_port_enable(up);
	up->ier |= UART_IER_MSI;
	serial_out(up, UART_IER, up->ier);
	serial_omap_port_disable(up);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:11,代码来源:omap-serial.c

示例6: serial_omap_stop_rx

static void serial_omap_stop_rx(struct uart_port *port)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;

	serial_omap_port_enable(up);
	if (up->use_dma)
		serial_omap_stop_rxdma(up);
	up->ier &= ~UART_IER_RLSI;
	up->port.read_status_mask &= ~UART_LSR_DR;
	serial_out(up, UART_IER, up->ier);
	serial_omap_port_disable(up);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:12,代码来源:omap-serial.c

示例7: omap_uart_wake

int omap_uart_wake(u8 uart_num)
{
	if (uart_num > OMAP_MAX_HSUART_PORTS)
		return -ENODEV;

	if (!ui[uart_num - 1])
		return -ENODEV;

	serial_omap_port_enable(ui[uart_num - 1]);
	serial_omap_port_disable(ui[uart_num - 1]);

	return 0;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:13,代码来源:omap-serial.c

示例8: serial_omap_poll_get_char

static int serial_omap_poll_get_char(struct uart_port *port)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;
	unsigned int status;

	serial_omap_port_enable(up);
	status = serial_in(up, UART_LSR);
	if (!(status & UART_LSR_DR))
		return NO_POLL_CHAR;

	status = serial_in(up, UART_RX);
	serial_omap_port_disable(up);
	return status;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:14,代码来源:omap-serial.c

示例9: omap_serial_ext_uart_enable

/* Used by ext client device connected to uart to control uart */
int omap_serial_ext_uart_enable(u8 port_id)
{
	struct uart_omap_port *up;
	int err = 0;

	if (port_id > OMAP_MAX_HSUART_PORTS) {
		pr_err("Invalid Port_id %d passed to %s\n", port_id, __func__);
		err = -ENODEV;
	} else {
		up = ui[port_id];
		serial_omap_port_enable(up);
	}
	return err;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:15,代码来源:omap-serial.c

示例10: serial_omap_tx_empty

//static unsigned int serial_omap_tx_empty(struct uart_port *port)
unsigned int serial_omap_tx_empty(struct uart_port *port)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;
	unsigned long flags = 0;
	unsigned int ret = 0;

	serial_omap_port_enable(up);
	dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->pdev->id);
	spin_lock_irqsave(&up->port.lock, flags);
	ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
	spin_unlock_irqrestore(&up->port.lock, flags);
	serial_omap_port_disable(up);
	return ret;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:15,代码来源:omap-serial.c

示例11: serial_omap_irq

/**
 * serial_omap_irq() - This handles the interrupt from one port
 * @irq: uart port irq number
 * @dev_id: uart port info
 */
static inline irqreturn_t serial_omap_irq(int irq, void *dev_id)
{
	struct uart_omap_port *up = dev_id;
	unsigned int iir, lsr;
	unsigned int int_id;
	unsigned long flags;
	int ret = IRQ_HANDLED;
	u8 tx_fifo_lvl;

	serial_omap_port_enable(up);
	iir = serial_in(up, UART_IIR);
	if (iir & UART_IIR_NO_INT) {
		serial_omap_port_disable(up);
		return IRQ_NONE;
	}

	int_id = iir & UART_OMAP_IIR_ID;

	spin_lock_irqsave(&up->port.lock, flags);
	lsr = serial_in(up, UART_LSR);
	if (int_id == UART_IIR_RDI || int_id == UART_OMAP_IIR_RX_TIMEOUT ||
	    int_id == UART_IIR_RLSI) {
		if (!up->use_dma) {
			if (lsr & UART_LSR_DR)
				receive_chars(up, &lsr);
		} else {
			up->ier &= ~(UART_IER_RDI | UART_IER_RLSI);
			serial_out(up, UART_IER, up->ier);
			if ((serial_omap_start_rxdma(up) != 0) &&
					(lsr & UART_LSR_DR))
				receive_chars(up, &lsr);
		}
	}

	check_modem_status(up);
	if (int_id == UART_IIR_THRI) {
		tx_fifo_lvl = serial_in(up, UART_OMAP_TXFIFO_LVL);
		if (lsr & UART_LSR_THRE || tx_fifo_lvl < up->port.fifosize)
			transmit_chars(up, tx_fifo_lvl);
		else
			ret = IRQ_NONE;
	}

	spin_unlock_irqrestore(&up->port.lock, flags);
	serial_omap_port_disable(up);

	up->port_activity = jiffies;
	return ret;
}
开发者ID:kf-otterx,项目名称:kernel_omap_otter-common,代码行数:54,代码来源:omap-serial.c

示例12: serial_omap_break_ctl

static void serial_omap_break_ctl(struct uart_port *port, int break_state)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;
	unsigned long flags = 0;

	dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->pdev->id);
	serial_omap_port_enable(up);
	spin_lock_irqsave(&up->port.lock, flags);
	if (break_state == -1)
		up->lcr |= UART_LCR_SBC;
	else
		up->lcr &= ~UART_LCR_SBC;
	serial_out(up, UART_LCR, up->lcr);
	spin_unlock_irqrestore(&up->port.lock, flags);
	serial_omap_port_disable(up);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:16,代码来源:omap-serial.c

示例13: serial_omap_shutdown

static void serial_omap_shutdown(struct uart_port *port)
{
	struct uart_omap_port *up = (struct uart_omap_port *)port;
	unsigned long flags = 0;

	dev_dbg(up->port.dev, "serial_omap_shutdown+%d\n", up->pdev->id);

	serial_omap_port_enable(up);
	/*
	 * Disable interrupts & wakeup events from this port
	 */
	up->ier = 0;
	up->wer_restore = 0;
	serial_out(up, UART_OMAP_WER, 0);
	serial_out(up, UART_IER, 0);

	spin_lock_irqsave(&up->port.lock, flags);
	up->port.mctrl &= ~TIOCM_OUT2;
	serial_omap_set_mctrl(&up->port, up->port.mctrl);
	spin_unlock_irqrestore(&up->port.lock, flags);

	/*
	 * Disable break condition and FIFOs
	 */
	serial_out(up, UART_LCR, serial_in(up, UART_LCR) & ~UART_LCR_SBC);
	serial_omap_clear_fifos(up);

	/*
	 * Read data port to reset things, and then free the irq
	 */
	if (serial_in(up, UART_LSR) & UART_LSR_DR)
		(void) serial_in(up, UART_RX);
	if (up->use_dma) {
		dma_free_coherent(up->port.dev,
			UART_XMIT_SIZE,	up->port.state->xmit.buf,
			up->uart_dma.tx_buf_dma_phys);
		up->port.state->xmit.buf = NULL;
		serial_omap_stop_rx(port);
		dma_free_coherent(up->port.dev,
			up->uart_dma.rx_buf_size, up->uart_dma.rx_buf,
			up->uart_dma.rx_buf_dma_phys);
		up->uart_dma.rx_buf = NULL;
	}
	serial_omap_port_disable(up);
	free_irq(up->port.irq, up);
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:46,代码来源:omap-serial.c

示例14: serial_omap_resume

static int serial_omap_resume(struct device *dev)
{
	struct uart_omap_port *up = dev_get_drvdata(dev);

	if (up) {
		uart_resume_port(&serial_omap_reg, &up->port);
		up->suspended = false;
        serial_omap_port_enable(up);//add enable and disable to make sure RTS state right after resume
        if (up->rts_mux_driver_control && up->rts_pullup_in_suspend) {
            omap_rts_mux_write(0, up->port.line);
            up->rts_pullup_in_suspend = 0;
        }
        serial_omap_port_disable(up);
	}

	return 0;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:17,代码来源:omap-serial.c

示例15: omap_uart_resume_idle

/* TBD: Should be removed once we irq-chaining mechanism in place */
u32 omap_uart_resume_idle()
{
	int i;
	u32 ret = 0;

	for (i = 0; i < OMAP_MAX_HSUART_PORTS; i++) {
		struct uart_omap_port *up = ui[i];

		if (!up)
			continue;

		if (up->chk_wakeup(up->pdev)) {
			serial_omap_port_enable(up);
			serial_omap_port_disable(up);
			ret++;
		}
	}
	return ret;
}
开发者ID:manusreload,项目名称:android_kernel_huawei_omap4,代码行数:20,代码来源:omap-serial.c


注:本文中的serial_omap_port_enable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。