From: Shawn Guo <shawn.guo@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 1/2] pinctrl: qcom: handle tiles for ACPI boot
Date: Tue, 2 Mar 2021 09:57:00 +0800 [thread overview]
Message-ID: <20210302015656.GH24428@dragon> (raw)
In-Reply-To: <YDz7dko8kmg5mOqa@smile.fi.intel.com>
On Mon, Mar 01, 2021 at 04:34:30PM +0200, Andy Shevchenko wrote:
> On Mon, Mar 01, 2021 at 09:43:28AM +0800, Shawn Guo wrote:
> > It's not always the case that DT and ACPI describe hardware resource in
> > the same schema, even for a single platform. For example, on SC8180X,
> > DT uses the tiles schema while ACPI describe memory resource as a single
> > region. It patches msm_pinctrl_probe() function to map tiles regions
> > only for DT. While for ACPI, it maps the single memory resource and
> > calculate tile bases with offsets passed from SoC data.
>
> ...
>
> > +#include <linux/acpi.h>
>
> No use of this header. See below.
> (Perhaps you meant mod_devicetable.h)
has_acpi_companion() call needs the header.
>
> ...
>
> > - if (soc_data->tiles) {
> > + if (soc_data->tiles && !has_acpi_companion(&pdev->dev)) {
>
> Any documentation to understand this change?
Well, !has_acpi_companion() is just to rule out ACPI boot and ensure
this is a DT boot with tiles.
>
> ...
>
> > + if (soc_data->tiles) {
> > + for (i = 0; i < soc_data->ntiles; i++)
> > + pctrl->regs[i] = base +
> > + soc_data->tile_offsets[i];
> > + } else {
> > + pctrl->regs[0] = base;
> > + }
>
> And so this?
For ACPI boot or DT without tiles, there is only one single memory
resource to map. But for SoC driver like pinctrl-sc8180x that defines
pins with tiles, even with ACPI boot, we need to have multiple regs[]
to hold bases for tiles.
I will add comment to make it easier for understanding.
Shawn
next prev parent reply other threads:[~2021-03-02 8:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 1:43 [PATCH 0/2] Add ACPI support for SC8180X pinctrl driver Shawn Guo
2021-03-01 1:43 ` [PATCH 1/2] pinctrl: qcom: handle tiles for ACPI boot Shawn Guo
2021-03-01 14:34 ` Andy Shevchenko
2021-03-02 1:57 ` Shawn Guo [this message]
2021-03-01 1:43 ` [PATCH 2/2] pinctrl: qcom: sc8180x: add ACPI probe support Shawn Guo
2021-03-01 14:37 ` Andy Shevchenko
2021-03-02 3:00 ` Shawn Guo
2021-03-01 14:32 ` [PATCH 0/2] Add ACPI support for SC8180X pinctrl driver Andy Shevchenko
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=20210302015656.GH24428@dragon \
--to=shawn.guo@linaro.org \
--cc=andriy.shevchenko@intel.com \
--cc=bjorn.andersson@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.