From: Lee Jones <lee.jones@linaro.org>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: robh+dt@kernel.org, mark.rutland@arm.com, a.zummo@towertech.it,
alexandre.belloni@bootlin.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org,
stefan@agner.ch, b.galvani@gmail.com, phh@phh.me,
letux-kernel@openphoenux.org
Subject: Re: [PATCH v3 3/6] mfd: rn5t618: add irq support
Date: Wed, 11 Dec 2019 07:50:21 +0000 [thread overview]
Message-ID: <20191211075021.GW3468@dell> (raw)
In-Reply-To: <20191210175900.64df7de8@kemnade.info>
On Tue, 10 Dec 2019, Andreas Kemnade wrote:
> On Tue, 10 Dec 2019 09:32:25 +0000
> Lee Jones <lee.jones@linaro.org> wrote:
>
> > On Fri, 29 Nov 2019, Andreas Kemnade wrote:
> >
> > > This adds support for irq handling in the rc5t619 which is required
> >
> > Please capitalise abbreviations and device names (as they do in the
> > datasheet).
> >
> for IRQ vs. irq: I see both things in commit messages. Is there any rule about
> that?
No, it's preference. Mine is to follow the conventions set out by
standard English grammar. Capital letters to start sentences, proper
nouns and abbreviations, etc.
> > > for properly implementing subdevices like rtc.
> >
> > "RTC"
> >
> > > For now only definitions for the variant rc5t619 are included.
> > >
> > > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> > > ---
> > > Changes in v3:
> > > alignment cleanup
> > >
> > > Changes in v2:
> > > - no dead code, did some more testing and thinking for that
> > > - remove extra empty lines
> > >
> > > drivers/mfd/Kconfig | 1 +
> > > drivers/mfd/Makefile | 2 +-
> > > drivers/mfd/rn5t618-core.c | 34 ++++++++++++++-
> > > drivers/mfd/rn5t618-irq.c | 85 +++++++++++++++++++++++++++++++++++++
> > > include/linux/mfd/rn5t618.h | 16 +++++++
> > > 5 files changed, 136 insertions(+), 2 deletions(-)
> > > create mode 100644 drivers/mfd/rn5t618-irq.c
> > >
> > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > > index ae24d3ea68ea..522e068d0082 100644
> > > --- a/drivers/mfd/Kconfig
> > > +++ b/drivers/mfd/Kconfig
> > > @@ -1057,6 +1057,7 @@ config MFD_RN5T618
> > > depends on OF
> > > select MFD_CORE
> > > select REGMAP_I2C
> > > + select REGMAP_IRQ
> > > help
> > > Say yes here to add support for the Ricoh RN5T567,
> > > RN5T618, RC5T619 PMIC.
> > > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> > > index 110ea700231b..2906d5db67d0 100644
> > > --- a/drivers/mfd/Makefile
> > > +++ b/drivers/mfd/Makefile
> > > @@ -217,7 +217,7 @@ obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o
> > > obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o
> > > obj-$(CONFIG_MFD_RK808) += rk808.o
> > >
> > > -rn5t618-objs := rn5t618-core.o
> > > +rn5t618-objs := rn5t618-core.o rn5t618-irq.o
> > > obj-$(CONFIG_MFD_RN5T618) += rn5t618.o
> > > obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o
> > > obj-$(CONFIG_MFD_SYSCON) += syscon.o
> > > diff --git a/drivers/mfd/rn5t618-core.c b/drivers/mfd/rn5t618-core.c
> > > index da5cd9c92a59..1e2326217681 100644
> > > --- a/drivers/mfd/rn5t618-core.c
> > > +++ b/drivers/mfd/rn5t618-core.c
> > > @@ -8,6 +8,7 @@
> > >
> > > #include <linux/delay.h>
> > > #include <linux/i2c.h>
> > > +#include <linux/interrupt.h>
> > > #include <linux/mfd/core.h>
> > > #include <linux/mfd/rn5t618.h>
> > > #include <linux/module.h>
> > > @@ -105,7 +106,8 @@ static int rn5t618_i2c_probe(struct i2c_client *i2c,
> > >
> > > i2c_set_clientdata(i2c, priv);
> > > priv->variant = (long)of_id->data;
> > > -
> > > + priv->chip_irq = i2c->irq;
> > > + priv->dev = &i2c->dev;
> >
> > '\n'
> >
> > > priv->regmap = devm_regmap_init_i2c(i2c, &rn5t618_regmap_config);
> > > if (IS_ERR(priv->regmap)) {
> > > ret = PTR_ERR(priv->regmap);
> > > @@ -137,6 +139,11 @@ static int rn5t618_i2c_probe(struct i2c_client *i2c,
> > > return ret;
> > > }
> > >
> > > + if (priv->chip_irq > 0) {
> > > + if (rn5t618_irq_init(priv))
> > > + priv->chip_irq = 0;
> > > + }
> > > +
> > > return 0;
> > > }
> > >
> > > @@ -154,15 +161,40 @@ static int rn5t618_i2c_remove(struct i2c_client *i2c)
> > > return 0;
> > > }
> > >
> > > +static int __maybe_unused rn5t618_i2c_suspend(struct device *dev)
> > > +{
> > > + struct rn5t618 *priv = dev_get_drvdata(dev);
> > > +
> > > + if (priv->chip_irq)
> > > + disable_irq(priv->chip_irq);
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static int __maybe_unused rn5t618_i2c_resume(struct device *dev)
> > > +{
> > > + struct rn5t618 *priv = dev_get_drvdata(dev);
> > > +
> > > + if (priv->chip_irq)
> > > + enable_irq(priv->chip_irq);
> > > +
> > > + return 0;
> > > +}
> > > +
> > > static const struct i2c_device_id rn5t618_i2c_id[] = {
> > > { }
> > > };
> > > MODULE_DEVICE_TABLE(i2c, rn5t618_i2c_id);
> >
> > Not this patch I know, but it's strange to see this empty.
>
> Yes, should be cleaned up. For now the device tree stuff seems to kick in.
I think this can be removed completely.
Just make sure you use .probe2 and it should be automatic.
[...]
> > > + switch (rn5t618->variant) {
> > > + case RC5T619:
> > > + irq_chip = &rc5t619_irq_chip;
> > > + break;
> > > +
> > > + /* TODO: check irq definitions for other variants */
> >
> > No need for this. It's implied.
> >
> > OOI, when support for more variants be added?
> >
> I have done research about the RN5T618. It has just the RTC IRQ missing, I could just
> add the table for it to prepare the path for others. I cannot test it but
> since there are no users yet, it does not harm that it is not well-tested.
If there are no users and it can't be tested, it should be left out.
We don't want potentially broken, untested code with no users in the
kernel.
--
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-12-11 7:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 21:20 [PATCH v3 0/6] Add rtc support for rn5t618 mfd Andreas Kemnade
2019-11-29 21:20 ` [PATCH v3 1/6] dt-bindings: mfd: rn5t618: Document optional property interrupts Andreas Kemnade
2019-12-10 8:52 ` Lee Jones
2019-11-29 21:20 ` [PATCH v3 2/6] mfd: rn5t618: prepare for irq handling Andreas Kemnade
2019-12-10 9:13 ` Lee Jones
2019-12-10 17:06 ` Andreas Kemnade
2019-12-11 7:44 ` Lee Jones
2019-11-29 21:20 ` [PATCH v3 3/6] mfd: rn5t618: add irq support Andreas Kemnade
2019-12-10 9:32 ` Lee Jones
2019-12-10 16:59 ` Andreas Kemnade
2019-12-11 7:50 ` Lee Jones [this message]
2019-12-11 11:43 ` Andreas Kemnade
2019-11-29 21:20 ` [PATCH v3 4/6] mfd: rn5t618: add rtc related registers Andreas Kemnade
2019-11-29 21:20 ` [PATCH v3 5/6] mfd: rn5t618: add more subdevices Andreas Kemnade
2019-11-29 21:20 ` [PATCH v3 6/6] rtc: rtc-rc5t619: add ricoh rc5t619 RTC driver Andreas Kemnade
2019-12-02 9:39 ` Alexandre Belloni
2019-12-11 19:33 ` Andreas Kemnade
2019-12-11 20:17 ` Alexandre Belloni
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=20191211075021.GW3468@dell \
--to=lee.jones@linaro.org \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=andreas@kemnade.info \
--cc=b.galvani@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=letux-kernel@openphoenux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=phh@phh.me \
--cc=robh+dt@kernel.org \
--cc=stefan@agner.ch \
/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.