Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2158466rdf; Mon, 6 Nov 2023 06:26:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGHgEvvw0j/gvf/NKZ7PON2vLHvEFBeCxsXGWWGAutbHH+yur5MVT+BDW5YeslHle+UO3L X-Received: by 2002:a05:6a20:8e24:b0:17f:f8f3:ea51 with SMTP id y36-20020a056a208e2400b0017ff8f3ea51mr22487844pzj.20.1699280771857; Mon, 06 Nov 2023 06:26:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699280771; cv=none; d=google.com; s=arc-20160816; b=a7wciKsTBf8gNP7a7aTCR4TkXsBA6DggWlZF+zDbD2vj1kmX721ccBs0ak0Ys+SUdb BO56b7cF4P94/fyaO7idD8/ZgwuQrW9OI/Rw+Wa19EzCNxlVV1CdlvmVaqtDbhgZiG3k 0+0joza4L02YD20v7mXnHala8Gm7RXd3UmSAiukyvrnhXjJcawFoW5QqU/WuGB7hwkis 45UoRya8Qb6lhViktOuPEqSIVwKYffedu7IL9sQFY0lvNkVBr9knDAFBIvm6E3f9ds8j E98rmpsaqhVGtU/yc+mGvJPSvHXZbY1k2KE/UOx5tQr5a+6XeyTmG0nGcxKuTjAZX760 jcEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xhSXAbeVmj0rHpebio76wCI2+VtgmZpNSBoO2hpin6s=; fh=lWZuwTq+eHv/RINm3VqkhNbQGloveH3ap6ACoCqy3vQ=; b=nuH9wK6CpWPF6XbXw3On5RL2t4fv0zWFMVlEFCctZU+tge7H+lo8ZAyvD9E3X2iLkG SCuTXPIiOr7+g1p4ErOVtSjqvsIVD4nadAaeR9VzjW3JLGnNZkbHxnTpNn3Spl9PgpBR N0Nd8xzKz4UKqwwL6PRVc0FSFtYxpWwvOkXGZwRD1kB9TvrZY65zAAFkE34dH0L0cxGd s5sPrPFcFh4txxM8zGINZ9LqOyI0qJGzjukmidqrt2qS1sjAOKpMDmCbyhXisK5E36X6 Tv5bkXAcVrjbgwDutW9sM34xnQa3Q1GszY7zNqXV2G3TzOdegClCMr0uifURrV10mOg0 fDig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dfuahSDA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id kv11-20020a17090328cb00b001c9b2c2644bsi7671750plb.451.2023.11.06.06.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:26:11 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=dfuahSDA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D65DE80505D1; Mon, 6 Nov 2023 06:25:43 -0800 (PST) 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 S231738AbjKFOZ0 (ORCPT + 99 others); Mon, 6 Nov 2023 09:25:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231358AbjKFOZZ (ORCPT ); Mon, 6 Nov 2023 09:25:25 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD4A9C6; Mon, 6 Nov 2023 06:25:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77C91C433C8; Mon, 6 Nov 2023 14:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699280722; bh=HY3kSLldl7rK8Qt1R1njkwITH3UB/c7/iTo+eGw2/5g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dfuahSDA/ik+wqTm44m7fP26rdFTxfGHXXZAKtyCwwZL+BxZTfimvszIss7cGXVMK kta0oN61FDmSKiy356qtTiM36ZO08ms5xIsA/Wdu3q5PiG+VeFI5HGGD0BrCdwv3ry Uiw0Q1gnPy4/4MXy6Y0Zr4iTtshf0OMxdXWVrTvc3zYo3pNLPnO8MTS5H+l0yZfAn0 CVi2wIg/VJ8PGrZMoBZ4SVGP1lC1Rf1cli4TI36cIxzjPv6MaPFEgtZSyEd/aV3gR3 JBvEwolJGEI4j3CM3NHHGz7cQt5ObIFJSE0aHoePGuSNLHbPOj3J0pXIuu2eEt/nhK 0+dPGI19MJMfw== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1r00YJ-0000Ob-2S; Mon, 06 Nov 2023 15:26:08 +0100 Date: Mon, 6 Nov 2023 15:26:07 +0100 From: Johan Hovold To: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/3] gnss: ubx: add support for the reset gpio Message-ID: References: <20231103225601.6499-1-wsa+renesas@sang-engineering.com> <20231103225601.6499-4-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231103225601.6499-4-wsa+renesas@sang-engineering.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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]); Mon, 06 Nov 2023 06:25:44 -0800 (PST) On Fri, Nov 03, 2023 at 11:56:00PM +0100, Wolfram Sang wrote: > 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. > 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; So as I just replied to you v3, the hardware integration manual for NEO-M8 and the datasheets for some of the other modules explicitly says that the RESET_N pin should not be used this way: 1.5 I/O pins RESET_N: Reset input Driving RESET_N low activates a hardware reset of the system. Use this pin only to reset the module. Do not use RESET_N to turn the module on and off, since the reset state increases power consumption. (and AFAIU you should generally not try to use reset this way unless it is explicitly said to be supported). Johan