[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200330145102.GU1922688@smile.fi.intel.com>
Date: Mon, 30 Mar 2020 17:51:02 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Heiko Stuebner <heiko@...ech.de>
Cc: gregkh@...uxfoundation.org, jslaby@...e.com,
matwey.kornilov@...il.com, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org, lukas@...ner.de,
christoph.muellner@...obroma-systems.com,
giulio.benetti@...ronovasrl.com
Subject: Re: [PATCH DON'T APPLY v2 3/7] serial: 8250: Support rs485 bus
termination GPIO
On Thu, Mar 26, 2020 at 12:14:18AM +0100, Heiko Stuebner wrote:
> From: Lukas Wunner <lukas@...ner.de>
>
> Amend the serial core to retrieve the rs485 bus termination 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.
> + port->rs485_term_gpio = devm_gpiod_get(dev, "rs485-term",
> + GPIOD_FLAGS_BIT_DIR_OUT);
> + if (IS_ERR(port->rs485_term_gpio)) {
> + ret = PTR_ERR(port->rs485_term_gpio);
> + port->rs485_term_gpio = NULL;
> + if (ret != -ENOENT) {
> + if (ret != -EPROBE_DEFER)
> + dev_err(dev, "Cannot get rs485-term-gpios\n");
> + return ret;
> + }
NIH of gpiod_get_optional().
> + } else {
> + ret = gpiod_get_value(port->rs485_term_gpio);
> + if (ret < 0) {
> + dev_err(dev, "Cannot get rs485-term-gpios value\n");
> + return ret;
> + }
> + if (ret)
> + rs485conf->flags |= SER_RS485_TERMINATE_BUS;
> + }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists