On 26 November 2012 18:58, Paul Carpenter <paul@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote: >>> + ret = gpio_request_one(bri->scl_gpio, GPIOF_OPEN_DRAIN | >>> + GPIOF_OUT_INIT_HIGH, "i2c-scl"); >> >>I always get wary of people driving I2C with non-open-drain, especially >>with stuck busses > > I would want to know what "GPIOF_OUT_INIT_HIGH" did as that is > suspiciously driving output high at startup. I didn't get the question correctly. You mean you want me to explain what GPIOF_OPEN_DRAIN and GPIOF_OUT_INIT_HIGH will do? If no, exit(); GPIOF_OPEN_DRAIN: With this flag, all will work normally, leaving gpio_set_val(1); This will put the GPIO in input mode instead of writing one to it in output mode. GPIOF_OUT_INIT_HIGH: This will set the direction to output first, and then will do gpio_set_val(1), which will do what is mentioned in GPIOF_OPEN_DRAIN and so this action should be safe enough. -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html