Linux Serial subsystem development
 help / color / mirror / Atom feed
* Re: [PATCHv2 09/11] Bluetooth: add nokia driver
From: Sebastian Reichel @ 2017-03-22 22:48 UTC (permalink / raw)
  To: Rob Herring
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Samuel Thibault,
	Pavel Machek, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, open list:BLUETOOTH DRIVERS,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <CAL_Jsq+UXxocmpSJwJ8dVY0ZSLn1Rk+GfTRKP7Wqvo-_cE4qPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]

Hi,

On Wed, Mar 22, 2017 at 04:26:28PM -0500, Rob Herring wrote:
> On Tue, Mar 21, 2017 at 5:32 PM, Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > This adds a driver for the Nokia H4+ protocol, which is used
> > at least on the Nokia N9, N900 & N950.
> >
> > Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > ---
> 
> > +       btdev->wakeup_host = devm_gpiod_get(dev, "host-wakeup", GPIOD_IN);
> > +       if (IS_ERR(btdev->wakeup_host)) {
> > +               err = PTR_ERR(btdev->wakeup_host);
> > +               dev_err(dev, "could not get host wakeup gpio: %d", err);
> > +               return err;
> > +       }
> > +
> > +       btdev->wake_irq = gpiod_to_irq(btdev->wakeup_host);
> 
> Missed this in the binding review, but generally, we make these
> interrupts rather than gpios in the binding.

I also read the state of the GPIO. AFAIK it's not possible to read
the state of an IRQ, so I can't switch to IRQ.

> > +
> > +       err = devm_request_threaded_irq(dev, btdev->wake_irq, NULL,
> > +               wakeup_handler,
> > +               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> > +               "wakeup", btdev);
> > +       if (err) {
> > +               dev_err(dev, "could request wakeup irq: %d", err);
> > +               return err;
> > +       }

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCHv2 09/11] Bluetooth: add nokia driver
From: Rob Herring @ 2017-03-22 21:26 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Samuel Thibault,
	Pavel Machek, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, open list:BLUETOOTH DRIVERS,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20170321223216.11733-10-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Tue, Mar 21, 2017 at 5:32 PM, Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> This adds a driver for the Nokia H4+ protocol, which is used
> at least on the Nokia N9, N900 & N950.
>
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---

> +       btdev->wakeup_host = devm_gpiod_get(dev, "host-wakeup", GPIOD_IN);
> +       if (IS_ERR(btdev->wakeup_host)) {
> +               err = PTR_ERR(btdev->wakeup_host);
> +               dev_err(dev, "could not get host wakeup gpio: %d", err);
> +               return err;
> +       }
> +
> +       btdev->wake_irq = gpiod_to_irq(btdev->wakeup_host);

Missed this in the binding review, but generally, we make these
interrupts rather than gpios in the binding.

> +
> +       err = devm_request_threaded_irq(dev, btdev->wake_irq, NULL,
> +               wakeup_handler,
> +               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> +               "wakeup", btdev);
> +       if (err) {
> +               dev_err(dev, "could request wakeup irq: %d", err);
> +               return err;
> +       }

^ permalink raw reply

* Re: [PATCHv2.1] serdev: implement get/set tiocm
From: Rob Herring @ 2017-03-22 21:18 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Samuel Thibault,
	Pavel Machek, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, open list:BLUETOOTH DRIVERS,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20170322005837.6047-1-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Tue, Mar 21, 2017 at 7:58 PM, Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> Add method for getting and setting tiocm.
>
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> Changes since PATCHv2:
>  * fix serdev_device_set_tiocm inline definition for disabled SERDEV
>  * use <linux/termios.h> instead of <asm-generic/termios.h>
> ---
>  drivers/tty/serdev/core.c           | 22 ++++++++++++++++++++++
>  drivers/tty/serdev/serdev-ttyport.c | 24 ++++++++++++++++++++++++
>  include/linux/serdev.h              | 13 +++++++++++++
>  3 files changed, 59 insertions(+)

I'm not that big of a fan of {set,get}_tiocm, but I guess it is fine.

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCHv2 10/11] ARM: dts: N900: Add bluetooth
From: Rob Herring @ 2017-03-22 21:06 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Samuel Thibault,
	Pavel Machek, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, open list:BLUETOOTH DRIVERS,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20170321223216.11733-11-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Tue, Mar 21, 2017 at 5:32 PM, Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> Add bcm2048 node and its system clock to the N900 device tree file.
> Apart from that a reference to the new clock has been added to
> wl1251 (which uses it, too).
>
> Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> Changes since PATCHv1:
>  - update compatible string
> ---
>  arch/arm/boot/dts/omap3-n900.dts | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCHv2 11/11] ARM: dts: N9/N950: add bluetooth
From: Rob Herring @ 2017-03-22 21:06 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Samuel Thibault,
	Pavel Machek, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, open list:BLUETOOTH DRIVERS,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20170321223216.11733-12-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Tue, Mar 21, 2017 at 5:32 PM, Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> The Nokia N950 and N9 have a wl1271 (with nokia bootloader) bluetooth
> module connected to second UART.
>
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> Changes since PATCHv1:
>  - update compatible string
> ---
>  arch/arm/boot/dts/omap3-n950-n9.dtsi | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCHv2 08/11] dt-bindings: net: bluetooth: Add nokia-bluetooth
From: Rob Herring @ 2017-03-22 21:04 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Samuel Thibault,
	Pavel Machek, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, open list:BLUETOOTH DRIVERS,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20170321223216.11733-9-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Tue, Mar 21, 2017 at 5:32 PM, Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> Add binding document for serial bluetooth chips using
