i2c-gpio: Also set bus numbers from reg property
authorPhil Elwell <phil@raspberrypi.org>
Tue, 20 Feb 2018 10:07:27 +0000 (10:07 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:03:51 +0000 (16:03 +0000)
commitb34ca922765123611691e268dcc5d82ab6c5b5da
treeaea946914eb2f2a972e0c88ea8f4a5b947e82cfd
parent81da9cedd8d67db52d7626b6de8f6ff4d014eaa4
i2c-gpio: Also set bus numbers from reg property

I2C busses can be assigned specific bus numbers using aliases in
Device Tree - string properties where the name is the alias and the
value is the path to the node. The current DT parameter mechanism
does not allow property names to be derived from a parameter value
in any way, so it isn't possible to generate unique or matching
aliases for nodes from an overlay that can generate multiple
instances, e.g. i2c-gpio.

Work around this limitation (at least temporarily) by allowing
the i2c adapter number to be initialised from the "reg" property
if present.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/i2c/busses/i2c-gpio.c