File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
drivers/sensor/realtek/rts5912 Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,11 @@ struct tach_rts5912_data {
3434 uint16_t count ;
3535};
3636
37- #define COUNT_100KHZ_SEC 100000U
38- #define SEC_TO_MINUTE 60U
39- #define PIN_STUCK_TIMEOUT (100U * USEC_PER_MSEC)
37+ #define COUNT_100KHZ_SEC 100000U
38+ #define SEC_TO_MINUTE 60U
39+ /* Reduced PIN_STUCK checks from 100 to 25 to reduce disruption of the cpu sleep */
40+ #define PIN_STUCK_TIMEOUT (50U * USEC_PER_MSEC)
41+ #define PIN_STUCK_CHECK_INTERVAL (2)
4042
4143int tach_rts5912_sample_fetch (const struct device * dev , enum sensor_channel chan )
4244{
@@ -50,7 +52,8 @@ int tach_rts5912_sample_fetch(const struct device *dev, enum sensor_channel chan
5052
5153 tach -> status = TACHO_STS_CNTRDY ;
5254
53- if (WAIT_FOR (tach -> status & TACHO_STS_CNTRDY , PIN_STUCK_TIMEOUT , k_msleep (1 ))) {
55+ if (WAIT_FOR (tach -> status & TACHO_STS_CNTRDY , PIN_STUCK_TIMEOUT ,
56+ k_msleep (PIN_STUCK_CHECK_INTERVAL ))) {
5457 /* See whether internal counter is already latched */
5558 if (tach -> status & TACHO_STS_CNTRDY ) {
5659 tach -> status = TACHO_STS_CNTRDY ;
You can’t perform that action at this time.
0 commit comments