summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-12-14 03:16:55 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 18:10:23 (GMT)
commite93854da880d6dc357c00625d8371b6a926fd19b (patch)
tree8bf87df8cf639fe7af7e35fb5cbc42792742a31b /include
parent4714eda87748f226833c32400ab60dd6a3b80766 (diff)
downloadlinux-e93854da880d6dc357c00625d8371b6a926fd19b.tar.xz
V4L/DVB (13634): ir-core: allow passing IR device parameters to ir-core
Adds an structure to ir_input_register to contain IR device characteristics, like supported protocols and a callback to handle protocol event changes. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/ir-common.h4
-rw-r--r--include/media/ir-core.h18
-rw-r--r--include/media/ir-kbd-i2c.h2
3 files changed, 16 insertions, 8 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 2c6af24..1b43b77 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -35,7 +35,7 @@
struct ir_input_state {
/* configuration */
- int ir_type;
+ enum ir_type ir_type;
/* key info */
u32 ir_key; /* ir scancode */
@@ -84,7 +84,7 @@ struct card_ir {
/* Routines from ir-functions.c */
int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
- int ir_type);
+ const enum ir_type ir_type);
void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
u32 ir_key);
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index a5a3bda..dbdffd1 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -23,10 +23,10 @@ extern int ir_core_debug;
enum ir_type {
IR_TYPE_UNKNOWN = 0,
- IR_TYPE_RC5 = 1,
- IR_TYPE_PD = 2, /* Pulse distance encoded IR */
- IR_TYPE_NEC = 3,
- IR_TYPE_OTHER = 99,
+ IR_TYPE_RC5 = 1L << 0, /* Philips RC5 protocol */
+ IR_TYPE_PD = 1L << 1, /* Pulse distance encoded IR */
+ IR_TYPE_NEC = 1L << 2,
+ IR_TYPE_OTHER = 1L << 63,
};
struct ir_scancode {
@@ -41,12 +41,19 @@ struct ir_scancode_table {
spinlock_t lock;
};
+struct ir_dev_props {
+ unsigned long allowed_protos;
+ void *priv;
+ int (*change_protocol)(void *priv, unsigned long protocol);
+};
+
struct ir_input_dev {
struct input_dev *dev; /* Input device*/
struct ir_scancode_table rc_tab; /* scan/key table */
unsigned long devno; /* device number */
struct attribute_group attr; /* IR attributes */
struct device *class_dev; /* virtual class dev */
+ const struct ir_dev_props *props; /* Device properties */
};
/* Routines from ir-keytable.c */
@@ -59,7 +66,8 @@ int ir_set_keycode_table(struct input_dev *input_dev,
int ir_roundup_tablesize(int n_elems);
int ir_input_register(struct input_dev *dev,
- struct ir_scancode_table *ir_codes);
+ const struct ir_scancode_table *ir_codes,
+ const struct ir_dev_props *props);
void ir_input_unregister(struct input_dev *input_dev);
/* Routines from ir-sysfs.c */
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index aaf65e8..45926e3 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -36,7 +36,7 @@ enum ir_kbd_get_key_fn {
struct IR_i2c_init_data {
struct ir_scancode_table *ir_codes;
const char *name;
- int type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */
+ enum ir_type type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */
/*
* Specify either a function pointer or a value indicating one of
* ir_kbd_i2c's internal get_key functions