lkml.org 
[lkml]   [2017]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4] mfd: cpcap: implement irq sense helper
Hi Lee,

On Tue, Mar 28, 2017 at 11:27:16AM +0100, Lee Jones wrote:
> > +int cpcap_sense_virq(struct regmap *regmap, int virq)
> > +{
> > + struct regmap_irq_chip_data *d = irq_get_chip_data(virq);
> > + int base = regmap_irq_chip_get_base(d);
>
> What base is this?

This function takes an Linux irq number. That number is a virtual
irq number, which has nothing to do with the hardware. For example
a platform could look like this:

linux irq device base device irq
---------------------------------------------
0-63 SoC 0 0-63
64-127 SoC-GPIO 64 0-63
128-191 CPCAP 128 0-63

For the above example the function would map 128-191 to 0-63 as
used by the device.

> Could it be used to avoid some calculations in cpcap_sense_irq()?

No.

> > + return cpcap_sense_irq(regmap, virq - base);
> > +}
> > +EXPORT_SYMBOL_GPL(cpcap_sense_virq);

-- Sebastian
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-03-28 17:04    [W:0.293 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site