Hi Guenter,
On 6/18/24 6:29 PM, Guenter Roeck wrote:
On 6/18/24 09:06, Farouk Bouabid wrote:
Mule is an MCU that emulates a set of I2C devices which are reachable
through an I2C-mux.
The mux and amc6821 combined make the Mule multi-function device (@0x18)
I don't think that is appropriate. Those devices should all have separate
devicetree entries and be modeled as individual i2c devices.
I think there is a misunderstanding around the wording. They all have
separate devicetree entries and they all are individual i2c devices
(from the PoV of the kernel, they all are emulated within the same MCU).
- AMC6821 on address 0x18 for registers from 0x00 to 0xfe.
- Mux (paging, however you want to call it) on address 0x18 for register
0xff.
Note that AMC6821 is **emulated** in the MCU so this is not some HW
trickery here.
This MCU also emulates ISL1208 on 0x6f, as well as a PWM controller
(merge request pending) and two small AT24 "protocol" EEPROMs, on that
same address. Those are behind a paging/muxing mechanism. You access
ISL1208 through page 0, PWM controller through page 1, etc...
So basically, the point is:
- 0x18 on i2c is now MFD Mule
- two platform devices behind MFD = AMC6821 (reg 0x00 to 0xfe) + Mux
(reg 0xff)
- 0x6f for devices "behind" the Mux
- page 0 for device behind adapter 0
- page 1 for device behind adapter 1
- ...
All of the above are part of the same MCU.
Mule MFD is a simple-mfd-i2c device with its own devicetree entry.
Child nodes of the Mule MFD are AMC6821 as a platform device (but
operates over i2c) and Mule Mux. That's what was meant as "The mux and
amc6821 combined make the Mule multi-function device (@0x18)".
The Mule Mux then creates N i2c adapters representing the mux/pages, all
of those being represented in DT. Each of those have one device on
address 0x6f, all represented in DT as well.
Nothing hidden or hardcoded, everything in DT.
Did I miss something here?
Cheers,
Quentin