Skip to content

Commit 0cbbbe0

Browse files
Wolfram Sangjhovold
authored andcommitted
gnss: ubx: add support for the reset gpio
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 <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> [ johan: rename gpio descriptor variable ] Signed-off-by: Johan Hovold <[email protected]>
1 parent aba9f8b commit 0cbbbe0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gnss/ubx.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/errno.h>
99
#include <linux/gnss.h>
10+
#include <linux/gpio/consumer.h>
1011
#include <linux/init.h>
1112
#include <linux/kernel.h>
1213
#include <linux/module.h>
@@ -65,6 +66,7 @@ static const struct gnss_serial_ops ubx_gserial_ops = {
6566
static int ubx_probe(struct serdev_device *serdev)
6667
{
6768
struct gnss_serial *gserial;
69+
struct gpio_desc *reset;
6870
struct ubx_data *data;
6971
int ret;
7072

@@ -90,6 +92,13 @@ static int ubx_probe(struct serdev_device *serdev)
9092
if (ret < 0 && ret != -ENODEV)
9193
goto err_free_gserial;
9294

95+
/* Deassert reset */
96+
reset = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_LOW);
97+
if (IS_ERR(reset)) {
98+
ret = PTR_ERR(reset);
99+
goto err_free_gserial;
100+
}
101+
93102
ret = gnss_serial_register(gserial);
94103
if (ret)
95104
goto err_free_gserial;

0 commit comments

Comments
 (0)