]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: gpio: Add support for named gpios in DT
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 16 Sep 2017 21:56:49 +0000 (23:56 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 30 Oct 2017 07:42:59 +0000 (08:42 +0100)
commitf3fd06cabeea9d605f4da2867b45f2d7d5c95483
treeebbbec1519344517a96ba562ca78c8496d59832a
parentb54ad7e874cb09f4086766e120581346b8ec3d66
i2c: gpio: Add support for named gpios in DT

This adds support for using the "sda" and "scl" GPIOs in
device tree instead of anonymously using index 0 and 1 of
the "gpios" property.

We add a helper function to retrieve the GPIO descriptors
and some explicit error handling since the probe may have
to be deferred. At least this happened to me when moving
to using named "sda" and "scl" lines (all of a sudden this
started to probe before the GPIO driver) so we need to
gracefully defer probe when we ge -ENOENT in the error
pointer.

Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/i2c/busses/i2c-gpio.c