Re: GPS driver for Linux - kernel or user-space driver?

2013-04-04 Thread Mika Westerberg
(Adding Lv, he has been working on this).

On Wed, Apr 03, 2013 at 06:44:51PM -0700, Marcel Holtmann wrote:
> Hi Greg,
> 
>  I've been approached by a developer at Sony who wants to publish an
>  open source driver for a Sony GPS receiver module.
> >>> 
> >>> What does the device look like?  USB device?  UART?  Something else?
> >>> 
>  I've looked in the kernel source, and only see one standalone GPS
>  driver, for Garmin.  It appears that most GPS support in Linux is done
>  via user-space drivers.  Many GPS hardware modules appear to be
>  accessed via a serial line, or USB/serial port.  The Sony
>  module is pretty much the same, accepting commands and delivering
>  data via a uart from the chip.
>  
>  I planning to recommend writing a user-space driver (based on
>  gpsd and/or the Android GPS HAL specification).  But I'm worried
>  I'm missing something.  Is this the correct approach, or is there
>  an established kernel API for GPS modules - such that I should
>  recommend that this developer writes a kernel module instead
>  of, or in addition to, the user-space support for the hardware?
> >>> 
> >>> If it's just a uart-like device, just write a serial driver and drive it
> >>> from gpsd.  That way seems to be the simplest and then the kernel just
> >>> becomes a dumb-pipe, which is fine.
> >> 
> >> the one thing that still bugs me is that detecting an UART with GPS
> >> functionality behind it is extremely bad experience. If we could get
> >> something like DEVTYPE=gps support for the TTY layer, that would be
> >> helpful.
> > 
> > I would love that, but there's tons of USB gps devices that we don't
> > know if they are a USB serial device, or a GPS device as the device id
> > is the same (companies just embed a usb to serial chip in their
> > devices.)
> > 
> > So, someone has to guess, right now it's userspace.
> > 
> > Unless you have a better idea?
> 
> we could at least try to fix the good ones where we have proper vendor
> and product IDs dedicated for these devices. Or where things can be
> labeled through device tree or some similar methods. The less guess work
> userspace has to do, the smooth the experience will be.

There is one attempt to do this in case of ACPI here:

http://www.spinics.net/lists/linux-acpi/msg42951.html

Basically it adds a new sysfs attribute "peripheral_type" which then has
the ACPI modalias for the device behind UART. That should help userspace to
find out which device it is. The same attribute should work with DeviceTree
as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-04 Thread Mika Westerberg
(Adding Lv, he has been working on this).

On Wed, Apr 03, 2013 at 06:44:51PM -0700, Marcel Holtmann wrote:
 Hi Greg,
 
  I've been approached by a developer at Sony who wants to publish an
  open source driver for a Sony GPS receiver module.
  
  What does the device look like?  USB device?  UART?  Something else?
  
  I've looked in the kernel source, and only see one standalone GPS
  driver, for Garmin.  It appears that most GPS support in Linux is done
  via user-space drivers.  Many GPS hardware modules appear to be
  accessed via a serial line, or USB/serial port.  The Sony
  module is pretty much the same, accepting commands and delivering
  data via a uart from the chip.
  
  I planning to recommend writing a user-space driver (based on
  gpsd and/or the Android GPS HAL specification).  But I'm worried
  I'm missing something.  Is this the correct approach, or is there
  an established kernel API for GPS modules - such that I should
  recommend that this developer writes a kernel module instead
  of, or in addition to, the user-space support for the hardware?
  
  If it's just a uart-like device, just write a serial driver and drive it
  from gpsd.  That way seems to be the simplest and then the kernel just
  becomes a dumb-pipe, which is fine.
  
  the one thing that still bugs me is that detecting an UART with GPS
  functionality behind it is extremely bad experience. If we could get
  something like DEVTYPE=gps support for the TTY layer, that would be
  helpful.
  
  I would love that, but there's tons of USB gps devices that we don't
  know if they are a USB serial device, or a GPS device as the device id
  is the same (companies just embed a usb to serial chip in their
  devices.)
  
  So, someone has to guess, right now it's userspace.
  
  Unless you have a better idea?
 
 we could at least try to fix the good ones where we have proper vendor
 and product IDs dedicated for these devices. Or where things can be
 labeled through device tree or some similar methods. The less guess work
 userspace has to do, the smooth the experience will be.

