diff mbox

[v2,0/4] Add driver for Mediatek-based GNSS receivers

Message ID 1547744074-28308-1-git-send-email-lollivier@baylibre.com
State New
Headers show

Commit Message

Loys Ollivier Jan. 17, 2019, 4:54 p.m. UTC
Hi,

This patch series adds a new GNSS driver for the Mediatek-based GNSS receivers.
These receivers transmits NMEA output sequence after boot.
Power management can be done via the main supply and optional backup supply
as defined in the device tree.

The driver has been tested using a GlobalTop pa6h chipset on a Libretech-cc
board using the expansion header. Changes made in the board device tree can
be found below for reference and testing.

Loys

Sorry it took so long for the v2. Rebased that serie on 5.0-rc1 and had to send
some fixes for the board before testing.

Version 2 changes:
- driver: Renamed driver from Globaltop/gtop to Mediatek/mtk
- driver: Added "mediatek,mt3339" compatible
- dt: Renamed bindings from Globaltop to Mediatek
- dt: Moved the current-speed property as optional
- dt: removed the status line in example
- cover-letter: removed the alias that is not needed anymore

Loys Ollivier (4):
  dt-bindings: Add vendor prefix for "GlobalTop Technology, Inc."
  dt-bindings: gnss: add mediatek binding
  gnss: add mtk receiver type support
  gnss: add driver for mediatek receivers

 .../devicetree/bindings/gnss/mediatek.txt          |  39 ++++++
 .../devicetree/bindings/vendor-prefixes.txt        |   1 +
 drivers/gnss/Kconfig                               |  13 ++
 drivers/gnss/Makefile                              |   3 +
 drivers/gnss/core.c                                |   1 +
 drivers/gnss/mtk.c                                 | 153 +++++++++++++++++++++
 include/linux/gnss.h                               |   1 +
 7 files changed, 211 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gnss/mediatek.txt
 create mode 100644 drivers/gnss/mtk.c

---
        pinctrl-names = "default";
 };
 
+/* This is brought out on the UART_A_TX (8) and UART_A_RX (10) pins: */
+&uart_A {
+       status = "okay";
+       pinctrl-0 = <&uart_a_pins>;
+       pinctrl-names = "default";
+
+       gnss {
+               compatible = "globaltop,pa6h";
+               v-bckp-supply = <&vcc_3v3>;
+               vcc-supply = <&vcc_3v3>;
+               current-speed = <9600>;
+       };
+};
+
 &usb0 {
        status = "okay";
 };

-- 
2.7.4

Comments

Rob Herring Jan. 21, 2019, 5:09 p.m. UTC | #1
On Thu, 17 Jan 2019 17:54:31 +0100, Loys Ollivier wrote:
> Add globaltop vendor definition.

> 

> Signed-off-by: Loys Ollivier <lollivier@baylibre.com>

> ---

> 

> v2: Alphabetical order

> 

>  Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +

>  1 file changed, 1 insertion(+)

> 


Reviewed-by: Rob Herring <robh@kernel.org>
Johan Hovold Jan. 25, 2019, 9:12 a.m. UTC | #2
On Thu, Jan 17, 2019 at 05:54:33PM +0100, Loys Ollivier wrote:
> Add an MTK (Mediatek) type to the "GNSS_TYPE" attribute.

> 

> Note that MTK receivers support a subset of NMEA 0183 with vendor

> extensions (e.g. to allow switching to the vendor protocol).


Copy paste error? AFAICT there is no Mediatek vendor protocol, only the
extensions to NMEA.

> Signed-off-by: Loys Ollivier <lollivier@baylibre.com>

> ---

> 

> v2: renamed from GTOP to MTK.

> 

>  include/linux/gnss.h | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/include/linux/gnss.h b/include/linux/gnss.h

> index 43546977098c..36968a0f33e8 100644

> --- a/include/linux/gnss.h

> +++ b/include/linux/gnss.h

> @@ -22,6 +22,7 @@ enum gnss_type {

>  	GNSS_TYPE_NMEA = 0,

>  	GNSS_TYPE_SIRF,

>  	GNSS_TYPE_UBX,

> +	GNSS_TYPE_MTK,

>  

>  	GNSS_TYPE_COUNT

>  };


Add the gnss_type_names string in this patch along with the define.

Johan
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
index 90a56af967a7..3b3d4dcc47aa 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
@@ -17,6 +17,7 @@ 
 
        aliases {
                serial0 = &uart_AO;
                ethernet0 = &ethmac;
        };
 
@@ -269,7 +270,20 @@