> Nokia H4+ protocol.
>
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> Changes since PATCHv1:
>  * change compatible strings
>  * mention active high/low state for GPIOs
> ---
>  .../devicetree/bindings/net/nokia-bluetooth.txt    | 51 ++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCHv2 07/11] serdev: add helpers for cts and rts handling
From: Rob Herring @ 2017-03-22 21:03 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Samuel Thibault,
	Pavel Machek, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, open list:BLUETOOTH DRIVERS,
	linux-serial@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <20170321223216.11733-8-sre@kernel.org>

On Tue, Mar 21, 2017 at 5:32 PM, Sebastian Reichel <sre@kernel.org> wrote:
> Add serdev helper functions for handling of cts and rts
> lines using the serdev's tiocm functions.
>
> Signed-off-by: Sebastian Reichel <sre@kernel.org>
> ---
>  include/linux/serdev.h | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
>
> diff --git a/include/linux/serdev.h b/include/linux/serdev.h
> index 3ad1d695f947..8cdce2ea0d51 100644
> --- a/include/linux/serdev.h
> +++ b/include/linux/serdev.h
> @@ -16,6 +16,7 @@
>  #include <linux/types.h>
>  #include <linux/device.h>
>  #include <asm-generic/termios.h>
> +#include <linux/delay.h>
>
>  struct serdev_controller;
>  struct serdev_device;
> @@ -254,6 +255,36 @@ static inline int serdev_device_write_room(struct serdev_device *sdev)
>
>  #endif /* CONFIG_SERIAL_DEV_BUS */
>
> +static inline bool serdev_device_get_cts(struct serdev_device *serdev)
> +{
> +       int status = serdev_device_get_tiocm(serdev);
> +       return !!(status & TIOCM_CTS);
> +}
> +
> +static inline int serdev_device_wait_for_cts(struct serdev_device *serdev, bool state, int timeout_ms)
> +{
> +       unsigned long timeout;
> +       bool signal;
> +
> +       timeout = jiffies + msecs_to_jiffies(timeout_ms);
> +       while (!time_after(jiffies, timeout)) {

You can use time_is_after_jiffies(timeout) instead of !time_after.

> +               signal = serdev_device_get_cts(serdev);
> +               if (signal == state)
> +                       return 0;
> +               usleep_range(1000, 2000);
> +       }
> +
> +       return -ETIMEDOUT;
> +}
> +
> +static inline int serdev_device_set_rts(struct serdev_device *serdev, bool enable)
> +{
> +       if (enable)
> +               return serdev_device_set_tiocm(serdev, TIOCM_OUT2 | TIOCM_RTS, 0);

Perhaps a comment why we're messing with OUT2.

With those,

Acked-by: Rob Herring <robh@kernel.org>

> +       else
> +               return serdev_device_set_tiocm(serdev, 0, TIOCM_OUT2 | TIOCM_RTS);
> +}
> +
>  /*
>   * serdev hooks into TTY core
>   */
> --
> 2.11.0
>

^ permalink raw reply

* Re: [RFC RESEND] serdev binding for QCA7000 UART driver
From: Rob Herring @ 2017-03-22 20:32 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Frank Rowand, Greg Kroah-Hartman, Jiri Slaby,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <b2273c4a-069b-0b9a-83d3-aed782920c34-eS4NqCHxEME@public.gmane.org>

On Mon, Mar 13, 2017 at 11:16 AM, Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org> wrote:
> Hi Rob,
>
> since serdev has been merged, i'm currently working on a
> suitable ethernet driver for the QCA7000 [1]. In order to provide a plug
> and play solution for the network interface i suggest the following
> binding, which uses common properties for UART configuration:
>
> * Qualcomm QCA7000 (Ethernet over UART protocol)
>
> Note: The QCA7000 is also useable as a UART slave device.

Should this be s/UART/SPI/ ?

>
> Required properties:
> - compatible        : Should be "qca,qca7000-uart"
>
> Optional properties:
> - local-mac-address : 6 bytes, Specifies MAC address
> - current-speed     : Specifies current serial device speed in
>                       bits per second (default = 115200)
> - data-bits         : Specifies number of data bits (default = 8)
> - use-parity        : If present, this enables the parity
>                       error detection (default = off)
> - odd-parity        : If present, this specifies that the parity
>                       of each character must be odd (default = even)
>
> Example:
>
> /* Freescale i.MX28 UART */
> auart0: serial@8006a000 {
>     compatible = "fsl,imx28-auart", "fsl,imx23-auart";
>     reg = <0x8006a000 0x2000>;
>     pinctrl-names = "default";
>     pinctrl-0 = <&auart0_2pins_a>;
>     status = "okay";
>
>     qca7000: ethernet {
>         compatible = "qca,qca7000-uart";
>         local-mac-address = [ A0 B0 C0 D0 E0 F0 ];
>         current-speed = <38400>;

Unless this device supports auto-baud (generally only AT command set
devices do), this is setup by a bootloader (and you have no way to
reset the device), or the speed changes with different firmware, I
don't think you should need this. Devices typically have a fixed,
initial baudrate that is known, so the driver should know it. Many
devices switch to a higher speed with some command which the driver
should also know. Unless there is some board limitation of the max
speed, then you shouldn't really need a baudrate property. And for max
baudrate, I added "max-speed".

>         data-bits = <8>;

Nearly everything uses 8 bits, so this should be the default.

>         use-parity;
>         odd-parity;

I don't think we need 2 properties here. "even-parity" and
"odd-parity" booleans should be enough to enable and set parity type.

>     };
> };
>
> Is it okay for you or do you want a different kind of configuration?
> Are there any plans for parity handling?

