From patchwork Mon Jan 28 16:37:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loys Ollivier X-Patchwork-Id: 10784013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5C79922 for ; Mon, 28 Jan 2019 16:38:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FE2D2BB84 for ; Mon, 28 Jan 2019 16:38:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 928402BB8A; Mon, 28 Jan 2019 16:38:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4AD3D2BB84 for ; Mon, 28 Jan 2019 16:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MDbLeKWf9VWTLFXJsGpOeQrKPHv4O9Gy8wRqDWGOWzg=; b=Ypxk7j9Fh4LUq7xawGIraNqvkR gZb2mrKSO2m1fED4pGo3zS1cydA5snaef4FPK5r7wFLeHR9DYoAXnm4y1ScMdvS9wcdUSamrQ03FU /DgSLoDfD0b2jnyfe/84nQhuD7+ETekMcCMyGnla8QW3L4GHCPOX8Tw4pT5zxi45kPX6WK/FMYVO6 hVoXQnFlKtkQ9BJv+9U9N6anJ7qG0USR1QKexLofMqodU/W7bl/o84ffo8oa2mNYnOrzH92WRWnLj dd53JFK6MD40KGrLUV9KbRkWy3Xl/Pn9LVjTiSunqMS4mg25s9ZwwcdYCc862U5/SngXSmF1JKX6n 95ANqydg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9vd-00077d-IT; Mon, 28 Jan 2019 16:38:33 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9vE-0006jE-9e for linux-mediatek@lists.infradead.org; Mon, 28 Jan 2019 16:38:12 +0000 Received: by mail-wr1-x443.google.com with SMTP id x10so18765839wrs.8 for ; Mon, 28 Jan 2019 08:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DwXU/DABY03ITJwoWyaouwbE8TjJuTN6E6OnLCAmCoA=; b=AvL9UiD3J4AerEcQE13yxgFPcrNzEyvgVO/Oed9HUx52ap7/tMpLGzKcGWXRGxciNK ZdRFq9lnPpRcfvosrhlsegfVAVUgGprCIx2a1cscd0T90+lG1RfGJ+pyg90BTmK4JXB1 +ifa2QS9EZd00bpcesusSxt9OZC6c6+v2Y8TlJL+ILgy2nG3wkyeVbaJZ0uV9TjxYOXS DNkQCUG28w5ZJogOBquDxyApdURnAZdJpFoMcU7vt8jwxyH7Mabs6MCuA3PLNlazBkYR IJVCZNnSnsei5MriMsg3c4hjn9z6IKnWjDEZ0ASkG5I9PgdHeOzA3NEHWSTyOistHo9+ 0Now== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DwXU/DABY03ITJwoWyaouwbE8TjJuTN6E6OnLCAmCoA=; b=pu8KnORdCjke84twzbFLPvrvcBQFDM6oOpCA5ulvK5pnQoWzjRDFHSfuKRXjWGniJQ CO41pcyjV+FWk4PDtn0k0LDeFpExvTsp7lBihzPeyBDG3OIqksWPSK+lQ05yMZ2pGphT Xd+E38eTbIlSb64923IDAgu+ALMSeuRo99YiCt5ba8HEkHiDT53N0E53dCP6iwmytM8k jqc7oMZkT7pVs6IRWo+g2iMOTLGzlCvfAMD/6Gfm0k2su3vAw+F+7RvzFDL/I64j1qav zVUrro639XikNIb6OfAOfMvK0DcIFwOME0H3Ad56dWo87a8pWrrpGoQmFMY4UIJw+GXX /W5Q== X-Gm-Message-State: AJcUukcgwK2YgTNJf/rPBoclCZTaqSimye/doxQLxiZcXYmf8C50apEL 03mG1BSLLn97Z5xoo/X3drIhUA== X-Google-Smtp-Source: ALg8bN5KMG1QHbxfXu8KVWN1cLvVGhJydZpy2RUk7wZ6NpeR6bHPzOsCNI6QCr0tfyobn6ULK0jr6g== X-Received: by 2002:a5d:56d2:: with SMTP id m18mr23651374wrw.113.1548693486851; Mon, 28 Jan 2019 08:38:06 -0800 (PST) Received: from loys-ubuntu-BY1835A49200471.thefacebook.com ([2620:10d:c092:180::1:d40b]) by smtp.googlemail.com with ESMTPSA id s3sm52388982wmj.23.2019.01.28.08.38.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 08:38:06 -0800 (PST) From: Loys Ollivier To: devicetree@vger.kernel.org, Johan Hovold Subject: [PATCH v3 1/4] dt-bindings: Add vendor prefix for "GlobalTop Technology, Inc." Date: Mon, 28 Jan 2019 17:37:58 +0100 Message-Id: <1548693481-1162-2-git-send-email-lollivier@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> References: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_083808_495254_D6AC3627 X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Martin Blumenstingl , Kevin Hilman , Loys Ollivier , linux-kernel@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add globaltop vendor definition. Signed-off-by: Loys Ollivier --- v3: No changes v2: Alphabetical order Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 389508584f48..d80a70343b36 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -150,6 +150,7 @@ geniatech Geniatech, Inc. giantec Giantec Semiconductor, Inc. giantplus Giantplus Technology Co., Ltd. globalscale Globalscale Technologies, Inc. +globaltop GlobalTop Technology, Inc. gmt Global Mixed-mode Technology, Inc. goodix Shenzhen Huiding Technology Co., Ltd. google Google, Inc. From patchwork Mon Jan 28 16:37:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loys Ollivier X-Patchwork-Id: 10784021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46B20922 for ; Mon, 28 Jan 2019 16:39:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 320F22A15F for ; Mon, 28 Jan 2019 16:39:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23E2B2A19E; Mon, 28 Jan 2019 16:39:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B97182A15F for ; Mon, 28 Jan 2019 16:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YKPHnLAa1Q79ynvd6Nbxj7vRRwHFtFtzydlJGTZ6jVY=; b=uE0ubYpOtIp235Md+aZj3EagA+ YhQSpG0oDtyA9qc2die7yo8QA5v9vL9Mp+V415cFKuUqxHMOnbX6qhmfetEyMvCtB4sb6QdL7JRjz W50D+WsW7Iu1tFrGV1Hwyc9QkHUG3C56/eD90+BYzlgDylwtHaHoEjzEJzSZ/s/A4UH12UTLEnzT3 dU+ptlLuZIPNJQ0HzTTWG0Rb7yuqBQ+kcoJRbzsei/vzUAzU3RgPzo5nOo9Rx6hAI2qyTV8iocLVq g2s8X4OhteVQ2qr9lJEN5ZcQg4WRrK0nKtuAFLHdNH+5gjnaOqDYbn+sa2ys2jv+6h9/M3zUG1C+c S/x9zAzg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9w8-0007Xw-N0; Mon, 28 Jan 2019 16:39:04 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9vG-0006k0-3o for linux-mediatek@lists.infradead.org; Mon, 28 Jan 2019 16:38:18 +0000 Received: by mail-wr1-x443.google.com with SMTP id p7so18854075wru.0 for ; Mon, 28 Jan 2019 08:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9TWS3RWKZyY10HyUQ8/8Pkd3n2zCGA7KyKif2utYLQk=; b=RDmU414oN71nkBAYiPqn/5DnY9a/u9LMT3qHlV2ydHCc9+jtKa3TZNdEJgRBEKLjco NI+Lb1XZrxNIUcye9zYNtrllkeaj2GBJoJI7Z/i1XARKPFGR9kWhG+lXT2jrRFEJnFXG fb0nNllUVAVqtLBaoWLKoW9l+FHgd0sKaMl5VY5QMFASIbkKM3vKMmKsLdNCuDCWoG46 0AMutNJrNG1RtjHGwSWyW5Q7n5J90mjXDurK03szScyb9cpynPLrpT31fd8bU0tOTEb2 EzYmx8T2acxvSwN8Brv/qxA6tYytvzdG1jBUYjMrnKEiND2F1CQCHlEcU9+/R2aYozSO qW8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9TWS3RWKZyY10HyUQ8/8Pkd3n2zCGA7KyKif2utYLQk=; b=RiRya45dMmkaE3s7UB2EZHHRa0x7pgbziX3UNPYGWe63h8RUThba+YoMMav5B+QST5 tTx6Fby6ZtmlfVhTt7dzVCY0PVfHX/EJorsjo6BY4cvjZNSKjOi6PJP0dLf2hwk6ZLo4 9vXa9SmrVkWIHKZOotExBbNv9pjyVLCzzcdGVsFEHQyEeoJfPHmccxXSx4s8tmgu0wBn RXjSipYXKusEEy5fBLlDE1u4oeDj7FdnKTGruy5K2tR+r0k8Iy2T8Lp6XAQyOJPzoPYm uSqKlFbBfDJ4Rm1aYe6NSi1h7RAKGxUwoV90yM9rd5OGUPn8uVd/qC1kPOt8+u0y6elB 9YVQ== X-Gm-Message-State: AJcUukexmjNGmGFgA5kfI1fHSXjD5nfZbeCsy4MUqsbtxB0DaUHxrk2O VBr/RXm7CkpIQmdAYR6+G1wKEg== X-Google-Smtp-Source: ALg8bN4eVHINugfE+Wj5WD3XT4PnxZy5JY6koo/ABOSVBWhpinarToJm9cMVU9wRXD/OYiuX3Zt80A== X-Received: by 2002:a5d:5182:: with SMTP id k2mr22490514wrv.121.1548693488056; Mon, 28 Jan 2019 08:38:08 -0800 (PST) Received: from loys-ubuntu-BY1835A49200471.thefacebook.com ([2620:10d:c092:180::1:d40b]) by smtp.googlemail.com with ESMTPSA id s3sm52388982wmj.23.2019.01.28.08.38.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 08:38:07 -0800 (PST) From: Loys Ollivier To: devicetree@vger.kernel.org, Johan Hovold Subject: [PATCH v3 2/4] dt-bindings: gnss: add mediatek binding Date: Mon, 28 Jan 2019 17:37:59 +0100 Message-Id: <1548693481-1162-3-git-send-email-lollivier@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> References: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_083810_439475_0414DACF X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Martin Blumenstingl , Kevin Hilman , Loys Ollivier , linux-kernel@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add binding for Mediatek-based GNSS receivers. Signed-off-by: Loys Ollivier --- v3: Removed the I2C and SPI interfaces references. Removed the "mediatek,mt3339" compatible line. Added the optional propertied (reset, fix) Added the pin names for the optional properties. v2: Renamed bindings from Globaltop/gtop to Mediatek/mtk. Moved current-speed as an optional propertie. Removed the status line in the example. Added "mediatek,mt3339" compatible. .../devicetree/bindings/gnss/mediatek.txt | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Documentation/devicetree/bindings/gnss/mediatek.txt diff --git a/Documentation/devicetree/bindings/gnss/mediatek.txt b/Documentation/devicetree/bindings/gnss/mediatek.txt new file mode 100644 index 000000000000..00650d81c5c8 --- /dev/null +++ b/Documentation/devicetree/bindings/gnss/mediatek.txt @@ -0,0 +1,37 @@ +Mediatek-based GNSS Receiver DT binding + +Mediatek chipsets are used in GNSS-receiver modules produced by several +vendors and can use an UART interface. + +Please see Documentation/devicetree/bindings/gnss/gnss.txt for generic +properties. + +Required properties: + +- compatible : Must be + + "globaltop,pa6h" + +- vcc-supply : Main voltage regulator (pin name: VCC) + +Optional properties: + +- gtop,reset-gpios : GPIO used to reset the device + (pin name: RESET, NRESET) +- gtop,fix-gpios : GPIO used to determine device position fix state + (pin name: FIX, 3D_FIX) +- timepulse-gpios : Time pulse GPIO (pin name: PPS1, 1PPS) +- v-bckp-supply : Backup voltage regulator + (pin name: VBAT, VBACKUP) +- current-speed : Default UART baud rate + +Example: + +serial@1234 { + compatible = "ns16550a"; + + gnss { + compatible = "globaltop,pa6h"; + vcc-supply = <&vcc_3v3>; + }; +}; From patchwork Mon Jan 28 16:38:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loys Ollivier X-Patchwork-Id: 10784033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A219922 for ; Mon, 28 Jan 2019 16:39:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 762702A19E for ; Mon, 28 Jan 2019 16:39:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69C752AB40; Mon, 28 Jan 2019 16:39:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 086CD2A19E for ; Mon, 28 Jan 2019 16:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ckjcwYIm7GNdfug+cmdWQK6YryEEMsLc9vH7VnV/dWc=; b=nZTdg5xj7uWrKc6EFuhH58rbHN VUuXkZLEgjHMEa13hd/wXDqvUol1KZ8yLzU0Q84VxlDtKUMEwBw17/j5eKvmzKM8Y27JvzNRYBj33 hRmPOfmibKLt49FS1POGXztHjVpGI6nZdJ2AslYKZejhAz4nP3QEzgIgkL+EQjG243BCaF91sJPWU V2zGX/8paqEtgqcRp4lD66qywrE4Ldiw1cFVEtdIHEglbtBu1cTHmv04DCSkrGs3hgMymDYT9mUMX 0184uSf2RoY4d0En1lmjYycf3mjmZ7WLn9K9SVVrMTHSe0v0FPlyeDHyXggyqLe1WirVyb/8X4vrK FIXTsIbg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9ws-0008IQ-Jw; Mon, 28 Jan 2019 16:39:52 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9vG-0006kg-Jx for linux-mediatek@lists.infradead.org; Mon, 28 Jan 2019 16:38:15 +0000 Received: by mail-wr1-x441.google.com with SMTP id v13so18767832wrw.5 for ; Mon, 28 Jan 2019 08:38:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fyBQQHTr8PUOvMNC5TSDB366cWfD8A0+KHCn5LVVNH8=; b=HYqf2z5eD3+QLpuQsIa8Phc08x0KnTYkWPWdqhent4WHaKgV4AbHrdtuSEnDNKkNea scxM5Kd1hkFVFFI5IHpusyuIjntVpb2gnbFpH79sCOqq5mBgtfdPApxIgeCI0uoboDz7 CmTfvBuda3ITtikhX8QxoAqgbZAQgO/hztL1G88Gyxh6/tf2cqnOxQ6OKQGiCFlpfKq8 7Ld2pI88cmWYyySZhmb1YoxRZF0HfbJauuKsWpbg9ssVMXAv3mh09+s0BgXqfyLxXxxH ghdjIouftGV65Hgm1OLT7E7tq70USf2NZLEJlM8dJ8EREsqhBC09RG5Na/qrCNvsNWyJ +BTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fyBQQHTr8PUOvMNC5TSDB366cWfD8A0+KHCn5LVVNH8=; b=LkB0er4tPOdUDR+e5EHOjBlPTtrvmCtLKKDsYc2L5UuZqzDs+jVwYatl9V9d6vwIQs 3VMv9YTop9Ass6hPo62Kktj73Kw9B6v9ofX9HFM41Ktx97XzSelx2skd6daqsbcxt9fW 6nPmJ+LkWA/n24WtYj99XV01H9Iz19DQCGUQWC1FInqALGSXn83MXVlyFRkwb3HAM4ou SP5YPOs/6ZwUqsW+XDpEcpw/izoD3rBgbKGVdr1El6nPZ+6y9i3DOUylWz/s5tNW1id7 FGJMLla9Djdw7U+/Ah3hEv0Ft3RMBrpip6Ax0srOliuu1XnkbkEzrLH1HCaBMjXd+4jM bDoA== X-Gm-Message-State: AJcUukd8464037t01AfXpeEhIsVlcLgOiv3Einy0zHS+D9vih28IFB+b OGMpun2KCpC1nPqscUCVTAue8w== X-Google-Smtp-Source: ALg8bN4/B4SWxIm7vCUbRYvn874M1dL1HvhVWIsz6SyWTxC8hna3Zz/YBgIob2CzSREhZRSEL60eAA== X-Received: by 2002:adf:eec9:: with SMTP id a9mr22139027wrp.242.1548693489225; Mon, 28 Jan 2019 08:38:09 -0800 (PST) Received: from loys-ubuntu-BY1835A49200471.thefacebook.com ([2620:10d:c092:180::1:d40b]) by smtp.googlemail.com with ESMTPSA id s3sm52388982wmj.23.2019.01.28.08.38.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 08:38:08 -0800 (PST) From: Loys Ollivier To: devicetree@vger.kernel.org, Johan Hovold Subject: [PATCH v3 3/4] gnss: add mtk receiver type support Date: Mon, 28 Jan 2019 17:38:00 +0100 Message-Id: <1548693481-1162-4-git-send-email-lollivier@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> References: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_083810_909639_E36E092A X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Martin Blumenstingl , Kevin Hilman , Loys Ollivier , linux-kernel@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add an MTK (Mediatek) type to the "GNSS_TYPE" attribute. Note that MTK receivers support a subset of NMEA 0183 with vendor extensions. Signed-off-by: Loys Ollivier --- v3: Moved the gnss_type_names string addition to this patch. Edited the commit message to remove the reference to a vendor protocol. v2: renamed from GTOP to MTK. drivers/gnss/core.c | 1 + include/linux/gnss.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c index 4291a0dd22aa..320cfca80d5f 100644 --- a/drivers/gnss/core.c +++ b/drivers/gnss/core.c @@ -334,6 +334,7 @@ static const char * const gnss_type_names[GNSS_TYPE_COUNT] = { [GNSS_TYPE_NMEA] = "NMEA", [GNSS_TYPE_SIRF] = "SiRF", [GNSS_TYPE_UBX] = "UBX", + [GNSS_TYPE_MTK] = "MTK", }; static const char *gnss_type_name(struct gnss_device *gdev) 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 }; From patchwork Mon Jan 28 16:38:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loys Ollivier X-Patchwork-Id: 10784025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 304EE922 for ; Mon, 28 Jan 2019 16:39:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 197CF2A19E for ; Mon, 28 Jan 2019 16:39:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D0D62A1DF; Mon, 28 Jan 2019 16:39:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7BD522A19E for ; Mon, 28 Jan 2019 16:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ShoXAWLN/kuJWdF9lwLJiKv4Ux49YE1dOnSp+r1eyGk=; b=OHMVM8lHXD76wiohYDyHDKJ9Nn y1pm7b1HUp7nd2DzHhmqq2LEfeXQLEeYVCiItzDazVlIs2z+CNOxLUFV8oF2rkolEtNi/P2ADtI7T rqEW7uW+JtyFOw4FPjd2o7Kz2DkNcj6D0MXNsIvPaYUP8QIPsNdOcVIseX2weO7mhJx8deDzTRScD tTu8qfoOf/o/CzFfJsq+uvoS4AJAm41ev09pp9i1oy7L46JdTJB+e5kjliKFEzRYjQ9wZhAsyqkXM 91+YYd/lgeEkKhfkHzoZms955OD1E04gVgYUawIsrAG1WqS6/N7tSsvuUOJ3aMcJQMnUfIV4Ed8wj GnMlO4Pw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9wK-0007f1-Ud; Mon, 28 Jan 2019 16:39:16 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go9vH-0006lt-Qi for linux-mediatek@lists.infradead.org; Mon, 28 Jan 2019 16:38:24 +0000 Received: by mail-wr1-x442.google.com with SMTP id q18so18781766wrx.9 for ; Mon, 28 Jan 2019 08:38:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J7q2ZjQCinm0IA/wotZbsDzW17KZqQK/HytBY9aOmww=; b=jCkIK7qOU+oQ1Qf34xBNH44bu15/Eyc78HQubpYXfrNqRhzbGg3DLSspO5WFomgfxQ ci7q5n3OMQVcMVv4ouYs3jdw8Bl9a29EfuewI2VUXE+o99WXguBy4COns+R1Jy4pUuPO GCAKPLG+EJpDA1hrhDo2vLPv1oWl4fhuwHBI2/qksQuGYUkCa+Z+Fi3Ng1ipN4fh9PPU NLIrrFaHrfT0pVMt/FfGAd8c2ldttUAuWPUMA6fYtinkc2rI9D0uSos4KvDod3NPbZIR KNNYoff6rjsNQWcGRMxK5grcIt2BEhRZ9c4Q8P+6l6g91fcANuGpSC9G7rDhAd6fFCGb IEPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=J7q2ZjQCinm0IA/wotZbsDzW17KZqQK/HytBY9aOmww=; b=jne4Qye6Q+AVOiRhNgsOlAOD2HSxFADxbZ5eIapaNfxGn+Gj5TIPlJ5DCHZwKsPdd8 4dglEl6X771N4KTINfFEciZYRR/f/15ImvIXkzshFpWAsZSsg64GC7XdLL/hBlpZfRQx PHg8OfNgUOtcsCudVZCmDVS3yNJiu0p4wgJ99Vzt/VdBPbVP+k250s+NtS8NoYZNWmi2 akLshFTq/1TG7oVLeYDy0ASj2zsFbojhNJg5bBSWO8WEqsi/qoHIRDWcVFMYNcFGwjS2 ioq8cFtympV/Hw/07MXa31gsGG2La/P3kD1F8eTfzAAZozZ9JtpLnwBOT+1deYkC3/wH pKxQ== X-Gm-Message-State: AJcUuke0FTraR5mVcw2ibK7saCCBP0k9xnVBIs+uEg5rHG7OBZMEtoOI GF+8TZtE0AK2MdbS2d0ub49X0w== X-Google-Smtp-Source: ALg8bN7blyEvsvwmNr8fUFPB28n210TFW2WoUsaWbisBlgkZPfBc9rYG0fS4DpIKo7pWK/NFlt6Kfw== X-Received: by 2002:adf:ae41:: with SMTP id u1mr21558974wrd.20.1548693490439; Mon, 28 Jan 2019 08:38:10 -0800 (PST) Received: from loys-ubuntu-BY1835A49200471.thefacebook.com ([2620:10d:c092:180::1:d40b]) by smtp.googlemail.com with ESMTPSA id s3sm52388982wmj.23.2019.01.28.08.38.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 08:38:09 -0800 (PST) From: Loys Ollivier To: devicetree@vger.kernel.org, Johan Hovold Subject: [PATCH v3 4/4] gnss: add driver for mediatek receivers Date: Mon, 28 Jan 2019 17:38:01 +0100 Message-Id: <1548693481-1162-5-git-send-email-lollivier@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> References: <1548693481-1162-1-git-send-email-lollivier@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_083812_028661_1FC1A711 X-CRM114-Status: GOOD ( 18.50 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Martin Blumenstingl , Kevin Hilman , Loys Ollivier , linux-kernel@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add driver for serial-connected Mediatek-based GNSS receivers. These devices typically boot transmitting vendor specific NMEA output sequences. The serial port bit rate is read from the device tree "current-speed". Note that the driver uses the generic GNSS serial implementation and therefore essentially only manages power abstracted into three power states: ACTIVE, STANDBY, and OFF. For mediatek receivers with a main supply and no enable-gpios, this simply means that the main supply is disabled in STANDBY and OFF (the optional backup supply is kept enabled while the driver is bound). Note that the timepulse-support is left unimplemented. Signed-off-by: Loys Ollivier --- v3: Sorted the Kconfig and Makefile Retained the original Copyright Removed "mediatek,mt3339" compatible. v2: Renamed from gtop/Globaltop to mtk/Mediatek. Added "mediatek,mt3339" compatible. drivers/gnss/Kconfig | 13 +++++ drivers/gnss/Makefile | 3 + drivers/gnss/mtk.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 drivers/gnss/mtk.c diff --git a/drivers/gnss/Kconfig b/drivers/gnss/Kconfig index 6abc88514512..6d8c8027e1cd 100644 --- a/drivers/gnss/Kconfig +++ b/drivers/gnss/Kconfig @@ -15,6 +15,19 @@ if GNSS config GNSS_SERIAL tristate +config GNSS_MTK_SERIAL + tristate "Mediatek GNSS receiver support" + depends on SERIAL_DEV_BUS + select GNSS_SERIAL + help + Say Y here if you have a Mediatek-based GNSS receiver which uses a + serial interface. + + To compile this driver as a module, choose M here: the module will + be called gnss-mtk. + + If unsure, say N. + config GNSS_SIRF_SERIAL tristate "SiRFstar GNSS receiver support" depends on SERIAL_DEV_BUS diff --git a/drivers/gnss/Makefile b/drivers/gnss/Makefile index 5cf0ebe0330a..451f11401ecc 100644 --- a/drivers/gnss/Makefile +++ b/drivers/gnss/Makefile @@ -9,6 +9,9 @@ gnss-y := core.o obj-$(CONFIG_GNSS_SERIAL) += gnss-serial.o gnss-serial-y := serial.o +obj-$(CONFIG_GNSS_MTK_SERIAL) += gnss-mtk.o +gnss-mtk-y := mtk.o + obj-$(CONFIG_GNSS_SIRF_SERIAL) += gnss-sirf.o gnss-sirf-y := sirf.o diff --git a/drivers/gnss/mtk.c b/drivers/gnss/mtk.c new file mode 100644 index 000000000000..a5aad08fb9d7 --- /dev/null +++ b/drivers/gnss/mtk.c @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Mediatek GNSS receiver driver + * + * Copyright (C) 2018 Johan Hovold + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "serial.h" + +struct mtk_data { + struct regulator *v_bckp; + struct regulator *vcc; +}; + +static int mtk_set_active(struct gnss_serial *gserial) +{ + struct mtk_data *data = gnss_serial_get_drvdata(gserial); + int ret; + + ret = regulator_enable(data->vcc); + if (ret) + return ret; + + return 0; +} + +static int mtk_set_standby(struct gnss_serial *gserial) +{ + struct mtk_data *data = gnss_serial_get_drvdata(gserial); + int ret; + + ret = regulator_disable(data->vcc); + if (ret) + return ret; + + return 0; +} + +static int mtk_set_power(struct gnss_serial *gserial, + enum gnss_serial_pm_state state) +{ + switch (state) { + case GNSS_SERIAL_ACTIVE: + return mtk_set_active(gserial); + case GNSS_SERIAL_OFF: + case GNSS_SERIAL_STANDBY: + return mtk_set_standby(gserial); + } + + return -EINVAL; +} + +static const struct gnss_serial_ops mtk_gserial_ops = { + .set_power = mtk_set_power, +}; + +static int mtk_probe(struct serdev_device *serdev) +{ + struct gnss_serial *gserial; + struct mtk_data *data; + int ret; + + gserial = gnss_serial_allocate(serdev, sizeof(*data)); + if (IS_ERR(gserial)) { + ret = PTR_ERR(gserial); + return ret; + } + + gserial->ops = &mtk_gserial_ops; + + gserial->gdev->type = GNSS_TYPE_MTK; + + data = gnss_serial_get_drvdata(gserial); + + data->vcc = devm_regulator_get(&serdev->dev, "vcc"); + if (IS_ERR(data->vcc)) { + ret = PTR_ERR(data->vcc); + goto err_free_gserial; + } + + data->v_bckp = devm_regulator_get_optional(&serdev->dev, "v-bckp"); + if (IS_ERR(data->v_bckp)) { + ret = PTR_ERR(data->v_bckp); + if (ret == -ENODEV) + data->v_bckp = NULL; + else + goto err_free_gserial; + } + + if (data->v_bckp) { + ret = regulator_enable(data->v_bckp); + if (ret) + goto err_free_gserial; + } + + ret = gnss_serial_register(gserial); + if (ret) + goto err_disable_v_bckp; + + return 0; + +err_disable_v_bckp: + if (data->v_bckp) + regulator_disable(data->v_bckp); +err_free_gserial: + gnss_serial_free(gserial); + + return ret; +} + +static void mtk_remove(struct serdev_device *serdev) +{ + struct gnss_serial *gserial = serdev_device_get_drvdata(serdev); + struct mtk_data *data = gnss_serial_get_drvdata(gserial); + + gnss_serial_deregister(gserial); + if (data->v_bckp) + regulator_disable(data->v_bckp); + gnss_serial_free(gserial); +}; + +#ifdef CONFIG_OF +static const struct of_device_id mtk_of_match[] = { + { .compatible = "globaltop,pa6h" }, + {}, +}; +MODULE_DEVICE_TABLE(of, mtk_of_match); +#endif + +static struct serdev_device_driver mtk_driver = { + .driver = { + .name = "gnss-mtk", + .of_match_table = of_match_ptr(mtk_of_match), + .pm = &gnss_serial_pm_ops, + }, + .probe = mtk_probe, + .remove = mtk_remove, +}; +module_serdev_device_driver(mtk_driver); + +MODULE_AUTHOR("Loys Ollivier "); +MODULE_DESCRIPTION("Mediatek GNSS receiver driver"); +MODULE_LICENSE("GPL v2");