usb: typec: ucsi: add support for Cypress CCGx
PATCH v13 2/2 usb: typec: ucsi: add support for Cypress CCGx
Quoted 16 lines · Ajay Gupta
Hi Heikki and Andy
[...]Quoted 14 lines
Quoted 14 lines
Quoted 1 line
Shouldn't you return
-ETIMEDOUTif count == 0?Yes. Good catch. Does the below fix looks ok?
do { status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, sizeof(data)); if (status < 0) return status; usleep_range(10000, 11000); status = ccg_read(uc, CCGX_RAB_INTR_REG, &data, sizeof(data)); if (status < 0) return status;
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
if (!data) return 0; } while (data && count--);Doesn't that condition break out of the loop immediately?
How? I didn't get your point? We want to break out when data is zero (interrupt status cleared).
Sorry Ajay. My brain interpreted that "while" as an "if" statement :-)
thanks,