All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/1] build: gpio-ir-tx for 3.13
@ 2017-08-27 10:35 Jasmin J.
  2017-08-27 10:35 ` [PATCH V2 1/1] build: gpio-ir-tx backport Jasmin J.
  2017-09-01  8:39 ` [PATCH V2 0/1] build: gpio-ir-tx for 3.13 Hans Verkuil
  0 siblings, 2 replies; 4+ messages in thread
From: Jasmin J. @ 2017-08-27 10:35 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil, d.scheller, sean, jasmin

From: Jasmin Jessich <jasmin@anw.at>

Changes to V1:
 Moved IR_GPIO_TX from 4.10.0 to 3.13.0 instead of adding it.

Kernel 3.17 introduces GPIOD_OUT_LOW/HIGH. gpio-ir-tx requires this
definitions. This patch adds the API calls prior to 3.17 to be used
by gpio-ir-tx.
With that gpio-ir-tx can be compiled back to Kernel 3.13.
I tested the compilation (not the functionality!) on 4.4, 3.13 and
3.4.

@Sean: Please check if the code in v3.16_gpio-ir-tx.patch looks
feasible for you (can't test this here). If not, we will drop this
patch and simply disable gpio-ir-tx for Kernels older than 3.17.

Jasmin Jessich (1):
  build: gpio-ir-tx backport

 backports/backports.txt          |  1 +
 backports/v3.16_gpio-ir-tx.patch | 25 +++++++++++++++++++++++++
 v4l/versions.txt                 |  2 +-
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 backports/v3.16_gpio-ir-tx.patch

-- 
2.7.4

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

* [PATCH V2 1/1] build: gpio-ir-tx backport
  2017-08-27 10:35 [PATCH V2 0/1] build: gpio-ir-tx for 3.13 Jasmin J.
@ 2017-08-27 10:35 ` Jasmin J.
  2017-09-01  8:39 ` [PATCH V2 0/1] build: gpio-ir-tx for 3.13 Hans Verkuil
  1 sibling, 0 replies; 4+ messages in thread
From: Jasmin J. @ 2017-08-27 10:35 UTC (permalink / raw)
  To: linux-media; +Cc: hverkuil, d.scheller, sean, jasmin

From: Jasmin Jessich <jasmin@anw.at>

- Added v3.16_gpio-ir-tx.patch
- gpio_ir_tx needs 3.13. at least

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
---
 backports/backports.txt          |  1 +
 backports/v3.16_gpio-ir-tx.patch | 25 +++++++++++++++++++++++++
 v4l/versions.txt                 |  2 +-
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 backports/v3.16_gpio-ir-tx.patch

diff --git a/backports/backports.txt b/backports/backports.txt
index 873b2f5..b511e57 100644
--- a/backports/backports.txt
+++ b/backports/backports.txt
@@ -83,6 +83,7 @@ add v3.17_fix_clamp.patch
 add v3.16_netdev.patch
 add v3.16_wait_on_bit.patch
 add v3.16_void_gpiochip_remove.patch
+add v3.16_gpio-ir-tx.patch
 
 [3.12.255]
 add v3.12_kfifo_in.patch
diff --git a/backports/v3.16_gpio-ir-tx.patch b/backports/v3.16_gpio-ir-tx.patch
new file mode 100644
index 0000000..3ec4304
--- /dev/null
+++ b/backports/v3.16_gpio-ir-tx.patch
@@ -0,0 +1,25 @@
+diff --git a/drivers/media/rc/gpio-ir-tx.c b/drivers/media/rc/gpio-ir-tx.c
+index cd476ca..f48aba2 100644
+--- a/drivers/media/rc/gpio-ir-tx.c
++++ b/drivers/media/rc/gpio-ir-tx.c
+@@ -136,13 +136,19 @@ static int gpio_ir_tx_probe(struct platform_device *pdev)
+ 	if (!rcdev)
+ 		return -ENOMEM;
+ 
+-	gpio_ir->gpio = devm_gpiod_get(&pdev->dev, NULL, GPIOD_OUT_LOW);
++	gpio_ir->gpio = devm_gpiod_get(&pdev->dev, NULL);
+ 	if (IS_ERR(gpio_ir->gpio)) {
+ 		if (PTR_ERR(gpio_ir->gpio) != -EPROBE_DEFER)
+ 			dev_err(&pdev->dev, "Failed to get gpio (%ld)\n",
+ 				PTR_ERR(gpio_ir->gpio));
+ 		return PTR_ERR(gpio_ir->gpio);
+ 	}
++	rc = gpiod_direction_output(gpio_ir->gpio, 0);
++	if (!rc) {
++		dev_err(&pdev->dev, "Failed to set output direction(%d)\n", rc);
++		gpiod_put(gpio_ir->gpio);
++		return rc;
++	}
+ 
+ 	rcdev->priv = gpio_ir;
+ 	rcdev->driver_name = DRIVER_NAME;
diff --git a/v4l/versions.txt b/v4l/versions.txt
index 7634038..7c54778 100644
--- a/v4l/versions.txt
+++ b/v4l/versions.txt
@@ -39,7 +39,6 @@ VIDEO_XILINX
 VIDEO_OV5670
 # needs ktime_t as s64
 CEC_PIN
-IR_GPIO_TX
 
 [4.7.0]
 # needs i2c_mux_alloc
@@ -98,6 +97,7 @@ VIDEO_COBALT
 [3.13.0]
 # needs gpio/consumer.h
 RADIO_SI4713
+IR_GPIO_TX
 
 [3.12.0]
 # BIN_ATTR_RW was changed
-- 
2.7.4

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

* Re: [PATCH V2 0/1] build: gpio-ir-tx for 3.13
  2017-08-27 10:35 [PATCH V2 0/1] build: gpio-ir-tx for 3.13 Jasmin J.
  2017-08-27 10:35 ` [PATCH V2 1/1] build: gpio-ir-tx backport Jasmin J.
@ 2017-09-01  8:39 ` Hans Verkuil
  2017-09-02  9:54   ` Jasmin J.
  1 sibling, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2017-09-01  8:39 UTC (permalink / raw)
  To: Jasmin J., linux-media; +Cc: d.scheller, sean

On 27/08/17 12:35, Jasmin J. wrote:
> From: Jasmin Jessich <jasmin@anw.at>
> 
> Changes to V1:
>  Moved IR_GPIO_TX from 4.10.0 to 3.13.0 instead of adding it.
> 
> Kernel 3.17 introduces GPIOD_OUT_LOW/HIGH. gpio-ir-tx requires this
> definitions. This patch adds the API calls prior to 3.17 to be used
> by gpio-ir-tx.
> With that gpio-ir-tx can be compiled back to Kernel 3.13.
> I tested the compilation (not the functionality!) on 4.4, 3.13 and
> 3.4.
> 
> @Sean: Please check if the code in v3.16_gpio-ir-tx.patch looks
> feasible for you (can't test this here). If not, we will drop this
> patch and simply disable gpio-ir-tx for Kernels older than 3.17.

I moved gpio-ir-tx to 3.17. Is there a really urgent need to compile
it for older kernels?

The problem is that you have to maintain that backports patch as well.
So I kept it simple.

Regards,

	Hans

> 
> Jasmin Jessich (1):
>   build: gpio-ir-tx backport
> 
>  backports/backports.txt          |  1 +
>  backports/v3.16_gpio-ir-tx.patch | 25 +++++++++++++++++++++++++
>  v4l/versions.txt                 |  2 +-
>  3 files changed, 27 insertions(+), 1 deletion(-)
>  create mode 100644 backports/v3.16_gpio-ir-tx.patch
> 

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

* Re: [PATCH V2 0/1] build: gpio-ir-tx for 3.13
  2017-09-01  8:39 ` [PATCH V2 0/1] build: gpio-ir-tx for 3.13 Hans Verkuil
@ 2017-09-02  9:54   ` Jasmin J.
  0 siblings, 0 replies; 4+ messages in thread
From: Jasmin J. @ 2017-09-02  9:54 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: d.scheller, sean

Hello Hans!

> I moved gpio-ir-tx to 3.17. Is there a really urgent need to compile
> it for older kernels?
No, 3.17 is fine also.

BR,
   Jasmin

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

end of thread, other threads:[~2017-09-02  9:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27 10:35 [PATCH V2 0/1] build: gpio-ir-tx for 3.13 Jasmin J.
2017-08-27 10:35 ` [PATCH V2 1/1] build: gpio-ir-tx backport Jasmin J.
2017-09-01  8:39 ` [PATCH V2 0/1] build: gpio-ir-tx for 3.13 Hans Verkuil
2017-09-02  9:54   ` Jasmin J.

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.