There is one attempt to do this in case of ACPI here:

http://www.spinics.net/lists/linux-acpi/msg42951.html

Basically it adds a new sysfs attribute peripheral_type which then has
the ACPI modalias for the device behind UART. That should help userspace to
find out which device it is. The same attribute should work with DeviceTree
as well.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Greg KH
On Wed, Apr 03, 2013 at 06:44:51PM -0700, Marcel Holtmann wrote:
> Hi Greg,
> 
>  I've been approached by a developer at Sony who wants to publish an
>  open source driver for a Sony GPS receiver module.
> >>> 
> >>> What does the device look like?  USB device?  UART?  Something else?
> >>> 
>  I've looked in the kernel source, and only see one standalone GPS
>  driver, for Garmin.  It appears that most GPS support in Linux is done
>  via user-space drivers.  Many GPS hardware modules appear to be
>  accessed via a serial line, or USB/serial port.  The Sony
>  module is pretty much the same, accepting commands and delivering
>  data via a uart from the chip.
>  
>  I planning to recommend writing a user-space driver (based on
>  gpsd and/or the Android GPS HAL specification).  But I'm worried
>  I'm missing something.  Is this the correct approach, or is there
>  an established kernel API for GPS modules - such that I should
>  recommend that this developer writes a kernel module instead
>  of, or in addition to, the user-space support for the hardware?
> >>> 
> >>> If it's just a uart-like device, just write a serial driver and drive it
> >>> from gpsd.  That way seems to be the simplest and then the kernel just
> >>> becomes a dumb-pipe, which is fine.
> >> 
> >> the one thing that still bugs me is that detecting an UART with GPS
> >> functionality behind it is extremely bad experience. If we could get
> >> something like DEVTYPE=gps support for the TTY layer, that would be
> >> helpful.
> > 
> > I would love that, but there's tons of USB gps devices that we don't
> > know if they are a USB serial device, or a GPS device as the device id
> > is the same (companies just embed a usb to serial chip in their
> > devices.)
> > 
> > So, someone has to guess, right now it's userspace.
> > 
> > Unless you have a better idea?
> 
> we could at least try to fix the good ones where we have proper vendor
> and product IDs dedicated for these devices. Or where things can be
> labeled through device tree or some similar methods. The less guess
> work userspace has to do, the smooth the experience will be.

Sure, but right now, that list is already in userspace, right?  Moving
it to the kernel wouldn't help much as the tools would have to handle
both looking at what the kernel says, and their old userspace table.

Anyway, if someone wants to send me a patch adding this to the kernel, I
will not object...

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Marcel Holtmann
Hi Greg,

 I've been approached by a developer at Sony who wants to publish an
 open source driver for a Sony GPS receiver module.
>>> 
>>> What does the device look like?  USB device?  UART?  Something else?
>>> 
 I've looked in the kernel source, and only see one standalone GPS
 driver, for Garmin.  It appears that most GPS support in Linux is done
 via user-space drivers.  Many GPS hardware modules appear to be
 accessed via a serial line, or USB/serial port.  The Sony
 module is pretty much the same, accepting commands and delivering
 data via a uart from the chip.
 
 I planning to recommend writing a user-space driver (based on
 gpsd and/or the Android GPS HAL specification).  But I'm worried
 I'm missing something.  Is this the correct approach, or is there
 an established kernel API for GPS modules - such that I should
 recommend that this developer writes a kernel module instead
 of, or in addition to, the user-space support for the hardware?
>>> 
>>> If it's just a uart-like device, just write a serial driver and drive it
>>> from gpsd.  That way seems to be the simplest and then the kernel just
>>> becomes a dumb-pipe, which is fine.
>> 
>> the one thing that still bugs me is that detecting an UART with GPS
>> functionality behind it is extremely bad experience. If we could get
>> something like DEVTYPE=gps support for the TTY layer, that would be
>> helpful.
> 
> I would love that, but there's tons of USB gps devices that we don't
> know if they are a USB serial device, or a GPS device as the device id
> is the same (companies just embed a usb to serial chip in their
> devices.)
> 
> So, someone has to guess, right now it's userspace.
> 
> Unless you have a better idea?

