Beispiel #1
0
static unsigned int etraxfs_uart_get_mctrl(struct uart_port *port)
{
	struct uart_cris_port *up = (struct uart_cris_port *)port;
	unsigned int ret;

	ret = 0;
	if (crisv32_serial_get_rts(up))
		ret |= TIOCM_RTS;
	if (crisv32_serial_get_cts(up))
		ret |= TIOCM_CTS;
	return mctrl_gpio_get(up->gpios, &ret);
}
Beispiel #2
0
static unsigned int etraxfs_uart_get_mctrl(struct uart_port *port)
{
	struct uart_cris_port *up = (struct uart_cris_port *)port;
	unsigned int ret;

	ret = 0;
	if (crisv32_serial_get_rts(up))
		ret |= TIOCM_RTS;
	/* DTR is active low */
	if (up->dtr_pin && !gpiod_get_raw_value(up->dtr_pin))
		ret |= TIOCM_DTR;
	/* CD is active low */
	if (up->cd_pin && !gpiod_get_raw_value(up->cd_pin))
		ret |= TIOCM_CD;
	/* RI is active low */
	if (up->ri_pin && !gpiod_get_raw_value(up->ri_pin))
		ret |= TIOCM_RI;
	/* DSR is active low */
	if (up->dsr_pin && !gpiod_get_raw_value(up->dsr_pin))
		ret |= TIOCM_DSR;
	if (crisv32_serial_get_cts(up))
		ret |= TIOCM_CTS;
	return ret;
}