]> git.baikalelectronics.ru Git - uboot.git/commit
x86: Probe device if needed in intel_gpio_xlate()
authorSimon Glass <sjg@chromium.org>
Mon, 15 Mar 2021 05:00:04 +0000 (18:00 +1300)
committerSimon Glass <sjg@chromium.org>
Sat, 27 Mar 2021 00:59:36 +0000 (13:59 +1300)
commit3602c0481204a9ca9ba44c5a63ff9527539838df
treea2d09a07d1441e68a72c8fe17caca9c359e7beec
parent76e48d68929a3e16c5471e717239113850d88d2f
x86: Probe device if needed in intel_gpio_xlate()

The Intel GPIO binding allows GPIOs to be globally numbered, so that it
does not matter which GPIO bank is specified in the device tree. This is
convenient and avoid confusion since the banks do not have the same number
of GPIOs and the numbering is not sequential.

The GPIO uclass ensures that the device mentioned in the devicetree
binding is probed. It is fine for the driver to update gpio_desc to point
to a different driver, but this may not have been probed. If it has not
been, then it cannot be claimed since there is no uclass data.

We could handle this in the GPIO uclass but so far it is an unusual
situation so it is probably not worth the extra code. Handle this case in
the GPIO driver by probing the selected device if necessary.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/gpio/intel_gpio.c