linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Johan Hovold <johan@kernel.org>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	DTML <devicetree@vger.kernel.org>,
	"Discussions about the Letux Kernel"
	<letux-kernel@openphoenux.org>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Tony Lindgren" <tony@atomide.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	kernel@pyra-handheld.com, "Russell King" <linux@armlinux.org.uk>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Pavel Machek" <pavel@ucw.cz>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Thierry Reding" <treding@nvidia.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Jonathan Cameron" <jic23@kernel.org>
Subject: Re: [Letux-kernel] [PATCH v5 3/5] misc serdev: Add w2sg0004 (gps receiver) power control driver
Date: Tue, 20 Mar 2018 15:49:33 +0100	[thread overview]
Message-ID: <FCD404C1-3DD4-45BD-9242-3F7A7C44F6C9@goldelico.com> (raw)
In-Reply-To: <20180319135418.GL18359@localhost>

Hi Johan,

> Am 19.03.2018 um 14:54 schrieb Johan Hovold <johan@kernel.org>:
> 
> On Tue, Feb 27, 2018 at 08:32:50AM +0100, H. Nikolaus Schaller wrote:
>> Hi Johan,
>> 
>>> Am 27.02.2018 um 08:04 schrieb Johan Hovold <johan@kernel.org>:
>>> 
>>> On Mon, Feb 12, 2018 at 04:26:18PM +0100, Pavel Machek wrote:
>>>> Hi!
>>>> 
>>>>>> Let's restart this discussion and focus on the main roadblock (others
>>>>>> are minor details which can be sorted out later).
>>>>>> 
>>>>>> If it feels like a hack, the key issue seems to me to be the choice of
>>>>>> the API to present the GPS data to user space. Right?
>>>>> 
>>>>> Or even more fundamentally, does this belong in the kernel at all?
>>>> 
>>>> Yes, it does.
>> 
>> Thanks, Pavel for supporting our view.
>> 
>>> 
>>> But not necessarily in its current form.
>> 
>> Is this a "yes after some code fixes"?
> 
> No, we need some kind of at least rudimentary gps framework even if we
> allow for a raw (NMEA) interface for the time being (possibly
> indefinitely).

Ok, that would be fine if we can get that!

For a minimal set of API I think something like this (following hci_dev) would suffice:

struct gps_dev {
	...
	int (*open)(struct gps_dev *gdev);
	int (*close)(struct gps_dev *gdev);
	int (*send)(struct gps_dev *gdev, char *data, int length);
};

int gps_register_dev(struct gps_dev *gdev);
void gps_unregister_dev(struct gps_dev *gdev);
int gps_recv_nmea_chars(struct gps_dev *gdev, char *data, int length);

If that would wrap all creation of some /dev/ttyGPS0 (or however it is called),
it would fit our needs for a driver and user-space for our system.

And I would be happy to get rid of creating and registering a /dev/ttyGPS0
in the w2sg0004 driver.

Then, the driver will not need to be touched if the GPS framework is improved
in some far future (e.g. to provide some additional ioctl for getting kalman-filtered
position+heading by doing sensor fusion with some iio-based accelerometer/gyro). 

So I am looking forward to some framework for review and integration testing.

BR and thanks,
Nikolaus

  reply	other threads:[~2018-03-20 14:49 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01  7:49 [PATCH v5 0/5] misc serdev: new serdev based driver for Wi2Wi w2sg00x4 GPS module H. Nikolaus Schaller
2017-12-01  7:49 ` [PATCH v5 1/5] dt-bindings: define vendor prefix for Wi2Wi, Inc H. Nikolaus Schaller
2017-12-01 14:44   ` Andreas Färber
2017-12-01  7:49 ` [PATCH v5 2/5] dt-bindings: gps: add w2sg00x4 bindings documentation (GPS module with UART)) H. Nikolaus Schaller
2017-12-01  7:49 ` [PATCH v5 3/5] misc serdev: Add w2sg0004 (gps receiver) power control driver H. Nikolaus Schaller
2017-12-22 12:44   ` Johan Hovold
2017-12-22 14:40     ` H. Nikolaus Schaller
2018-01-09 11:55       ` [Letux-kernel] " H. Nikolaus Schaller
2018-01-12 15:39         ` Johan Hovold
2018-01-12 17:59           ` H. Nikolaus Schaller
2018-01-18  6:13             ` Johan Hovold
2018-01-18 13:43               ` H. Nikolaus Schaller
2018-03-07 15:53                 ` H. Nikolaus Schaller
2018-03-19 14:05                   ` Johan Hovold
2018-02-12 15:26           ` [Letux-kernel] " Pavel Machek
2018-02-27  7:04             ` Johan Hovold
2018-02-27  7:32               ` H. Nikolaus Schaller
2018-03-19 13:54                 ` Johan Hovold
2018-03-20 14:49                   ` H. Nikolaus Schaller [this message]
2018-03-26 13:59                     ` Pavel Machek
2018-02-27 18:38               ` Pavel Machek
2018-02-12 15:25         ` Pavel Machek
2018-01-09 17:43     ` Andreas Kemnade
2018-01-12 14:46       ` Johan Hovold
2018-01-12 18:40         ` Andreas Kemnade
2018-01-18  6:47           ` Johan Hovold
2018-03-08  6:16             ` Andreas Kemnade
2018-03-19 14:02               ` Johan Hovold
2017-12-01  7:49 ` [PATCH v5 4/5] DTS: gta04: add uart2 child node for w2sg00x4 H. Nikolaus Schaller
2017-12-21 14:53   ` Tony Lindgren
2017-12-01  7:49 ` [PATCH v5 5/5] misc serdev: w2sg0004: add debugging code and Kconfig H. Nikolaus Schaller
2017-12-22 12:51   ` Johan Hovold
2017-12-22 14:41     ` H. Nikolaus Schaller
2017-12-22 14:58       ` Greg Kroah-Hartman
2017-12-18  8:52 ` [PATCH v5 0/5] misc serdev: new serdev based driver for Wi2Wi w2sg00x4 GPS module H. Nikolaus Schaller
2017-12-18 14:48   ` Greg Kroah-Hartman
2017-12-18 14:52     ` H. Nikolaus Schaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FCD404C1-3DD4-45BD-9242-3F7A7C44F6C9@goldelico.com \
    --to=hns@goldelico.com \
    --cc=afaerber@suse.de \
    --cc=arnd@arndb.de \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=johan@kernel.org \
    --cc=kernel@pyra-handheld.com \
    --cc=khilman@baylibre.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).