linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Ladislav Michl <ladis@linux-mips.org>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Thierry Reding" <treding@nvidia.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Maxime Ripard" <maxime.ripard@free-electrons.com>,
	"Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org, letux-kernel@openphoenux.org,
	kernel@pyra-handheld.com
Subject: Re: [RFC 2/3] misc: Add w2sg0004 (gps receiver) power control driver
Date: Wed, 7 Jun 2017 12:08:17 +0200	[thread overview]
Message-ID: <8F1B0629-A5FD-4794-9A50-BA6D18C0C34C@goldelico.com> (raw)
In-Reply-To: <20170607073459.qg4giwqdajtmpy4n@lenoch>

Hi Ladislav,

> Am 07.06.2017 um 09:34 schrieb Ladislav Michl <ladis@linux-mips.org>:
> 
> Dear Nikolaus,
> 
> On Sun, May 21, 2017 at 12:44:03PM +0200, H. Nikolaus Schaller wrote:
>> Add driver for Wi2Wi W2SG0004/84 GPS module connected through uart.
>> 
>> Use serdev API hooks to monitor and forward the UART traffic to /dev/BTn
>> and turn on/off the module. It also detects if the module is turned on (sends data)
>> but should be off, e.g. if it was already turned on during boot or power-on-reset.
>> 
>> Additionally, rfkill block/unblock can be used to control an external LNA
>> (and power down the module if not needed).
>> 
>> The driver concept is based on code developed by NeilBrown <neilb@suse.de>
>> but simplified and adapted to use the new serdev API introduced in 4.11.
> [snip]
>> diff --git a/Documentation/devicetree/bindings/misc/wi2wi,w2sg0004.txt b/Documentation/devicetree/bindings/misc/wi2wi,w2sg0004.txt
>> new file mode 100644
>> index 000000000000..b7125c7a598c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/misc/wi2wi,w2sg0004.txt
>> @@ -0,0 +1,20 @@
>> +Wi2Wi GPS module connected through UART
>> +
>> +Should be a subnode of the SoC UART it is connected to (serdev).
>> +
>> +Required properties:
>> +- compatible:	wi2wi,w2sg0004 or wi2wi,w2sg0084
>> +- on-off-gpio:	the GPIO that controls the module's on-off toggle input
>> +
>> +Optional properties:
>> +- lna-suppy:	an (optional) LNA regulator that is enabled together with the GPS receiver
>> +
>> +Example:
>> +
>> +&uart2 {
>> +	gps: w2sg0004 {
>> +		compatible = "wi2wi,w2sg0004";
>> +		lna-supply = <&vsim>;   /* LNA regulator */
>> +		on-off-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;    /* GPIO_145: trigger for turning on/off w2sg0004 */
>> +        };
>> +};
> 
> Here it seems is nothing specific to GPS receiver in this driver

Well, most serdev subnodes will look similar to this but still will
need different drivers (timing, pulses, other logic, special functions,
firmware download etc.).

> and
> basically UART connected GSM modules could benefit from such functionality
> too - as they need power supply, had reset and ignition pin and often
> status pin. See for example:
> http://simcom.ee/documents/SIM5300E/SIM5300E_Hardware_Design_V1.08.pdf
> page 14 or
> http://www.robotshop.com/media/files/pdf/datasheet-gsm-tc35.pdf
> page 19 for block diagrams.
> So I wonder if you would accept making this driver a bit more generic
> to cover also GSM modems use case.

We also have such a 2G/3G/4G module in the GTA04 and Pyra devices but there
we have significantly different power control needs because they are connected
through USB and not as UART / serdev.

But you could simply try to use and extend our proposed w2cbw003 bluetooth
driver [RFC 3/3] for that purpose.

It already has most of what you need: provides a user-space /dev/tty for the
serdev and controls some power-control gpio or regulator.

This w2sg0004 gps chip is very specific for this chip since it has no simple
power-enable to be controlled. This also differs too much from GSM modules
with ignition. Especially it has no status feedback.

Another aspect is that there are plans to have some gps infrastructure in the
kernel. Then, this driver wouldn't be the right solution for gsm.

Therefore it is and should remain a special purpose driver for this type of
gps chips.

The common denominator of all these things is the serdev and gpio infrastructure.

Feel free to take both drivers as blueprints to propose some new driver
for your chips.

BR,
Nikolaus

  reply	other threads:[~2017-06-07 10:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-21 10:44 [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth H. Nikolaus Schaller
2017-05-21 10:44 ` [RFC 1/3] DTS: gta04: add serdev nodes for w2sg00x4, w2cbw etc H. Nikolaus Schaller
2017-05-21 10:44 ` [RFC 2/3] misc: Add w2sg0004 (gps receiver) power control driver H. Nikolaus Schaller
2017-05-21 10:48   ` H. Nikolaus Schaller
2017-05-30 23:09   ` Rob Herring
2017-06-06 18:50     ` H. Nikolaus Schaller
2017-06-07  7:34   ` Ladislav Michl
2017-06-07 10:08     ` H. Nikolaus Schaller [this message]
2017-05-21 10:44 ` [RFC 3/3] misc: Add w2cbw003 (wifi/bluetooth) " H. Nikolaus Schaller
2017-05-23  2:26 ` [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth Rob Herring
2017-05-23  5:43   ` H. Nikolaus Schaller
2017-05-23 12:28     ` Rob Herring
2017-05-23 12:48       ` H. Nikolaus Schaller
2017-05-23 13:10         ` Rob Herring
2017-05-23 13:49           ` H. Nikolaus Schaller
2017-05-25 12:48             ` Rob Herring
2017-06-06 18:50               ` H. Nikolaus Schaller
2017-05-25 17:05             ` Pavel Machek

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=8F1B0629-A5FD-4794-9A50-BA6D18C0C34C@goldelico.com \
    --to=hns@goldelico.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=kernel@pyra-handheld.com \
    --cc=ladis@linux-mips.org \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --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).