linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Quan Nguyen <qnguyen@apm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>, Y Vo <yvo@apm.com>,
	Phong Vo <pvo@apm.com>, Loc Ho <lho@apm.com>,
	Feng Kan <fkan@apm.com>, Duc Dang <dhdang@apm.com>,
	patches <patches@apm.com>
Subject: Re: [PATCH v4 1/3] gpio: xgene: Enable X-Gene standby GPIO as interrupt controller
Date: Wed, 27 Jan 2016 13:10:51 +0000	[thread overview]
Message-ID: <56A8C1DB.5040606@arm.com> (raw)
In-Reply-To: <CAFopSPR1ZKinH=N29gaAu3M8oc-vfKUnPsFpAu3EUNb3Doi68w@mail.gmail.com>

Quan,

On 27/01/16 12:48, Quan Nguyen wrote:
> On Wed, Jan 27, 2016 at 12:39 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> On 26/01/16 16:27, Quan Nguyen wrote:
>>> On Tue, Jan 26, 2016 at 5:34 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>>>>
>>>> On 26/01/16 07:22, Quan Nguyen wrote:
>>>>> Enable X-Gene standby GPIO controller as interrupt controller to provide
>>>>> its own resources. This avoids ambiguity where GIC interrupt resource is
>>>>> use as X-Gene standby GPIO interrupt resource in user driver.
>>>>>
>>>>> Signed-off-by: Y Vo <yvo@apm.com>
>>>>> Signed-off-by: Quan Nguyen <qnguyen@apm.com>
>>>>> ---
>>>>>  drivers/gpio/gpio-xgene-sb.c | 331 ++++++++++++++++++++++++++++++++++++-------
>>>>>  1 file changed, 276 insertions(+), 55 deletions(-)
>>
>> [...]
>>>>> @@ -90,6 +301,32 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
>>>>>       if (IS_ERR(regs))
>>>>>               return PTR_ERR(regs);
>>>>>
>>>>> +     priv->regs = regs;
>>>>> +
>>>>> +     of_id = of_match_device(xgene_gpio_sb_of_match, &pdev->dev);
>>>>> +     if (of_id)
>>>>> +             priv->flags = (uintptr_t)of_id->data;
>>>>
>>>> Wait. Everything is hardcoded? So why do we have to deal with looking
>>>> into that structure if nothing is actually parametrized?
>>>
>>> There will be other instances with difference number of irq pins /gpio
>>> /start_irq_base etc.
>>
>> Then it has to be described in DT right now.
>>
> 
> What I was thinking is to have other id to match with difference
> instances and these code can be use for ACPI also. Let say
> "apm,xgene2-gpio-sb"
> Please help correcting me if it is not right.

I still think this is the wrong thing to do. You are hiding magic values
in the driver, for no good reason. If ACPI has such a broken model that
it cannot give you the various parameters you need, then this is an ACPI
problem you can solve in the ACPI-specific code. Alternatively, you
could also fix your ACPI tables to be less braindead.

But please do not turn the DT code into the same mess for the sake of
using the lowest common denominator. Have a set of properties describing
the HW, a compatibility string to nicely identify the revision, and use
that. You can still hardcode things for ACPI if you desperately need it.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2016-01-27 13:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  7:22 [PATCH v4 0/3] Enable X-Gene standby GPIO as interrupt controller Quan Nguyen
2016-01-26  7:22 ` [PATCH v4 1/3] gpio: xgene: " Quan Nguyen
2016-01-26 10:34   ` Marc Zyngier
2016-01-26 16:27     ` Quan Nguyen
2016-01-26 17:39       ` Marc Zyngier
2016-01-27 12:48         ` Quan Nguyen
2016-01-27 13:10           ` Marc Zyngier [this message]
2016-01-28  9:30             ` Quan Nguyen
2016-01-26  7:22 ` [PATCH v4 2/3] Documentation: gpio: Update description for X-Gene standby GPIO controller DTS binding Quan Nguyen
2016-01-29  2:46   ` Rob Herring
2016-01-29  4:18     ` Quan Nguyen
2016-01-26  7:22 ` [PATCH v4 3/3] arm64: dts: Update X-Gene standby GPIO controller DTS entries Quan Nguyen

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=56A8C1DB.5040606@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dhdang@apm.com \
    --cc=fkan@apm.com \
    --cc=jason@lakedaemon.net \
    --cc=lho@apm.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=patches@apm.com \
    --cc=pvo@apm.com \
    --cc=qnguyen@apm.com \
    --cc=tglx@linutronix.de \
    --cc=yvo@apm.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).