Linux-OMAP Archive on lore.kernel.org
 help / color / Atom feed
* [PATCHv6 0/6] n_gsm serdev support and GNSS driver for droid4
@ 2020-04-30 17:46 Tony Lindgren
  2020-04-30 17:46 ` [PATCH 1/6] tty: n_gsm: Add support for serdev drivers Tony Lindgren
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Tony Lindgren @ 2020-04-30 17:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Johan Hovold, Rob Herring
  Cc: Alan Cox, Lee Jones, Jiri Slaby, Merlijn Wajer, Pavel Machek,
	Peter Hurley, Sebastian Reichel, linux-serial, devicetree,
	linux-kernel, linux-omap

Hi all,

Here's v6 set of these patches fixed up for Johan's earlier comments.

Getting rid of the custom chardev interface, and making things more
generic also simplified things quite a bit. Thanks a lot Johan :)

This series does the following:

1. Adds functions to n_gsm.c for serdev-ngsm.c driver to use

2. Adds a generic serdev-ngsm.c driver that brings up the TS 27.010
   TTY ports configured in devicetree with help of n_gsm.c

3. Allows the use of standard Linux device drivers for dedicated
   TS 27.010 channels for devices like GNSS and ALSA found on some
   modems for example

4. Adds a serdev-ngsm consumer driver for the GNSS device found on
   the Motorola Mapphone MDM6600 modem on devices like droid4

I've placed the serdev-ngsm.c under drivers/tty/serdev as it still
seems to make most sense with no better places available. It's no
longer an MFD driver as it really does not need to care what channel
specific consumer drivers might be configured. So it now just uses
of_platform_populate() to probe whatever child nodes it might find.

I'm not attached having the driver in drivers/tty/serdev. I just
don't have any better locations in mind. So jsing Johan's earlier
i2c example, the drivers/tty/serdev/serdev-ngsm.c driver is now a
generic protocol and bus driver, so it's getting closer to the
maybe the drivers/i2c/busses analogy :) Please do suggest better
locations other than MFD and misc if you have better ideas.

Now without the chardev support, the /dev/gsmtty* using apps need
to use "U1234AT+CFUN?" format for the packets. The advantage is
less kernel code, and we keep the existing /dev/gsmtty* interface.

If we still really need the custom chardev support, that can now
be added as needed with the channel specific consumer driver(s).

My guess is that at least with the pending ofono patches, we just
want to use the raw interface for /dev/gsmtty* interface and stop
pretending we have a modem that is AT compatible.

Regards,

Tony


Changes since v5:
- Based on comments from Johan, moved back to using the existing
  TS 27.010 TTYs created by n_gsm.c instaed of adding custom chardev
  support to deal with the Motorola custom protocol

- Based on comments from Johan, made the serdev-ngsm driver generic
  with just minimal quirk handling for the Motorola modem

- Dropped the Motorola custom protocol on top of TS 27.010 handling
  from serdev-ngsm.c as this can now be easily handled by the channel
  specific drivers as needed

- Added few more helpers to n_gsm.c for serdev-ngsm.c to use

- Added the channel specific GNSS driver for the Motorola modem

Changes since v4:
- Use drivers/tty/serdev/protocol directory for the driver instead of
  drivers/mfd as discussed on the lists for v3 set of patches
- Fix remove to call kfree only after removing device from the list

Changes since v3:
- Update list of folks in Cc, looks like I sent v3 only to Lee and lkml
- Init privdata before motmdm_register_dlci calls gsm_serdev_register_dlci
- Update binding based on Rob's comments for license and "allOf"

Changes since v2:
- Drop useless send_command indirection, use static motmdm_send_command

Changes since v1:

- Simplified usage and got rid of few pointless inline functions
- Added consumer MFD driver, devicetree binding, and dts changes


Tony Lindgren (6):
  tty: n_gsm: Add support for serdev drivers
  dt-bindings: serdev: ngsm: Add binding for serdev-ngsm
  serdev: ngsm: Add generic serdev-ngsm driver
  dt-bindings: gnss: Add binding for Motorola Mapphone MDM6600 GNSS
  gnss: motmdm: Add support for Motorola Mapphone MDM6600 modem
  ARM: dts: omap4-droid4: Configure modem for serdev-ngsm

 .../devicetree/bindings/gnss/motmdm.yaml      |  29 ++
 .../bindings/serdev/serdev-ngsm.yaml          |  64 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 .../boot/dts/motorola-mapphone-common.dtsi    |  14 +
 drivers/gnss/Kconfig                          |   8 +
 drivers/gnss/Makefile                         |   3 +
 drivers/gnss/motmdm.c                         | 419 ++++++++++++++++
 drivers/tty/n_gsm.c                           | 428 +++++++++++++++++
 drivers/tty/serdev/Kconfig                    |  10 +
 drivers/tty/serdev/Makefile                   |   1 +
 drivers/tty/serdev/serdev-ngsm.c              | 449 ++++++++++++++++++
 include/linux/serdev-gsm.h                    | 163 +++++++
 12 files changed, 1590 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gnss/motmdm.yaml
 create mode 100644 Documentation/devicetree/bindings/serdev/serdev-ngsm.yaml
 create mode 100644 drivers/gnss/motmdm.c
 create mode 100644 drivers/tty/serdev/serdev-ngsm.c
 create mode 100644 include/linux/serdev-gsm.h

-- 
2.26.2

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, back to index

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 17:46 [PATCHv6 0/6] n_gsm serdev support and GNSS driver for droid4 Tony Lindgren
2020-04-30 17:46 ` [PATCH 1/6] tty: n_gsm: Add support for serdev drivers Tony Lindgren
2020-05-01 20:31   ` Pavel Machek
2020-05-01 21:31     ` Tony Lindgren
2020-04-30 17:46 ` [PATCH 2/6] dt-bindings: serdev: ngsm: Add binding for serdev-ngsm Tony Lindgren
2020-05-01 20:33   ` Pavel Machek
2020-05-12 15:37   ` Rob Herring
2020-04-30 17:46 ` [PATCH 3/6] serdev: ngsm: Add generic serdev-ngsm driver Tony Lindgren
2020-05-01 20:44   ` Pavel Machek
2020-04-30 17:46 ` [PATCH 4/6] dt-bindings: gnss: Add binding for Motorola Mapphone MDM6600 GNSS Tony Lindgren
2020-05-01 20:45   ` Pavel Machek
2020-05-01 21:14   ` Rob Herring
2020-05-01 21:19   ` Rob Herring
2020-05-01 21:25     ` Tony Lindgren
2020-04-30 17:46 ` [PATCH 5/6] gnss: motmdm: Add support for Motorola Mapphone MDM6600 modem Tony Lindgren
2020-05-01 20:51   ` Pavel Machek
2020-04-30 17:46 ` [PATCH 6/6] ARM: dts: omap4-droid4: Configure modem for serdev-ngsm Tony Lindgren
2020-05-01 20:53   ` Pavel Machek
2020-04-30 22:26 ` [PATCHv6 0/6] n_gsm serdev support and GNSS driver for droid4 Pavel Machek
2020-05-01 14:52   ` Tony Lindgren
2020-05-01 22:06     ` Pavel Machek
2020-05-01  8:21 ` Pavel Machek
2020-05-01 14:20   ` Tony Lindgren
2020-05-01 20:19 ` Pavel Machek
2020-05-01 20:32   ` Tony Lindgren
2020-05-01 20:23 ` Pavel Machek

Linux-OMAP Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-omap/0 linux-omap/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-omap linux-omap/ https://lore.kernel.org/linux-omap \
		linux-omap@vger.kernel.org
	public-inbox-index linux-omap

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-omap


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git