I don't have any. Patches welcome. :)

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 2/2] serial: 8250: 8250_core: Fix irq name for 8250 serial irq
From: Andy Shevchenko @ 2017-03-22 18:48 UTC (permalink / raw)
  To: Vignesh R
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm Mailing List,
	Jisheng Zhang
In-Reply-To: <20170321133636.8814-3-vigneshr@ti.com>

On Tue, Mar 21, 2017 at 3:36 PM, Vignesh R <vigneshr@ti.com> wrote:
> Using dev_name() as irq name during request_irq() might be misleading in
> case of serial over PCI. Therefore identify serial port irqs using
> uart_port's name field. This will help mapping irqs to appropriate
> ttySN(where N is the serial port index) instances.
>

Based on the information in name member of uart_port it looks best
approach to me.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
>  drivers/tty/serial/8250/8250_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index f83b69f30987..48a07e2f617f 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -218,7 +218,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
>                 spin_unlock_irq(&i->lock);
>                 irq_flags |= up->port.irqflags;
>                 ret = request_irq(up->port.irq, serial8250_interrupt,
> -                                 irq_flags, dev_name(up->port.dev), i);
> +                                 irq_flags, up->port.name, i);
>                 if (ret < 0)
>                         serial_do_unlink(i, up);
>         }
> --
> 2.11.0
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply

* Re: [PATCH 0/2] serial: Add name field to uart_port
From: Andy Shevchenko @ 2017-03-22 18:46 UTC (permalink / raw)
  To: Vignesh R
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm Mailing List,
	Jisheng Zhang
In-Reply-To: <20170321133636.8814-1-vigneshr@ti.com>

On Tue, Mar 21, 2017 at 3:36 PM, Vignesh R <vigneshr@ti.com> wrote:
> This series adds name attribute to uart_port struct inorder to store
> name of the tty port that will help in identify different uart
> instances.
> This patch series is based on discussion here[1].

Please, use versioning for the series. This AFAIU should be v3, and
next (which is expecting based on comments) would be v4.

> [1] https://www.spinics.net/lists/arm-kernel/msg569188.html

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply

* Re: [PATCH 1/2] tty: serial_core: Add name field to uart_port struct
From: Andy Shevchenko @ 2017-03-22 18:45 UTC (permalink / raw)
  To: Vignesh R
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm Mailing List,
	Jisheng Zhang
In-Reply-To: <20170321133636.8814-2-vigneshr@ti.com>

On Tue, Mar 21, 2017 at 3:36 PM, Vignesh R <vigneshr@ti.com> wrote:
> Introduce a field to store name of uart_port that can be used to easily
> identify uart port instances on a system that has more than one uart

uart -> UART

> instance. The name is of the form ttyXN(eg. ttyS0, ttyAMA0,..) where N
> is number that particular uart instance.
> This field will be useful when printing debug info for a particular port
> or in register irqs with unique irq name. Port name is populated during

irq(s) -> IRQ(s)

> uart_add_one_port().

> +       snprintf(uport->name, sizeof(uport->name), "%s%d", drv->dev_name,
> +                drv->tty_driver->name_base + uport->line);

This is fragile. dev_name is defined as pointer, so, it would be any length.
So, better to use [devm_]kasprintf().

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply

* [PATCH 1/1] tty: serial: st-asc: Make the locking RT aware
From: Lionel Debieve @ 2017-03-22 17:12 UTC (permalink / raw)
  To: Patrice Chotard, Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-serial, linux-kernel, linux-arm-kernel, linux-rt-users,
	Lionel Debieve

The lock is a sleeping lock and local_irq_save() is not the
standard implementation now. Working for both -RT and non
RT.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/tty/serial/st-asc.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index c334bcc..4889396 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -887,13 +887,12 @@ static void asc_console_write(struct console *co, const char *s, unsigned count)
 	int locked = 1;
 	u32 intenable;
 
-	local_irq_save(flags);
 	if (port->sysrq)
 		locked = 0; /* asc_interrupt has already claimed the lock */
 	else if (oops_in_progress)
-		locked = spin_trylock(&port->lock);
+		locked = spin_trylock_irqsave(&port->lock, flags);
 	else
