mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Johan Hovold <johan@kernel.org>,
	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	[thread overview]
Message-ID: <20231113005152.10656-4-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20231113005152.10656-1-wsa+renesas@sang-engineering.com>

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 <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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 <linux/errno.h>
 #include <linux/gnss.h>
+#include <linux/gpio/consumer.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -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;
-- 
2.35.1


  parent reply	other threads:[~2023-11-13  0:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13  0:51 [PATCH v5 0/3] gnss: ubx: support the reset pin of the Neo-M8 variant Wolfram Sang
2023-11-13  0:51 ` [PATCH v5 1/3] gnss: ubx: use new helper to remove open coded regulator handling Wolfram Sang
2023-11-13  0:51 ` [PATCH v5 2/3] dt-bindings: gnss: u-blox: add "reset-gpios" binding Wolfram Sang
2023-11-13  0:51 ` Wolfram Sang [this message]
2023-12-12  3:30 ` [PATCH v5 0/3] gnss: ubx: support the reset pin of the Neo-M8 variant Wolfram Sang
2023-12-14 15:53   ` Wolfram Sang
2023-12-15  8:34     ` Johan Hovold
2023-12-15 20:15       ` 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=20231113005152.10656-4-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=geert+renesas@glider.be \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®