Skip to content

Commit 0b9598d

Browse files
committed
drivers: sensor: Explicitly deassert reset on GNSS (#170)
Fixed GNSS driver to function without board explicitly de-asserting the reset line. Signed-off-by: Jared Baumann <jared.baumann8@t-mobile.com>
1 parent 0102e49 commit 0b9598d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

drivers/sensor/cxd5605/cxd5605.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct drv_data {
6363
int aux;
6464
};
6565

66-
void driver_cxd5605_nmea_cb(struct gnss_global_data *pvt)
66+
static void driver_cxd5605_nmea_cb(struct gnss_global_data *pvt)
6767
{
6868
#ifdef DEBUG
6969
memcpy(&drv_data->pvt, pvt, sizeof(struct gnss_global_data));
@@ -102,7 +102,7 @@ void driver_cxd5605_nmea_cb(struct gnss_global_data *pvt)
102102
* @return nothing
103103
*
104104
*/
105-
void driver_cxd5605_resp_cb(struct cxd5605_data *drv_data,
105+
static void driver_cxd5605_resp_cb(struct cxd5605_data *drv_data,
106106
struct cxd5605_cmd_data *cxd5605_cmd_data,
107107
int cmd, int ret)
108108
{
@@ -146,7 +146,7 @@ void driver_cxd5605_resp_cb(struct cxd5605_data *drv_data,
146146
* @return returns an error (-ENODEV) if the i2c bus is not ready
147147
*
148148
*/
149-
int init(const struct device *dev)
149+
static int init(const struct device *dev)
150150
{
151151
const struct cxd5605_config *cfg = dev->config;
152152
struct cxd5605_data *drv_data = dev->data;
@@ -168,6 +168,8 @@ int init(const struct device *dev)
168168
/* save this driver instance for passing to other functions */
169169
drv_data->cxd5605_dev = dev;
170170

171+
result = gpio_pin_configure_dt(&cfg->rst_gpio, GPIO_OUTPUT_HIGH);
172+
171173
return result;
172174
}
173175

@@ -591,7 +593,7 @@ static int cxd5605_attr_set(const struct device *dev,
591593
case SENSOR_ATTR_CXD5605_CALLBACK:
592594
init(dev);
593595
LOG_DBG("Got CXD5605_ALERT_INTERRUPTS\n");
594-
setup_interrupts(dev);
596+
cxd5605_setup_interrupts(dev);
595597
/* setup shim callbacks */
596598
#ifdef DEBUG
597599
printf("[driver] register driver callback\n");
@@ -630,7 +632,7 @@ static const struct sensor_driver_api cxd5605_driver_api = {
630632
* @return 0 if successful, negative errno code if failure
631633
*
632634
*/
633-
int setup_interrupts(const struct device *dev)
635+
int cxd5605_setup_interrupts(const struct device *dev)
634636
{
635637
int result;
636638
struct cxd5605_data *drv_data = dev->data;
@@ -681,7 +683,6 @@ static int cxd5605_driver_pm_action(const struct device *dev,
681683
enum pm_device_action action)
682684
{
683685
const struct cxd5605_config *config = dev->config;
684-
const struct gpio_dt_spec *pwr_gpio = &config->pwr_gpio;
685686
const struct gpio_dt_spec *rst_gpio = &config->rst_gpio;
686687

687688
int result = 0;

drivers/sensor/cxd5605/cxd5605.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#include <zephyr/drivers/sensor.h>
1414
#include <zephyr/drivers/gpio.h>
1515

16-
int setup_interrupts(const struct device *dev);
16+
int cxd5605_setup_interrupts(const struct device *dev);
1717

1818
#endif /* ZEPHYR_DRIVERS_SENSOR_CXD5605_CXD5605_H_ */

0 commit comments

Comments
 (0)