linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add irq_over_gpio DT support to STMPE
@ 2014-09-12  3:18 Sean Cross
  2014-09-12  3:18 ` [PATCH v2 1/2] mfd: stmpe: support gpio over irq under device tree Sean Cross
  2014-09-12  3:18 ` [PATCH v2 2/2] mfd: stmpe: Document DT binding for irq_over_gpio Sean Cross
  0 siblings, 2 replies; 5+ messages in thread
From: Sean Cross @ 2014-09-12  3:18 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones, linux-kernel, Randy Dunlap,
	Ian Campbell, Kumar Gala, Rob Herring, devicetree
  Cc: bunnie, Sean Cross

These patches add support for using a GPIO as an IRQ source for the
STMPE module when configured using device tree.

Changes since v1:
    - Split actual patch and Documentation into two parts

Sean Cross (2):
  mfd: stmpe: support gpio over irq under device tree
  mfd: stmpe: Document DT binding for irq_over_gpio

 Documentation/devicetree/bindings/mfd/stmpe.txt | 1 +
 drivers/mfd/stmpe.c                             | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.1.0


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

* [PATCH v2 1/2] mfd: stmpe: support gpio over irq under device tree
  2014-09-12  3:18 [PATCH v2 0/2] Add irq_over_gpio DT support to STMPE Sean Cross
@ 2014-09-12  3:18 ` Sean Cross
  2014-09-15 23:12   ` Lee Jones
  2014-09-12  3:18 ` [PATCH v2 2/2] mfd: stmpe: Document DT binding for irq_over_gpio Sean Cross
  1 sibling, 1 reply; 5+ messages in thread
From: Sean Cross @ 2014-09-12  3:18 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones, linux-kernel, Randy Dunlap,
	Ian Campbell, Kumar Gala, Rob Herring, devicetree
  Cc: bunnie, Sean Cross

The stmpe_platform_data has a irq_over_gpio field, which allows the
system to read STMPE events whenever an IRQ occurs on a GPIO pin.
This patch adds the ability to configure this field and to use a GPIO
as an IRQ source for boards configuring the STMPE in device tree.

Signed-off-by: Sean Cross <xobs@kosagi.com>
---
 drivers/mfd/stmpe.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 3b6bfa7..4c42b05 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1122,7 +1122,12 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
 	if (pdata->id < 0)
 		pdata->id = -1;
 
-	pdata->irq_trigger = IRQF_TRIGGER_NONE;
+	pdata->irq_gpio = of_get_named_gpio_flags(np, "irq-gpio", 0,
+				&pdata->irq_trigger);
+	if (gpio_is_valid(pdata->irq_gpio))
+		pdata->irq_over_gpio = 1;
+	else
+		pdata->irq_trigger = IRQF_TRIGGER_NONE;
 
 	of_property_read_u32(np, "st,autosleep-timeout",
 			&pdata->autosleep_timeout);
-- 
2.1.0


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

* [PATCH v2 2/2] mfd: stmpe: Document DT binding for irq_over_gpio
  2014-09-12  3:18 [PATCH v2 0/2] Add irq_over_gpio DT support to STMPE Sean Cross
  2014-09-12  3:18 ` [PATCH v2 1/2] mfd: stmpe: support gpio over irq under device tree Sean Cross
@ 2014-09-12  3:18 ` Sean Cross
  2014-09-15 23:13   ` Lee Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Sean Cross @ 2014-09-12  3:18 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones, linux-kernel, Randy Dunlap,
	Ian Campbell, Kumar Gala, Rob Herring, devicetree
  Cc: bunnie, Sean Cross

STMPE now supports using a GPIO as an IRQ source.  Document the device
tree binding for this option.

Signed-off-by: Sean Cross <xobs@kosagi.com>
---
 Documentation/devicetree/bindings/mfd/stmpe.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mfd/stmpe.txt b/Documentation/devicetree/bindings/mfd/stmpe.txt
