On 20.05.2020 19:27, Wolfram Sang wrote: > >>> This will do for 5.7. For 5.8 or 5.9, I can imagine to take the two >>> pinctrl_state pointers into bus_recovery_info and handle all this in the >>> core. I will try this later this week if noone is super-eager to try it >>> out before. >>> >> >> By 'all this' you mean to move the entire function in the core, right? >> Having just these two pointers bus_recinovery_info won't help much. I >> can try it, if you haven't already started... > > I mean to add those two pointers to bus_recinovery_info and if they are > populated, then the I2C core is doing the necessary magic (or maybe just > the pinctrl handle and assume the states have fixed names?). Russell > just sent patches to add it to the PXA driver, so we could now double > check how much could be factored out. > > I haven't started yet, let's keep in touch who started first :) > I started working at this. I added the pinctrl state initialization at the beginning of the i2c_init_recovery(). Due to the pinmux state issue with the GPIOs, the GPIO part needs to be also moved. The problem I ran in to now is the fact that, even if we can ignore if the GPIOs are not available, we should at least treat EPROBE_DEFER error. To do this, the I2C bus drivers should take into account the fact that i2c_register_adapter() can return -EPROBE_DEFER. Is this something to consider? Thanks and best regards, Codrin