linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: dts: gta04: add gps support
@ 2019-01-25 19:43 Andreas Kemnade
  2019-01-28  7:53 ` Johan Hovold
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Kemnade @ 2019-01-25 19:43 UTC (permalink / raw)
  To: bcousson, tony, robh+dt, mark.rutland, linux-omap, devicetree,
	linux-kernel, letux-kernel
  Cc: Andreas Kemnade

The GTA04 has a w2sg0004 or w2sg0084 gps chip. Not detectable
which one is mounted so use the compatibility entry for w2sg0004
for all which will work for both.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
w2sg0004 bindings (together with the corresponding support is in
https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss gnss-next)
 arch/arm/boot/dts/omap3-gta04.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
index e53d32691308..d58c117e429f 100644
--- a/arch/arm/boot/dts/omap3-gta04.dtsi
+++ b/arch/arm/boot/dts/omap3-gta04.dtsi
@@ -312,6 +312,12 @@
 		>;
        };
 
+	gps_pins: pinmux_gps_pins {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x2176, PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* gpio145 */
+		>;
+	};
+
 	hdq_pins: hdq_pins {
 		pinctrl-single,pins = <
 			OMAP3_CORE1_IOPAD(0x21c6, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda.hdq */
@@ -644,6 +650,13 @@
 &uart2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart2_pins>;
+	gps: gps {
+		compatible = "wi2wi,w2sg0004";
+		pinctrl-names = "default";
+		pinctrl-0 = <&gps_pins>;
+		sirf,onoff-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
+		lna-supply = <&vsim>;
+	};
 };
 
 &uart3 {
-- 
2.11.0


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

* Re: [PATCH] arm: dts: gta04: add gps support
  2019-01-25 19:43 [PATCH] arm: dts: gta04: add gps support Andreas Kemnade
@ 2019-01-28  7:53 ` Johan Hovold
  2019-01-28 16:44   ` Andreas Kemnade
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Hovold @ 2019-01-28  7:53 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: bcousson, tony, robh+dt, mark.rutland, linux-omap, devicetree,
	linux-kernel, letux-kernel

On Fri, Jan 25, 2019 at 08:43:10PM +0100, Andreas Kemnade wrote:
> The GTA04 has a w2sg0004 or w2sg0084 gps chip. Not detectable
> which one is mounted so use the compatibility entry for w2sg0004
> for all which will work for both.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
> w2sg0004 bindings (together with the corresponding support is in
> https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss gnss-next)
>  arch/arm/boot/dts/omap3-gta04.dtsi | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
> index e53d32691308..d58c117e429f 100644
> --- a/arch/arm/boot/dts/omap3-gta04.dtsi
> +++ b/arch/arm/boot/dts/omap3-gta04.dtsi
> @@ -312,6 +312,12 @@
>  		>;
>         };
>  
> +	gps_pins: pinmux_gps_pins {
> +		pinctrl-single,pins = <
> +			OMAP3_CORE1_IOPAD(0x2176, PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* gpio145 */
> +		>;
> +	};
> +
>  	hdq_pins: hdq_pins {
>  		pinctrl-single,pins = <
>  			OMAP3_CORE1_IOPAD(0x21c6, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda.hdq */
> @@ -644,6 +650,13 @@
>  &uart2 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&uart2_pins>;
> +	gps: gps {

The node should be named "gnss" as per the binding.

> +		compatible = "wi2wi,w2sg0004";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gps_pins>;
> +		sirf,onoff-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
> +		lna-supply = <&vsim>;

Also, the vcc-supply is a required property.

> +	};
>  };
>  
>  &uart3 {

Johan

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

* Re: [PATCH] arm: dts: gta04: add gps support
  2019-01-28  7:53 ` Johan Hovold
@ 2019-01-28 16:44   ` Andreas Kemnade
  2019-01-30  9:02     ` Johan Hovold
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Kemnade @ 2019-01-28 16:44 UTC (permalink / raw)
  To: Johan Hovold
  Cc: bcousson, tony, robh+dt, mark.rutland, linux-omap, devicetree,
	linux-kernel, letux-kernel

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

On Mon, 28 Jan 2019 08:53:56 +0100
Johan Hovold <johan@kernel.org> wrote:

