Waits until SCL goes high. Prints a contextual error message on timeout. */
| 59 | |
| 60 | /* Waits until SCL goes high. Prints a contextual error message on timeout. */ |
| 61 | static int wait_for_scl(unsigned int bus, const char *error_context) |
| 62 | { |
| 63 | if (!__wait(bus, TIMEOUT_US, 1)) { |
| 64 | printk(BIOS_ERR, "software_i2c(%d): ERROR: Clock stretching " |
| 65 | "timeout %s!\n", bus, error_context); |
| 66 | return ERR_TIMEOUT; |
| 67 | } |
| 68 | |
| 69 | return 0; |
| 70 | } |
| 71 | |
| 72 | static int start_cond(unsigned int bus) |
| 73 | { |
no test coverage detected