we could at least try to fix the good ones where we have proper vendor and 
product IDs dedicated for these devices. Or where things can be labeled through 
device tree or some similar methods. The less guess work userspace has to do, 
the smooth the experience will be.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Greg KH
On Wed, Apr 03, 2013 at 06:12:42PM -0700, Marcel Holtmann wrote:
> Hi Greg,
> 
> >> I've been approached by a developer at Sony who wants to publish an
> >> open source driver for a Sony GPS receiver module.
> > 
> > What does the device look like?  USB device?  UART?  Something else?
> > 
> >> I've looked in the kernel source, and only see one standalone GPS
> >> driver, for Garmin.  It appears that most GPS support in Linux is done
> >> via user-space drivers.  Many GPS hardware modules appear to be
> >> accessed via a serial line, or USB/serial port.  The Sony
> >> module is pretty much the same, accepting commands and delivering
> >> data via a uart from the chip.
> >> 
> >> I planning to recommend writing a user-space driver (based on
> >> gpsd and/or the Android GPS HAL specification).  But I'm worried
> >> I'm missing something.  Is this the correct approach, or is there
> >> an established kernel API for GPS modules - such that I should
> >> recommend that this developer writes a kernel module instead
> >> of, or in addition to, the user-space support for the hardware?
> > 
> > If it's just a uart-like device, just write a serial driver and drive it
> > from gpsd.  That way seems to be the simplest and then the kernel just
> > becomes a dumb-pipe, which is fine.
> 
> the one thing that still bugs me is that detecting an UART with GPS
> functionality behind it is extremely bad experience. If we could get
> something like DEVTYPE=gps support for the TTY layer, that would be
> helpful.

I would love that, but there's tons of USB gps devices that we don't
know if they are a USB serial device, or a GPS device as the device id
is the same (companies just embed a usb to serial chip in their
devices.)

So, someone has to guess, right now it's userspace.

Unless you have a better idea?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Marcel Holtmann
Hi Greg,

>> I've been approached by a developer at Sony who wants to publish an
>> open source driver for a Sony GPS receiver module.
> 
> What does the device look like?  USB device?  UART?  Something else?
> 
>> I've looked in the kernel source, and only see one standalone GPS
>> driver, for Garmin.  It appears that most GPS support in Linux is done
>> via user-space drivers.  Many GPS hardware modules appear to be
>> accessed via a serial line, or USB/serial port.  The Sony
>> module is pretty much the same, accepting commands and delivering
>> data via a uart from the chip.
>> 
>> I planning to recommend writing a user-space driver (based on
>> gpsd and/or the Android GPS HAL specification).  But I'm worried
>> I'm missing something.  Is this the correct approach, or is there
>> an established kernel API for GPS modules - such that I should
>> recommend that this developer writes a kernel module instead
>> of, or in addition to, the user-space support for the hardware?
> 
> If it's just a uart-like device, just write a serial driver and drive it
> from gpsd.  That way seems to be the simplest and then the kernel just
> becomes a dumb-pipe, which is fine.

the one thing that still bugs me is that detecting an UART with GPS 
functionality behind it is extremely bad experience. If we could get something 
like DEVTYPE=gps support for the TTY layer, that would be helpful.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Greg KH
On Wed, Apr 03, 2013 at 05:52:03PM -0700, Tim Bird wrote:
> I've been approached by a developer at Sony who wants to publish an
> open source driver for a Sony GPS receiver module.

What does the device look like?  USB device?  UART?  Something else?

> I've looked in the kernel source, and only see one standalone GPS
> driver, for Garmin.  It appears that most GPS support in Linux is done
> via user-space drivers.  Many GPS hardware modules appear to be
> accessed via a serial line, or USB/serial port.  The Sony
> module is pretty much the same, accepting commands and delivering
> data via a uart from the chip.
> 
> I planning to recommend writing a user-space driver (based on
> gpsd and/or the Android GPS HAL specification).  But I'm worried
> I'm missing something.  Is this the correct approach, or is there
> an established kernel API for GPS modules - such that I should
> recommend that this developer writes a kernel module instead
> of, or in addition to, the user-space support for the hardware?

