From: Lee Jones <lee.jones@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] mfd: Add support for Merrifield Basin Cove PMIC
Date: Thu, 4 Apr 2019 08:00:04 +0100 [thread overview]
Message-ID: <20190404070004.GE6830@dell> (raw)
In-Reply-To: <20190402122001.GM9224@smile.fi.intel.com>
On Tue, 02 Apr 2019, Andy Shevchenko wrote:
> On Tue, Apr 02, 2019 at 06:12:11AM +0100, Lee Jones wrote:
> > On Mon, 18 Mar 2019, Andy Shevchenko wrote:
> >
> > > Add an mfd driver for Intel Merrifield Basin Cove PMIC.
> >
> > Nit: s/mfd/MFD/
>
> Noted. And changed for v2.
>
> > > +static const struct mfd_cell bcove_dev[] = {
> > > + {
> > > + .name = "mrfld_bcove_pwrbtn",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[0],
> > > + }, {
> > > + .name = "mrfld_bcove_tmu",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[1],
> > > + }, {
> > > + .name = "mrfld_bcove_thermal",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[2],
> > > + }, {
> > > + .name = "mrfld_bcove_bcu",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[3],
> > > + }, {
> > > + .name = "mrfld_bcove_adc",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[4],
> > > + }, {
> > > + .name = "mrfld_bcove_charger",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[5],
> > > + }, {
> > > + .name = "mrfld_bcove_extcon",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[5],
> > > + }, {
> > > + .name = "mrfld_bcove_gpio",
> > > + .num_resources = 1,
> > > + .resources = &irq_level2_resources[6],
> > > + },
> > > + { .name = "mrfld_bcove_region", },
> > > +};
>
> > > +static int regmap_ipc_byte_reg_read(void *context, unsigned int reg,
> >
> > Prefixing these with regmap is pretty confusing, since this it not
> > part of the Regmap API. Better to provide them with local names
> > instead.
> >
> > bcove_ipc_byte_reg_read()
>
> Good point. And changed for v2.
>
> > > + for (i = 0; i < ARRAY_SIZE(irq_level2_resources); i++) {
> > > + ret = platform_get_irq(pdev, i);
> > > + if (ret < 0)
> > > + return ret;
> > > +
> > > + irq_level2_resources[i].start = ret;
> > > + irq_level2_resources[i].end = ret;
> > > + }
> >
> > Although succinct, dragging values from one platform device into
> > another doesn't sound that neat.
>
> So, how to split resources given in one _physical_ multi-functional device to
> several of them? Isn't it what MFD framework for?
>
> Any other approach here? I'm all ears!
From the child:
platform_get_irq(dev->parent, CLIENT_ID);
> > Also, since the ordering of the
> > devices is critical in this implementation, it also comes across as
> > fragile.
>
> How fragile? In ACPI we don't have IRQ labeling scheme. Index is used for that.
>
> > Any reason why ACPI can't register all of the child devices, or for
> > the child devices to obtain their IRQ directly from the tables?
>
> And how are we supposed to enumerated them taking into consideration single
> ACPI ID given?
This question was a little whimsical, since I have no idea how the
ACPI tables you're working with are laid out.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2019-04-04 7:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 9:53 [PATCH v1] mfd: Add support for Merrifield Basin Cove PMIC Andy Shevchenko
2019-03-18 12:07 ` Andy Shevchenko
2019-04-02 5:12 ` Lee Jones
2019-04-02 12:20 ` Andy Shevchenko
2019-04-02 12:21 ` Andy Shevchenko
2019-04-04 7:00 ` Lee Jones [this message]
2019-04-04 7:03 ` Lee Jones
2019-04-04 8:21 ` Andy Shevchenko
2019-04-04 9:03 ` Lee Jones
2019-04-04 9:26 ` Andy Shevchenko
2019-04-04 9:44 ` Lee Jones
2019-04-04 12:27 ` 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=20190404070004.GE6830@dell \
--to=lee.jones@linaro.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@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 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).