All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Hsin-hsiung Wang <hsin-hsiung.wang@mediatek.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Frank Wunderlich <frank-w@public-files.de>,
	Josef Friedl <josef.friedl@speed.at>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	srv_heupstream <srv_heupstream@mediatek.com>
Subject: Re: [PATCH 1/8] mfd: mt6358: refine interrupt code
Date: Mon, 10 Aug 2020 08:31:28 +0100	[thread overview]
Message-ID: <20200810073128.GC4411@dell> (raw)
In-Reply-To: <1596443379.31084.3.camel@mtksdaap41>

On Mon, 03 Aug 2020, Hsin-hsiung Wang wrote:

> Hi,
> 
> On Mon, 2020-07-27 at 16:48 +0100, Lee Jones wrote:
> > On Thu, 23 Jul 2020, Hsin-Hsiung Wang wrote:
> > 
> > > This patch refines the interrupt related code to support new chips.
> > 
> > Refines in what way?
> > 
> > What makes this better?
> > 
> 
> Thanks for the comment. I will add more information into comment message
> based on my below explanation.

Thanks.

> > > Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
> > > ---
> > >  drivers/mfd/mt6358-irq.c        | 65 ++++++++++++++++++++++++-----------------
> > >  include/linux/mfd/mt6358/core.h |  8 ++---
> > >  2 files changed, 41 insertions(+), 32 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c
> > > index db734f2..4b094e5 100644
> > > --- a/drivers/mfd/mt6358-irq.c
> > > +++ b/drivers/mfd/mt6358-irq.c
> > > @@ -13,7 +13,9 @@
> > >  #include <linux/platform_device.h>
> > >  #include <linux/regmap.h>
> > >  
> > > -static struct irq_top_t mt6358_ints[] = {
> > > +#define MTK_PMIC_REG_WIDTH 16
> > > +
> > > +static const struct irq_top_t mt6358_ints[] = {
> > >  	MT6358_TOP_GEN(BUCK),
> > >  	MT6358_TOP_GEN(LDO),
> > >  	MT6358_TOP_GEN(PSC),
> > > @@ -24,6 +26,13 @@ static struct irq_top_t mt6358_ints[] = {
> > >  	MT6358_TOP_GEN(MISC),
> > >  };
> > >  
> > > +static struct pmic_irq_data mt6358_irqd = {
> > > +	.num_top = ARRAY_SIZE(mt6358_ints),
> > > +	.num_pmic_irqs = MT6358_IRQ_NR,
> > > +	.top_int_status_reg = MT6358_TOP_INT_STATUS0,
> > > +	.pmic_ints = mt6358_ints,
> > > +};
> > 
> > Dynamically assigned driver data is usually preferred.
> > 
> > Why have you gone static?
> > 
> 
> Do you consider the memory allocation?
> Below modification is to assign necessary data dynamically and the code
> will become longer with more chips if we assign every member of the
> structure.

[...]

Never mind.  On second glance, this should be fine.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Hsin-hsiung Wang <hsin-hsiung.wang@mediatek.com>
Cc: devicetree@vger.kernel.org, Josef Friedl <josef.friedl@speed.at>,
	srv_heupstream <srv_heupstream@mediatek.com>,
	Frank Wunderlich <frank-w@public-files.de>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/8] mfd: mt6358: refine interrupt code
Date: Mon, 10 Aug 2020 08:31:28 +0100	[thread overview]
Message-ID: <20200810073128.GC4411@dell> (raw)
In-Reply-To: <1596443379.31084.3.camel@mtksdaap41>

On Mon, 03 Aug 2020, Hsin-hsiung Wang wrote:

> Hi,
> 
> On Mon, 2020-07-27 at 16:48 +0100, Lee Jones wrote:
> > On Thu, 23 Jul 2020, Hsin-Hsiung Wang wrote:
> > 
> > > This patch refines the interrupt related code to support new chips.
> > 
> > Refines in what way?
> > 
> > What makes this better?
> > 
> 
> Thanks for the comment. I will add more information into comment message
> based on my below explanation.

Thanks.

> > > Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
> > > ---
> > >  drivers/mfd/mt6358-irq.c        | 65 ++++++++++++++++++++++++-----------------
> > >  include/linux/mfd/mt6358/core.h |  8 ++---
> > >  2 files changed, 41 insertions(+), 32 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c
> > > index db734f2..4b094e5 100644
> > > --- a/drivers/mfd/mt6358-irq.c
> > > +++ b/drivers/mfd/mt6358-irq.c
> > > @@ -13,7 +13,9 @@
> > >  #include <linux/platform_device.h>
> > >  #include <linux/regmap.h>
> > >  
> > > -static struct irq_top_t mt6358_ints[] = {
> > > +#define MTK_PMIC_REG_WIDTH 16
> > > +
> > > +static const struct irq_top_t mt6358_ints[] = {
> > >  	MT6358_TOP_GEN(BUCK),
> > >  	MT6358_TOP_GEN(LDO),
> > >  	MT6358_TOP_GEN(PSC),
> > > @@ -24,6 +26,13 @@ static struct irq_top_t mt6358_ints[] = {
> > >  	MT6358_TOP_GEN(MISC),
> > >  };
> > >  
> > > +static struct pmic_irq_data mt6358_irqd = {
> > > +	.num_top = ARRAY_SIZE(mt6358_ints),
> > > +	.num_pmic_irqs = MT6358_IRQ_NR,
> > > +	.top_int_status_reg = MT6358_TOP_INT_STATUS0,
> > > +	.pmic_ints = mt6358_ints,
> > > +};
> > 
> > Dynamically assigned driver data is usually preferred.
> > 
> > Why have you gone static?
> > 
> 
> Do you consider the memory allocation?
> Below modification is to assign necessary data dynamically and the code
> will become longer with more chips if we assign every member of the
> structure.

[...]

Never mind.  On second glance, this should be fine.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Hsin-hsiung Wang <hsin-hsiung.wang@mediatek.com>
Cc: devicetree@vger.kernel.org, Josef Friedl <josef.friedl@speed.at>,
	srv_heupstream <srv_heupstream@mediatek.com>,
	Frank Wunderlich <frank-w@public-files.de>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/8] mfd: mt6358: refine interrupt code
Date: Mon, 10 Aug 2020 08:31:28 +0100	[thread overview]
Message-ID: <20200810073128.GC4411@dell> (raw)
In-Reply-To: <1596443379.31084.3.camel@mtksdaap41>

On Mon, 03 Aug 2020, Hsin-hsiung Wang wrote:

> Hi,
> 
> On Mon, 2020-07-27 at 16:48 +0100, Lee Jones wrote:
> > On Thu, 23 Jul 2020, Hsin-Hsiung Wang wrote:
> > 
> > > This patch refines the interrupt related code to support new chips.
> > 
> > Refines in what way?
> > 
> > What makes this better?
> > 
> 
> Thanks for the comment. I will add more information into comment message
> based on my below explanation.

Thanks.

> > > Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
> > > ---
> > >  drivers/mfd/mt6358-irq.c        | 65 ++++++++++++++++++++++++-----------------
> > >  include/linux/mfd/mt6358/core.h |  8 ++---
> > >  2 files changed, 41 insertions(+), 32 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c
> > > index db734f2..4b094e5 100644
> > > --- a/drivers/mfd/mt6358-irq.c
> > > +++ b/drivers/mfd/mt6358-irq.c
> > > @@ -13,7 +13,9 @@
> > >  #include <linux/platform_device.h>
> > >  #include <linux/regmap.h>
> > >  
> > > -static struct irq_top_t mt6358_ints[] = {
> > > +#define MTK_PMIC_REG_WIDTH 16
> > > +
> > > +static const struct irq_top_t mt6358_ints[] = {
> > >  	MT6358_TOP_GEN(BUCK),
> > >  	MT6358_TOP_GEN(LDO),
> > >  	MT6358_TOP_GEN(PSC),
> > > @@ -24,6 +26,13 @@ static struct irq_top_t mt6358_ints[] = {
> > >  	MT6358_TOP_GEN(MISC),
> > >  };
> > >  
> > > +static struct pmic_irq_data mt6358_irqd = {
> > > +	.num_top = ARRAY_SIZE(mt6358_ints),
> > > +	.num_pmic_irqs = MT6358_IRQ_NR,
> > > +	.top_int_status_reg = MT6358_TOP_INT_STATUS0,
> > > +	.pmic_ints = mt6358_ints,
> > > +};
> > 
> > Dynamically assigned driver data is usually preferred.
> > 
> > Why have you gone static?
> > 
> 
> Do you consider the memory allocation?
> Below modification is to assign necessary data dynamically and the code
> will become longer with more chips if we assign every member of the
> structure.

[...]

Never mind.  On second glance, this should be fine.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-10  7:31 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 12:58 [PATCH 0/8] Add Support for MediaTek PMIC MT6359 Hsin-Hsiung Wang
2020-07-23 12:58 ` Hsin-Hsiung Wang
2020-07-23 12:58 ` Hsin-Hsiung Wang
2020-07-23 12:58 ` [PATCH 1/8] mfd: mt6358: refine interrupt code Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-27 15:48   ` Lee Jones
2020-07-27 15:48     ` Lee Jones
2020-07-27 15:48     ` Lee Jones
2020-08-03  8:29     ` Hsin-hsiung Wang
2020-08-03  8:29       ` Hsin-hsiung Wang
2020-08-03  8:29       ` Hsin-hsiung Wang
2020-08-10  7:31       ` Lee Jones [this message]
2020-08-10  7:31         ` Lee Jones
2020-08-10  7:31         ` Lee Jones
2020-07-23 12:58 ` [PATCH 2/8] dt-bindings: mfd: Add compatible for the MediaTek MT6359 PMIC Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 21:31   ` Rob Herring
2020-07-23 21:31     ` Rob Herring
2020-07-23 21:31     ` Rob Herring
2020-07-28  6:33   ` Lee Jones
2020-07-28  6:33     ` Lee Jones
2020-07-28  6:33     ` Lee Jones
2020-07-23 12:58 ` [PATCH 3/8] dt-bindings: regulator: Add document for MT6359 regulator Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58 ` [PATCH 4/8] mfd: Add support for the MediaTek MT6359 PMIC Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-28  6:42   ` Lee Jones
2020-07-28  6:42     ` Lee Jones
2020-07-28  6:42     ` Lee Jones
2020-07-23 12:58 ` [PATCH 5/8] regulator: mt6359: Add support for MT6359 regulator Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-24 12:21   ` Mark Brown
2020-07-24 12:21     ` Mark Brown
2020-07-24 12:21     ` Mark Brown
2020-07-23 12:58 ` [PATCH 6/8] regulator: mt6359: Set the enable time for LDOs Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-24 12:22   ` Mark Brown
2020-07-24 12:22     ` Mark Brown
2020-07-24 12:22     ` Mark Brown
2020-07-23 12:58 ` [PATCH 7/8] regulator: mt6359: Add support for MT6359P regulator Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-24 12:23   ` Mark Brown
2020-07-24 12:23     ` Mark Brown
2020-07-24 12:23     ` Mark Brown
2020-07-23 12:58 ` [PATCH 8/8] arm64: dts: mt6359: add PMIC MT6359 related nodes Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang
2020-07-23 12:58   ` Hsin-Hsiung Wang

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=20200810073128.GC4411@dell \
    --to=lee.jones@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frank-w@public-files.de \
    --cc=hsin-hsiung.wang@mediatek.com \
    --cc=josef.friedl@speed.at \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=srv_heupstream@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 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.