If it's just a uart-like device, just write a serial driver and drive it
from gpsd.  That way seems to be the simplest and then the kernel just
becomes a dumb-pipe, which is fine.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Greg KH
On Wed, Apr 03, 2013 at 06:44:51PM -0700, Marcel Holtmann wrote:
 Hi Greg,
 
  I've been approached by a developer at Sony who wants to publish an
  open source driver for a Sony GPS receiver module.
  
  What does the device look like?  USB device?  UART?  Something else?
  
  I've looked in the kernel source, and only see one standalone GPS
  driver, for Garmin.  It appears that most GPS support in Linux is done
  via user-space drivers.  Many GPS hardware modules appear to be
  accessed via a serial line, or USB/serial port.  The Sony
  module is pretty much the same, accepting commands and delivering
  data via a uart from the chip.
  
  I planning to recommend writing a user-space driver (based on
  gpsd and/or the Android GPS HAL specification).  But I'm worried
  I'm missing something.  Is this the correct approach, or is there
  an established kernel API for GPS modules - such that I should
  recommend that this developer writes a kernel module instead
  of, or in addition to, the user-space support for the hardware?
  
  If it's just a uart-like device, just write a serial driver and drive it
  from gpsd.  That way seems to be the simplest and then the kernel just
  becomes a dumb-pipe, which is fine.
  
  the one thing that still bugs me is that detecting an UART with GPS
  functionality behind it is extremely bad experience. If we could get
  something like DEVTYPE=gps support for the TTY layer, that would be
  helpful.
  
  I would love that, but there's tons of USB gps devices that we don't
  know if they are a USB serial device, or a GPS device as the device id
  is the same (companies just embed a usb to serial chip in their
  devices.)
  
  So, someone has to guess, right now it's userspace.
  
  Unless you have a better idea?
 
 we could at least try to fix the good ones where we have proper vendor
 and product IDs dedicated for these devices. Or where things can be
 labeled through device tree or some similar methods. The less guess
 work userspace has to do, the smooth the experience will be.

Sure, but right now, that list is already in userspace, right?  Moving
it to the kernel wouldn't help much as the tools would have to handle
both looking at what the kernel says, and their old userspace table.

Anyway, if someone wants to send me a patch adding this to the kernel, I
will not object...

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Greg KH
On Wed, Apr 03, 2013 at 05:52:03PM -0700, Tim Bird wrote:
 I've been approached by a developer at Sony who wants to publish an
 open source driver for a Sony GPS receiver module.

What does the device look like?  USB device?  UART?  Something else?

 I've looked in the kernel source, and only see one standalone GPS
 driver, for Garmin.  It appears that most GPS support in Linux is done
 via user-space drivers.  Many GPS hardware modules appear to be
 accessed via a serial line, or USB/serial port.  The Sony
 module is pretty much the same, accepting commands and delivering
 data via a uart from the chip.
 
 I planning to recommend writing a user-space driver (based on
 gpsd and/or the Android GPS HAL specification).  But I'm worried
 I'm missing something.  Is this the correct approach, or is there
 an established kernel API for GPS modules - such that I should
 recommend that this developer writes a kernel module instead
 of, or in addition to, the user-space support for the hardware?

If it's just a uart-like device, just write a serial driver and drive it
from gpsd.  That way seems to be the simplest and then the kernel just
becomes a dumb-pipe, which is fine.

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Marcel Holtmann
Hi Greg,

 I've been approached by a developer at Sony who wants to publish an
 open source driver for a Sony GPS receiver module.
 
 What does the device look like?  USB device?  UART?  Something else?
 
 I've looked in the kernel source, and only see one standalone GPS
 driver, for Garmin.  It appears that most GPS support in Linux is done
 via user-space drivers.  Many GPS hardware modules appear to be
 accessed via a serial line, or USB/serial port.  The Sony
 module is pretty much the same, accepting commands and delivering
 data via a uart from the chip.
 
 I planning to recommend writing a user-space driver (based on
 gpsd and/or the Android GPS HAL specification).  But I'm worried
 I'm missing something.  Is this the correct approach, or is there
 an established kernel API for GPS modules - such that I should
 recommend that this developer writes a kernel module instead
 of, or in addition to, the user-space support for the hardware?
 
 If it's just a uart-like device, just write a serial driver and drive it
 from gpsd.  That way seems to be the simplest and then the kernel just
 becomes a dumb-pipe, which is fine.

