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: 10784029 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 385A6746 for ; Mon, 28 Jan 2019 16:39:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 267722A19E for ; Mon, 28 Jan 2019 16:39:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 182712AB40; Mon, 28 Jan 2019 16:39:23 +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 C4A022A19E for ; Mon, 28 Jan 2019 16:39:22 +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=4Wo9vGkvNaoaIA03rxFAOsbPGmP4XP9MzZ8T+qHyo6I=; b=OxYcFE/ByZXlQLq4aAj52qM+no YH62cF9QAAwYv5QJ3wCq9OinNtJPE8miY47w8w/WDerSxWv/alO3Pt7bm+WaN76jrrgYzMPHTXR1Q T4RAgLMEndZLzYGaO87xK0al2ZWgLR+6HeYzNlNwJ7V2VElXV5c8FBrHJ/VoAsJu+VGyaALrHiOF5 uDphfMQzfxzgDXj3q9OsVt6EhqYlEGI4N82rPO1gEcsQQk54wX4BoqodlmhKLJhSPPN6CHyIFZuCf wYpbNkgoQ5VkD8b4zNnVOreuVVpyA8EpRXD/Ms8+H5NTr/pRd3EiKZzfIfSIIdE+HaaYFB8b+OvqM UBTcj05Q==; 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 1go9wP-0007h6-H4; Mon, 28 Jan 2019 16:39:21 +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 1go9vE-0006jD-Ix for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 16:38:12 +0000 Received: by mail-wr1-x441.google.com with SMTP id q18so18781504wrx.9 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=GEvTHOHBPA/Z7OE4EiJ4NZQa2yaR4fEPfovqrfG8GeSYt9N/yT1UrKuH+76TlSdf6n x7T9PkjG4nmwwvHWyITPlQs+l1CtutEMWfmUc32RShie0gCgg8FvZ98XXqvMelhNVtqZ m6KfXGkSVg+0giBJg6m05iBT2XIbKs4OduzgkiAxQdkBP0LTEQzhvtjoePjnkqYXD2Dv x1oMC6X6EpWt7Yb3TG8UtoroEvb6Tnb1zytJ3taqNQI8Feg6wecunioDFlbqO6B4Wn7f WHeRoend1m5MPQ3iv5dOMF2/ppPW1vZlWTCQmrH/O51bfoUYwCzlPBclQnDG5s81kjVL qupA== X-Gm-Message-State: AJcUukfWMUmjKofoVgU4HUBMXV1wxBG81sc/SdqjAbmj8FfT/lLPJgz4 CKegvLmTkOGx6e2r0XhqdvL1ug== 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_626265_555A6626 X-CRM114-Status: GOOD ( 10.87 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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: 10784017 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 D0CFA746 for ; Mon, 28 Jan 2019 16:38:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBF8F2A747 for ; Mon, 28 Jan 2019 16:38:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD4402A784; Mon, 28 Jan 2019 16:38:51 +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 3F2A02A747 for ; Mon, 28 Jan 2019 16:38:51 +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=QeZogwHe+8fiZl+TdgpAOiTepPg0V1x4Yf3nsserUMg=; b=HJ83QHhv96D0su2iPWmhFlFOPG Lxjlst+oMssy3I2kW+rXSZf8eOlMLbr7XpkkQsM7b7O5N5TfKhVjz27LdX6Uxfg0Aw8fa2Fl3fjEQ NL/zVUay0yM0SlxclqED53mrCX+p/baWr3ImaPHjqZhYFMDTW9zsffdGigkLgsQtvX9eWOX1ap22u YlPJxab3Iwn/w6g2mRXBo74jIoYlMSNnBQmzeYFAsmjgf0KTtHuB5F2cPRCo8LjAucSCf1O/u6xeR 8AiRS8pu5Pk4Guv36nyp1/9fhRLRn47ucWz+SdlWuqC85v0HLy8X/AsKfSLpnvQJshwK4o634sERe Y+v/Z1QA==; 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 1go9vt-0007GT-98; Mon, 28 Jan 2019 16:38:49 +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 1go9vF-0006k1-FV for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 16:38:13 +0000 Received: by mail-wr1-x441.google.com with SMTP id u4so18805089wrp.3 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=I4MwTbOFFHantZnGLhGcGy/5NMl/lGeDycJd48YlMSDJ4JhTfEkFB8atCqRGdto4hU Z6+WD2RsclnBd7TeLhxbaNj5OoxeKKv9lEU/mgMcEsLa3WnQOHuNk5WJitauJB8hvfaM 4nnD1fklRADSzcq6yGHlqs3dQdJ4EODOBJau4G5eDBfIP8EFUlU787wEEjGAk+dLolUe /8Eq9TD4f8TpW/6kbJrs3Fj6/RjhFFbyVWHSc5EZ686T66ZRGc+x0QAe3A8kDgsn3w6U 7AJhVH/DFCQoe4n+z7iYVt1UT8axYZbCoJKTTle5nM02DkPuyQslpX4Y/LnrApG+PKeX woLw== X-Gm-Message-State: AJcUukeK+rrhFJouoRKeNAQv88IFYxIh7Hg1R/nFapppHGTkdqflQu+g DwVRUlj35QdQr9OC7S2K7c0Kvg== 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_083809_527308_ACD7EA14 X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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: 10784035 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 55480922 for ; Mon, 28 Jan 2019 16:40:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 437932B05A for ; Mon, 28 Jan 2019 16:40:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36F022B068; Mon, 28 Jan 2019 16:40:25 +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 DA9A82B05A for ; Mon, 28 Jan 2019 16:40:24 +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=v8vGzPB3zbyBJ2g6XtfmBKPZTvceZWSIXIb6ZjWBpfk=; b=i7e5nbGzGIcSXk9jNPSZzCHKiu Dm8RhZ8ZxddKssTjCL+5lnohxpHJ9IWIYzLT4tDp79f6raazuxKrTaGaTmTc5G7KZl6k+39SwaBYB twLvQ2Y9OkzWtTgdnKzooqRzqtxLiQqV8baonVnT+ShZCQSf+8E0S7DAsGmByYRillfhK3LapxPrQ bBoP9Atqs029ZLdHdz4ktwzYi6u34nzQH5t60YKu33UExRnn7TDyLv2P/MwYUQKjomkF7C4YnR8Dr OnvSX6xDEPv34nogUbEffrA3RwmTFER9rTyasI+4XUG8Q0339HwITsh6RBMADJ5e73J/iqJr4wdec /SPZM/dA==; 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 1go9xM-000145-EX; Mon, 28 Jan 2019 16:40:20 +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-0006kh-LM for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 16:38:22 +0000 Received: by mail-wr1-x443.google.com with SMTP id r10so18762584wrs.10 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=KdG69L91dJ5wSyimciqPYiZFNzidPzapgo+2sU12vB7qi2/8jlcs7gAIS3em44GKrK xbL4yGv9eDcb+Pa9HcbNGjQyZs5xNJJUtzhrMmXBim7kjfl87urh5VJM4j+V47L4Ygtw vcu0VIWnymmIcxohTsJI2WdSc3E0UYidmdhC18DvH/tgGCF0C1vtiOKEcGhE/rLp0Juv 13GuwVfzJ0Fj6xjCBcw4QHf8klXBrHEeEZ5UZY6u8nJetCJvvBAKFsOo+MUAE9KF86Kp cFiD/kkCiCGmeaAAyUotq2vrckV/cH2CHTd05lNMybiPb/b0PqEu64V+r5SmsgCbPhxH 4uDA== X-Gm-Message-State: AJcUukf87AbNgvV4SWZJnIWkMJHkPcJhEQh1S7bAv4Sd2k1KUufTM7xA ZV42nZddyJzw5oOGYo6etJDAMQ== 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_915401_1A43EEF2 X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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: 10784031 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 A36EC746 for ; Mon, 28 Jan 2019 16:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F5CE2A19E for ; Mon, 28 Jan 2019 16:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 831992AB40; Mon, 28 Jan 2019 16:39:40 +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=unavailable 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 E4DEA2A19E for ; Mon, 28 Jan 2019 16:39:39 +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=Nwxy03LWMR7gO5xEqD6pGwm9U7cqEtMEg+J12Gi/3X0=; b=nuNhbcLUhRB5dZxibiCMuNxWp9 rZKu1QQdoMy18ht4D/nRmOxyGgXJEDXSgcRWvnkt1OzE6wiaKXDXKDQXA1JWiSgyeP7d/SBooTb/H +AdVe1RDTu/CVilB/+WpCp8NwaRIWLw2jRXRFs6vs7RgiEZN09hu9nd/xrPc/tjO62VwM55GsbfR9 NKus345xHlS5QERZlzznp3cBHBEHDS7WnEJbdC6KiE0clefrXXR3IFvSijEZPpxikZUcJFtf5YZK4 eUPD/sdsypbrMFNOZ4/XC+zJt+se9GNo8v5KY8snZUSBhu6fsBCa2MlQSc77rHA6Ze8/6FQ0CLQ4K /lefi7vA==; 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 1go9wb-0007u8-1K; Mon, 28 Jan 2019 16:39:33 +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 1go9vH-0006lu-Ra for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 16:38:29 +0000 Received: by mail-wr1-x441.google.com with SMTP id l9so18730517wrt.13 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=PYNlDsBZ6UAMNoeDPE+3RnkwxQsojQouZt0b9qhPn2/J0eA6AYjxRlimtJWmzwudMc nZLOz5LIxaKguA0OLoQN/PdXRHOpN8LA69QYibHzQkZyhTX/scYA4WtREDfK659PjXGc MijNBxZzMtWMLVeuIF1viuUbSlXt337mBJFvxCxbFjHYkI/2KaEg9U0KlT5P39ZSxAsH ac68Z/gZmu3TtRE+K4zYb7MwFxNaQRbVvXKdgUbkm9+IhY+1V5WLsB94DGeNLzmUFnb6 fkYCQFISdRPKsMKJz/HFv8V4BlIFmFPGFpn8/WxdYMGJReheHRA2H9FTVIbaXKBBxJgP orgA== X-Gm-Message-State: AJcUukciFTAgtn0fR2S/T9wn7I/tzJCrxEObrrpQK4cxGxcPm5chVqt2 LcRonqBMRZ/wIIsXaMYmIMtYhA== 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_038338_ECD333DE X-CRM114-Status: GOOD ( 19.96 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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");