0

I am trying to see how I could instantiate i2c-mux-gpio driver at run time from user-space.

Basically, the intent is to use a default version of the distribution but at run time determine based on certain parameters to instantiate the i2c-mux-gpio so that it can add more buses.

Example, something like

modprobe i2c-mux-gpio <"gpio0=1,gpio2=0">

The existing i2c-mux-gpio seems to take the required information via standard structure which happens to be populated via a device-tree/acpi etc.

Exploring if someone has already attempted to pass this information at run time.

Thanks Sriaknth

ksrikanth
  • 71
  • 9

1 Answers1

2

If you're using the Device Tree on your platform, you should have a look at the recent Device Tree Overlay mechanism which was merged. It also to load additional fragments of Device Tree at runtime.

Thomas Petazzoni
  • 5,636
  • 17
  • 25
  • Thanks. At the moment we use ACPI. I am not sure if I would be able to mix acpi and device tree. I am experimenting if it is possible. – ksrikanth Sep 17 '14 at 20:23
  • Thanks @thomas-petazzoni I was on debian old distributions, and all my research at that time made me believe that device tree is only available on on non-intel archs, an that it would required uboot. Discovered a few of your talks too, but they too were silent on Intel processors. I now see that we can get the same functionality using UEFI(ACPI DSDT/SSDT) tables. I am now trying out with https://github.com/CumulusNetworks/apd-tools/wiki along with https://www.kernel.org/doc/html/latest/admin-guide/acpi/ssdt-overlays.html so as to use Device-Tree features. – ksrikanth Jul 11 '20 at 12:10
  • In some cases it might be needed to amend the kernel driver(s) which is (are) too OF-centric (historically and by other reasons). – 0andriy Nov 13 '21 at 18:07
  • I hope you have seen these: https://stackoverflow.com/questions/54768841/building-a-i2c-device-controller and https://stackoverflow.com/questions/63490765/how-does-one-declare-devices-behind-muxes-in-acpi. – 0andriy Nov 13 '21 at 18:08