Skip to content

Commit 955cd05

Browse files
alejandroenrique-geotabjhovold
authored andcommitted
gnss: ubx: add support for the safeboot gpio
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@geotab.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20250911-ubx-safeboot-v3-2-32fe6b882a3c@geotab.com [ johan: deassert after requesting supplies ] Signed-off-by: Johan Hovold <johan@kernel.org>
1 parent 0fc1b4b commit 955cd05

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/gnss/ubx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static const struct gnss_serial_ops ubx_gserial_ops = {
6666
static int ubx_probe(struct serdev_device *serdev)
6767
{
6868
struct gnss_serial *gserial;
69+
struct gpio_desc *safeboot;
6970
struct gpio_desc *reset;
7071
struct ubx_data *data;
7172
int ret;
@@ -92,6 +93,13 @@ static int ubx_probe(struct serdev_device *serdev)
9293
if (ret < 0 && ret != -ENODEV)
9394
goto err_free_gserial;
9495

96+
/* Deassert safeboot */
97+
safeboot = devm_gpiod_get_optional(&serdev->dev, "safeboot", GPIOD_OUT_LOW);
98+
if (IS_ERR(safeboot)) {
99+
ret = PTR_ERR(safeboot);
100+
goto err_free_gserial;
101+
}
102+
95103
/* Deassert reset */
96104
reset = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_LOW);
97105
if (IS_ERR(reset)) {

0 commit comments

Comments
 (0)