2 * Remote Controller core header
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2 of the License.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
17 #include <linux/input.h>
18 #include <linux/spinlock.h>
20 extern int ir_core_debug;
21 #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
22 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
26 IR_TYPE_RC5 = 1L << 0, /* Philips RC5 protocol */
27 IR_TYPE_PD = 1L << 1, /* Pulse distance encoded IR */
28 IR_TYPE_NEC = 1L << 2,
29 IR_TYPE_OTHER = 1L << 63,
37 struct ir_scancode_table {
38 struct ir_scancode *scan;
45 unsigned long allowed_protos;
47 int (*change_protocol)(void *priv, enum ir_type ir_type);
52 struct input_dev *dev; /* Input device*/
53 struct ir_scancode_table rc_tab; /* scan/key table */
54 unsigned long devno; /* device number */
55 struct attribute_group attr; /* IR attributes */
56 struct device *class_dev; /* virtual class dev */
57 const struct ir_dev_props *props; /* Device properties */
59 #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr)
61 /* Routines from ir-keytable.c */
63 u32 ir_g_keycode_from_table(struct input_dev *input_dev,
66 int ir_set_keycode_table(struct input_dev *input_dev,
67 struct ir_scancode_table *rc_tab);
69 int ir_roundup_tablesize(int n_elems);
70 int ir_input_register(struct input_dev *dev,
71 const struct ir_scancode_table *ir_codes,
72 const struct ir_dev_props *props);
73 void ir_input_unregister(struct input_dev *input_dev);
75 /* Routines from ir-sysfs.c */
77 int ir_register_class(struct input_dev *input_dev);
78 void ir_unregister_class(struct input_dev *input_dev);