All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-input@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Vipul Kumar Samar <vipulkumar.samar@st.com>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH] mfd: stmpe: Pull IRQ GPIO number from DT during DT-based probe
Date: Mon, 7 Jan 2013 16:13:33 +0100	[thread overview]
Message-ID: <201301071613.33573.marex@denx.de> (raw)
In-Reply-To: <20130107150341.GT21994@gmail.com>

Dear Lee Jones,

> On Mon, 07 Jan 2013, Marek Vasut wrote:
> > In case of a DT-based probe of the stmpe MFD driver, the irq_gpio was
> > zero, which resulted in the driver failing to probe.
> > 
> > Implement DT properties "irq-over-gpio" and "irq-gpios" which are already
> > used in "arch/arm/boot/dts/spear320-hmi.dts" to circumvent these
> > problems.
> 
> This must have slipped through the gaps. It should be removed.

True

> > The new
> > behaviour is the expected one and copies the behavior of
> > platform_data-based probe.
> 
> Blindly copying platform data behaviour to DT bindings is seldom a good
> idea.

Do you have suggestions how to pass these information? I suspect the irq-over-
gpio property can be killed, since if irq-gpios prop is there, it implies irq-
over-gpio anyway.

> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Samuel Ortiz <sameo@linux.intel.com>
> > Cc: Vipul Kumar Samar <vipulkumar.samar@st.com>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> > 
> >  drivers/mfd/stmpe.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> > index 4b11202..fb9cd6f 100644
> > --- a/drivers/mfd/stmpe.c
> > +++ b/drivers/mfd/stmpe.c
> > @@ -1018,6 +1018,11 @@ void stmpe_of_probe(struct stmpe_platform_data
> > *pdata, struct device_node *np)
> > 
> >  	pdata->id = -1;
> >  	pdata->irq_trigger = IRQF_TRIGGER_NONE;
> > 
> > +	pdata->irq_over_gpio = of_get_property(np, "irq-over-gpio", NULL);
> 
> This is a new DT binding and you haven't provided any documentation for it.
> 
> Also, there is no reason for the binding to exist.
> 
> Lots of drivers use GPIO pins as IRQs.

Right, this can be removed and only the 'irq-gpios' can be kept around. What do 
you say?

> > +	pdata->irq_gpio = of_get_named_gpio(np, "irq-gpios", 0);
> > +	if (!gpio_is_valid(pdata->irq_gpio))
> > +		pdata->irq_gpio = -1;
> > +
> > 
> >  	of_property_read_u32(np, "st,autosleep-timeout",
> >  	
> >  			&pdata->autosleep_timeout);

Best regards,
Marek Vasut

WARNING: multiple messages have this Message-ID (diff)
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mfd: stmpe: Pull IRQ GPIO number from DT during DT-based probe
Date: Mon, 7 Jan 2013 16:13:33 +0100	[thread overview]
Message-ID: <201301071613.33573.marex@denx.de> (raw)
In-Reply-To: <20130107150341.GT21994@gmail.com>

Dear Lee Jones,

> On Mon, 07 Jan 2013, Marek Vasut wrote:
> > In case of a DT-based probe of the stmpe MFD driver, the irq_gpio was
> > zero, which resulted in the driver failing to probe.
> > 
> > Implement DT properties "irq-over-gpio" and "irq-gpios" which are already
> > used in "arch/arm/boot/dts/spear320-hmi.dts" to circumvent these
> > problems.
> 
> This must have slipped through the gaps. It should be removed.

True

> > The new
> > behaviour is the expected one and copies the behavior of
> > platform_data-based probe.
> 
> Blindly copying platform data behaviour to DT bindings is seldom a good
> idea.

Do you have suggestions how to pass these information? I suspect the irq-over-
gpio property can be killed, since if irq-gpios prop is there, it implies irq-
over-gpio anyway.

> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Samuel Ortiz <sameo@linux.intel.com>
> > Cc: Vipul Kumar Samar <vipulkumar.samar@st.com>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> > 
> >  drivers/mfd/stmpe.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> > index 4b11202..fb9cd6f 100644
> > --- a/drivers/mfd/stmpe.c
> > +++ b/drivers/mfd/stmpe.c
> > @@ -1018,6 +1018,11 @@ void stmpe_of_probe(struct stmpe_platform_data
> > *pdata, struct device_node *np)
> > 
> >  	pdata->id = -1;
> >  	pdata->irq_trigger = IRQF_TRIGGER_NONE;
> > 
> > +	pdata->irq_over_gpio = of_get_property(np, "irq-over-gpio", NULL);
> 
> This is a new DT binding and you haven't provided any documentation for it.
> 
> Also, there is no reason for the binding to exist.
> 
> Lots of drivers use GPIO pins as IRQs.

Right, this can be removed and only the 'irq-gpios' can be kept around. What do 
you say?

> > +	pdata->irq_gpio = of_get_named_gpio(np, "irq-gpios", 0);
> > +	if (!gpio_is_valid(pdata->irq_gpio))
> > +		pdata->irq_gpio = -1;
> > +
> > 
> >  	of_property_read_u32(np, "st,autosleep-timeout",
> >  	
> >  			&pdata->autosleep_timeout);

Best regards,
Marek Vasut

  reply	other threads:[~2013-01-07 15:13 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 14:29 [PATCH] mfd: stmpe: Pull IRQ GPIO number from DT during DT-based probe Marek Vasut
2013-01-07 14:29 ` Marek Vasut
2013-01-07 15:03 ` Lee Jones
2013-01-07 15:03   ` Lee Jones
2013-01-07 15:13   ` Marek Vasut [this message]
2013-01-07 15:13     ` Marek Vasut
2013-01-07 15:44     ` Lee Jones
2013-01-07 15:44       ` Lee Jones
2013-01-07 18:19     ` Viresh Kumar
2013-01-07 18:19       ` Viresh Kumar
2013-01-08  3:52       ` vipul kumar samar
2013-01-08  3:52         ` vipul kumar samar
2013-01-08  9:41         ` Lee Jones
2013-01-08  9:41           ` Lee Jones
2013-01-08  9:44           ` Marek Vasut
2013-01-08  9:44             ` Marek Vasut
2013-01-08  9:48             ` Marek Vasut
2013-01-08  9:48               ` Marek Vasut
2013-01-08 10:47               ` Viresh Kumar
2013-01-08 10:47                 ` Viresh Kumar
2013-01-08 11:11                 ` Lee Jones
2013-01-08 11:11                   ` Lee Jones
2013-01-08 11:14                   ` Viresh Kumar
2013-01-08 11:14                     ` Viresh Kumar
2013-01-08 11:18                     ` Laxman Dewangan
2013-01-08 11:18                       ` Laxman Dewangan
2013-01-08 11:23                       ` Viresh Kumar
2013-01-08 11:23                         ` Viresh Kumar
2013-01-10 11:42                     ` Linus Walleij
2013-01-10 11:42                       ` Linus Walleij
2013-01-10 12:57                       ` Lee Jones
2013-01-10 12:57                         ` Lee Jones
2013-02-08 22:51                       ` Grant Likely
2013-02-08 22:51                         ` Grant Likely
2013-02-14 16:26                         ` Marek Vasut
2013-02-14 16:26                           ` Marek Vasut

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=201301071613.33573.marex@denx.de \
    --to=marex@denx.de \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=vipulkumar.samar@st.com \
    --cc=viresh.kumar@linaro.org \
    /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.