Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-10 Thread David Härdeman
On Fri, Apr 09, 2010 at 11:00:41AM -0300, Mauro Carvalho Chehab wrote: struct { unsigned mark : 1; unsigned duration :31; } There's no memory spend at all: it will use just one unsigned int and it is clearly indicated what's mark and what's duration. If all three of you agree

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-10 Thread Andy Walls
On Sat, 2010-04-10 at 08:48 +0200, David Härdeman wrote: On Fri, Apr 09, 2010 at 11:00:41AM -0300, Mauro Carvalho Chehab wrote: struct { unsigned mark : 1; unsigned duration :31; } There's no memory spend at all: it will use just one unsigned int and it is clearly indicated

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-10 Thread Mauro Carvalho Chehab
Andy Walls wrote: On Sat, 2010-04-10 at 08:48 +0200, David Härdeman wrote: On Fri, Apr 09, 2010 at 11:00:41AM -0300, Mauro Carvalho Chehab wrote: struct { unsigned mark : 1; unsigned duration :31; } There's no memory spend at all: it will use just one unsigned int and it is

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-10 Thread Jon Smirl
On Sat, Apr 10, 2010 at 2:48 AM, David Härdeman da...@hardeman.nu wrote: On Fri, Apr 09, 2010 at 11:00:41AM -0300, Mauro Carvalho Chehab wrote: struct {       unsigned mark : 1;       unsigned duration :31; } There's no memory spend at all: it will use just one unsigned int and it is

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-10 Thread Andy Walls
On Sat, 2010-04-10 at 09:10 -0300, Mauro Carvalho Chehab wrote: Andy Walls wrote: On Sat, 2010-04-10 at 08:48 +0200, David Härdeman wrote: On Fri, Apr 09, 2010 at 11:00:41AM -0300, Mauro Carvalho Chehab wrote: struct { unsigned mark : 1; unsigned duration :31; } There's no

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-09 Thread Andy Walls
On Thu, 2010-04-08 at 13:39 +0200, David Härdeman wrote: drivers/media/IR/ir-raw-event.c is currently written with the assumption that all raw hardware will generate events only on state change (i.e. when a pulse or space starts). However, some hardware (like mceusb, probably the most

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-09 Thread Jon Smirl
On Fri, Apr 9, 2010 at 7:25 AM, Andy Walls awa...@md.metrocast.net wrote: On Thu, 2010-04-08 at 13:39 +0200, David Härdeman wrote: drivers/media/IR/ir-raw-event.c is currently written with the assumption that all raw hardware will generate events only on state change (i.e. when a pulse or

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-09 Thread Mauro Carvalho Chehab
Jon Smirl wrote: +/* macros for ir decoders */ +#define PULSE(units) ((units)) +#define SPACE(units) (-(units)) Encoding pulse vs space with a negative sign, even if now hidden with macros, is still just using a sign instead of a boolean.

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-09 Thread Jon Smirl
On Fri, Apr 9, 2010 at 10:00 AM, Mauro Carvalho Chehab mche...@infradead.org wrote: Jon Smirl wrote: +/* macros for ir decoders */ +#define PULSE(units)                         ((units)) +#define SPACE(units)                         (-(units)) Encoding pulse vs space with a negative sign,

Found NEC IR specification in NEC uPD6122 datasheet (Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations)

2010-04-09 Thread Andy Walls
On Fri, 2010-04-09 at 11:00 -0300, Mauro Carvalho Chehab wrote: Jon Smirl wrote: #define NEC_NBITS32 -#define NEC_UNIT 559979 /* ns */ -#define NEC_HEADER_MARK (16 * NEC_UNIT) -#define NEC_HEADER_SPACE (8 * NEC_UNIT) -#define NEC_REPEAT_SPACE

[RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-08 Thread David Härdeman
drivers/media/IR/ir-raw-event.c is currently written with the assumption that all raw hardware will generate events only on state change (i.e. when a pulse or space starts). However, some hardware (like mceusb, probably the most popular IR receiver out there) only generates duration data (and

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-08 Thread Mauro Carvalho Chehab
David Härdeman wrote: Your're fast! OK, the code looks good. I'll test and apply it, if it passes on the test. The only missed thing is the comment about the kfifo size (see the email I just sent). If you prefer, I can add a one line comment when applying it, to avoid you to re-send the code.

Re: [RFC3] Teach drivers/media/IR/ir-raw-event.c to use durations

2010-04-08 Thread Mauro Carvalho Chehab
David Härdeman wrote: drivers/media/IR/ir-raw-event.c is currently written with the assumption that all raw hardware will generate events only on state change (i.e. when a pulse or space starts). However, some hardware (like mceusb, probably the most popular IR receiver out there) only