Lines Matching refs:bri
744 struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; in i2c_get_gpios_for_recovery() local
748 ret = gpio_request_one(bri->scl_gpio, GPIOF_OPEN_DRAIN | in i2c_get_gpios_for_recovery()
751 dev_warn(dev, "Can't get SCL gpio: %d\n", bri->scl_gpio); in i2c_get_gpios_for_recovery()
755 if (bri->get_sda) { in i2c_get_gpios_for_recovery()
756 if (gpio_request_one(bri->sda_gpio, GPIOF_IN, "i2c-sda")) { in i2c_get_gpios_for_recovery()
759 bri->sda_gpio); in i2c_get_gpios_for_recovery()
760 bri->get_sda = NULL; in i2c_get_gpios_for_recovery()
769 struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; in i2c_put_gpios_for_recovery() local
771 if (bri->get_sda) in i2c_put_gpios_for_recovery()
772 gpio_free(bri->sda_gpio); in i2c_put_gpios_for_recovery()
774 gpio_free(bri->scl_gpio); in i2c_put_gpios_for_recovery()
787 struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; in i2c_generic_recovery() local
790 if (bri->prepare_recovery) in i2c_generic_recovery()
791 bri->prepare_recovery(adap); in i2c_generic_recovery()
793 bri->set_scl(adap, val); in i2c_generic_recovery()
802 if (bri->get_sda && bri->get_sda(adap)) in i2c_generic_recovery()
805 if (!bri->get_scl(adap)) { in i2c_generic_recovery()
814 bri->set_scl(adap, val); in i2c_generic_recovery()
818 if (bri->unprepare_recovery) in i2c_generic_recovery()
819 bri->unprepare_recovery(adap); in i2c_generic_recovery()
857 struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; in i2c_init_recovery() local
860 if (!bri) in i2c_init_recovery()
863 if (!bri->recover_bus) { in i2c_init_recovery()
869 if (bri->recover_bus == i2c_generic_gpio_recovery) { in i2c_init_recovery()
870 if (!gpio_is_valid(bri->scl_gpio)) { in i2c_init_recovery()
875 if (gpio_is_valid(bri->sda_gpio)) in i2c_init_recovery()
876 bri->get_sda = get_sda_gpio_value; in i2c_init_recovery()
878 bri->get_sda = NULL; in i2c_init_recovery()
880 bri->get_scl = get_scl_gpio_value; in i2c_init_recovery()
881 bri->set_scl = set_scl_gpio_value; in i2c_init_recovery()
882 } else if (bri->recover_bus == i2c_generic_scl_recovery) { in i2c_init_recovery()
884 if (!bri->set_scl || !bri->get_scl) { in i2c_init_recovery()