index 56edb55..3fb68bf 100644
--- a/Documentation/devicetree/bindings/mfd/stmpe.txt
+++ b/Documentation/devicetree/bindings/mfd/stmpe.txt
@@ -13,6 +13,7 @@ Optional properties:
  - interrupt-parent             : Specifies which IRQ controller we're connected to
  - wakeup-source                : Marks the input device as wakable
  - st,autosleep-timeout         : Valid entries (ms); 4, 16, 32, 64, 128, 256, 512 and 1024
+ - irq-gpio                     : If present, which GPIO to use for event IRQ
 
 Example:
 
-- 
2.1.0


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

* Re: [PATCH v2 1/2] mfd: stmpe: support gpio over irq under device tree
  2014-09-12  3:18 ` [PATCH v2 1/2] mfd: stmpe: support gpio over irq under device tree Sean Cross
@ 2014-09-15 23:12   ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2014-09-15 23:12 UTC (permalink / raw)
  To: Sean Cross
  Cc: Samuel Ortiz, linux-kernel, Randy Dunlap, Ian Campbell,
	Kumar Gala, Rob Herring, devicetree, bunnie

On Fri, 12 Sep 2014, Sean Cross wrote:

> The stmpe_platform_data has a irq_over_gpio field, which allows the
> system to read STMPE events whenever an IRQ occurs on a GPIO pin.
> This patch adds the ability to configure this field and to use a GPIO
> as an IRQ source for boards configuring the STMPE in device tree.
> 
> Signed-off-by: Sean Cross <xobs@kosagi.com>
> ---
>  drivers/mfd/stmpe.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index 3b6bfa7..4c42b05 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -1122,7 +1122,12 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
>  	if (pdata->id < 0)
>  		pdata->id = -1;
>  
> -	pdata->irq_trigger = IRQF_TRIGGER_NONE;
> +	pdata->irq_gpio = of_get_named_gpio_flags(np, "irq-gpio", 0,
> +				&pdata->irq_trigger);
> +	if (gpio_is_valid(pdata->irq_gpio))
> +		pdata->irq_over_gpio = 1;
> +	else
> +		pdata->irq_trigger = IRQF_TRIGGER_NONE;
>  
>  	of_property_read_u32(np, "st,autosleep-timeout",
>  			&pdata->autosleep_timeout);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v2 2/2] mfd: stmpe: Document DT binding for irq_over_gpio
  2014-09-12  3:18 ` [PATCH v2 2/2] mfd: stmpe: Document DT binding for irq_over_gpio Sean Cross
@ 2014-09-15 23:13   ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2014-09-15 23:13 UTC (permalink / raw)
  To: Sean Cross
  Cc: Samuel Ortiz, linux-kernel, Randy Dunlap, Ian Campbell,
	Kumar Gala, Rob Herring, devicetree, bunnie

On Fri, 12 Sep 2014, Sean Cross wrote:

> STMPE now supports using a GPIO as an IRQ source.  Document the device
> tree binding for this option.
> 
> Signed-off-by: Sean Cross <xobs@kosagi.com>
> ---
>  Documentation/devicetree/bindings/mfd/stmpe.txt | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

> diff --git a/Documentation/devicetree/bindings/mfd/stmpe.txt b/Documentation/devicetree/bindings/mfd/stmpe.txt
> index 56edb55..3fb68bf 100644
> --- a/Documentation/devicetree/bindings/mfd/stmpe.txt
> +++ b/Documentation/devicetree/bindings/mfd/stmpe.txt
> @@ -13,6 +13,7 @@ Optional properties:
>   - interrupt-parent             : Specifies which IRQ controller we're connected to
>   - wakeup-source                : Marks the input device as wakable
>   - st,autosleep-timeout         : Valid entries (ms); 4, 16, 32, 64, 128, 256, 512 and 1024
> + - irq-gpio                     : If present, which GPIO to use for event IRQ
>  
>  Example:
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2014-09-15 23:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12  3:18 [PATCH v2 0/2] Add irq_over_gpio DT support to STMPE Sean Cross
2014-09-12  3:18 ` [PATCH v2 1/2] mfd: stmpe: support gpio over irq under device tree Sean Cross
2014-09-15 23:12   ` Lee Jones
2014-09-12  3:18 ` [PATCH v2 2/2] mfd: stmpe: Document DT binding for irq_over_gpio Sean Cross
2014-09-15 23:13   ` Lee Jones

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