-		spin_lock(&port->lock);
+		spin_lock_irqsave(&port->lock, flags);
 
 	/*
 	 * Disable interrupts so we don't get the IRQ line bouncing
@@ -911,8 +910,7 @@ static void asc_console_write(struct console *co, const char *s, unsigned count)
 	asc_out(port, ASC_INTEN, intenable);
 
 	if (locked)
-		spin_unlock(&port->lock);
-	local_irq_restore(flags);
+		spin_unlock_irqrestore(&port->lock, flags);
 }
 
 static int asc_console_setup(struct console *co, char *options)
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH] [v2][for 4.11]tty: acpi/spcr: QDF2400 E44 checks for wrong OEM revision
From: Greg Kroah-Hartman @ 2017-03-22 15:45 UTC (permalink / raw)
  To: Timur Tabi
  Cc: Dann Frazier, Manoj Iyer, linux-serial,
	linux-arm-kernel@lists.infradead.org, Christopher Covington
In-Reply-To: <CAOZdJXW6k=fwaD96dPSikK6kntbKFuhypALG8YGbcWcBcRcLiw@mail.gmail.com>

On Wed, Mar 22, 2017 at 10:13:00AM -0500, Timur Tabi wrote:
> On Sun, Mar 12, 2017 at 11:19 PM, Timur Tabi <timur@codeaurora.org> wrote:
> > On Tue, Feb 28, 2017 at 2:30 PM, Timur Tabi <timur@codeaurora.org> wrote:
> >> For Qualcomm Technologies QDF2400 SOCs that are affected by erratum E44,
> >> the ACPI oem_revision field is actually set to 1, not 0.
> >>
> >> Fixes: d8a4995bcea1 ("tty: pl011: Work around QDF2400 E44 stuck BUSY bit")
> >>
> >> Tested-by: Manoj Iyer <manoj.iyer@canonical.com>
> >> Signed-off-by: Timur Tabi <timur@codeaurora.org>
> >
> > Greg, this is a critical fix for our platform.  Can you please pick it
> > up for 4.11-rc3?  Thank you.
> 
> Ok, how about 4.11-rc4?

It's in the queue in tty-linus, right?  If so, that should make it into
4.11-final.

thanks,

greg k-h

^ permalink raw reply

* Re: [RFC RESEND] serdev binding for QCA7000 UART driver
From: Stefan Wahren @ 2017-03-22 15:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Frank Rowand, Greg Kroah-Hartman, Jiri Slaby,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-serial-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <b2273c4a-069b-0b9a-83d3-aed782920c34-eS4NqCHxEME@public.gmane.org>

Am 13.03.2017 um 17:16 schrieb Stefan Wahren:
> Hi Rob,
>
> since serdev has been merged, i'm currently working on a
> suitable ethernet driver for the QCA7000 [1]. In order to provide a plug
> and play solution for the network interface i suggest the following
> binding, which uses common properties for UART configuration:
>
> * Qualcomm QCA7000 (Ethernet over UART protocol)
>
> Note: The QCA7000 is also useable as a UART slave device.
>
> Required properties:
> - compatible        : Should be "qca,qca7000-uart"
>
> Optional properties:
> - local-mac-address : 6 bytes, Specifies MAC address
> - current-speed     : Specifies current serial device speed in
>                       bits per second (default = 115200)
> - data-bits         : Specifies number of data bits (default = 8)
> - use-parity        : If present, this enables the parity
>                       error detection (default = off)
> - odd-parity        : If present, this specifies that the parity
>                       of each character must be odd (default = even)
>
> Example:
>
> /* Freescale i.MX28 UART */
> auart0: serial@8006a000 {
>     compatible = "fsl,imx28-auart", "fsl,imx23-auart";
>     reg = <0x8006a000 0x2000>;
>     pinctrl-names = "default";
>     pinctrl-0 = <&auart0_2pins_a>;
>     status = "okay";
>
>     qca7000: ethernet {
>         compatible = "qca,qca7000-uart";
>         local-mac-address = [ A0 B0 C0 D0 E0 F0 ];
>         current-speed = <38400>;
>         data-bits = <8>;
>         use-parity;
>         odd-parity;
>     };
> };
>
> Is it okay for you or do you want a different kind of configuration?
> Are there any plans for parity handling?
>
> Thanks
> Stefan
>
> P.S.: Sorry for the broken version
>
> [1] - https://lwn.net/Articles/701225/

gentle ping ...
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] [v2][for 4.11]tty: acpi/spcr: QDF2400 E44 checks for wrong OEM revision
From: Timur Tabi @ 2017-03-22 15:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dann Frazier, Manoj Iyer, linux-serial,
	linux-arm-kernel@lists.infradead.org, Christopher Covington
In-Reply-To: <CAOZdJXUVz8w2tQdgQ1CyQC9XZL=Gig5kaSEb3b+3Yjap0ExfGg@mail.gmail.com>

On Sun, Mar 12, 2017 at 11:19 PM, Timur Tabi <timur@codeaurora.org> wrote:
> On Tue, Feb 28, 2017 at 2:30 PM, Timur Tabi <timur@codeaurora.org> wrote:
>> For Qualcomm Technologies QDF2400 SOCs that are affected by erratum E44,
>> the ACPI oem_revision field is actually set to 1, not 0.
>>
>> Fixes: d8a4995bcea1 ("tty: pl011: Work around QDF2400 E44 stuck BUSY bit")
>>
>> Tested-by: Manoj Iyer <manoj.iyer@canonical.com>
>> Signed-off-by: Timur Tabi <timur@codeaurora.org>
>
> Greg, this is a critical fix for our platform.  Can you please pick it
> up for 4.11-rc3?  Thank you.

Ok, how about 4.11-rc4?

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply

* Re: [REGRESSION next-20170321] acbdad8dd1ab ("serial: 8250_dw: simplify optional reset handling") causes silent kernel.
From: Ralph Sennhauser @ 2017-03-22 15:11 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andy Shevchenko, Greg Kroah-Hartman, linux-serial, linux-kernel
In-Reply-To: <1490193227.2285.39.camel@pengutronix.de>

Hi Philipp

