Lines Matching +full:pins +full:- +full:sda +full:- +full:scl
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
32 * Helper code to recover a hung i2c bus by bit-banging a recovery sequence.
35 * The most common cause is a partially-completed transaction such as rebooting
44 * embedded i2c controllers, the i2c pins can be temporarily reassigned as gpio
45 * pins to do the bus recovery, then can be assigned back to the i2c hardware.
58 iic_recover_bus(struct iicrb_pin_access *pins) in iic_recover_bus() argument
67 pins->setsda(pins->ctx, 1); in iic_recover_bus()
68 pins->setscl(pins->ctx, 1); in iic_recover_bus()
71 * At this point, SCL should be high. If it's not, some slave on the in iic_recover_bus()
72 * bus is doing clock-stretching and we should wait a while. If that in iic_recover_bus()
75 * cheap eeprom has a max post-write delay of only 10ms), and also long in iic_recover_bus()
79 if (pins->getscl(pins->ctx)) in iic_recover_bus()
96 if (pins->getsda(pins->ctx)) in iic_recover_bus()
100 pins->setscl(pins->ctx, 0); in iic_recover_bus()
102 pins->setscl(pins->ctx, 1); in iic_recover_bus()
111 * - START: SDA transitions high->low while SCL remains high. in iic_recover_bus()
112 * - STOP: SDA transitions low->high while SCL remains high. in iic_recover_bus()
116 pins->setsda(pins->ctx, 0); in iic_recover_bus()
118 pins->setsda(pins->ctx, 1); in iic_recover_bus()