devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gpio-rcar: DT and IRQ_TYPE_EDGE_BOTH
@ 2013-10-29  8:52 Simon Horman
  2013-10-30  7:04 ` Magnus Damm
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2013-10-29  8:52 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: SH-Linux, devicetree, Magnus Damm

Hi Laurent,

In 7e1092b5a264c4 ("gpio-rcar: Add support for IRQ_TYPE_EDGE_BOTH")
I added a 'has_both_edge_trigger' field to struct gpio_rcar_config.
Setting this adds support IRQ_TYPE_EDGE_BOTH. The motivation for
this was to allow use of the gpio-keys driver on the lager board.

I am now looking at enabling gpio-keys via DT for koelsch and lager
and find myself needing to set has_both_edge_trigger somehow.
I am wondering if you have any ideas on how best to do this.

So far I have two ideas:

1. Expose has_both_edge_trigger as a binding.

2. Set has_both_edge_trigger in the driver if the
   compat string is renesas,gpio-r8a7791 or renesas,gpio-r8a7790
   but not for other supported compat strings (as is currently the case).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gpio-rcar: DT and IRQ_TYPE_EDGE_BOTH
  2013-10-29  8:52 gpio-rcar: DT and IRQ_TYPE_EDGE_BOTH Simon Horman
@ 2013-10-30  7:04 ` Magnus Damm
  2013-10-30  8:26   ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Magnus Damm @ 2013-10-30  7:04 UTC (permalink / raw)
  To: Simon Horman; +Cc: Laurent Pinchart, SH-Linux, devicetree

Hi Simon,

On Tue, Oct 29, 2013 at 8:52 AM, Simon Horman <horms@verge.net.au> wrote:
> Hi Laurent,
>
> In 7e1092b5a264c4 ("gpio-rcar: Add support for IRQ_TYPE_EDGE_BOTH")
> I added a 'has_both_edge_trigger' field to struct gpio_rcar_config.
> Setting this adds support IRQ_TYPE_EDGE_BOTH. The motivation for
> this was to allow use of the gpio-keys driver on the lager board.
>
> I am now looking at enabling gpio-keys via DT for koelsch and lager
> and find myself needing to set has_both_edge_trigger somehow.
> I am wondering if you have any ideas on how best to do this.
>
> So far I have two ideas:
>
> 1. Expose has_both_edge_trigger as a binding.
>
> 2. Set has_both_edge_trigger in the driver if the
>    compat string is renesas,gpio-r8a7791 or renesas,gpio-r8a7790
>    but not for other supported compat strings (as is currently the case).

I think which to pick depends on the type of feature. In the case of
enabling both edge support for this GPIO driver, I believe going with
2) is the best way forward. The reason for this is that all GPIO
instances within a particular SoC seem to either have or not have
support for dual edges. At least that is the case on r8a7790 and
r8a7791.

There may be other properties in the future like per-GPIO hardware
debounce, and I suspect that those may be more suitable for 1) since
they are only supported on a certain set of GPIO pins. So from my POV
this is a case by case thing.

Cheers,

/ magnus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gpio-rcar: DT and IRQ_TYPE_EDGE_BOTH
  2013-10-30  7:04 ` Magnus Damm
@ 2013-10-30  8:26   ` Simon Horman
  2013-10-30 10:20     ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2013-10-30  8:26 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Laurent Pinchart, SH-Linux, devicetree

Hi Magnus,

On Wed, Oct 30, 2013 at 07:04:46AM +0000, Magnus Damm wrote:
> Hi Simon,
> 
> On Tue, Oct 29, 2013 at 8:52 AM, Simon Horman <horms@verge.net.au> wrote:
> > Hi Laurent,
> >
> > In 7e1092b5a264c4 ("gpio-rcar: Add support for IRQ_TYPE_EDGE_BOTH")
> > I added a 'has_both_edge_trigger' field to struct gpio_rcar_config.
> > Setting this adds support IRQ_TYPE_EDGE_BOTH. The motivation for
> > this was to allow use of the gpio-keys driver on the lager board.
> >
> > I am now looking at enabling gpio-keys via DT for koelsch and lager
> > and find myself needing to set has_both_edge_trigger somehow.
> > I am wondering if you have any ideas on how best to do this.
> >
> > So far I have two ideas:
> >
> > 1. Expose has_both_edge_trigger as a binding.
> >
> > 2. Set has_both_edge_trigger in the driver if the
> >    compat string is renesas,gpio-r8a7791 or renesas,gpio-r8a7790
> >    but not for other supported compat strings (as is currently the case).
> 
> I think which to pick depends on the type of feature. In the case of
> enabling both edge support for this GPIO driver, I believe going with
> 2) is the best way forward. The reason for this is that all GPIO
> instances within a particular SoC seem to either have or not have
> support for dual edges. At least that is the case on r8a7790 and
> r8a7791.
> 
> There may be other properties in the future like per-GPIO hardware
> debounce, and I suspect that those may be more suitable for 1) since
> they are only supported on a certain set of GPIO pins. So from my POV
> this is a case by case thing.

Thanks, that sounds reasonable from my POV.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gpio-rcar: DT and IRQ_TYPE_EDGE_BOTH
  2013-10-30  8:26   ` Simon Horman
@ 2013-10-30 10:20     ` Laurent Pinchart
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2013-10-30 10:20 UTC (permalink / raw)
  To: Simon Horman; +Cc: Magnus Damm, SH-Linux, devicetree

Hi Magnus and Simon,

On Wednesday 30 October 2013 17:26:10 Simon Horman wrote:
> On Wed, Oct 30, 2013 at 07:04:46AM +0000, Magnus Damm wrote:
> > On Tue, Oct 29, 2013 at 8:52 AM, Simon Horman <horms@verge.net.au> wrote:
> > > Hi Laurent,
> > > 
> > > In 7e1092b5a264c4 ("gpio-rcar: Add support for IRQ_TYPE_EDGE_BOTH")
> > > I added a 'has_both_edge_trigger' field to struct gpio_rcar_config.
> > > Setting this adds support IRQ_TYPE_EDGE_BOTH. The motivation for
> > > this was to allow use of the gpio-keys driver on the lager board.
> > > 
> > > I am now looking at enabling gpio-keys via DT for koelsch and lager
> > > and find myself needing to set has_both_edge_trigger somehow.
> > > I am wondering if you have any ideas on how best to do this.
> > > 
> > > So far I have two ideas:
> > > 
> > > 1. Expose has_both_edge_trigger as a binding.
> > > 
> > > 2. Set has_both_edge_trigger in the driver if the
> > >    compat string is renesas,gpio-r8a7791 or renesas,gpio-r8a7790
> > >    but not for other supported compat strings (as is currently the
> > >    case).
> > 
> > I think which to pick depends on the type of feature. In the case of
> > enabling both edge support for this GPIO driver, I believe going with
> > 2) is the best way forward. The reason for this is that all GPIO
> > instances within a particular SoC seem to either have or not have
> > support for dual edges. At least that is the case on r8a7790 and
> > r8a7791.
> > 
> > There may be other properties in the future like per-GPIO hardware
> > debounce, and I suspect that those may be more suitable for 1) since
> > they are only supported on a certain set of GPIO pins. So from my POV
> > this is a case by case thing.
> 
> Thanks, that sounds reasonable from my POV.

I agree, let's put have property in the driver.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-30 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29  8:52 gpio-rcar: DT and IRQ_TYPE_EDGE_BOTH Simon Horman
2013-10-30  7:04 ` Magnus Damm
2013-10-30  8:26   ` Simon Horman
2013-10-30 10:20     ` Laurent Pinchart

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).