usb: typec: ucsi: add support for Cypress CCGx
PATCH v14 2/2 usb: typec: ucsi: add support for Cypress CCGx
Quoted 14 lines · On Thu, Oct 25, 2018 at 03:33:53PM -0700, [email protected] wrote:
Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over I2C interface.
This UCSI I2C driver uses I2C bus driver interface for communicating with Type-C controller.
(quoted diff) +8
-0+ /* + * Flush CCGx RESPONSE queue by acking interrupts. Above ucsi control + * register write will push response which must be cleared. + */ + do { + status = ccg_read(uc, CCGX_RAB_INTR_REG, &data, sizeof(data)); + if (status < 0) + return status;
Review
Quoted 10 lines
(quoted diff) +10
-0+ + if (!data) + return 0; + + status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, sizeof(data)); + if (status < 0) + return status; + + usleep_range(10000, 11000); + } while (data && --count);
I don't see any point to check data here. How can it be different from the check above?
Quoted 1 line
(quoted diff) +1
-0+ return -ETIMEDOUT;