From: Mark Brown <broonie@kernel.org>
To: Guru Das Srinagesh <gurus@codeaurora.org>
Cc: Markus Elfring <Markus.Elfring@web.de>,
Lee Jones <lee.jones@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Greg KH <gregkh@linuxfoundation.org>,
Guenter Roeck <linux@roeck-us.net>, Joe Perches <joe@perches.com>,
Subbaraman Narayanamurthy <subbaram@codeaurora.org>,
David Collins <collinsd@codeaurora.org>,
Anirudh Ghayal <aghayal@codeaurora.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2 1/3] regmap-irq: Add support for peripheral offsets
Date: Thu, 12 Nov 2020 19:33:12 +0000 [thread overview]
Message-ID: <20201112193312.GE4742@sirena.org.uk> (raw)
In-Reply-To: <40581a58bd16442f03db1abea014ca1eedc94d3c.1603402280.git.gurus@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 2577 bytes --]
On Thu, Oct 22, 2020 at 02:35:40PM -0700, Guru Das Srinagesh wrote:
> Some MFD chips do not have the register space for their peripherals
> mapped out with a fixed stride. Add peripheral address offsets to the
> framework to support such address spaces.
> In this new scheme, the regmap-irq client registering with the framework
> shall have to define the *_base registers (e.g. status_base, mask_base,
> type_base, etc.) as those of the very first peripheral in the chip, and
> then specify address offsets of each subsequent peripheral so that their
> corresponding *_base registers may be calculated by the framework. The
> first element of the periph_offs array must be zero so that the first
> peripherals' addresses may be accessed.
> Some MFD chips define two registers in addition to the IRQ type
> registers: POLARITY_HI and POLARITY_LO, so add support to manage their
> data as well as write to them.
It is difficult to follow what this change is supposed to do, in part
because it looks like this is in fact two separate changes, one adding
the _base feature and another adding the polarity feature. These should
each be in a separate patch if that is the case, and I think each needs
a clearer changelog - I'm not entirely sure what the polarity feature is
supposed to do. Nothing here says what POLARITY_HI and POLARITY_LO are,
how they interact or anything.
For the address offsets I'm not sure that this is the best way to
represent things. It looks like the hardware this is trying to describe
is essentially a bunch of separate interrupt controllers that happen to
share an upstream interrupt and I think that the code would be a lot
clearer if at least the implementation looked like this. Instead of
having to check for this array of offsets at every use point (which is
going to be rarely used and hence prone to bugs) we'd have a set of
separate regmap-irqs and then we'd mostly only have to loop through them
on handling, the bulk of the implementation wouldn't have to worry about
this special case.
Historically genirq didn't support sharing threaded interrupts, if
that's not changed we'd need to open code everything inside regmap-irq
but it would be doable, or ideally genirq could grow this feature. If
it's done inside regmap you'd have a separate API that took an array of
regmap-irq configurations instead of just one and then when an interrupt
is delivered just loops through all of them handling it. A quick scan
through the interrupt code suggests it might be able to cope with shared
IRQs now though which would make life easier.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-11-12 19:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 21:35 [PATCH v2 0/3] Add support for Qualcomm MFD PMIC register layout Guru Das Srinagesh
2020-10-22 21:35 ` [PATCH v2 1/3] regmap-irq: Add support for peripheral offsets Guru Das Srinagesh
2020-11-12 19:33 ` Mark Brown [this message]
2021-03-04 18:27 ` Guru Das Srinagesh
2021-03-04 19:52 ` Mark Brown
2020-10-22 21:35 ` [PATCH v2 2/3] dt-bindings: mfd: Add QCOM PM8008 MFD bindings Guru Das Srinagesh
2020-10-30 15:49 ` Rob Herring
2020-11-02 19:52 ` Guru Das Srinagesh
2020-10-22 21:35 ` [PATCH v2 3/3] mfd: Add PM8008 driver Guru Das Srinagesh
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=20201112193312.GE4742@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=aghayal@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=collinsd@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=gurus@codeaurora.org \
--cc=joe@perches.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
--cc=subbaram@codeaurora.org \
/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
Powered by JetHome