On Tue, May 05, 2020 at 04:42:04PM +0200, Lukas Wunner wrote: > Commit e8759ad17d41 ("serial: uapi: Add support for bus termination") > introduced the ability to enable rs485 bus termination from user space. > So far the feature is only used by a single driver, 8250_exar.c, using a > hardcoded GPIO pin specific to Siemens IOT2040 products. > > Provide for a more generic solution by allowing specification of an > rs485 bus termination GPIO pin in the device tree: Amend the serial > core to retrieve the GPIO from the device tree (or ACPI table) and amend > the default ->rs485_config() callback for 8250 drivers to change the > GPIO on request from user space. ... > @@ -3331,6 +3332,29 @@ int uart_get_rs485_mode(struct uart_port *port) > + devm_gpiod_put(dev, port->rs485_term_gpio); > + port->rs485_term_gpio = devm_gpiod_get_optional(dev, "rs485-term", Using devm_*() in uart_get_rs485_mode() seems not right. Why do you need this? > + GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT); Parameter has a specific macro GPIOD_OUT_HIGH. -- With Best Regards, Andy Shevchenko