From patchwork Fri Nov 3 22:55:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 161457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1355055vqu; Fri, 3 Nov 2023 15:56:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBxlRTt6hOXqODt1ogVv6N+KjHnXY5PjZBlo1pUMH+yt9GKvLfOjb1FLak3hQtagp4QeJA X-Received: by 2002:a05:6a20:d90b:b0:181:98d6:6b01 with SMTP id jd11-20020a056a20d90b00b0018198d66b01mr7017159pzb.5.1699052197595; Fri, 03 Nov 2023 15:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699052197; cv=none; d=google.com; s=arc-20160816; b=SC/pdD+SZI0gfyVg5dKz9nrseo15o+/9LNS+GWaPYW1u1Fm5TZM/woEI6K3RuX6FOv ZYM3po7+qx18ynUMWGyGbdQRM85peULC4q8LV9ph2112SNAhNoQhSowEZpR3Ki84mkw1 QzFnBIeTOKP7EklLvyr19tepF6JxCYP5EQGyndx1glMoDo1kdYHtjI0SOTXobZJg5QJs oA19MeHCeYnbPdJAjmGwdYHgauX99XcrGY7kBtk9p8K22dyyG/UoTwYSidTPOBg7Qmg6 GD2byUy3S7TUxl8vQrS1OImmWgsC0ci65tLbEwj9+zpeO1DcFOLDJO7RTa5ZqgKO0DQi WWfQ== 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=EzZ1VatqfWxQhDUcF9TinY3eHHdZUFg/2GJwAA3DgHY=; fh=OlWmP2uhTrj9jFj06aj7UbYW3kh4GkDA9IAtXFWUw6M=; b=q27pBwY1Cnz1mYyRwyUutPkefMsGVVgL0+DH0PlJ32IShq5Iu4SuYhEAL80CGrQ/SI 0pbcvdLLqIsZf3X0qVwZEbOknNCKV/tTm8DXM62RWwGNK8glklQn6dhIXX3wNucqMS+E pr7xIk43Z+hNe54M73mmH88Dspcw3zTCVQ05zMq2havjRmtw2UHU20zrZfUk+GE4KYPV o8qTsxsRmivTpb6d97xPVjsCzWfq0pzCXM5uxAdO6Pnshivag8nJNsYXTpJTZZmBdYUa jMHhl9MOOnKUMCgHBjjZxglHyvjHz+6CqGstThUk1/keLCmsqMKXdtZ46DmsjeAwC0FB iqoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=Dbc1D6qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id kg11-20020a170903060b00b001cc53edcc72si2328545plb.302.2023.11.03.15.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 15:56:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=Dbc1D6qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 3681F81EE2CD; Fri, 3 Nov 2023 15:56:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377938AbjKCW4X (ORCPT + 35 others); Fri, 3 Nov 2023 18:56:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377580AbjKCW4T (ORCPT ); Fri, 3 Nov 2023 18:56:19 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B17AD61 for ; Fri, 3 Nov 2023 15:56:14 -0700 (PDT) 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=EzZ1VatqfWxQhDUcF9TinY3eHHdZUFg/2GJwAA3DgHY=; b=Dbc1D6 qvB92mHgNIf3tzBjiEz1qCDq1h+F791hzbugl3cDUdO1dEMWZ2ZWPmMqyqQd7kWU kKAUzv0Z9BksWJ6ikepqVbtyyRXHYBU7qXyb3YvE+0/QraUgMmJgw5UvMYPc9l2V 49XdF/TPBJHY0xCiLHdGz2cfvXeaHObf8arwfSYkz4cArY9JrBlfMNsuWkqmnuRy 6Bklv7iO2GFwDHdmoMjCQueMkZTOntJwB6Iol/9O5g1DiiaDLlIpQ5JR6VXq1rhf eoBgFcGlun9OUf28p2PqSvhk/N2yLCb5XgsgBt61Kb70aOTs3buPFlnkzJmbD86S WkdPvqBPoP11ogJg== Received: (qmail 1327867 invoked from network); 3 Nov 2023 23:56:12 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Nov 2023 23:56:12 +0100 X-UD-Smtp-Session: l3s3148p1@cWotaUcJAs5ehhrK From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Geert Uytterhoeven , Johan Hovold , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] gnss: ubx: use new helper to remove open coded regulator handling Date: Fri, 3 Nov 2023 23:55:58 +0100 Message-Id: <20231103225601.6499-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231103225601.6499-1-wsa+renesas@sang-engineering.com> References: <20231103225601.6499-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,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 agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 15:56:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781585356986901624 X-GMAIL-MSGID: 1781585356986901624 v_bckp shall always be enabled as long as the device exists. We now have a regulator helper for that, use it. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven --- drivers/gnss/ubx.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c index c951be202ca2..9b76b101ba5e 100644 --- a/drivers/gnss/ubx.c +++ b/drivers/gnss/ubx.c @@ -17,7 +17,6 @@ #include "serial.h" struct ubx_data { - struct regulator *v_bckp; struct regulator *vcc; }; @@ -87,30 +86,16 @@ static int ubx_probe(struct serdev_device *serdev) 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 = devm_regulator_get_enable_optional(&serdev->dev, "v-bckp"); + if (ret < 0 && ret != -ENODEV) + goto err_free_gserial; ret = gnss_serial_register(gserial); if (ret) - goto err_disable_v_bckp; + goto err_free_gserial; return 0; -err_disable_v_bckp: - if (data->v_bckp) - regulator_disable(data->v_bckp); err_free_gserial: gnss_serial_free(gserial); @@ -120,11 +105,8 @@ static int ubx_probe(struct serdev_device *serdev) static void ubx_remove(struct serdev_device *serdev) { struct gnss_serial *gserial = serdev_device_get_drvdata(serdev); - struct ubx_data *data = gnss_serial_get_drvdata(gserial); gnss_serial_deregister(gserial); - if (data->v_bckp) - regulator_disable(data->v_bckp); gnss_serial_free(gserial); } From patchwork Fri Nov 3 22:55:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 161459 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1355111vqu; Fri, 3 Nov 2023 15:56:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbOPjdyekNNJT+H0vzPacDkkBxVpy8UoneSVDh4QuAhnon/LhM1/kNDu7KeM3FcAxwNv+I X-Received: by 2002:a05:6a20:3d02:b0:17e:8326:e4b3 with SMTP id y2-20020a056a203d0200b0017e8326e4b3mr30298776pzi.43.1699052211022; Fri, 03 Nov 2023 15:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699052211; cv=none; d=google.com; s=arc-20160816; b=lRhaHJFtzY9f3TCelPZxENOQwcUi9mc9uhV5MrcmaUSNva29kV5dxuMwngWeR2Jb/+ pLL/7skC4RkgoNteG+C9GgYmFDdUH03dh3qQECLpT8t2ynGuM4on35CBvhBtJ1Dyz5DC 19KXXz2fq7vWSGukpzUgZKPjSONI4s5BujMkHpOfpvf4EUb71pbmtEciKs0kmhVO24Je hHPD+Z55h3DRhlUFOhlly6k723h44mFyTG5gmFuAPMpdVCnv41q2pruop4pADDFOSrwt tgTR0QKWpmgZ6i8CrxzAQ9IQddw5nVo92hi+HL0Q7Y0Ir2gnng7r7qRqDWvJivGg4A7u sa8Q== 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=TiJf9ojlNhxPnbwNmLPWFg4kCpD3p403c86z54PQPYc=; fh=lKIDu7o6PChJqMtvXL5KJ9TxG5mA831gYR4U/JDtSmU=; b=GDqV/ouyn08pvm/5fDUZ3FbStUTbcTjitO6sw6L4sAxVGuu3o4A4JL3rs+xhpEejmi CL389ZKQR8KfVNjIeC8JlDooPUBXIXkwoz7vOcZcKZohdvFBA/hkjMHbb3kFkLpDEqGw Q94XFm9BgRbqniWEkYOq99CVvSNnNSD1mGiWG9QkYocmPFQ4fdW9h5RUYGVB7tw8rTkk P56Z4JmtuKnnYq5RC1luptyQogfS1iKGchl8/JJMvq4a6rzZO8vkbSU5Kie7WzIvtOH4 Qp89Zv5s480QdJHSM2u2+Wvhxbe6vU20FJ6d4EXK5mKSxC7XaWF2vjFCu1MH0c8EM8wv R/Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=l5gDiEJ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e18-20020a056a001a9200b006be0a1e095bsi2491921pfv.183.2023.11.03.15.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 15:56:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=l5gDiEJ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id C6D99806D444; Fri, 3 Nov 2023 15:56:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377940AbjKCW4Z (ORCPT + 35 others); Fri, 3 Nov 2023 18:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377663AbjKCW4U (ORCPT ); Fri, 3 Nov 2023 18:56:20 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C3C7D6A for ; Fri, 3 Nov 2023 15:56:15 -0700 (PDT) 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=TiJf9ojlNhxPnbwNmLPWFg4kCpD3p403c86z54PQPYc=; b=l5gDiE J0Y/10+Tr0gW2tra8ruaauzW5TGXXvtazMBns04VQdHcy2KUfRkR5YcJjq+ofCnx 6uqV8ds+yEYX3uDNly1DjG7GAWbd6x2OoVq3qaKY36VVhEZzv1koMan8JWgzdgVd aS9ZG+7ba+pEx0OFpus+p7v0xaQwBOnScr0AHpZeViWw8W3vUXVp7Wj1I8MJdguq 15iWnXPj2o9JvT3dzqreWoIosMEcU2xmKy1aVFf2aY0TBPF59hYKPlf++9kwm4Sx /Iph2xaQlcyiE42Qp/x5R1zLuc9Mz7hRh34Cdu9kAU2QSCA/5AUcjtcD5MwEo3ER 4eVNYa1G39M1LnWg== Received: (qmail 1327910 invoked from network); 3 Nov 2023 23:56:13 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Nov 2023 23:56:13 +0100 X-UD-Smtp-Session: l3s3148p1@iCk8aUcJCM5ehhrK From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Conor Dooley , Geert Uytterhoeven , Johan Hovold , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/3] dt-bindings: gnss: u-blox: add "reset-gpios" binding Date: Fri, 3 Nov 2023 23:55:59 +0100 Message-Id: <20231103225601.6499-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231103225601.6499-1-wsa+renesas@sang-engineering.com> References: <20231103225601.6499-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,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 fry.vger.email 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 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 15:56:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781585371095898279 X-GMAIL-MSGID: 1781585371095898279 The Renesas KingFisher board includes a U-Blox Neo-M8 chip. This chip has a reset pin which is also wired on the board. Introduce a binding to support this reset pin. Signed-off-by: Wolfram Sang Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven --- Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml index 4835a280b3bf..8e97e475613f 100644 --- a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml +++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml @@ -41,6 +41,9 @@ properties: description: > Backup voltage regulator + reset-gpios: + maxItems: 1 + required: - compatible - vcc-supply @@ -49,10 +52,12 @@ unevaluatedProperties: false examples: - | + #include serial { gnss { compatible = "u-blox,neo-8"; v-bckp-supply = <&gnss_v_bckp_reg>; vcc-supply = <&gnss_vcc_reg>; + reset-gpios = <&gpio 1 GPIO_ACTIVE_LOW>; }; }; From patchwork Fri Nov 3 22:56:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 161458 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1355096vqu; Fri, 3 Nov 2023 15:56:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGSCwHl3Y+VhUPP6SR353uDmNoW/6WY+fuTViZRJWXS1KdJbB7c8yysa81KZx9I+DZSS8DD X-Received: by 2002:a17:902:bd05:b0:1c9:b207:d412 with SMTP id p5-20020a170902bd0500b001c9b207d412mr20444701pls.37.1699052207938; Fri, 03 Nov 2023 15:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699052207; cv=none; d=google.com; s=arc-20160816; b=s5xOl90ssOm3iGmiV10UpyFOQH7AhSy31zrV6ZxDC4qhHXgbKyVp/lmbuORQc9MsuU sFaBXwE2UDD1nX0VCj3MOB3qLg8W9zdDLuwG/d0XnC4c221YbMamsJLkLO15+z92DhmE IBck2IZOGWCGrOtzmM/3tdMiwsTaIsvHRfZZHJhnPTxg8nrCjeeW4Sdb2kT0l2HyWWgp GThJRd2m5+tIo6a++L9jbewt1FG9KeNj32Eu2LUVnosdu+BJwAOanakVs2Nq951xb3ra /x9JZsJ1VY2n277b4l32ryyfcBMnIb1g4WJjmqIKtWvuKd9au0Xweq2yF8aY9P/hCEsJ M/HA== 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=fmrU2g6eF1M/O9NhTkCGo0q8tJfP+vuJFadhZEhBZqk=; fh=VjHho0Qv8oJSt7HJ3RgckH4LAQCZvu5o942PmtSURt4=; b=SUSuAESvBsbw830bZ8wsueJ7qwDWCVxF4w06nGAULnnd+WYYM+RLAdRKVMZQis/yQs QggIDmZPzECA4K15XvYXjh8jL5r2SwNbGOXzhKWcwEm6PUleK1EUrAYxQlr5CzMjrVBZ Zyy4HtEoNdBWkhLUuSgFqig5UgTfcqLVKrNIhHUiovTpsDKk2wH8wf0TgAM1d7Z0JLIO Kg2wNttaL6Jz+Y0SS0m/YovaV8+vKNJnMbx+zOrmePPPWJR9FwM+wVZSCMNMmjnTulD5 AQhV3U7/5dvGansH2WLprclW8Y4xuYE2G2GxWMr6f8ZhI2++2TfqBbzpLKInk9yPYBIr Ro4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=bBNUBHkT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id km15-20020a17090327cf00b001c60c5bbff2si2311719plb.201.2023.11.03.15.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 15:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=bBNUBHkT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id A3646802F08E; Fri, 3 Nov 2023 15:56:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377972AbjKCW42 (ORCPT + 35 others); Fri, 3 Nov 2023 18:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377673AbjKCW4U (ORCPT ); Fri, 3 Nov 2023 18:56:20 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6250ED6F for ; Fri, 3 Nov 2023 15:56:16 -0700 (PDT) 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=fmrU2g6eF1M/O9NhTkCGo0q8tJfP+vuJFadhZEhBZqk=; b=bBNUBH kTPO9XBWgGHWN/xKtJuHwwsT/4ldN0N7Bfhgzj97e8bmNLSdmsfKSwXmQ2a+JTh4 /PSSBjswK0XthI/X0n4JxDWvT6U+g8aS6fYDuITqkgJ5ZeRYI7gJTW2GWQ1ia6dZ JymuzTl+Kdf8Vo4AoAXoiC6RZigjkp2IRONIBVwESm8VPKGSZk+L6Sq3FzSV+vqu KXIgzZp8TmUdoFfyLmpFlO9hT3jngZa0xI8ZaAemMahix3flJ16POcv40EC71HmR 7CDOiJd4wgTKA4v1ys9UhxFMi0RXikbIn0uSJn+/fi4sRY9hvQYltJACHQjXIaJF uGtY5dn4bCkVNh5g== Received: (qmail 1327964 invoked from network); 3 Nov 2023 23:56:14 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Nov 2023 23:56:14 +0100 X-UD-Smtp-Session: l3s3148p1@xx1IaUcJEM5ehhrK From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Geert Uytterhoeven , Johan Hovold , linux-kernel@vger.kernel.org Subject: [PATCH v4 3/3] gnss: ubx: add support for the reset gpio Date: Fri, 3 Nov 2023 23:56:00 +0100 Message-Id: <20231103225601.6499-4-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231103225601.6499-1-wsa+renesas@sang-engineering.com> References: <20231103225601.6499-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,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 lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 15:56:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781585367902542205 X-GMAIL-MSGID: 1781585367902542205 The Renesas KingFisher board includes a U-Blox Neo-M8 chip. This chip has a reset pin which is also wired on the board. Add code to the driver to support this reset pin. Because my GNSS device is hooked up via UART and I2C simultaneously, I could verify functionality by opening/closing the GNSS device using UART and see if the corresponding I2C device was visible on the bus. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven --- drivers/gnss/ubx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c index 9b76b101ba5e..e7d151cbc8c3 100644 --- a/drivers/gnss/ubx.c +++ b/drivers/gnss/ubx.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -18,6 +19,7 @@ struct ubx_data { struct regulator *vcc; + struct gpio_desc *reset_gpio; }; static int ubx_set_active(struct gnss_serial *gserial) @@ -29,6 +31,8 @@ static int ubx_set_active(struct gnss_serial *gserial) if (ret) return ret; + gpiod_set_value_cansleep(data->reset_gpio, 0); + return 0; } @@ -37,6 +41,8 @@ static int ubx_set_standby(struct gnss_serial *gserial) struct ubx_data *data = gnss_serial_get_drvdata(gserial); int ret; + gpiod_set_value_cansleep(data->reset_gpio, 1); + ret = regulator_disable(data->vcc); if (ret) return ret; @@ -90,6 +96,13 @@ static int ubx_probe(struct serdev_device *serdev) if (ret < 0 && ret != -ENODEV) goto err_free_gserial; + /* Start with reset asserted */ + data->reset_gpio = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(data->reset_gpio)) { + ret = PTR_ERR(data->reset_gpio); + goto err_free_gserial; + } + ret = gnss_serial_register(gserial); if (ret) goto err_free_gserial;