All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Abraham <thomas.abraham@linaro.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linux-kernel@vger.kernel.org, k.lewandowsk@samsung.com,
	devicetree-discuss@lists.ozlabs.org, rob.herring@calxeda.com,
	kgene.kim@samsung.com, broonie@opensource.wolfsonmicro.com,
	myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, patches@linaro.org
Subject: Re: [PATCH v4 1/2] mfd: add irq domain support for max8997 interrupts
Date: Tue, 17 Apr 2012 23:41:51 +0530	[thread overview]
Message-ID: <CAJuYYwRa-_0HWeSuOgAT20dCCDdg=NBruQ9_m28TFZkXMRJhaw@mail.gmail.com> (raw)
In-Reply-To: <20120330220619.334AC3E054E@localhost>

On 31 March 2012 03:36, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Sat, 24 Mar 2012 15:19:49 +0530, Thomas Abraham <thomas.abraham@linaro.org> wrote:
>> Add irq domain support for max8997 interrupts. The reverse mapping method
>> used is linear mapping since the sub-drivers of max8997 such as regulator
>> and charger drivers can use the max8997 irq_domain to get the linux irq
>> number for max8997 interrupts. All uses of irq_base in platform data and
>> max8997 driver private data are removed.
>>
>> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> Acked-by: Grant Likely <grant.likely@secretlab.ca>
>> ---
>>  arch/arm/mach-exynos/mach-nuri.c    |    4 --
>>  arch/arm/mach-exynos/mach-origen.c  |    1 -
>>  drivers/mfd/max8997-irq.c           |   61 ++++++++++++++++++++--------------
>>  drivers/mfd/max8997.c               |    1 -
>>  include/linux/mfd/max8997-private.h |    4 ++-
>>  include/linux/mfd/max8997.h         |    1 -
>>  6 files changed, 39 insertions(+), 33 deletions(-)
>>
>> diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
>> index 7ac81ce..b21d85d 100644
>> --- a/arch/arm/mach-exynos/mach-nuri.c
>> +++ b/arch/arm/mach-exynos/mach-nuri.c
>> @@ -1077,12 +1077,8 @@ static struct platform_device nuri_max8903_device = {
>>  static void __init nuri_power_init(void)
>>  {
>>       int gpio;
>> -     int irq_base = IRQ_GPIO_END + 1;
>>       int ta_en = 0;
>>
>> -     nuri_max8997_pdata.irq_base = irq_base;
>> -     irq_base += MAX8997_IRQ_NR;
>> -
>>       gpio = EXYNOS4_GPX0(7);
>>       gpio_request(gpio, "AP_PMIC_IRQ");
>>       s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
>> diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
>> index 827cb99..d3b2e9d 100644
>> --- a/arch/arm/mach-exynos/mach-origen.c
>> +++ b/arch/arm/mach-exynos/mach-origen.c
>> @@ -424,7 +424,6 @@ static struct max8997_platform_data __initdata origen_max8997_pdata = {
>>       .buck1_gpiodvs  = false,
>>       .buck2_gpiodvs  = false,
>>       .buck5_gpiodvs  = false,
>> -     .irq_base       = IRQ_GPIO_END + 1,
>>
>>       .ignore_gpiodvs_side_effect = true,
>>       .buck125_default_idx = 0x0,
>> diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
>> index 09274cf..00390a1 100644
>> --- a/drivers/mfd/max8997-irq.c
>> +++ b/drivers/mfd/max8997-irq.c
>> @@ -142,7 +142,8 @@ static void max8997_irq_sync_unlock(struct irq_data *data)
>>  static const inline struct max8997_irq_data *
>>  irq_to_max8997_irq(struct max8997_dev *max8997, int irq)
>>  {
>> -     return &max8997_irqs[irq - max8997->irq_base];
>> +     struct irq_data *data = irq_get_irq_data(irq);
>> +     return &max8997_irqs[data->hwirq];
>>  }
>
> Haha, this is kind of bogus now.  There are only two users of this
> function, and *both* of them already have the irq_data pointer.
> Instead of this, delete this function entirely and make each caller
> derefernce max8997_irqs directly:
>
>        const struct max8997_irq_data *irq_data = &max8997_irqs[data->hwirq];
>
> Otherwise, looks good.  After fixing you can add my:
>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>

Hi Grant,

Thanks for the suggestion. I have modified the code accordingly and
included your ack.

Regards,
Thomas.

WARNING: multiple messages have this Message-ID (diff)
From: thomas.abraham@linaro.org (Thomas Abraham)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/2] mfd: add irq domain support for max8997 interrupts
Date: Tue, 17 Apr 2012 23:41:51 +0530	[thread overview]
Message-ID: <CAJuYYwRa-_0HWeSuOgAT20dCCDdg=NBruQ9_m28TFZkXMRJhaw@mail.gmail.com> (raw)
In-Reply-To: <20120330220619.334AC3E054E@localhost>

On 31 March 2012 03:36, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Sat, 24 Mar 2012 15:19:49 +0530, Thomas Abraham <thomas.abraham@linaro.org> wrote:
>> Add irq domain support for max8997 interrupts. The reverse mapping method
>> used is linear mapping since the sub-drivers of max8997 such as regulator
>> and charger drivers can use the max8997 irq_domain to get the linux irq
>> number for max8997 interrupts. All uses of irq_base in platform data and
>> max8997 driver private data are removed.
>>
>> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> Acked-by: Grant Likely <grant.likely@secretlab.ca>
>> ---
>> ?arch/arm/mach-exynos/mach-nuri.c ? ?| ? ?4 --
>> ?arch/arm/mach-exynos/mach-origen.c ?| ? ?1 -
>> ?drivers/mfd/max8997-irq.c ? ? ? ? ? | ? 61 ++++++++++++++++++++--------------
>> ?drivers/mfd/max8997.c ? ? ? ? ? ? ? | ? ?1 -
>> ?include/linux/mfd/max8997-private.h | ? ?4 ++-
>> ?include/linux/mfd/max8997.h ? ? ? ? | ? ?1 -
>> ?6 files changed, 39 insertions(+), 33 deletions(-)
>>
>> diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
>> index 7ac81ce..b21d85d 100644
>> --- a/arch/arm/mach-exynos/mach-nuri.c
>> +++ b/arch/arm/mach-exynos/mach-nuri.c
>> @@ -1077,12 +1077,8 @@ static struct platform_device nuri_max8903_device = {
>> ?static void __init nuri_power_init(void)
>> ?{
>> ? ? ? int gpio;
>> - ? ? int irq_base = IRQ_GPIO_END + 1;
>> ? ? ? int ta_en = 0;
>>
>> - ? ? nuri_max8997_pdata.irq_base = irq_base;
>> - ? ? irq_base += MAX8997_IRQ_NR;
>> -
>> ? ? ? gpio = EXYNOS4_GPX0(7);
>> ? ? ? gpio_request(gpio, "AP_PMIC_IRQ");
>> ? ? ? s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
>> diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
>> index 827cb99..d3b2e9d 100644
>> --- a/arch/arm/mach-exynos/mach-origen.c
>> +++ b/arch/arm/mach-exynos/mach-origen.c
>> @@ -424,7 +424,6 @@ static struct max8997_platform_data __initdata origen_max8997_pdata = {
>> ? ? ? .buck1_gpiodvs ?= false,
>> ? ? ? .buck2_gpiodvs ?= false,
>> ? ? ? .buck5_gpiodvs ?= false,
>> - ? ? .irq_base ? ? ? = IRQ_GPIO_END + 1,
>>
>> ? ? ? .ignore_gpiodvs_side_effect = true,
>> ? ? ? .buck125_default_idx = 0x0,
>> diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
>> index 09274cf..00390a1 100644
>> --- a/drivers/mfd/max8997-irq.c
>> +++ b/drivers/mfd/max8997-irq.c
>> @@ -142,7 +142,8 @@ static void max8997_irq_sync_unlock(struct irq_data *data)
>> ?static const inline struct max8997_irq_data *
>> ?irq_to_max8997_irq(struct max8997_dev *max8997, int irq)
>> ?{
>> - ? ? return &max8997_irqs[irq - max8997->irq_base];
>> + ? ? struct irq_data *data = irq_get_irq_data(irq);
>> + ? ? return &max8997_irqs[data->hwirq];
>> ?}
>
> Haha, this is kind of bogus now. ?There are only two users of this
> function, and *both* of them already have the irq_data pointer.
> Instead of this, delete this function entirely and make each caller
> derefernce max8997_irqs directly:
>
> ? ? ? ?const struct max8997_irq_data *irq_data = &max8997_irqs[data->hwirq];
>
> Otherwise, looks good. ?After fixing you can add my:
>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>

Hi Grant,

Thanks for the suggestion. I have modified the code accordingly and
included your ack.

Regards,
Thomas.

  reply	other threads:[~2012-04-17 18:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-24  9:49 [PATCH v4 0/2] regulator: add irq domain and device tree support for MAX8997 Thomas Abraham
2012-03-24  9:49 ` Thomas Abraham
2012-03-24  9:49 ` Thomas Abraham
2012-03-24  9:49 ` [PATCH v4 1/2] mfd: add irq domain support for max8997 interrupts Thomas Abraham
2012-03-24  9:49   ` Thomas Abraham
2012-03-24  9:49   ` Thomas Abraham
2012-03-26 12:20   ` MyungJoo Ham
2012-03-26 12:20     ` MyungJoo Ham
2012-03-30 22:06   ` Grant Likely
2012-03-30 22:06     ` Grant Likely
2012-04-17 18:11     ` Thomas Abraham [this message]
2012-04-17 18:11       ` Thomas Abraham
2012-04-04 21:22   ` Mark Brown
2012-04-04 21:22     ` Mark Brown
2012-04-16 15:32     ` Samuel Ortiz
2012-04-16 15:32       ` Samuel Ortiz
2012-04-16 18:47   ` Mark Brown
2012-04-16 18:47     ` Mark Brown
2012-03-24  9:49 ` [PATCH v4 2/2] regulator: add device tree support for max8997 Thomas Abraham
2012-03-24  9:49   ` Thomas Abraham
2012-03-27  6:40   ` MyungJoo Ham
2012-03-27  6:40     ` MyungJoo Ham
2012-03-28 17:03   ` Karol Lewandowski
2012-03-28 17:03     ` Karol Lewandowski
2012-04-17 18:35     ` Thomas Abraham
2012-04-17 18:35       ` Thomas Abraham
2012-04-17 18:38       ` Mark Brown
2012-04-17 18:38         ` Mark Brown
2012-04-18  8:16         ` Thomas Abraham
2012-04-18  8:16           ` Thomas Abraham
2012-03-30 22:09   ` Grant Likely
2012-03-30 22:09     ` Grant Likely
2012-04-16 18:51   ` Mark Brown
2012-04-16 18:51     ` Mark Brown
2012-04-16 18:56     ` Thomas Abraham
2012-04-16 18:56       ` Thomas Abraham

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='CAJuYYwRa-_0HWeSuOgAT20dCCDdg=NBruQ9_m28TFZkXMRJhaw@mail.gmail.com' \
    --to=thomas.abraham@linaro.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=k.lewandowsk@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=patches@linaro.org \
    --cc=rob.herring@calxeda.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.