Re: Externally multiplexing interfaces on the same processor pins
- Date: Wed, 5 Dec 2018 22:29:19 +0800
- From: Song Qiang <songqiang1304521@xxxxxxxxx>
- Subject: Re: Externally multiplexing interfaces on the same processor pins
On 8/29/18 2:46 AM, Frederick Heinecke wrote:
Does anybody here know how the kernel handles externally multiplexed peripherals and and what the proper way to setup the device tree for multiplexed peripherals? For example, if I have two interfaces (say USB and I2C) on the same pins, and I want both to be available and usable (not at the same time of course), does the kernel natively support this or is this something that needs to be written into the drivers for both interfaces? Could the kernel or a user-space process potentially attempt to access both at the same time?
Here's a poorly drawn example of what I'm asking about: https://i.snag.gy/SJQnH1.jpg
Recently I've been looking at a devices just act as you described. A FT232H
adapter. It has several interfaces including i2c, spi, jtag, etc but share some
pins. As far as I know these kind of devices should fall in mfd subsystem and as
for mfd subsystem, it handles devices with functions enabled together. Doing
what we want would need dynamic device register and unregister support. I;m just
planning to write a more support driver for FT232H and I handle this situation
with another sysfs entry 'current_mode', through this, I select which mode this
device should be working on. I haven't found any facility in kernel supports this.
Would you share what you device is? I think we can help you insight the
corresponding driver and check how did the manufacture do with it.