the one thing that still bugs me is that detecting an UART with GPS 
functionality behind it is extremely bad experience. If we could get something 
like DEVTYPE=gps support for the TTY layer, that would be helpful.

Regards

Marcel

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Greg KH
On Wed, Apr 03, 2013 at 06:12:42PM -0700, Marcel Holtmann wrote:
 Hi Greg,
 
  I've been approached by a developer at Sony who wants to publish an
  open source driver for a Sony GPS receiver module.
  
  What does the device look like?  USB device?  UART?  Something else?
  
  I've looked in the kernel source, and only see one standalone GPS
  driver, for Garmin.  It appears that most GPS support in Linux is done
  via user-space drivers.  Many GPS hardware modules appear to be
  accessed via a serial line, or USB/serial port.  The Sony
  module is pretty much the same, accepting commands and delivering
  data via a uart from the chip.
  
  I planning to recommend writing a user-space driver (based on
  gpsd and/or the Android GPS HAL specification).  But I'm worried
  I'm missing something.  Is this the correct approach, or is there
  an established kernel API for GPS modules - such that I should
  recommend that this developer writes a kernel module instead
  of, or in addition to, the user-space support for the hardware?
  
  If it's just a uart-like device, just write a serial driver and drive it
  from gpsd.  That way seems to be the simplest and then the kernel just
  becomes a dumb-pipe, which is fine.
 
 the one thing that still bugs me is that detecting an UART with GPS
 functionality behind it is extremely bad experience. If we could get
 something like DEVTYPE=gps support for the TTY layer, that would be
 helpful.

I would love that, but there's tons of USB gps devices that we don't
know if they are a USB serial device, or a GPS device as the device id
is the same (companies just embed a usb to serial chip in their
devices.)

So, someone has to guess, right now it's userspace.

Unless you have a better idea?

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: GPS driver for Linux - kernel or user-space driver?

2013-04-03 Thread Marcel Holtmann
Hi Greg,

 I've been approached by a developer at Sony who wants to publish an
 open source driver for a Sony GPS receiver module.
 
 What does the device look like?  USB device?  UART?  Something else?
 
 I've looked in the kernel source, and only see one standalone GPS
 driver, for Garmin.  It appears that most GPS support in Linux is done
 via user-space drivers.  Many GPS hardware modules appear to be
 accessed via a serial line, or USB/serial port.  The Sony
 module is pretty much the same, accepting commands and delivering
 data via a uart from the chip.
 
 I planning to recommend writing a user-space driver (based on
 gpsd and/or the Android GPS HAL specification).  But I'm worried
 I'm missing something.  Is this the correct approach, or is there
 an established kernel API for GPS modules - such that I should
 recommend that this developer writes a kernel module instead
 of, or in addition to, the user-space support for the hardware?
 
 If it's just a uart-like device, just write a serial driver and drive it
 from gpsd.  That way seems to be the simplest and then the kernel just
 becomes a dumb-pipe, which is fine.
 
 the one thing that still bugs me is that detecting an UART with GPS
 functionality behind it is extremely bad experience. If we could get
 something like DEVTYPE=gps support for the TTY layer, that would be
 helpful.
 
 I would love that, but there's tons of USB gps devices that we don't
 know if they are a USB serial device, or a GPS device as the device id
 is the same (companies just embed a usb to serial chip in their
 devices.)
 
 So, someone has to guess, right now it's userspace.
 
 Unless you have a better idea?

we could at least try to fix the good ones where we have proper vendor and 
product IDs dedicated for these devices. Or where things can be labeled through 
device tree or some similar methods. The less guess work userspace has to do, 
the smooth the experience will be.

Regards

Marcel

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/