Commit 0cbbbe09 authored by Wolfram Sang's avatar Wolfram Sang Committed by Johan Hovold

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
[ johan: rename gpio descriptor variable ]
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent aba9f8b0
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/gnss.h> #include <linux/gnss.h>
#include <linux/gpio/consumer.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -65,6 +66,7 @@ static const struct gnss_serial_ops ubx_gserial_ops = { ...@@ -65,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 *reset;
struct ubx_data *data; struct ubx_data *data;
int ret; int ret;
...@@ -90,6 +92,13 @@ static int ubx_probe(struct serdev_device *serdev) ...@@ -90,6 +92,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 reset */
reset = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(reset)) {
ret = PTR_ERR(reset);
goto err_free_gserial;
}
ret = gnss_serial_register(gserial); ret = gnss_serial_register(gserial);
if (ret) if (ret)
goto err_free_gserial; goto err_free_gserial;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment