Skip to contentSkip to conversation

media: dt-bindings: bind nokia,n900-ir to generic pwm-ir-tx driver

PATCH In review Sean Young 5 participants 9 messages Jul 13, 2018 – Sep 10, 2018

Subsystems (6)
lore
Share & tools
lore

Sean Young

author maintainer
#0 lore raw

PATCH v3 1/2 media: dt-bindings: bind nokia,n900-ir to generic pwm-ir-tx driver

The generic pwm-ir-tx driver should work for the Nokia n900.

Compile tested only.

Cc Rob Herring <[email protected]>
Cc Ivaylo Dimitrov <[email protected]>
Cc Pali Rohár <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Timo Kokkonen <[email protected]>
Cc Tony Lindgren <[email protected]>
---
 arch/arm/boot/dts/omap3-n900.dts | 2 +-
 drivers/media/rc/pwm-ir-tx.c     | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap3-n900.dts +1 -1
index 182a53991c90..fd12dea15799 100644
@@ -154,7 +154,7 @@
 	};
 
 	ir: n900-ir {
-		compatible = "nokia,n900-ir";
+		compatible = "nokia,n900-ir", "pwm-ir-tx";
 		pwms = <&pwm9 0 26316 0>; /* 38000 Hz */
 	};
 
drivers/media/rc/pwm-ir-tx.c +1 -0
index 27d0f5837a76..272947b430c8 100644
@@ -30,6 +30,7 @@ struct pwm_ir {
 };
 
 static const struct of_device_id pwm_ir_of_match[] = {
+	{ .compatible = "nokia,n900-ir" },
 	{ .compatible = "pwm-ir-tx", },
 	{ },
 };
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v3 2/2 media: rc: remove ir-rx51 in favour of generic pwm-ir-tx

The ir-rx51 is a pwm-based TX driver specific to the N900. This can be handled entirely by the generic pwm-ir-tx driver.

Note that the suspend code in the ir-rx51 driver is unnecessary, since during transmit, the process is not in interruptable sleep. The process is not put to sleep until the transmit completes.

Compile tested only.

Cc Ivaylo Dimitrov <[email protected]>
Cc Pali Rohár <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Timo Kokkonen <[email protected]>
Cc Tony Lindgren <[email protected]>
---
 arch/arm/configs/omap2plus_defconfig |   1 -
 drivers/media/rc/Kconfig             |  10 -
 drivers/media/rc/Makefile            |   1 -
 drivers/media/rc/ir-rx51.c           | 305 ---------------------------
 4 files changed, 317 deletions(-)
 delete mode 100644 drivers/media/rc/ir-rx51.c
arch/arm/configs/omap2plus_defconfig +0 -1
index 6491419b1dad..1ce489a250e0 100644
@@ -325,7 +325,6 @@ CONFIG_RC_CORE=m
 CONFIG_LIRC=y
 CONFIG_RC_DEVICES=y
 CONFIG_IR_SPI=m
-CONFIG_IR_RX51=m
 CONFIG_IR_GPIO_TX=m
 CONFIG_IR_PWM_TX=m
 CONFIG_MEDIA_SUPPORT=m
drivers/media/rc/Kconfig +0 -10
index 1021c08a9ba4..3817127bd240 100644
@@ -377,16 +377,6 @@ config IR_TTUSBIR
 	   To compile this driver as a module, choose M here: the module will
 	   be called ttusbir.
 
-config IR_RX51
-	tristate "Nokia N900 IR transmitter diode"
-	depends on (OMAP_DM_TIMER && PWM_OMAP_DMTIMER && ARCH_OMAP2PLUS || COMPILE_TEST) && RC_CORE
-	---help---
-	   Say Y or M here if you want to enable support for the IR
-	   transmitter diode built in the Nokia N900 (RX51) device.
-
-	   The driver uses omap DM timers for generating the carrier
-	   wave and pulses.
-
 source "drivers/media/rc/img-ir/Kconfig"
 
 config RC_LOOPBACK
drivers/media/rc/Makefile +0 -1
index e0340d043fe8..124a823555bc 100644
@@ -29,7 +29,6 @@ obj-$(CONFIG_IR_MESON) += meson-ir.o
 obj-$(CONFIG_IR_NUVOTON) += nuvoton-cir.o
 obj-$(CONFIG_IR_ENE) += ene_ir.o
 obj-$(CONFIG_IR_REDRAT3) += redrat3.o
-obj-$(CONFIG_IR_RX51) += ir-rx51.o
 obj-$(CONFIG_IR_SPI) += ir-spi.o
 obj-$(CONFIG_IR_STREAMZAP) += streamzap.o
 obj-$(CONFIG_IR_WINBOND_CIR) += winbond-cir.o
drivers/media/rc/ir-rx51.c deleted +0 -305

305 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v3 2/2] media: rc: remove ir-rx51 in favour of generic pwm-ir-tx

Hi,

Quoted 9 lines · Sean Young

The ir-rx51 is a pwm-based TX driver specific to the N900. This can be handled entirely by the generic pwm-ir-tx driver.

Note that the suspend code in the ir-rx51 driver is unnecessary, since during transmit, the process is not in interruptable sleep. The process is not put to sleep until the transmit completes.

Compile tested only.

I would like to see this being tested on a real HW, however I am on a holiday for the next week so won't be able to test till I am back.

@Pali - do you have n900 with fremantle, upstream kernel and pierogi to test pwm-ir-tx on it?

Ivo

#3 lore raw

Re: [PATCH v3 2/2] media: rc: remove ir-rx51 in favour of generic pwm-ir-tx

Quoted 10 lines · On Friday 13 July 2018 17:38:25 Ivaylo Dimitrov wrote:

Hi,

Quoted 7 lines · Sean Young

The ir-rx51 is a pwm-based TX driver specific to the N900. This can be handled entirely by the generic pwm-ir-tx driver.

Note that the suspend code in the ir-rx51 driver is unnecessary, since during transmit, the process is not in interruptable sleep. The process is not put to sleep until the transmit completes.

Quoted 8 lines
Quoted 2 lines

Compile tested only.

I would like to see this being tested on a real HW, however I am on a holiday for the next week so won't be able to test till I am back.

@Pali - do you have n900 with fremantle, upstream kernel and pierogi to test pwm-ir-tx on it?

Hi! Currently on my N900 with Maemo Fremantle is 2.6.28 and 3.12 kernels. And 3.12 is a far away from current upstream kernel.

Signature · 2 lines
Pali Rohár
[email protected]
author maintainer
#4 lore raw

Re: [PATCH v3 2/2] media: rc: remove ir-rx51 in favour of generic pwm-ir-tx

In reply to Ivaylo Dimitrov
Quoted 10 lines · Ivaylo Dimitrov

Hi,

Quoted 7 lines · Sean Young

The ir-rx51 is a pwm-based TX driver specific to the N900. This can be handled entirely by the generic pwm-ir-tx driver.

Note that the suspend code in the ir-rx51 driver is unnecessary, since during transmit, the process is not in interruptable sleep. The process is not put to sleep until the transmit completes.

Quoted 8 lines
Quoted 2 lines

Compile tested only.

I would like to see this being tested on a real HW, however I am on a holiday for the next week so won't be able to test till I am back.

@Pali - do you have n900 with fremantle, upstream kernel and pierogi to test pwm-ir-tx on it?

It would be nice to have this verified on real hardware, if possible. If not, I would like to merge this anyway. If there are any problems we can always later patch any problem in pwm-ir-tx for the n900.

Sean

#5 lore raw
In reply to Sean Young

Em Fri, 13 Jul 2018 13:22:29 +0100
Sean Young <[email protected]> escreveu:

Quoted 3 lines

The generic pwm-ir-tx driver should work for the Nokia n900.

Compile tested only.

It would be good to have some tests...

Quoted 7 lines
Cc Rob Herring <[email protected]>
Cc Ivaylo Dimitrov <[email protected]>
Cc Pali Rohár <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Timo Kokkonen <[email protected]>
Cc Tony Lindgren <[email protected]>

And some acks

Before merging it.

Quoted 24 lines
---
 arch/arm/boot/dts/omap3-n900.dts | 2 +-
 drivers/media/rc/pwm-ir-tx.c     | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap3-n900.dts +1 -1
index 182a53991c90..fd12dea15799 100644
@@ -154,7 +154,7 @@
 	};
 
 	ir: n900-ir {
-		compatible = "nokia,n900-ir";
+		compatible = "nokia,n900-ir", "pwm-ir-tx";
 		pwms = <&pwm9 0 26316 0>; /* 38000 Hz */
 	};
 
drivers/media/rc/pwm-ir-tx.c +0 -0
index 27d0f5837a76..272947b430c8 100644

drivers/media/rc/pwm-ir-tx.c struct pwm_ir { · line 36

Quoted 7 lines
drivers/media/rc/pwm-ir-tx.c +1 -0
@@ -30,6 +30,7 @@ struct pwm_ir {
 };
 
 static const struct of_device_id pwm_ir_of_match[] = {
+	{ .compatible = "nokia,n900-ir" },
 	{ .compatible = "pwm-ir-tx", },
 	{ },
 };

Thanks,
Mauro

#6 lore raw
Quoted 9 lines · Mauro Carvalho Chehab

Em Fri, 13 Jul 2018 13:22:29 +0100
Sean Young <[email protected]> escreveu:

Quoted 3 lines

The generic pwm-ir-tx driver should work for the Nokia n900.

Compile tested only.

It would be good to have some tests...

Unfortunately, it turned out I won't be able to test soon, so please, somebody else do it.

Quoted 49 lines
Quoted 7 lines
Cc Rob Herring <[email protected]>
Cc Ivaylo Dimitrov <[email protected]>
Cc Pali Rohár <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Timo Kokkonen <[email protected]>
Cc Tony Lindgren <[email protected]>

And some acks

Before merging it.

Quoted 24 lines
---
  arch/arm/boot/dts/omap3-n900.dts | 2 +-
  drivers/media/rc/pwm-ir-tx.c     | 1 +
  2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap3-n900.dts +1 -1
index 182a53991c90..fd12dea15799 100644
@@ -154,7 +154,7 @@
  	};
 
  	ir: n900-ir {
-		compatible = "nokia,n900-ir";
+		compatible = "nokia,n900-ir", "pwm-ir-tx";
  		pwms = <&pwm9 0 26316 0>; /* 38000 Hz */
  	};
 
drivers/media/rc/pwm-ir-tx.c +0 -0
index 27d0f5837a76..272947b430c8 100644

drivers/media/rc/pwm-ir-tx.c struct pwm_ir { · line 36

Quoted 7 lines
drivers/media/rc/pwm-ir-tx.c +1 -0
@@ -30,6 +30,7 @@ struct pwm_ir {
  };
 
  static const struct of_device_id pwm_ir_of_match[] = {
+	{ .compatible = "nokia,n900-ir" },
  	{ .compatible = "pwm-ir-tx", },
  	{ },
  };

Thanks,
Mauro

#7 lore raw
In reply to Sean Young

Hi Sean,

Quoted 34 lines · Sean Young

The generic pwm-ir-tx driver should work for the Nokia n900.

Compile tested only.

Cc Rob Herring <[email protected]>
Cc Ivaylo Dimitrov <[email protected]>
Cc Pali Rohár <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Timo Kokkonen <[email protected]>
Cc Tony Lindgren <[email protected]>
---
 arch/arm/boot/dts/omap3-n900.dts | 2 +-
 drivers/media/rc/pwm-ir-tx.c     | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap3-n900.dts +1 -1
index 182a53991c90..fd12dea15799 100644
@@ -154,7 +154,7 @@
 	};
 
 	ir: n900-ir {
-		compatible = "nokia,n900-ir";
+		compatible = "nokia,n900-ir", "pwm-ir-tx";
 		pwms = <&pwm9 0 26316 0>; /* 38000 Hz */
 	};
 
drivers/media/rc/pwm-ir-tx.c +0 -0
index 27d0f5837a76..272947b430c8 100644

drivers/media/rc/pwm-ir-tx.c struct pwm_ir { · line 33

Quoted 4 lines
drivers/media/rc/pwm-ir-tx.c +1 -0
@@ -30,6 +30,7 @@ struct pwm_ir {
 };
 
 static const struct of_device_id pwm_ir_of_match[] = {
+	{ .compatible = "nokia,n900-ir" },

Is this change needed as well? I suppose you could add it later if there's a need to e.g. do something differently for the N900 IR transmitter.

It'd be nice if someone tested it, too...

Quoted 3 lines
drivers/media/rc/pwm-ir-tx.c +0 -0
 	{ .compatible = "pwm-ir-tx", },
 	{ },
 };
Signature · 2 lines
Sakari Ailus
e-mail: [email protected]
author maintainer
#8 lore raw
Quoted 39 lines · Sakari Ailus

Hi Sean,

Quoted 36 lines · Sean Young

The generic pwm-ir-tx driver should work for the Nokia n900.

Compile tested only.

Cc Rob Herring <[email protected]>
Cc Ivaylo Dimitrov <[email protected]>
Cc Pali Rohár <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Timo Kokkonen <[email protected]>
Cc Tony Lindgren <[email protected]>
---
 arch/arm/boot/dts/omap3-n900.dts | 2 +-
 drivers/media/rc/pwm-ir-tx.c     | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap3-n900.dts +1 -1
index 182a53991c90..fd12dea15799 100644
@@ -154,7 +154,7 @@
 	};
 
 	ir: n900-ir {
-		compatible = "nokia,n900-ir";
+		compatible = "nokia,n900-ir", "pwm-ir-tx";
 		pwms = <&pwm9 0 26316 0>; /* 38000 Hz */
 	};
 
drivers/media/rc/pwm-ir-tx.c +0 -0
index 27d0f5837a76..272947b430c8 100644
@@ -30,6 +30,7 @@ struct pwm_ir {
 };
 
Quoted 5 lines

drivers/media/rc/pwm-ir-tx.c struct pwm_ir { · line 33

Quoted 2 lines
drivers/media/rc/pwm-ir-tx.c +1 -0
 static const struct of_device_id pwm_ir_of_match[] = {
+	{ .compatible = "nokia,n900-ir" },

Is this change needed as well? I suppose you could add it later if there's a need to e.g. do something differently for the N900 IR transmitter.

This is to ensure compatibility of a new kernel with an old board dtb.

Quoted 1 line

It'd be nice if someone tested it, too...

That would be nice, but I don't have the hardware and so far I there has been noone willing/able to test it.

Sean