On Sat, Mar 12, 2016 at 12:22 PM, Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> wrote: > Hello Yegor, > > On Fri, Mar 11, 2016 at 10:30:14PM +0100, Yegor Yefremov wrote: >> On Fri, Mar 11, 2016 at 5:26 PM, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> wrote: >> > On 03/11/2016 08:19 AM, Uwe Kleine-König wrote: >> >> On Fri, Mar 11, 2016 at 05:06:30PM +0100, Yegor Yefremov wrote: >> >>> On Thu, Mar 10, 2016 at 8:55 PM, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> wrote: >> >>>> On 03/10/2016 08:36 AM, Peter Hurley wrote: >> >>>>> Rather, transform >> >>>>> >> >>>>> serial_out(port, UART_MCR, val); >> >>>>> serial_port_out(up, UART_MCR, val); >> >>>>> >> >>>>> to >> >>>>> >> >>>>> serial8250_out_MCR(up, val); >> >>>>> >> >>>>> and add the gpio setting to that. >> >>>>> Do the transform first in a prequel patch; then add gpio to that. >> >>>>> >> >>>>> Similarly for serial_in(port, UART_MCR) >> >>> >> >>> To implement serial8250_in_MCR() we will need something like >> >>> mctrl_gpio_get_mcr(), because mctrl_gpio_get() returns only GPIO >> >>> values in input mode. Peter, Uwe what do you think about it? >> > >> > mctrl_gpio_read() ? >> >> What about renaming the functions to reflect their actual meaning? >> >> mctrl_gpio_get_mcr() >> mctrl_gpio_set_mcr() >> mctrl_gpio_get_msr() > > I think this is only understandable, if you have 8250 in mind where (I > guess) the registers to set and read the handshaking lines are called > mcr and msr. > > So I don't think this is a good idea. What is the best way to check, if for example RTS is implemented via GPIO? Following code fails to compile: drivers/tty/serial/8250/8250_omap.c: In function ‘omap8250_set_mctrl’: drivers/tty/serial/8250/8250_omap.c:131:15: error: dereferencing pointer to incomplete type if (up->gpios->gpio[TIOCM_RTS]) { Should I move struct mctrl_gpios { struct uart_port *port; struct gpio_desc *gpio[UART_GPIO_MAX]; int irq[UART_GPIO_MAX]; unsigned int mctrl_prev; bool mctrl_on; }; to serial_mctrl_gpio.h or should I create some routine, that tells me, if given signal is GPIO or not? Yegor -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html