From: Johan Hovold <johan@kernel.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] gnss: ubx: add support for the reset gpio
Date: Mon, 6 Nov 2023 15:26:07 +0100 [thread overview]
Message-ID: <ZUj3fzArgPU4kYYT@hovoldconsulting.com> (raw)
In-Reply-To: <20231103225601.6499-4-wsa+renesas@sang-engineering.com>
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
next prev parent reply other threads:[~2023-11-06 14:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 22:55 [PATCH v4 0/3] gnss: ubx: support the reset pin of the Neo-M8 variant Wolfram Sang
2023-11-03 22:55 ` [PATCH v4 1/3] gnss: ubx: use new helper to remove open coded regulator handling Wolfram Sang
2023-11-03 22:55 ` [PATCH v4 2/3] dt-bindings: gnss: u-blox: add "reset-gpios" binding Wolfram Sang
2023-11-03 22:56 ` [PATCH v4 3/3] gnss: ubx: add support for the reset gpio Wolfram Sang
2023-11-06 14:26 ` Johan Hovold [this message]
2023-11-06 20:06 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZUj3fzArgPU4kYYT@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox