diff mbox

Add EV_IR bit

Message ID 20090812223327.GA6827@hardeman.nu (mailing list archive)
State New, archived
Headers show

Commit Message

David Härdeman Aug. 12, 2009, 10:33 p.m. UTC
This patch adds an EV_IR bit to allow input drivers to let userspace 
know that the hardware is an infrared remote control transceiver.

No dev->irbit is defined yet but I plan to add that later (which would 
be used to indicate whether the hardware supports RX, TX, etc).

If the patch is accepted I'll send followup patches adding the 
appropriate input_set_capability call to the relevant drivers.

Signed-off-by: David Härdeman <david@hardeman.nu>


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dmitry Torokhov Aug. 13, 2009, 6:49 a.m. UTC | #1
On Thu, Aug 13, 2009 at 12:33:27AM +0200, David Härdeman wrote:
> This patch adds an EV_IR bit to allow input drivers to let userspace  
> know that the hardware is an infrared remote control transceiver.
>
> No dev->irbit is defined yet but I plan to add that later (which would  
> be used to indicate whether the hardware supports RX, TX, etc).
>
> If the patch is accepted I'll send followup patches adding the  
> appropriate input_set_capability call to the relevant drivers.
>

Do you expect devices to actually _send_ EV_IR events?
David Härdeman Aug. 13, 2009, 8:32 a.m. UTC | #2
On Thu, August 13, 2009 08:49, Dmitry Torokhov wrote:
> On Thu, Aug 13, 2009 at 12:33:27AM +0200, David Härdeman wrote:
>> This patch adds an EV_IR bit to allow input drivers to let userspace
>> know that the hardware is an infrared remote control transceiver.
>>
>> No dev->irbit is defined yet but I plan to add that later (which would
>> be used to indicate whether the hardware supports RX, TX, etc).
>>
>> If the patch is accepted I'll send followup patches adding the
>> appropriate input_set_capability call to the relevant drivers.
>>
>
> Do you expect devices to actually _send_ EV_IR events?

Yes, and I have some patches going in that direction (loosely based on Jon
Smirl's in-kernel IR driver patchset).

The basic idea so far would be to add:

IR_PROTOCOL
IR_TOGGLE
IR_DEVICE
IR_SUBDEVICE
IR_COMMAND

Which should be sufficient at this point for the major IR protocols. Then
input drivers can report to userspace the actual command they received
(and hacks like using MSC_SCAN / MSC_RAW / the sysfs attribute you
commented in my winbond-cir driver would not be necessary).

It also allows userspace to know that a button was pressed even where
there is no keymap for that particular remote which should help a lot in
building custom keymaps.

Further along we might also add IR_RAW to signal to willing user-space
apps the raw IR timings for more esoteric remotes (I guess it would need
to be enabled/disabled by an ioctl).
Dmitry Torokhov Aug. 13, 2009, 3:57 p.m. UTC | #3
On Thu, Aug 13, 2009 at 10:32:16AM +0200, David Härdeman wrote:
> On Thu, August 13, 2009 08:49, Dmitry Torokhov wrote:
> > On Thu, Aug 13, 2009 at 12:33:27AM +0200, David Härdeman wrote:
> >> This patch adds an EV_IR bit to allow input drivers to let userspace
> >> know that the hardware is an infrared remote control transceiver.
> >>
> >> No dev->irbit is defined yet but I plan to add that later (which would
> >> be used to indicate whether the hardware supports RX, TX, etc).
> >>
> >> If the patch is accepted I'll send followup patches adding the
> >> appropriate input_set_capability call to the relevant drivers.
> >>
> >
> > Do you expect devices to actually _send_ EV_IR events?
> 
> Yes, and I have some patches going in that direction (loosely based on Jon
> Smirl's in-kernel IR driver patchset).
> 
> The basic idea so far would be to add:
> 
> IR_PROTOCOL
> IR_TOGGLE
> IR_DEVICE
> IR_SUBDEVICE
> IR_COMMAND
> 
> Which should be sufficient at this point for the major IR protocols. Then
> input drivers can report to userspace the actual command they received
> (and hacks like using MSC_SCAN / MSC_RAW / the sysfs attribute you
> commented in my winbond-cir driver would not be necessary).
> 
> It also allows userspace to know that a button was pressed even where
> there is no keymap for that particular remote which should help a lot in
> building custom keymaps.
> 
> Further along we might also add IR_RAW to signal to willing user-space
> apps the raw IR timings for more esoteric remotes (I guess it would need
> to be enabled/disabled by an ioctl).
>

Would you mind posting the complete patchset?
diff mbox

Patch

Index: linux-2.6/drivers/input/input.c
===================================================================
--- linux-2.6.orig/drivers/input/input.c	2009-08-12 19:45:10.000000000 +0200
+++ linux-2.6/drivers/input/input.c	2009-08-12 19:54:56.000000000 +0200
@@ -1375,6 +1375,10 @@ 
  		/* do nothing */
  		break;
  
+	case EV_IR:
+		/* do nothing */
+		break;
+
  	default:
  		printk(KERN_ERR
  			"input_set_capability: unknown type %u (code %u)\n",
Index: linux-2.6/include/linux/input.h
===================================================================
--- linux-2.6.orig/include/linux/input.h	2009-08-12 19:56:03.000000000 +0200
+++ linux-2.6/include/linux/input.h	2009-08-12 19:57:53.000000000 +0200
@@ -98,6 +98,7 @@ 
  #define EV_FF			0x15
  #define EV_PWR			0x16
  #define EV_FF_STATUS		0x17
+#define EV_IR			0x18
  #define EV_MAX			0x1f
  #define EV_CNT			(EV_MAX+1)