I have the following setup (from external; this cannot be changed):
+------+ I2C | I2C |--------------------- Device 0--------| to |------------ Device 1 | MISO0 | SPI |--- Device 2 | MISO1 |+------+ | MISO2 | | | | | | | MISO +-------------------------+ | | GPIO |+-------| MUX | | |+-------------------------+ GPIO[0:1] |--------------------------------+
In words: There is an I2C-to SPI bridge that is used to communicate with three devices. All SPI signals (MOSI, CS, SCLK) are directly connected to this bridge, except for MISO.For some reason, the MISO pins to the bridge are multiplexed using a separate GPIO multiplexer.If it were only for the bridge, the device-tree setup would be fairly straightforward:
i2c_to_spi_brigde: some_device { compatible = "..."; device-0 { // ... }; device-1 { // ... }; device-2 { // ... };};
However, I'm not sure how to incorporate the GPIO multiplexer in this scheme. From all that I have read about gpio-mux
and pinctrl
, the multiplexed device (in this example, devices 0-2) must also be a child of the mux (in this example, the GPIO MUX). However, the devices 0-2 are already children of the I2C to SPI node.Is it therefore possible to map the setup I have shown into a device-tree, or is there some form of custom driver necessary?