mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
0fc1b4b6fd
commit
955cd0545b
|
|
@ -66,6 +66,7 @@ static const struct gnss_serial_ops ubx_gserial_ops = {
|
||||||
static int ubx_probe(struct serdev_device *serdev)
|
static int ubx_probe(struct serdev_device *serdev)
|
||||||
{
|
{
|
||||||
struct gnss_serial *gserial;
|
struct gnss_serial *gserial;
|
||||||
|
struct gpio_desc *safeboot;
|
||||||
struct gpio_desc *reset;
|
struct gpio_desc *reset;
|
||||||
struct ubx_data *data;
|
struct ubx_data *data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
@ -92,6 +93,13 @@ static int ubx_probe(struct serdev_device *serdev)
|
||||||
if (ret < 0 && ret != -ENODEV)
|
if (ret < 0 && ret != -ENODEV)
|
||||||
goto err_free_gserial;
|
goto err_free_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;
|
||||||
|
}
|
||||||
|
|
||||||
/* Deassert reset */
|
/* Deassert reset */
|
||||||
reset = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_LOW);
|
reset = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_LOW);
|
||||||
if (IS_ERR(reset)) {
|
if (IS_ERR(reset)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue