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 {
34
34
uint16_t count ;
35
35
};
36
36
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)
40
42
41
43
int tach_rts5912_sample_fetch (const struct device * dev , enum sensor_channel chan )
42
44
{
@@ -50,7 +52,8 @@ int tach_rts5912_sample_fetch(const struct device *dev, enum sensor_channel chan
50
52
51
53
tach -> status = TACHO_STS_CNTRDY ;
52
54
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 ))) {
54
57
/* See whether internal counter is already latched */
55
58
if (tach -> status & TACHO_STS_CNTRDY ) {
56
59
tach -> status = TACHO_STS_CNTRDY ;
You can’t perform that action at this time.
0 commit comments