> On Fri, Jan 25, 2019 at 08:43:10PM +0100, Andreas Kemnade wrote:
> > The GTA04 has a w2sg0004 or w2sg0084 gps chip. Not detectable
> > which one is mounted so use the compatibility entry for w2sg0004
> > for all which will work for both.
> > 
> > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> > ---
> > w2sg0004 bindings (together with the corresponding support is in
> > https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss gnss-next)
> >  arch/arm/boot/dts/omap3-gta04.dtsi | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
> > index e53d32691308..d58c117e429f 100644
> > --- a/arch/arm/boot/dts/omap3-gta04.dtsi
> > +++ b/arch/arm/boot/dts/omap3-gta04.dtsi
> > @@ -312,6 +312,12 @@  
> >  		>;  
> >         };
> >  
> > +	gps_pins: pinmux_gps_pins {
> > +		pinctrl-single,pins = <
> > +			OMAP3_CORE1_IOPAD(0x2176, PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* gpio145 */
> > +		>;
> > +	};
> > +
> >  	hdq_pins: hdq_pins {
> >  		pinctrl-single,pins = <
> >  			OMAP3_CORE1_IOPAD(0x21c6, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda.hdq */
> > @@ -644,6 +650,13 @@
> >  &uart2 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&uart2_pins>;
> > +	gps: gps {  
> 
> The node should be named "gnss" as per the binding.
> 
> > +		compatible = "wi2wi,w2sg0004";
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&gps_pins>;
> > +		sirf,onoff-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
> > +		lna-supply = <&vsim>;  
> 
> Also, the vcc-supply is a required property.
> 
well, it is not require in the driver and it has different behavior (on even when not opened if
on-off is there) than the lna-supply used here. So maybe fix the binding documentation?

Regards,
Andreas

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

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

* Re: [PATCH] arm: dts: gta04: add gps support
  2019-01-28 16:44   ` Andreas Kemnade
@ 2019-01-30  9:02     ` Johan Hovold
  2019-01-30 14:06       ` [Letux-kernel] " H. Nikolaus Schaller
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Hovold @ 2019-01-30  9:02 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Johan Hovold, bcousson, tony, robh+dt, mark.rutland, linux-omap,
	devicetree, linux-kernel, letux-kernel

On Mon, Jan 28, 2019 at 05:44:29PM +0100, Andreas Kemnade wrote:
> On Mon, 28 Jan 2019 08:53:56 +0100
> Johan Hovold <johan@kernel.org> wrote:
> 
> > On Fri, Jan 25, 2019 at 08:43:10PM +0100, Andreas Kemnade wrote:
> > > The GTA04 has a w2sg0004 or w2sg0084 gps chip. Not detectable
> > > which one is mounted so use the compatibility entry for w2sg0004
> > > for all which will work for both.
> > > 
> > > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> > > ---
> > > w2sg0004 bindings (together with the corresponding support is in
> > > https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss gnss-next)
> > >  arch/arm/boot/dts/omap3-gta04.dtsi | 13 +++++++++++++
> > >  1 file changed, 13 insertions(+)

> > > +	gps: gps {  
> > 
> > The node should be named "gnss" as per the binding.
> > 
> > > +		compatible = "wi2wi,w2sg0004";
> > > +		pinctrl-names = "default";
> > > +		pinctrl-0 = <&gps_pins>;
> > > +		sirf,onoff-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
> > > +		lna-supply = <&vsim>;  
> > 
> > Also, the vcc-supply is a required property.
> > 
> well, it is not require in the driver and it has different behavior
> (on even when not opened if on-off is there) than the lna-supply used
> here. So maybe fix the binding documentation?

The device-tree describes hardware, and how a particular driver happens
to implement a binding is not relevant.

That said, there is a bit of an on-going, shall we say philosophical,
debate about this. The regulator maintainer takes a firm position that
all mandatory physical supplies should be represented in firmware
	
	https://lore.kernel.org/lkml/20181123133126.GF2089@sirena.org.uk/T/#u
	https://lore.kernel.org/lkml/20180409102244.GB11532@sirena.org.uk/T/#u

while Rob appears to take a slightly different stance on fixed
regulators while admitting that this an issue which has not yet been
fully resolved:

	https://lore.kernel.org/lkml/20180425171123.xhyoay3nu463btoq@rob-hp-laptop/T/#u

Since this is a new binding, and the hardware requires the vcc supply
and this is reflected in the binding, I think you should add a fixed
regulator. At least until you hear otherwise. ;)

Johan

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

* Re: [Letux-kernel] [PATCH] arm: dts: gta04: add gps support
  2019-01-30  9:02     ` Johan Hovold
@ 2019-01-30 14:06       ` H. Nikolaus Schaller
  2019-01-30 20:11         ` Andreas Kemnade
  0 siblings, 1 reply; 6+ messages in thread
From: H. Nikolaus Schaller @ 2019-01-30 14:06 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Mark Rutland, devicetree, Tony Lindgren, Johan Hovold, LKML,
	Rob Herring, Benoit Cousson, linux-omap,
	Discussions about the Letux Kernel

Hi Andreas,

> Am 30.01.2019 um 10:02 schrieb Johan Hovold <johan@kernel.org>:
> 
> On Mon, Jan 28, 2019 at 05:44:29PM +0100, Andreas Kemnade wrote:
>> On Mon, 28 Jan 2019 08:53:56 +0100
>> Johan Hovold <johan@kernel.org> wrote:
>> 
>>> On Fri, Jan 25, 2019 at 08:43:10PM +0100, Andreas Kemnade wrote:
>>>> The GTA04 has a w2sg0004 or w2sg0084 gps chip. Not detectable
>>>> which one is mounted so use the compatibility entry for w2sg0004
>>>> for all which will work for both.
>>>> 
>>>> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
>>>> ---
>>>> w2sg0004 bindings (together with the corresponding support is in
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss gnss-next)
>>>> arch/arm/boot/dts/omap3-gta04.dtsi | 13 +++++++++++++
>>>> 1 file changed, 13 insertions(+)
> 
>>>> +	gps: gps {  
>>> 
>>> The node should be named "gnss" as per the binding.
>>> 
>>>> +		compatible = "wi2wi,w2sg0004";
>>>> +		pinctrl-names = "default";
>>>> +		pinctrl-0 = <&gps_pins>;
>>>> +		sirf,onoff-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
>>>> +		lna-supply = <&vsim>;  
>>> 
>>> Also, the vcc-supply is a required property.
>>> 
>> well, it is not require in the driver and it has different behavior
>> (on even when not opened if on-off is there) than the lna-supply used
>> here. So maybe fix the binding documentation?
> 
> The device-tree describes hardware, and how a particular driver happens
> to implement a binding is not relevant.
> 
> That said, there is a bit of an on-going, shall we say philosophical,
> debate about this. The regulator maintainer takes a firm position that
> all mandatory physical supplies should be represented in firmware
> 	
> 	https://lore.kernel.org/lkml/20181123133126.GF2089@sirena.org.uk/T/#u
> 	https://lore.kernel.org/lkml/20180409102244.GB11532@sirena.org.uk/T/#u
> 
> while Rob appears to take a slightly different stance on fixed
> regulators while admitting that this an issue which has not yet been
> fully resolved:
> 
> 	https://lore.kernel.org/lkml/20180425171123.xhyoay3nu463btoq@rob-hp-laptop/T/#u
> 
> Since this is a new binding, and the hardware requires the vcc supply
> and this is reflected in the binding, I think you should add a fixed
> regulator. At least until you hear otherwise. ;)

Assuming that there is no REGEN signal from the twl4030 unless 1V8 is also
stable, I'd suggest as a simple solution:

	 vcc-supply = <&vio>;

Alternatively, we could define a dedicated fixed-regulator in omap3-gta04.dtsi
for the 3V3 rail. Which is always-on. This would allow to describe that e.g. the
itg3200, panel and other chips and sensors are also supplied by this. But since
no driver can really make use of it (turn on/off on demand) this is IMHO quite
needless.

BR,
Nikolaus


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

* Re: [Letux-kernel] [PATCH] arm: dts: gta04: add gps support
  2019-01-30 14:06       ` [Letux-kernel] " H. Nikolaus Schaller
@ 2019-01-30 20:11         ` Andreas Kemnade
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Kemnade @ 2019-01-30 20:11 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Mark Rutland, devicetree, Tony Lindgren, Johan Hovold, LKML,
	Rob Herring, Benoit Cousson, linux-omap,
	Discussions about the Letux Kernel

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

On Wed, 30 Jan 2019 15:06:12 +0100
"H. Nikolaus Schaller" <hns@goldelico.com> wrote:

> Hi Andreas,
> 
> > Am 30.01.2019 um 10:02 schrieb Johan Hovold <johan@kernel.org>:
> > 
> > On Mon, Jan 28, 2019 at 05:44:29PM +0100, Andreas Kemnade wrote:  
> >> On Mon, 28 Jan 2019 08:53:56 +0100
> >> Johan Hovold <johan@kernel.org> wrote:
> >>   
> >>> On Fri, Jan 25, 2019 at 08:43:10PM +0100, Andreas Kemnade wrote:  
> >>>> The GTA04 has a w2sg0004 or w2sg0084 gps chip. Not detectable
> >>>> which one is mounted so use the compatibility entry for w2sg0004
> >>>> for all which will work for both.
> >>>> 
> >>>> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> >>>> ---
> >>>> w2sg0004 bindings (together with the corresponding support is in
> >>>> https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss gnss-next)
> >>>> arch/arm/boot/dts/omap3-gta04.dtsi | 13 +++++++++++++
> >>>> 1 file changed, 13 insertions(+)  
> >   
> >>>> +	gps: gps {    
> >>> 
> >>> The node should be named "gnss" as per the binding.
> >>>   
> >>>> +		compatible = "wi2wi,w2sg0004";
> >>>> +		pinctrl-names = "default";
> >>>> +		pinctrl-0 = <&gps_pins>;
> >>>> +		sirf,onoff-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
> >>>> +		lna-supply = <&vsim>;    
> >>> 
> >>> Also, the vcc-supply is a required property.
> >>>   
> >> well, it is not require in the driver and it has different behavior
> >> (on even when not opened if on-off is there) than the lna-supply used
> >> here. So maybe fix the binding documentation?  
> > 
> > The device-tree describes hardware, and how a particular driver happens
> > to implement a binding is not relevant.
> > 
> > That said, there is a bit of an on-going, shall we say philosophical,
> > debate about this. The regulator maintainer takes a firm position that
> > all mandatory physical supplies should be represented in firmware
> > 	
> > 	https://lore.kernel.org/lkml/20181123133126.GF2089@sirena.org.uk/T/#u
> > 	https://lore.kernel.org/lkml/20180409102244.GB11532@sirena.org.uk/T/#u
> > 
> > while Rob appears to take a slightly different stance on fixed
> > regulators while admitting that this an issue which has not yet been
> > fully resolved:
> > 
> > 	https://lore.kernel.org/lkml/20180425171123.xhyoay3nu463btoq@rob-hp-laptop/T/#u
> > 
> > Since this is a new binding, and the hardware requires the vcc supply
> > and this is reflected in the binding, I think you should add a fixed
> > regulator. At least until you hear otherwise. ;)  
> 
> Assuming that there is no REGEN signal from the twl4030 unless 1V8 is also
> stable, I'd suggest as a simple solution:
> 
> 	 vcc-supply = <&vio>;
> 
> Alternatively, we could define a dedicated fixed-regulator in omap3-gta04.dtsi
> for the 3V3 rail. Which is always-on. This would allow to describe that e.g. the
> itg3200, panel and other chips and sensors are also supplied by this. But since
> no driver can really make use of it (turn on/off on demand) this is IMHO quite
> needless.
> 
well, probably better to add that regulator, so we match the real
hardware and not doing some fake here just to satisfy that binding
requirement. I will send a new version with that regulator added.

Regards,
Andreas

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

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

end of thread, other threads:[~2019-01-30 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 19:43 [PATCH] arm: dts: gta04: add gps support Andreas Kemnade
2019-01-28  7:53 ` Johan Hovold
2019-01-28 16:44   ` Andreas Kemnade
2019-01-30  9:02     ` Johan Hovold
2019-01-30 14:06       ` [Letux-kernel] " H. Nikolaus Schaller
2019-01-30 20:11         ` Andreas Kemnade

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).