From: Lee Jones <lee.jones@linaro.org>
To: Hsin-hsiung Wang <hsin-hsiung.wang@mediatek.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
Eddie Huang <eddie.huang@mediatek.com>,
Sean Wang <sean.wang@mediatek.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Tianping Fang <tianping.fang@mediatek.com>,
Thomas Gleixner <tglx@linutronix.de>,
Josef Friedl <josef.friedl@speed.at>,
Kate Stewart <kstewart@linuxfoundation.org>,
Ran Bi <ran.bi@mediatek.com>,
Frank Wunderlich <frank-w@public-files.de>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-rtc@vger.kernel.org, srv_heupstream@mediatek.com
Subject: Re: [PATCH v7 3/6] mfd: Add support for the MediaTek MT6358 PMIC
Date: Mon, 3 Feb 2020 07:46:21 +0000 [thread overview]
Message-ID: <20200203074621.GB13919@dell> (raw)
In-Reply-To: <1579664886.6399.24.camel@mtksdaap41>
On Wed, 22 Jan 2020, Hsin-hsiung Wang wrote:
> Hi,
>
> On Mon, 2019-12-16 at 15:17 +0000, Lee Jones wrote:
> > On Wed, 11 Dec 2019, Hsin-Hsiung Wang wrote:
> >
> > > This adds support for the MediaTek MT6358 PMIC. This is a
> > > multifunction device with the following sub modules:
> > >
> > > - Regulator
> > > - RTC
> > > - Codec
> > > - Interrupt
> > >
> > > It is interfaced to the host controller using SPI interface
> > > by a proprietary hardware called PMIC wrapper or pwrap.
> > > MT6358 MFD is a child device of the pwrap.
> > >
> > > Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
> > > ---
> > > drivers/mfd/Makefile | 2 +-
> > > drivers/mfd/mt6358-irq.c | 224 ++++++++++++++++++++++++++++
> > > drivers/mfd/mt6397-core.c | 45 +++++-
> > > include/linux/mfd/mt6358/core.h | 158 ++++++++++++++++++++
> > > include/linux/mfd/mt6358/registers.h | 282 +++++++++++++++++++++++++++++++++++
> > > include/linux/mfd/mt6397/core.h | 3 +
> > > 6 files changed, 712 insertions(+), 2 deletions(-)
> > > create mode 100644 drivers/mfd/mt6358-irq.c
> > > create mode 100644 include/linux/mfd/mt6358/core.h
> > > create mode 100644 include/linux/mfd/mt6358/registers.h
[...]
> > > +int mt6358_irq_init(struct mt6397_chip *chip)
> > > +{
> > > + int i, j, ret;
> > > + struct pmic_irq_data *irqd;
> > > +
> > > + irqd = devm_kzalloc(chip->dev, sizeof(struct pmic_irq_data *),
> > > + GFP_KERNEL);
> > > + if (!irqd)
> > > + return -ENOMEM;
> > > +
> > > + chip->irq_data = irqd;
> > > +
> > > + mutex_init(&chip->irqlock);
> > > + irqd->top_int_status_reg = MT6358_TOP_INT_STATUS0;
> > > + irqd->num_pmic_irqs = MT6358_IRQ_NR;
> > > + irqd->num_top = ARRAY_SIZE(mt6358_ints);
> > > +
> > > + irqd->enable_hwirq = devm_kcalloc(chip->dev,
> > > + irqd->num_pmic_irqs,
> > > + sizeof(bool),
> >
> > This is fragile. What if the type changes elsewhere?
> >
>
> Thanks for your comment.
> Do you mean using 'sizeof(*irqd->enable_hwirq)' instead of
> 'sizeof(bool)'?
Yes please.
--
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:[~2020-02-03 7:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 9:43 [PATCH v7 0/6] Add Support for MediaTek PMIC MT6358 Hsin-Hsiung Wang
2019-12-11 9:43 ` [PATCH v7 1/6] mfd: mt6397: modify suspend/resume behavior Hsin-Hsiung Wang
2019-12-16 15:20 ` Lee Jones
2019-12-11 9:43 ` [PATCH v7 2/6] dt-bindings: mfd: Add compatible for the MediaTek MT6358 PMIC Hsin-Hsiung Wang
2019-12-11 9:43 ` [PATCH v7 3/6] mfd: Add support " Hsin-Hsiung Wang
2019-12-16 15:17 ` Lee Jones
2020-01-22 3:48 ` Hsin-hsiung Wang
2020-02-03 7:46 ` Lee Jones [this message]
2019-12-11 9:43 ` [PATCH v7 4/6] arm64: dts: mt6358: add PMIC MT6358 related nodes Hsin-Hsiung Wang
2019-12-11 9:43 ` [PATCH v7 5/6] rtc: mt6397: fix alarm register overwrite Hsin-Hsiung Wang
2019-12-11 12:25 ` Alexandre Belloni
2019-12-11 9:43 ` [PATCH v7 6/6] rtc: Add support for the MediaTek MT6358 RTC Hsin-Hsiung Wang
2019-12-11 12:27 ` Alexandre Belloni
2019-12-16 15:21 ` 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=20200203074621.GB13919@dell \
--to=lee.jones@linaro.org \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=devicetree@vger.kernel.org \
--cc=eddie.huang@mediatek.com \
--cc=frank-w@public-files.de \
--cc=hsin-hsiung.wang@mediatek.com \
--cc=josef.friedl@speed.at \
--cc=kstewart@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-rtc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=ran.bi@mediatek.com \
--cc=robh+dt@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=srv_heupstream@mediatek.com \
--cc=tglx@linutronix.de \
--cc=tianping.fang@mediatek.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).