Skip to content

Commit

Permalink
input: pmw3610: add soft reset when no reset pin is available
Browse files Browse the repository at this point in the history
The reset pin on the chip is optional, add a soft reset call when the
reset pin is not specified for the device.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri authored and nashif committed Aug 22, 2024
1 parent f0c053c commit fba0a47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/input/input_pmw3610.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ LOG_MODULE_REGISTER(input_pmw3610, CONFIG_INPUT_LOG_LEVEL);
#define PERFORMANCE_FMODE_MASK (0x0f << 4)
#define PERFORMANCE_FMODE_NORMAL (0x00 << 4)
#define PERFORMANCE_FMODE_FORCE_AWAKE (0x0f << 4)
#define POWER_UP_RESET 0x5a
#define POWER_UP_WAKEUP 0x96
#define SHUTDOWN_ENABLE 0xe7
#define SPI_PAGE0_1 0xff
Expand Down Expand Up @@ -362,6 +363,13 @@ static int pmw3610_configure(const struct device *dev)

gpio_pin_set_dt(&cfg->reset_gpio, 0);

k_sleep(K_MSEC(RESET_DELAY_MS));
} else {
ret = pmw3610_write_reg(dev, PMW3610_POWER_UP_RESET, POWER_UP_RESET);
if (ret < 0) {
return ret;
}

k_sleep(K_MSEC(RESET_DELAY_MS));
}

Expand Down

0 comments on commit fba0a47

Please sign in to comment.