From 1edf84238781769797aebeacf47dee473fbe6c2f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 14 Oct 2005 16:31:51 +0000 Subject: Several Improvement on I2C IR handling for em2820: - moved Pinnacle IR table (ir_codes_em2820) to em2820-input.c - IR struct renamed and moved to a header file. - New file to handle em2820-specific IR. - Some cleanups. - attach now detects I2C IR and calls em2820-specific IR code - IR compat code moved to compat.h - New header with struct IR_i2c there, to allow it to be used by board-specific input handlers. Some improvements at em28xx board detection: - Board detection message improved to show interface and class. - Now it doesn't touch audio interfaces. Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/ir-common.h | 37 ++++++------------------------------- linux/include/media/ir-kbd-i2c.h | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 31 deletions(-) create mode 100644 linux/include/media/ir-kbd-i2c.h (limited to 'linux/include/media') diff --git a/linux/include/media/ir-common.h b/linux/include/media/ir-common.h index d5de5d46e..1758f1507 100644 --- a/linux/include/media/ir-common.h +++ b/linux/include/media/ir-common.h @@ -1,5 +1,5 @@ /* - * $Id: ir-common.h,v 1.12 2005/10/09 18:07:06 mchehab Exp $ + * $Id: ir-common.h,v 1.13 2005/10/14 16:31:51 mchehab Exp $ * * some common structs and functions to handle infrared remotes via * input layer ... @@ -21,37 +21,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#ifndef _IR_COMMON +#define _IR_COMMON -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -/* some keys from 2.6.x which are not (yet?) in 2.4.x */ -# define KEY_PLAY 207 -# define KEY_PRINT 210 -# define KEY_SEARCH 217 -# define KEY_SELECT 0x161 -# define KEY_GOTO 0x162 -# define KEY_INFO 0x166 -# define KEY_CHANNEL 0x16b -# define KEY_LANGUAGE 0x170 -# define KEY_SUBTITLE 0x172 -# define KEY_ZOOM 0x174 -# define KEY_MODE 0x175 -# define KEY_TV 0x179 -# define KEY_CD 0x17f -# define KEY_TUNER 0x182 -# define KEY_TEXT 0x184 -# define KEY_DVD 0x185 -# define KEY_AUDIO 0x188 -# define KEY_VIDEO 0x189 -# define KEY_RED 0x18e -# define KEY_GREEN 0x18f -# define KEY_YELLOW 0x190 -# define KEY_BLUE 0x191 -# define KEY_CHANNELUP 0x192 -# define KEY_CHANNELDOWN 0x193 -# define KEY_RESTART 0x198 -# define KEY_SHUFFLE 0x19a -#endif +#include #define IR_TYPE_RC5 1 #define IR_TYPE_PD 2 /* Pulse distance encoded IR */ @@ -91,6 +64,8 @@ int ir_dump_samples(u32 *samples, int count); int ir_decode_biphase(u32 *samples, int count, int low, int high); int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); +#endif + /* * Local variables: * c-basic-offset: 8 diff --git a/linux/include/media/ir-kbd-i2c.h b/linux/include/media/ir-kbd-i2c.h new file mode 100644 index 000000000..a6fcdd380 --- /dev/null +++ b/linux/include/media/ir-kbd-i2c.h @@ -0,0 +1,22 @@ +#ifndef _IR_I2C +#define _IR_I2C + +#include + +struct IR_i2c; + +struct IR_i2c { + IR_KEYTAB_TYPE *ir_codes; + struct i2c_client c; + struct input_dev input; + struct ir_input_state ir; + + /* Used to avoid fast repeating */ + unsigned char old; + + struct work_struct work; + struct timer_list timer; + char phys[32]; + int (*get_key)(struct IR_i2c*, u32*, u32*); +}; +#endif -- cgit v1.2.3