summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2004-01-06 14:09:22 +0000
committerJohannes Stezenbach <devnull@localhost>2004-01-06 14:09:22 +0000
commit60b7466865a3797898310ded1597588d956d6214 (patch)
tree804e401c3677e99c1160fd36dd51ee8dedc95d93 /linux
parent3626dd35af55fa1cbf759bce2b7841ea8ebcf5ea (diff)
downloadmediapointer-dvb-s2-60b7466865a3797898310ded1597588d956d6214.tar.gz
mediapointer-dvb-s2-60b7466865a3797898310ded1597588d956d6214.tar.bz2
minor whitepsace / coding style cleanup
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_ir.c94
1 files changed, 43 insertions, 51 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ir.c b/linux/drivers/media/dvb/ttpci/av7110_ir.c
index a015f6543..d88e1a5d6 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_ir.c
@@ -47,19 +47,19 @@ static u16 key_map [256] = {
};
-static void av7110_emit_keyup (unsigned long data)
+static void av7110_emit_keyup(unsigned long data)
{
- if (!data || !test_bit (data, input_dev.key))
+ if (!data || !test_bit(data, input_dev.key))
return;
- input_event (&input_dev, EV_KEY, data, !!0);
+ input_event(&input_dev, EV_KEY, data, !!0);
}
-static struct timer_list keyup_timer = { function: av7110_emit_keyup };
+static struct timer_list keyup_timer = { .function = av7110_emit_keyup };
-static void av7110_emit_key (u32 ircom)
+static void av7110_emit_key(u32 ircom)
{
u8 data;
u8 addr;
@@ -80,8 +80,8 @@ static void av7110_emit_key (u32 ircom)
keycode = key_map[data];
- dprintk ("#########%08x######### addr %i data 0x%02x (keycode %i)\n",
- ircom, addr, data, keycode);
+ dprintk("#########%08x######### addr %i data 0x%02x (keycode %i)\n",
+ ircom, addr, data, keycode);
/* check device address (if selected) */
if (ir_config & 0x4000)
@@ -89,8 +89,7 @@ static void av7110_emit_key (u32 ircom)
return;
if (!keycode) {
- printk ("%s: unknown key 0x%02x!!\n",
- __FUNCTION__, data);
+ printk ("%s: unknown key 0x%02x!!\n", __FUNCTION__, data);
return;
}
@@ -99,36 +98,36 @@ static void av7110_emit_key (u32 ircom)
else
new_toggle = (ircom & 0x800); /* RC5 */
- if (timer_pending (&keyup_timer)) {
- del_timer (&keyup_timer);
+ if (timer_pending(&keyup_timer)) {
+ del_timer(&keyup_timer);
if (keyup_timer.data != keycode || new_toggle != old_toggle) {
- input_event (&input_dev, EV_KEY, keyup_timer.data, !!0);
- input_event (&input_dev, EV_KEY, keycode, !0);
+ input_event(&input_dev, EV_KEY, keyup_timer.data, !!0);
+ input_event(&input_dev, EV_KEY, keycode, !0);
} else
- input_event (&input_dev, EV_KEY, keycode, 2);
+ input_event(&input_dev, EV_KEY, keycode, 2);
} else
- input_event (&input_dev, EV_KEY, keycode, !0);
+ input_event(&input_dev, EV_KEY, keycode, !0);
keyup_timer.expires = jiffies + UP_TIMEOUT;
keyup_timer.data = keycode;
- add_timer (&keyup_timer);
+ add_timer(&keyup_timer);
old_toggle = new_toggle;
}
-static void input_register_keys (void)
+static void input_register_keys(void)
{
int i;
- memset (input_dev.keybit, 0, sizeof(input_dev.keybit));
+ memset(input_dev.keybit, 0, sizeof(input_dev.keybit));
- for (i=0; i<sizeof(key_map)/sizeof(key_map[0]); i++) {
+ for (i = 0; i < sizeof(key_map) / sizeof(key_map[0]); i++) {
if (key_map[i] > KEY_MAX)
key_map[i] = 0;
else if (key_map[i] > KEY_RESERVED)
- set_bit (key_map[i], input_dev.keybit);
+ set_bit(key_map[i], input_dev.keybit);
}
}
@@ -139,8 +138,8 @@ static void input_repeat_key(unsigned long data)
}
-static int av7110_ir_write_proc (struct file *file, const char *buffer,
- unsigned long count, void *data)
+static int av7110_ir_write_proc(struct file *file, const char *buffer,
+ unsigned long count, void *data)
{
char *page;
int size = 4 + 256 * sizeof(u16);
@@ -148,54 +147,48 @@ static int av7110_ir_write_proc (struct file *file, const char *buffer,
if (count < size)
return -EINVAL;
- page = (char *)vmalloc(size);
- if( NULL == page ) {
+ page = (char *) vmalloc(size);
+ if (!page)
return -ENOMEM;
- }
if (copy_from_user(page, buffer, size)) {
vfree(page);
return -EFAULT;
}
- memcpy (&ir_config, page, 4);
- memcpy (&key_map, page + 4, 256 * sizeof(u16));
-
+ memcpy(&ir_config, page, 4);
+ memcpy(&key_map, page + 4, 256 * sizeof(u16));
vfree(page);
-
- av7110_setup_irc_config (NULL, ir_config);
-
- input_register_keys ();
-
+ av7110_setup_irc_config(NULL, ir_config);
+ input_register_keys();
return count;
}
-int __init av7110_ir_init (void)
+int __init av7110_ir_init(void)
{
static struct proc_dir_entry *e;
- init_timer (&keyup_timer);
+ init_timer(&keyup_timer);
keyup_timer.data = 0;
- input_dev.name = "DVB on-card IR receiver";
+ input_dev.name = "DVB on-card IR receiver";
- /**
- * enable keys
- */
- set_bit (EV_KEY, input_dev.evbit);
- set_bit (EV_REP, input_dev.evbit);
+ /**
+ * enable keys
+ */
+ set_bit(EV_KEY, input_dev.evbit);
+ set_bit(EV_REP, input_dev.evbit);
- input_register_keys ();
+ input_register_keys();
input_register_device(&input_dev);
input_dev.timer.function = input_repeat_key;
- av7110_setup_irc_config (NULL, 0x0001);
- av7110_register_irc_handler (av7110_emit_key);
-
- e = create_proc_entry ("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
+ av7110_setup_irc_config(NULL, 0x0001);
+ av7110_register_irc_handler(av7110_emit_key);
+ e = create_proc_entry("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
if (e) {
e->write_proc = av7110_ir_write_proc;
e->size = 4 + 256 * sizeof(u16);
@@ -205,16 +198,15 @@ int __init av7110_ir_init (void)
}
-void __exit av7110_ir_exit (void)
+void __exit av7110_ir_exit(void)
{
- remove_proc_entry ("av7110_ir", NULL);
- av7110_unregister_irc_handler (av7110_emit_key);
+ remove_proc_entry("av7110_ir", NULL);
+ av7110_unregister_irc_handler(av7110_emit_key);
input_unregister_device(&input_dev);
}
//MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>");
//MODULE_LICENSE("GPL");
-MODULE_PARM(av7110_ir_debug,"i");
+MODULE_PARM(av7110_ir_debug, "i");
MODULE_PARM_DESC(av7110_ir_debug, "enable AV7110 IR receiver debug messages");
-