Skip to content

Commit fba0a47

Browse files
fabiobaltierinashif
authored andcommitted
input: pmw3610: add soft reset when no reset pin is available
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]>
1 parent f0c053c commit fba0a47

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/input/input_pmw3610.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ LOG_MODULE_REGISTER(input_pmw3610, CONFIG_INPUT_LOG_LEVEL);
7777
#define PERFORMANCE_FMODE_MASK (0x0f << 4)
7878
#define PERFORMANCE_FMODE_NORMAL (0x00 << 4)
7979
#define PERFORMANCE_FMODE_FORCE_AWAKE (0x0f << 4)
80+
#define POWER_UP_RESET 0x5a
8081
#define POWER_UP_WAKEUP 0x96
8182
#define SHUTDOWN_ENABLE 0xe7
8283
#define SPI_PAGE0_1 0xff
@@ -362,6 +363,13 @@ static int pmw3610_configure(const struct device *dev)
362363

363364
gpio_pin_set_dt(&cfg->reset_gpio, 0);
364365

366+
k_sleep(K_MSEC(RESET_DELAY_MS));
367+
} else {
368+
ret = pmw3610_write_reg(dev, PMW3610_POWER_UP_RESET, POWER_UP_RESET);
369+
if (ret < 0) {
370+
return ret;
371+
}
372+
365373
k_sleep(K_MSEC(RESET_DELAY_MS));
366374
}
367375

0 commit comments

Comments
 (0)