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)
commit7d252d0279ec92ac90a5cec7378bd877df7af008
treea2d09a07d1441e68a72c8fe17caca9c359e7beec
parent72d98ee09172d18919bd3e4c1c5393cc1b09cf76
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