From: Lee Jones <lee.jones@linaro.org>
To: Sebastian Reichel <sre@kernel.org>
Cc: Tony Lindgren <tony@atomide.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv4] mfd: cpcap: implement irq sense helper
Date: Wed, 29 Mar 2017 09:04:23 +0100 [thread overview]
Message-ID: <20170329080423.ijbl4seczla2s4nm@dell> (raw)
In-Reply-To: <20170328145415.td4xeqxedem5yjen@earth>
On Tue, 28 Mar 2017, Sebastian Reichel wrote:
> 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.
In which case may I suggest that you rename the variable, since 'base'
is commonly used in the kernel to mean base of a particular IP's
memory block.
> > 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
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2017-03-29 8:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 22:50 [PATCHv3 1/2] mfd: cpcap: implement irq sense helper Sebastian Reichel
2017-03-21 22:50 ` [PATCHv3 2/2] input: cpcap-pwrbutton: new driver Sebastian Reichel
[not found] ` <20170321225042.28057-1-sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-03-23 14:23 ` [PATCHv3 1/2] mfd: cpcap: implement irq sense helper Lee Jones
2017-03-24 8:42 ` [PATCHv4] " Sebastian Reichel
2017-03-28 10:27 ` Lee Jones
2017-03-28 14:54 ` Sebastian Reichel
2017-03-29 8:04 ` Lee Jones [this message]
2017-03-29 12:18 ` [PATCHv5] " Sebastian Reichel
2017-04-03 10:26 ` Lee Jones
2017-04-10 14:27 ` Sebastian Reichel
2017-04-11 14:21 ` Lee Jones
2017-04-11 14:21 ` [GIT PULL] Immutable branch between MFD and Input due for the v4.12 merge window Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170329080423.ijbl4seczla2s4nm@dell \
--to=lee.jones@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=sre@kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).