tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Multiple device attachments



On Fri, 22 Jul 2011, Frank Zerangue wrote:

> I have a hardware configuration with a cmos camera sensor on an i2c bus (for 
> configuring the camera) and connected to an (ipu) image processing controller 
> that acts as a hub for all things video. I envisioned (naturally I think) a 
> camera driver inheriting from two parents 1) i2c bus driver and 2) ipu 
> controller driver. 
> 
> This does not seem like such a strange hardware configuration to me that 
> would not be found on other embedded systems. Does anyone have a suggestion 
> for an appropriate driver hierarchy for such a configuration?


Ouch.

The autoconfig infrastructure is not designed to deal with that sort of 
configuration.  That's also not a traditional multi-path arrangement where 
the same device is visible through two distinct bus conrollers.

In this case you have two distinct connections to two separate devices 
that need to be managed together.  (I assume you can't send the same 
command down either the I2C or IPU bus and expect the same behavior?)

Is the I2C controller and ipu controller under the same parent device or 
are they in different parts of the device tree?  If you have e.g. a PCI 
card that provides I2C and IPU functionality it would be best to generate 
a driver for that that manages the entire camera, with possible child 
devices to handle communication over I2C and IPU separately.  However 
coordination between the two would be best handled at the parent.

If not, you need to do some nasty hacks to allow the separate driver bits 
to rendevous.  I did a really ugly hack like that for the psycho device 
which is a single bus controller which provides two PCI child buses, and 
some registers are shared between the two buses.

But it's definitely best if you could stick to the standard tree approach 
with one parent and one or more children, at least until the config 
framework really has multipath support.

Eduardo

> On Jul 22, 2011, at 12:07 PM, Eduardo Horvath wrote:
> 
> > On Thu, 21 Jul 2011, Frank Zerangue wrote:
> > 
> >> The examples you site seem to indicate that for example the le device may 
> >> attach to many
> >> alternative devices (e.g. pci, tc, …), but only one attachment is made 
> >> when autoconf is complete. I may have 
> >> read the code examples incorrectly -- please pardon me if I did; but what 
> >> I want to know is --  can a 
> >> device have multiple attachments (more than one parent device) when 
> >> autoconf is complete. 
> > 
> > What we have is a device tree.  That means a device instance can only have 
> > one parent.  Once it has been instantiated, that instance, with its 
> > associated instance number, cannot appear anywhere else in the device 
> > tree.
> > 
> > It might be good to extend the device tree to a directed graph at some 
> > point to support multi-pathed devices on fabrics like SAS, Fibre-channel, 
> > or PCIe that allow that sort of thing, but that's a different issue.
> > 
> > Eduardo
> 
> 


Home | Main Index | Thread Index | Old Index