On Wed, 22 Mar 2017 15:33:47 +0100
Philipp Zabel <p.zabel@pengutronix.de> wrote:

> Hi Ralph,
> 
> On Wed, 2017-03-22 at 15:24 +0100, Ralph Sennhauser wrote:
> > Hi Philipp,
> > 
> > Commit acbdad8dd1ab ("serial: 8250_dw: simplify optional reset
> > handling") causes the kernel to no longer print anything to the
> > serial console on a Linksys WRT3200ACM (Armada-385, a similar board
> > would be ./arch/arm/boot/dts/armada-385-linksys-cobra.dts). The
> > last message from uboot is "Starting kernel ..." and then silence.
> > The device boots all the way nonetheless.
> > 
> > Reverting the above commit gets the console output back.
> > 
> > Ralph  
> 
> Thank you for the report. I assume that you are compiling with the
> RESET_CONTROLLER Kconfig option disabled? Does commit 0ca10b60ceeb
>  [1] in
> the arm-soc fixes branch help with this issue?

Yes, RESET_CONTROLLER is not set.

Commit 0ca10b60ceeb ("reset: fix optional reset_control_get stubs to
return NULL") fixes the issue for me.

Thanks
Ralph

> 
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git/commit/?h=fixes&id=0ca10b60ceeb5372da01798ca68c116ae45a6eb6
> 
> regards
> Philipp
> 

^ permalink raw reply

* Re: [REGRESSION next-20170321] acbdad8dd1ab ("serial: 8250_dw: simplify optional reset handling") causes silent kernel.
From: Philipp Zabel @ 2017-03-22 14:33 UTC (permalink / raw)
  To: Ralph Sennhauser
  Cc: Andy Shevchenko, Greg Kroah-Hartman, linux-serial, linux-kernel
In-Reply-To: <20170322152445.0b25f78c@gmail.com>

Hi Ralph,

On Wed, 2017-03-22 at 15:24 +0100, Ralph Sennhauser wrote:
> Hi Philipp,
> 
> Commit acbdad8dd1ab ("serial: 8250_dw: simplify optional reset
> handling") causes the kernel to no longer print anything to the serial
> console on a Linksys WRT3200ACM (Armada-385, a similar board would
> be ./arch/arm/boot/dts/armada-385-linksys-cobra.dts). The last message
> from uboot is "Starting kernel ..." and then silence. The device boots
> all the way nonetheless.
> 
> Reverting the above commit gets the console output back.
> 
> Ralph

Thank you for the report. I assume that you are compiling with the
RESET_CONTROLLER Kconfig option disabled? Does commit 0ca10b60ceeb
("reset: fix optional reset_control_get stubs to return NULL") [1] in
the arm-soc fixes branch help with this issue?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git/commit/?h=fixes&id=0ca10b60ceeb5372da01798ca68c116ae45a6eb6

regards
Philipp

^ permalink raw reply

* [REGRESSION next-20170321] acbdad8dd1ab ("serial: 8250_dw: simplify optional reset handling") causes silent kernel.
From: Ralph Sennhauser @ 2017-03-22 14:24 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andy Shevchenko, Greg Kroah-Hartman, linux-serial, linux-kernel

Hi Philipp,

Commit acbdad8dd1ab ("serial: 8250_dw: simplify optional reset
handling") causes the kernel to no longer print anything to the serial
console on a Linksys WRT3200ACM (Armada-385, a similar board would
be ./arch/arm/boot/dts/armada-385-linksys-cobra.dts). The last message
from uboot is "Starting kernel ..." and then silence. The device boots
all the way nonetheless.

Reverting the above commit gets the console output back.

Ralph


Bisect log:

  git bisect start
  # bad: [50eff530518ae89e25d09ec1aa41a7aea6a7d51c] Add linux-next specific files for 20170321
  git bisect bad 50eff530518ae89e25d09ec1aa41a7aea6a7d51c
  # good: [97da3854c526d3a6ee05c849c96e48d21527606c] Linux 4.11-rc3
  git bisect good 97da3854c526d3a6ee05c849c96e48d21527606c
  # good: [445775520e021af86ee95b76eecca2df8203ce93] Merge remote-tracking branch 'drm/drm-next'
  git bisect good 445775520e021af86ee95b76eecca2df8203ce93
  # good: [9f18c54f1a491ed2ff42354352fa72949ce21622] Merge remote-tracking branch 'usb-serial/usb-next'
  git bisect good 9f18c54f1a491ed2ff42354352fa72949ce21622
  # good: [cfd23945be7413351ef57ff5b07c5b037a7f9995] staging: media: Remove unused function atomisp_set_stop_timeout()
  git bisect good cfd23945be7413351ef57ff5b07c5b037a7f9995
  # bad: [b8e4c398ad2f0c005b76298e6492a20804af5bf3] Merge remote-tracking branch 'gpio/for-next'
  git bisect bad b8e4c398ad2f0c005b76298e6492a20804af5bf3
  # bad: [1e0dec03559e0a6f57398d46167dcac5514e28cc] Merge remote-tracking branch 'staging/staging-next'
  git bisect bad 1e0dec03559e0a6f57398d46167dcac5514e28cc
  # bad: [1e0dec03559e0a6f57398d46167dcac5514e28cc] Merge remote-tracking branch 'staging/staging-next'
  git bisect bad 1e0dec03559e0a6f57398d46167dcac5514e28cc
  # bad: [b93a6959856081a440ca98debbbf81fd5828014f] Merge remote-tracking branch 'extcon/extcon-next'
  git bisect bad b93a6959856081a440ca98debbbf81fd5828014f
  # good: [1d3b2af213902059d9f4b35eb15b53f8062dc3b3] auxdisplay: charlcd: Add support for displays with more than two lines
  git bisect good 1d3b2af213902059d9f4b35eb15b53f8062dc3b3
  # good: [22077b091a4720d4336bd806e9c93b2a81fcc38a] tty: serial_core, remove state checks in uart_poll*
  git bisect good 22077b091a4720d4336bd806e9c93b2a81fcc38a
  # good: [16b11f258b4563a8d18b9e35344540ca41a5550b] extcon: int3496: Set the id pin to direction-input if necessary
  git bisect good 16b11f258b4563a8d18b9e35344540ca41a5550b
  # good: [5ce689f2e4b83363750c8dda46042f9332b37cc1] Merge remote-tracking branch 'phy-next/next'
  git bisect good 5ce689f2e4b83363750c8dda46042f9332b37cc1
  # good: [d47d88361feea2ce11f39bd70467ffc19a61d2d3] auxdisplay: Add HD44780 Character LCD support
  git bisect good d47d88361feea2ce11f39bd70467ffc19a61d2d3
  # bad: [76e00cb026f0afe6f62072dbb57c20a69e3427c8] Merge remote-tracking branch 'tty/tty-next'
  git bisect bad 76e00cb026f0afe6f62072dbb57c20a69e3427c8
  # bad: [acbdad8dd1abd98b216d8c37ff9c6de4aa595534] serial: 8250_dw: simplify optional reset handling
  git bisect bad acbdad8dd1abd98b216d8c37ff9c6de4aa595534
  # first bad commit: [acbdad8dd1abd98b216d8c37ff9c6de4aa595534]
  serial: 8250_dw: simplify optional reset handling

^ permalink raw reply

* Re: [PATCHv2.1] serdev: implement get/set tiocm
From: Pavel Machek @ 2017-03-22  9:40 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Rob Herring,
	Samuel Thibault, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170322005837.6047-1-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

On Wed 2017-03-22 01:58:37, Sebastian Reichel wrote:
> Add method for getting and setting tiocm.
> 
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: [PATCHv2 05/11] serdev: add serdev_device_wait_until_sent
From: Pavel Machek @ 2017-03-22  9:39 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Rob Herring,
	Samuel Thibault, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170321223216.11733-6-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

Hi!

> @@ -47,10 +48,13 @@ static void ttyport_write_wakeup(struct tty_port *port)
>  	struct serport *serport = serdev_controller_get_drvdata(ctrl);
>  
>  	if (!test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &port->tty->flags))
> -		return;
> +		goto out;
>  
>  	if (test_bit(SERPORT_ACTIVE, &serport->flags))
>  		serdev_controller_write_wakeup(ctrl);
> +
> +out:

I'd do "if (test_and_clear_bit() && test_bit()) serdev_()"
here. Otherwise it looks fine.

Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

									Pavel
									
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: [PATCHv2 04/11] tty: serial: omap: add UPF_BOOT_AUTOCONF flag for DT init
From: Pavel Machek @ 2017-03-22  9:32 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Rob Herring,
	Samuel Thibault, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170321223216.11733-5-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

On Tue 2017-03-21 23:32:09, Sebastian Reichel wrote:
> The UPF_BOOT_AUTOCONF flag is needed for proper
> flow control support.
> 
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: [PATCHv2 02/11] Bluetooth: hci_uart: add serdev driver support library
From: Pavel Machek @ 2017-03-22  9:32 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, Rob Herring,
	Samuel Thibault, Tony Lindgren, Greg Kroah-Hartman, Jiri Slaby,
	Mark Rutland, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring
In-Reply-To: <20170321223216.11733-3-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

On Tue 2017-03-21 23:32:07, Sebastian Reichel wrote:
> From: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 
> This adds library functions for serdev based BT drivers. This is largely
> copied from hci_ldisc.c and modified to use serdev calls. There's a little
> bit of duplication, but I avoided intermixing this as the ldisc code should
> eventually go away.
> 
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
> Cc: Gustavo Padovan <gustavo-THi1TnShQwVAfugRpC6u6w@public.gmane.org>
> Cc: Johan Hedberg <johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> [Fix style issues reported by Pavel]
> Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* [PATCHv2.1] serdev: implement get/set tiocm
From: Sebastian Reichel @ 2017-03-22  0:58 UTC (permalink / raw)
  To: Sebastian Reichel, Marcel Holtmann, Gustavo Padovan,
	Johan Hedberg, Rob Herring
  Cc: Samuel Thibault, Pavel Machek, Tony Lindgren, Greg Kroah-Hartman,
	Jiri Slaby, Mark Rutland, linux-bluetooth, linux-serial,
	devicetree, linux-kernel
In-Reply-To: <20170321223216.11733-7-sre@kernel.org>

Add method for getting and setting tiocm.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
Changes since PATCHv2:
 * fix serdev_device_set_tiocm inline definition for disabled SERDEV
 * use <linux/termios.h> instead of <asm-generic/termios.h>
---
 drivers/tty/serdev/core.c           | 22 ++++++++++++++++++++++
 drivers/tty/serdev/serdev-ttyport.c | 24 ++++++++++++++++++++++++
 include/linux/serdev.h              | 13 +++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index a63b74031e22..1e1cbae3a0ea 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -184,6 +184,28 @@ void serdev_device_wait_until_sent(struct serdev_device *serdev, long timeout)
 }
 EXPORT_SYMBOL_GPL(serdev_device_wait_until_sent);
 
+int serdev_device_get_tiocm(struct serdev_device *serdev)
+{
+	struct serdev_controller *ctrl = serdev->ctrl;
+
+	if (!ctrl || !ctrl->ops->get_tiocm)
+		return -ENOTSUPP;
+
+	return ctrl->ops->get_tiocm(ctrl);
+}
+EXPORT_SYMBOL_GPL(serdev_device_get_tiocm);
+
+int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear)
+{
+	struct serdev_controller *ctrl = serdev->ctrl;
+
+	if (!ctrl || !ctrl->ops->set_tiocm)
+		return -ENOTSUPP;
+
+	return ctrl->ops->set_tiocm(ctrl, set, clear);
+}
+EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);
+
 static int serdev_drv_probe(struct device *dev)
 {
 	const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index db2bc601e554..c5bdb901ff11 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -179,6 +179,28 @@ static void ttyport_wait_until_sent(struct serdev_controller *ctrl, long timeout
 	tty_wait_until_sent(tty, timeout);
 }
 
+static int ttyport_get_tiocm(struct serdev_controller *ctrl)
+{
+	struct serport *serport = serdev_controller_get_drvdata(ctrl);
+	struct tty_struct *tty = serport->tty;
+
+	if (!tty->ops->tiocmget)
+		return -ENOTSUPP;
+
+	return tty->driver->ops->tiocmget(tty);
+}
+
+static int ttyport_set_tiocm(struct serdev_controller *ctrl, unsigned int set, unsigned int clear)
+{
+	struct serport *serport = serdev_controller_get_drvdata(ctrl);
+	struct tty_struct *tty = serport->tty;
+
+	if (!tty->ops->tiocmset)
+		return -ENOTSUPP;
+
+	return tty->driver->ops->tiocmset(tty, set, clear);
+}
+
 static const struct serdev_controller_ops ctrl_ops = {
 	.write_buf = ttyport_write_buf,
 	.write_flush = ttyport_write_flush,
@@ -188,6 +210,8 @@ static const struct serdev_controller_ops ctrl_ops = {
 	.set_flow_control = ttyport_set_flow_control,
 	.set_baudrate = ttyport_set_baudrate,
 	.wait_until_sent = ttyport_wait_until_sent,
+	.get_tiocm = ttyport_get_tiocm,
+	.set_tiocm = ttyport_set_tiocm,
 };
 
 struct device *serdev_tty_port_register(struct tty_port *port,
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index a308b206d204..e29a270f603c 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -15,6 +15,7 @@
 
 #include <linux/types.h>
 #include <linux/device.h>
+#include <linux/termios.h>
 
 struct serdev_controller;
 struct serdev_device;
@@ -82,6 +83,8 @@ struct serdev_controller_ops {
 	void (*set_flow_control)(struct serdev_controller *, bool);
 	unsigned int (*set_baudrate)(struct serdev_controller *, unsigned int);
 	void (*wait_until_sent)(struct serdev_controller *, long);
+	int (*get_tiocm)(struct serdev_controller *);
+	int (*set_tiocm)(struct serdev_controller *, unsigned int, unsigned int);
 };
 
 /**
@@ -188,6 +191,8 @@ void serdev_device_close(struct serdev_device *);
 unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
 void serdev_device_set_flow_control(struct serdev_device *, bool);
 void serdev_device_wait_until_sent(struct serdev_device *, long);
+int serdev_device_get_tiocm(struct serdev_device *);
+int serdev_device_set_tiocm(struct serdev_device *, int, int);
 int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
 void serdev_device_write_flush(struct serdev_device *);
 int serdev_device_write_room(struct serdev_device *);
@@ -226,6 +231,14 @@ static inline unsigned int serdev_device_set_baudrate(struct serdev_device *sdev
 }
 static inline void serdev_device_set_flow_control(struct serdev_device *sdev, bool enable) {}
 static inline void serdev_device_wait_until_sent(struct serdev_device *sdev, long timeout) {}
+static inline int serdev_device_get_tiocm(struct serdev_device *serdev)
+{
+	return -ENOTSUPP;
+}
+static inline int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear)
+{
+	return -ENOTSUPP;
+}
 static inline int serdev_device_write_buf(struct serdev_device *sdev, const unsigned char *buf, size_t count)
 {
 	return -ENODEV;
-- 
2.11.0

^ permalink raw reply related

* Re: [patch 0/7] staging: speakup: introduce tty-based comms
From: Samuel Thibault @ 2017-03-22  0:05 UTC (permalink / raw)
  To: Rob Herring, Greg Kroah-Hartman, okash.khawaja, Jiri Slaby,
	linux-kernel@vger.kernel.org, devel, linux-serial@vger.kernel.org,
	Kirk Reiser, Chris Brannon, speakup
In-Reply-To: <20170315150323.pjda5qnxauxk5pcf@var.youpi.perso.aquilenet.fr>

Hello,

So Rob, how do you see this going?  Shall we introduce a serdev_device
*tty_port_register_serdev_device(tty, device)? Will you work on it or
should I give it a try?

Samuel

Samuel Thibault, on mer. 15 mars 2017 16:03:23 +0100, wrote:
> Rob Herring, on mer. 15 mars 2017 09:45:59 -0500, wrote:
> > On Mon, Mar 13, 2017 at 8:18 PM, Samuel Thibault
> > <samuel.thibault@ens-lyon.org> wrote:
> > > Samuel Thibault, on mar. 14 mars 2017 01:47:01 +0100, wrote:
> > >> Greg KH, on mar. 14 mars 2017 06:14:04 +0800, wrote:
> > >> > On Mon, Mar 13, 2017 at 10:05:51PM +0000, okash.khawaja@gmail.com wrote:
> > >> > > This patchset introduces a TTY-based way for the synths to communicate
> > >> > > with devices as an alternate for direct serial comms used by the synths
> > >> > > at the moment. It then migrates some of the synths to the TTY-based
> > >> > > comms. Synths migrated in this patchset are dummy, acntsa, bns and
> > >> > > txprt.
> > >> >
> > >> > What about using the serbus code that is now in the tree?  That should
> > >> > make this a lot easier than your patchset from what I can see.
> > >>
> > >> Mmm... AIUI from reading tty_port_register_device_attr, one
> > >> would have to have registered a speakup serdev device driver
> > >> *before* tty_port_register_device_attr gets called, so that
> > >> serdev_tty_port_register matches the driver in the loop of
> > >> of_serdev_register_devices, and no TTY cdev is created?
> > 
> > Not exactly. The driver doesn't have to be registered nor loaded, but
> > the device does have to be present so no tty cdev is created. The only
> > way a device is present currently is when a node is in the DT. I
> > expect the x86 folks will be adding ACPI support soon.
> 
> Ok, but in our case there is no hardware device that the system can
> see/probe, it's just plugged externally.
> 
> > >> That would mean that speakup can not be loaded as a module after ttyS0
> > >> initialization, that won't fly for our use needs. The line discipline
> > >> mechanism allows us to attach ourself to an existing tty.  Could we
> > >> imagine a tty_port function which removes the cdev and tries to register
> > >> the tty port again to serdev?
> > >>
> > >> What we basically need to be able to say on speakup module load is
> > >> e.g. "I'm now attaching a device to ttyS0, use this serdev_device_ops to
> > >> discuss with it".
> > >
> > > That for_each_available_child_of_node loop is really way more complex
> > > than what we need.  And what's more, it's not working without CONFIG_OF
> > > (!)
> > >
> > > It would really make sense to me to have a
> > >
> > > serdev_device *tty_port_register_serdev_device(tty, device)
> > >
> > > which unregisters the character device of the tty, and creates instead a
> > > controler with the given device plugged to it. Really much like a line
> > > discipline, but way simpler :)
> > 
> > What would trigger calling this function?
> 
> From the user point of view, loading the speakup module for the external
> device, typically, with "ttyS0" as module parameter. Then the speakup
> init function can do whatever it needs to achieve this :)

^ permalink raw reply

* [PATCHv2 11/11] ARM: dts: N9/N950: add bluetooth
From: Sebastian Reichel @ 2017-03-21 22:32 UTC (permalink / raw)
  To: Sebastian Reichel, Marcel Holtmann, Gustavo Padovan,
	Johan Hedberg, Rob Herring
  Cc: Samuel Thibault, Pavel Machek, Tony Lindgren, Greg Kroah-Hartman,
	Jiri Slaby, Mark Rutland, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170321223216.11733-1-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

The Nokia N950 and N9 have a wl1271 (with nokia bootloader) bluetooth
module connected to second UART.

Signed-off-by: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
Changes since PATCHv1:
 - update compatible string
---
 arch/arm/boot/dts/omap3-n950-n9.dtsi | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index 5d8c4b4a4205..df3366fa5409 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -58,6 +58,13 @@
 			pinctrl-0 = <&debug_leds>;
 		};
 	};
+
+	/* controlled (enabled/disabled) directly by wl1271 */
+	vctcxo: vctcxo {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <38400000>;
+	};
 };
 
 &omap3_pmx_core {
@@ -125,6 +132,15 @@
 			OMAP3_CORE1_IOPAD(0x210a, PIN_OUTPUT | MUX_MODE4)            /* gpio_93 (cmt_apeslpx) */
 		>;
 	};
+
+	uart2_pins: pinmux_uart2_pins {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x2174, PIN_INPUT_PULLUP | MUX_MODE0)		/* uart2_cts */
+			OMAP3_CORE1_IOPAD(0x2176, PIN_OUTPUT | MUX_MODE0)		/* uart2_rts */
+			OMAP3_CORE1_IOPAD(0x2178, PIN_OUTPUT | MUX_MODE0)		/* uart2_tx */
+			OMAP3_CORE1_IOPAD(0x217a, PIN_INPUT | MUX_MODE0)		/* uart2_rx */
+		>;
+	};
 };
 
 &omap3_pmx_core2 {
@@ -435,3 +451,19 @@
 &ssi_port2 {
 	status = "disabled";
 };
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
+
+	bluetooth {
+		compatible = "ti,wl1271-bluetooth-nokia", "nokia,h4p-bluetooth";
+
+		reset-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>; /* 26 */
+		host-wakeup-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* 101 */
+		bluetooth-wakeup-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; /* 37 */
+
+		clocks = <&vctcxo>;
+		clock-names = "sysclk";
+	};
+};
-- 
2.11.0

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox