From patchwork Mon Nov 13 00:51:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 164294 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp931986vqg; Sun, 12 Nov 2023 16:52:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHU/rr8/sZhRo70lw/RhT40oC7uA+forrnqYOvISucPszK/+lb1e1z/dCYXStERc4TXYrvo X-Received: by 2002:a17:90a:1951:b0:27d:12e1:7e20 with SMTP id 17-20020a17090a195100b0027d12e17e20mr5664683pjh.12.1699836764088; Sun, 12 Nov 2023 16:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699836764; cv=none; d=google.com; s=arc-20160816; b=j556aso9BWh1UzRmk/gbwSZksqcuraNlM6sy2ZIYWP/RsoLlAcDVPWiJc0pNeUzVx1 GgOYDO8YvdKhNfdCmlFFchoutQx+sCJdHC5A7grjaYu43TT0w8YPZvMg6O405lqT6/3d 7aJRsGbH5sq2dmwqdROE4uN3qjakqAB4bAOQcJL8VD+9vr6ndlFx+wZ9bAX2FX0lx+cz ctusLPzWeeyD06yEOfEturN8mIE0xuwkmsB2FzmOYZcIXY1mBbhXSrrEdLK6XEEhqm+0 4ra/sKLrTyQKVx18ag6336DByclLd23QUo+k7C8qk1hN7kTOAuXFFai6naod7eTpjMgg J3nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uNZI7twh1MCj378W/s61ElwRHXmJFA2B2l6wiFxkiz0=; fh=VjHho0Qv8oJSt7HJ3RgckH4LAQCZvu5o942PmtSURt4=; b=qe4JqqopMj55vJWm+eusdKOQYdi79Dqhlka4cvEJSlV6qwXDUXB+9wY1jh5CVUt735 rd28RA9AXMEE79A7rzT/tF0mDgTkHS131CAFN+rNd6u+MJzJ6Zz71XFi7Burrgr8rKUx jTcUKGbanQsv9SVBUCt4bN9fnDzPsHvmJJ9XvdXB3mrUCsPXexjzVp03d74XvqfbsV56 UCTJ2HsCwlHyeOpjkqFh5Iu+TQ9xXv3z+UO+HN3bTfkdBJGjTpyulpJjLuDOShKJefJ/ 1oclnOh3lTzt39QIseN5xkzLe6T5Ub8vnrO3qZpyIA8yNie3ZNaWMK49gubSJnGUVkrj f7cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=U+e1p4sa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y14-20020a17090a644e00b0028014e41ff7si4625616pjm.48.2023.11.12.16.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Nov 2023 16:52:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=U+e1p4sa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4468180564A0; Sun, 12 Nov 2023 16:52:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232682AbjKMAwm (ORCPT + 31 others); Sun, 12 Nov 2023 19:52:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232698AbjKMAwi (ORCPT ); Sun, 12 Nov 2023 19:52:38 -0500 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 372B51BFB for ; Sun, 12 Nov 2023 16:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=uNZI7twh1MCj378W/s61ElwRHXmJFA2B2l6wiFxkiz0=; b=U+e1p4 saoAL4Y1oOx/TTQLZnVYbWwRdR+CkxNl7Ct5ZBhX51sSG6OpZtNNlCplXlXZ+dI0 W/2gZhneNJz4flknFepJIPND1tU5x1XmrrUpgS5reC2MX+avWmTZLiLXeRVrNt6j MNnpdVHspoKZBwblbBYNI/qXLyNFaGLePruZ5OqwVJSZnaUKHHeYk+8d98GoF/Uz IgK4k/DnKBKpNR1SlEfMFkk+/dbVRK7T4ti/B3Y9cNMqx8goyEESmUocyeNCU2mT u7fWJavKYXhlc40SrK0817IqqWJq0w/iczVIYC/VSKWR9AAPUZHH8WT1kfK5ODxe zdSGfopJHBTFqFrQ== Received: (qmail 4084559 invoked from network); 13 Nov 2023 01:52:33 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 13 Nov 2023 01:52:33 +0100 X-UD-Smtp-Session: l3s3148p1@mR7NFf4JCsMMv8XD From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Geert Uytterhoeven , Johan Hovold , linux-kernel@vger.kernel.org Subject: [PATCH v5 3/3] gnss: ubx: add support for the reset gpio Date: Sun, 12 Nov 2023 19:51:51 -0500 Message-Id: <20231113005152.10656-4-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231113005152.10656-1-wsa+renesas@sang-engineering.com> References: <20231113005152.10656-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 12 Nov 2023 16:52:43 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782408034303662932 X-GMAIL-MSGID: 1782408034303662932 The Renesas KingFisher board includes a U-Blox Neo-M8 chip. This chip has a reset pin which is also wired on the board. When Linux starts, reset is asserted by the firmware. Deassert the reset pin when probing this driver. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven --- Changes since v4: * don't touch reset during open/close. Only deassert it during probe. drivers/gnss/ubx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c index 9b76b101ba5e..84cb50670644 100644 --- a/drivers/gnss/ubx.c +++ b/drivers/gnss/ubx.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -64,6 +65,7 @@ static const struct gnss_serial_ops ubx_gserial_ops = { static int ubx_probe(struct serdev_device *serdev) { + struct gpio_desc *reset_gpio; struct gnss_serial *gserial; struct ubx_data *data; int ret; @@ -90,6 +92,13 @@ static int ubx_probe(struct serdev_device *serdev) if (ret < 0 && ret != -ENODEV) goto err_free_gserial; + /* Deassert Reset */ + reset_gpio = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(reset_gpio)) { + ret = PTR_ERR(reset_gpio); + goto err_free_gserial; + } + ret = gnss_serial_register(gserial); if (ret) goto err_free_gserial;