On Thu, Apr 04, 2019 at 10:44:59AM +0100, Lee Jones wrote:
> On Thu, 04 Apr 2019, Andy Shevchenko wrote:
> > On Thu, Apr 04, 2019 at 10:03:14AM +0100, Lee Jones wrote:
> > > On Thu, 04 Apr 2019, Andy Shevchenko wrote:
> > > > On Thu, Apr 04, 2019 at 08:03:57AM +0100, Lee Jones wrote:
> > > > > On Thu, 04 Apr 2019, Lee Jones wrote:
> > > > > > On Tue, 02 Apr 2019, Andy Shevchenko wrote:

> > > > > > From the child:
> > > > > > 
> > > > > >   platform_get_irq(dev->parent, CLIENT_ID);
> > > > 
> > > > So, instead of keeping a fragile approach in one driver, we will spread 
> > > > this
> > > > to all of them.
> > > 
> > > No, the fragileness goes away with implicit definitions of IDs.
> > 
> > Did you mean "explicit"?
> 
> Yes.  Thank you for correcting my English. :)
> 
> > Something like we need to have a shared map of those indices?
> 
> Defining the IDs of the devices would lead to a more robust
> implementation, yes.

This would make children to know that they are springs of exact MFD parent 
driver
that makes them dependent and inflexible.

> > > > There is one device node with several IRQ and other resources.
> > > > In pseudo code:
> > > > 
> > > >         device node {
> > > >                 device ID,
> > > >                 IRQ 0,
> > > >                 IRQ 1,
> > > >                 ...
> > > >                 MMIO 0,
> > > >                 ...
> > > >         }
> > > 
> > > Sure.  Thanks for the explanation.
> > > 
> > > Very well.  I guess it's not too bad as it is.
> > 
> > It represent real hardware 1:1.
> > Just out of curiosity how this case can be described in DT?
> 
> In DT you can have a sub-node for each child which can contain the
> IRQ.  Without a sub-node you would define the IRQs in this file.  If
> these IRQs do not change, that option is still available to you.
> 
> I can't think of an example where all of the children's IRQs have been
> listed in the parent's DT node in this way.

I see. Something similar is done in ACPI table for Intel Galileo Gen2
(see intel_quark_i2c_gpio.c), though it's a PCI device with shared
interrupt line.

If it would be a case like above, MFD would have propagated IRQ resources from
them to the children anyway.

-- 
With Best Regards,
Andy Shevchenko


Reply via email to