From patchwork Thu Sep 21 13:31: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: 143171 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5323313vqi; Thu, 21 Sep 2023 21:49:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0JFwUD2UqDwP4ZEAyqYQSVR5xIwDW7GAYIkaMvAS4aDb/mXoxfvEaC3YhADeqCCoZ4p5Q X-Received: by 2002:a17:902:8c93:b0:1c3:94a4:34bd with SMTP id t19-20020a1709028c9300b001c394a434bdmr6205434plo.40.1695358156271; Thu, 21 Sep 2023 21:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695358156; cv=none; d=google.com; s=arc-20160816; b=XmfjgDbosozag34dBrD/ZCxzS4YGKBNJaRUC9L2g4qT6pDHLxFp5Shsb6F6dpVHeA0 9B/H+JskXJIxFiBRMvHeFxlkdK7gDdbR/fPm8fbTIkwi5keaLWlwKfrmG5gxF9YMooQJ EsuLgJbYeNGNr17B1oMbuHE78BGWNB62zdjyBpisqj9KfoJqp8sxfv/QP+Dei8mmK9a6 vUvii8KFWUWtj8Th77pQ3jDDkQhqwrLa+PHoXm+7a4t6LwztQZFb2l8Mk8eE/zOhtw6z rKk5Y+50GB8CeQv+grt94VFEE5lDA95uKyV9jNteZCrKSATzH/pdZcW8iOxV/4sBC3DG ahAA== 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=reNjgn7kzxEQb9z6cW/jNxTVl6+01ScVNkgoX1V0cyvr0awLxZBYWNvuJ8DxyEhhNk bFly1ntrQ59K1qsomzwFBqHCYVy/ehODwnY8D/pTwCcWk0TM7kT5EtCsFJ6aCAZSrk4J WvCmmpk/HbDR/GtA4frxAATKDEqn3OgtQ+uG8Ug5I7Wxi9emTcMWX8eHZYMHt8SFs5fI SP2HPP4Mt9aT0EOjYEkDulwCfwXCJ4aTE+8hYQcKQQz8aajrDfZh+/gTW/fJQ/qNKpDD N9rTVaXUkHgXc8rLPKjQOlhkpC7WA7BOCrCC+Q6IikzxezneOq3qKOKOV8IWu+bbs1k0 5k+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=mTg4dG+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id jf11-20020a170903268b00b001bb0fb5e06csi2778546plb.483.2023.09.21.21.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 21:49:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=mTg4dG+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id C099484DBA1A; Thu, 21 Sep 2023 13:47:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232341AbjIUUr0 (ORCPT + 29 others); Thu, 21 Sep 2023 16:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbjIUUrE (ORCPT ); Thu, 21 Sep 2023 16:47:04 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4CEE73AE4 for ; Thu, 21 Sep 2023 10:33:59 -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=mTg4dG +Bianf3DPRxaKs/gI0sSQdDTF7OZfMlNMJyJ4FqfW2azWnc2X+Q4sXv2hRvAiCeH ySPUkkqDLt3aego4DZRtiNMREMZTDI3SWROP7qUVColMvchseP5Ip96XFZkNHbuP IXe8wY9pzghVOWFmQo3InOtiSD/NTQyIOL7shtXND9FgudwaOS6bHoUYCMebC+Ey YZgu2+THXTysZQS2EzdA00Z3X+fPQu8vsL8535ikI2/08llCtLyXn3iKze1mWpZ8 aJAvHVkkSiQWj49OYW1IR+eoJ4TAnZsQHtjuwXIB2NeH7rv3J2Da6Sk+DxRxIEX4 tPCYFJ2GZhkPzqaw== Received: (qmail 964388 invoked from network); 21 Sep 2023 15:32:11 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Sep 2023 15:32:11 +0200 X-UD-Smtp-Session: l3s3148p1@1UDphN4FgmUuciJ+ 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 v3 1/3] gnss: ubx: use new helper to remove open coded regulator handling Date: Thu, 21 Sep 2023 15:31:59 +0200 Message-Id: <20230921133202.5828-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230921133202.5828-1-wsa+renesas@sang-engineering.com> References: <20230921133202.5828-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, URIBL_BLOCKED autolearn=ham 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 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:47:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777711873877437301 X-GMAIL-MSGID: 1777711873877437301 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 Thu Sep 21 13:32: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: 143176 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5324247vqi; Thu, 21 Sep 2023 21:52:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXHUneoZmA/qWUsRJ0mljoqbRZpswvYr3nEB2070VJaXI/2Rb9TIx7m0NPxFtXyuw/ATYV X-Received: by 2002:a05:6a20:1444:b0:140:2ec5:2bd3 with SMTP id a4-20020a056a20144400b001402ec52bd3mr2339933pzi.27.1695358364318; Thu, 21 Sep 2023 21:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695358364; cv=none; d=google.com; s=arc-20160816; b=VjDFY7y4PsLKGfLBJIHaJFOK0zN4mnVIne9KJiURnQkTtc9mqpmxTxK//PpgLwEW8U 1Ig6mf0baPLxiRoLzPSd1thx1lsKKliRJpp5go3F/5iD/I5KoQ/w8w+I+pP5t/ViKNqZ nbVYEqsdk+FskOuw/Zr7E++qIihHDZa2c6gMn2uQvXimBfch39RlAJSyPdRoYcxEcBdu 0FsKSfZtTtwPQFQM+CP2Jqqcw9P5j9gbOFpUORRFpHkvbHv5E1VQTdPY6AYe4i0Wj0Qx 12b1JkA02tYdjaY4nlow8re3rw00mPpGEFxwdpWsJje2FHDRdyD734JNUQWQGI5PoLLu VZWQ== 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=P2UTB5t8XD9NtlqSsq8WH+UKGF31k4LPyuXnRCJcSsU=; fh=lKIDu7o6PChJqMtvXL5KJ9TxG5mA831gYR4U/JDtSmU=; b=d1mbcut19iZTcndxFDHDi0ApkJ6dgofXvEh+Ii4k8UN7I11o+bMDepSkw6gJE/Df+9 u7Jsw98j5bJb9wjZ+4E+y2+G9Hf1MB+Wc1/bFpWCtjKGJPBFhCJiDqFLgNyF92WuwC21 5EImv9Lan/MOzCwxmNBsknSAjgtB2VZppYmvLCckzr1OZ/30MxvEdXdz3YsA/tr+plEx NZIIsvXyW0A7+eds6srCfejK+Xzr9I+uNCc7us13o2f3eKXJLwxdto/nekDHzv3pNUeQ txsDuAXS7kQwLgyUDL8DlHhU1UaFsZEm+qsbyQJ2tRCP2L0KP67OT74M1lut6HHEriJ3 XNdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=aQRTvRIo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a18-20020a63d412000000b00578b1a60710si3047250pgh.552.2023.09.21.21.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 21:52:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=aQRTvRIo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 68F8F83339D3; Thu, 21 Sep 2023 16:20:34 -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 S229877AbjIUXUY (ORCPT + 29 others); Thu, 21 Sep 2023 19:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbjIUXUU (ORCPT ); Thu, 21 Sep 2023 19:20:20 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DAD478BF1 for ; Thu, 21 Sep 2023 10:34:11 -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=P2UTB5t8XD9NtlqSsq8WH+UKGF31k4LPyuXnRCJcSsU=; b=aQRTvR IoCDhpscqTqS5VyqB969XMkC7KAhmznJ6gBMwQb1g1R7DPY64LTt/yzJOMrq7CWD C0h6BfMfn2sR8cYw/0BCkgxE06v4opOIJA4pqlTX77OxMeMEg9ynsFhTZka6OW+g eEwQkRArMvYq3rfrFtPIktzJihiUbeUzkfQDpdF1tAQpyP4H5VxTmZt5lXDlDdDQ OnWIdM6VUbgA/WeiMQ/9BGPYRuyuv9qZhuawB+VWA1EJNZsfsd8dKhMsnCz2X0yy 51najsSf09NGgEgYyWml7ju2tHDYB+LlikF3jQn96M3Z07f5RhIRnhS4Xn+w/eFc Ft+LEjQ9mCueLt1w== Received: (qmail 964439 invoked from network); 21 Sep 2023 15:32:12 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Sep 2023 15:32:12 +0200 X-UD-Smtp-Session: l3s3148p1@qKP8hN4FxgcuciJ+ 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 v3 2/3] dt-bindings: gnss: u-blox: add "reset-gpios" binding Date: Thu, 21 Sep 2023 15:32:00 +0200 Message-Id: <20230921133202.5828-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230921133202.5828-1-wsa+renesas@sang-engineering.com> References: <20230921133202.5828-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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]); Thu, 21 Sep 2023 16:20:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777712092580913338 X-GMAIL-MSGID: 1777712092580913338 Needed to enable this chip on a Renesas KingFisher board. Description copied over from the Mediatek driver which already supports it. 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 Thu Sep 21 13:32:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 143063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5254582vqi; Thu, 21 Sep 2023 18:27:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXC3lPf2q6GLkjcT3ADTIDM7vwz+S+dVUGLs0mmQkN4VgGIAxJgbbiWH637VRb3K6m82Wk X-Received: by 2002:a05:6a00:84e:b0:686:24e1:d12e with SMTP id q14-20020a056a00084e00b0068624e1d12emr7551235pfk.30.1695346066819; Thu, 21 Sep 2023 18:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695346066; cv=none; d=google.com; s=arc-20160816; b=rK5+eO7yxHeRmNY0GxWc+d7s6buievlZxSX67na7Rgxfk0e1d8ywW4IvwU8abtoDvq ebzAxnxrUPn13Pii7FS5NGVZ0yfdPJz+mDZVMvkDVOVCQtJwKbISfjjuXmesjvk9rwj/ 2LJ7xCmeTRGc0Ofg7euxsarCRxbrxpDfwjivFn59Eyfe1HlSt0ICn1jwrt5MB28Lr2C7 HSzYYqVf+7fbKDFmNjuVM9SmGKN71nwelZTuLXD9G8eUFmRrbdZ6Ud5H25xPSoKSlC3G jcvhN+fbI0+vevMgggWOO3oZD34uIjPhPoPTj2K/U1+KVx2vawKSqncvaaXAZwJm7cc6 EXdQ== 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=uK9AT+p6I3q5cMU/FhQSmJyxMmdzZujBNmfXxX9OQ/Y=; fh=VjHho0Qv8oJSt7HJ3RgckH4LAQCZvu5o942PmtSURt4=; b=QcZpDmyITTQ8+KOqueEy/Ms7zCn4Dx706Wbs01mF2q4LIDb+IE3QR2yWbt64vMHg6y vt6mksBQR4j3pe/6PfUfdVlEXuASxSB70KBkpB2MMzFG4oGuY/fBEMXE14ugJaNNIgTN 21rALnAzm0A3/MREFKNpVlMRV/5ErBTJ9OYrt/OwX5cXiPNbToGUIjtmvHzSYarUMWwP rlhOzCwza7Xr9WzvSP3w8VBxmkRdXHKXU/6TPo55sXwm+l3yCCHkLovB6z9K7ImMH1MP cTZhA/LvMd0z6Ce3wUHsGJW1JfcFFU4ekejvoOVjqb7goLrJR/hcD6mwMZuIfSt3Malc qg6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b="Ws/F0yIJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y30-20020a056a001c9e00b00686e01db946si2665211pfw.64.2023.09.21.18.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 18:27:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b="Ws/F0yIJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 6505F8363C90; Thu, 21 Sep 2023 13:17:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbjIUURN (ORCPT + 29 others); Thu, 21 Sep 2023 16:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbjIUUQr (ORCPT ); Thu, 21 Sep 2023 16:16:47 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F28B86E453 for ; Thu, 21 Sep 2023 11:58:55 -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=uK9AT+p6I3q5cMU/FhQSmJyxMmdzZujBNmfXxX9OQ/Y=; b=Ws/F0y IJEUCwYVDuBG8XEfGaRJOOmpS8LZ1ZxuugbH7mpzb9f7oJZq3wD3GmogwiFcof0U Q1l3H/AzKU8TUCiu0bQ5G5onMskbG8xMfleaDnkazoVXu5HXVfNZg2NfjELPgLWj cqBz/ZyrcF8Mj6YEgwLQPECsA73JSU2aln8IVfMSdQQY61GgFHPkIFHHwmL8Q7MQ ZZ8zdV2LM4z8mgxFS2nQ2R9N/ncsB9T5b3eRKXq/E3arY2FWc2zYO/aDWgqhW2zY NEpzmZ9zPFBC2wJ31UjWnbpqyJP1jtWIyNBigtjOkRONIsMlFW95BeLpxqzCVuHS Eop8gWjP3hHFcmyg== Received: (qmail 964496 invoked from network); 21 Sep 2023 15:32:14 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Sep 2023 15:32:14 +0200 X-UD-Smtp-Session: l3s3148p1@tYwShd4FDUIuciJ+ From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Geert Uytterhoeven , Johan Hovold , linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] gnss: ubx: add support for the reset gpio Date: Thu, 21 Sep 2023 15:32:01 +0200 Message-Id: <20230921133202.5828-4-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230921133202.5828-1-wsa+renesas@sang-engineering.com> References: <20230921133202.5828-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:17:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777699197215155184 X-GMAIL-MSGID: 1777699197215155184 Tested with a Renesas KingFisher board. 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;