[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250514-ubx-safeboot-v1-2-1ae771335356@geotab.com>
Date: Wed, 14 May 2025 15:54:42 +0200
From: Alejandro Enrique via B4 Relay <devnull+alejandroe1.geotab.com@...nel.org>
To: Johan Hovold <johan@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Alejandro Enrique <alejandroe1@...tab.com>
Subject: [PATCH 2/2] gnss: ubx: add support for the safeboot gpio
From: Alejandro Enrique <alejandroe1@...tab.com>
U-Blox M8/M9 chip have a pin to start it in safeboot mode, to be used
to recover from situations where the flash content has become
corrupted and needs to be restored. If this pin is asserted at power
up/reset, the receiver starts in safeboot mode and GNSS operation is
disabled.
Deassert the safeboot pin when probing this driver.
Signed-off-by: Alejandro Enrique <alejandroe1@...tab.com>
---
drivers/gnss/ubx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c
index 92402f6082c415c7b9051338eef5406b09e09455..1d6acace84f76f8d5d2eacdbbf5ab7a934b33486 100644
--- a/drivers/gnss/ubx.c
+++ b/drivers/gnss/ubx.c
@@ -67,6 +67,7 @@ static int ubx_probe(struct serdev_device *serdev)
{
struct gnss_serial *gserial;
struct gpio_desc *reset;
+ struct gpio_desc *safeboot;
struct ubx_data *data;
int ret;
@@ -82,6 +83,13 @@ static int ubx_probe(struct serdev_device *serdev)
data = gnss_serial_get_drvdata(gserial);
+ /* Deassert safeboot */
+ safeboot = devm_gpiod_get_optional(&serdev->dev, "safeboot", GPIOD_OUT_LOW);
+ if (IS_ERR(safeboot)) {
+ ret = PTR_ERR(safeboot);
+ goto err_free_gserial;
+ }
+
data->vcc = devm_regulator_get(&serdev->dev, "vcc");
if (IS_ERR(data->vcc)) {
ret = PTR_ERR(data->vcc);
--
2.34.1
Powered by blists - more mailing lists