diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-04-03 15:53:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:56:53 -0400 |
commit | 354389467b6b2a3b36666b6e933d78bbd9e23577 (patch) | |
tree | 361b2b1f713f661fc4af77b995ce00125c19f1de /drivers/media/IR/ir-keytable.c | |
parent | b3074c0a3f020766c05c1249a31212bff4a77bea (diff) |
V4L/DVB: ir-core: re-add some debug functions for keytable changes
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-keytable.c')
-rw-r--r-- | drivers/media/IR/ir-keytable.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 10e4be22dbfd..a0aa5c1b6b41 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c | |||
@@ -100,6 +100,8 @@ static int ir_do_setkeycode(struct input_dev *dev, | |||
100 | 100 | ||
101 | /* Did the user wish to remove the mapping? */ | 101 | /* Did the user wish to remove the mapping? */ |
102 | if (keycode == KEY_RESERVED || keycode == KEY_UNKNOWN) { | 102 | if (keycode == KEY_RESERVED || keycode == KEY_UNKNOWN) { |
103 | IR_dprintk(1, "#%d: Deleting scan 0x%04x\n", | ||
104 | i, scancode); | ||
103 | rc_tab->len--; | 105 | rc_tab->len--; |
104 | memmove(&rc_tab->scan[i], &rc_tab->scan[i + 1], | 106 | memmove(&rc_tab->scan[i], &rc_tab->scan[i + 1], |
105 | (rc_tab->len - i) * sizeof(struct ir_scancode)); | 107 | (rc_tab->len - i) * sizeof(struct ir_scancode)); |
@@ -115,6 +117,9 @@ static int ir_do_setkeycode(struct input_dev *dev, | |||
115 | if (ir_resize_table(rc_tab)) | 117 | if (ir_resize_table(rc_tab)) |
116 | return -ENOMEM; | 118 | return -ENOMEM; |
117 | 119 | ||
120 | IR_dprintk(1, "#%d: New scan 0x%04x with key 0x%04x\n", | ||
121 | i, scancode, keycode); | ||
122 | |||
118 | /* i is the proper index to insert our new keycode */ | 123 | /* i is the proper index to insert our new keycode */ |
119 | memmove(&rc_tab->scan[i + 1], &rc_tab->scan[i], | 124 | memmove(&rc_tab->scan[i + 1], &rc_tab->scan[i], |
120 | (rc_tab->len - i) * sizeof(struct ir_scancode)); | 125 | (rc_tab->len - i) * sizeof(struct ir_scancode)); |
@@ -123,6 +128,8 @@ static int ir_do_setkeycode(struct input_dev *dev, | |||
123 | rc_tab->len++; | 128 | rc_tab->len++; |
124 | set_bit(keycode, dev->keybit); | 129 | set_bit(keycode, dev->keybit); |
125 | } else { | 130 | } else { |
131 | IR_dprintk(1, "#%d: Replacing scan 0x%04x with key 0x%04x\n", | ||
132 | i, scancode, keycode); | ||
126 | /* A previous mapping was updated... */ | 133 | /* A previous mapping was updated... */ |
127 | clear_bit(old_keycode, dev->keybit); | 134 | clear_bit(old_keycode, dev->keybit); |
128 | /* ...but another scancode might use the same keycode */ | 135 | /* ...but another scancode might use the same keycode */ |
@@ -224,6 +231,10 @@ static int ir_getkeycode(struct input_dev *dev, | |||
224 | } | 231 | } |
225 | spin_unlock_irqrestore(&rc_tab->lock, flags); | 232 | spin_unlock_irqrestore(&rc_tab->lock, flags); |
226 | 233 | ||
234 | if (key == KEY_RESERVED) | ||
235 | IR_dprintk(1, "unknown key for scancode 0x%04x\n", | ||
236 | scancode); | ||
237 | |||
227 | *keycode = key; | 238 | *keycode = key; |
228 | return 0; | 239 | return 0; |
229 | } | 240 | } |
@@ -243,8 +254,9 @@ u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode) | |||
243 | int keycode; | 254 | int keycode; |
244 | 255 | ||
245 | ir_getkeycode(dev, scancode, &keycode); | 256 | ir_getkeycode(dev, scancode, &keycode); |
246 | IR_dprintk(1, "%s: scancode 0x%04x keycode 0x%02x\n", | 257 | if (keycode != KEY_RESERVED) |
247 | dev->name, scancode, keycode); | 258 | IR_dprintk(1, "%s: scancode 0x%04x keycode 0x%02x\n", |
259 | dev->name, scancode, keycode); | ||
248 | return keycode; | 260 | return keycode; |
249 | } | 261 | } |
250 | EXPORT_SYMBOL_GPL(ir_g_keycode_from_table); | 262 | EXPORT_SYMBOL_GPL(ir_g_keycode_from_table); |
@@ -386,6 +398,9 @@ int __ir_input_register(struct input_dev *input_dev, | |||
386 | if (rc < 0) | 398 | if (rc < 0) |
387 | goto out_table; | 399 | goto out_table; |
388 | 400 | ||
401 | IR_dprintk(1, "Registered input device on %s for %s remote.\n", | ||
402 | driver_name, rc_tab->name); | ||
403 | |||
389 | return 0; | 404 | return 0; |
390 | 405 | ||
391 | out_table: | 406 | out_table: |