hid-input.c (529fa5473123a9e81e711a92e46fba732c4264ed) | hid-input.c (e071298589418076ef0a9813677f2d7032b65baa) |
---|---|
1/* 2 * $Id: hid-input.c,v 1.2 2002/04/23 00:59:25 rdamazio Exp $ 3 * 4 * Copyright (c) 2000-2001 Vojtech Pavlik 5 * Copyright (c) 2006-2007 Jiri Kosina 6 * 7 * HID to Linux Input mapping 8 */ --- 230 unchanged lines hidden (view full) --- 239{ 240} 241#endif 242 243static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, 244 struct hid_usage *usage) 245{ 246 struct input_dev *input = hidinput->input; | 1/* 2 * $Id: hid-input.c,v 1.2 2002/04/23 00:59:25 rdamazio Exp $ 3 * 4 * Copyright (c) 2000-2001 Vojtech Pavlik 5 * Copyright (c) 2006-2007 Jiri Kosina 6 * 7 * HID to Linux Input mapping 8 */ --- 230 unchanged lines hidden (view full) --- 239{ 240} 241#endif 242 243static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field, 244 struct hid_usage *usage) 245{ 246 struct input_dev *input = hidinput->input; |
247 struct hid_device *device = input->private; | 247 struct hid_device *device = input_get_drvdata(input); |
248 int max = 0, code; 249 unsigned long *bit = NULL; 250 251 field->hidinput = hidinput; 252 253#ifdef CONFIG_HID_DEBUG 254 printk(KERN_DEBUG "Mapping: "); 255 hid_resolv_usage(usage->hid); --- 598 unchanged lines hidden (view full) --- 854 } 855 } 856 return -1; 857} 858EXPORT_SYMBOL_GPL(hidinput_find_field); 859 860static int hidinput_open(struct input_dev *dev) 861{ | 248 int max = 0, code; 249 unsigned long *bit = NULL; 250 251 field->hidinput = hidinput; 252 253#ifdef CONFIG_HID_DEBUG 254 printk(KERN_DEBUG "Mapping: "); 255 hid_resolv_usage(usage->hid); --- 598 unchanged lines hidden (view full) --- 854 } 855 } 856 return -1; 857} 858EXPORT_SYMBOL_GPL(hidinput_find_field); 859 860static int hidinput_open(struct input_dev *dev) 861{ |
862 struct hid_device *hid = dev->private; | 862 struct hid_device *hid = input_get_drvdata(dev); 863 |
863 return hid->hid_open(hid); 864} 865 866static void hidinput_close(struct input_dev *dev) 867{ | 864 return hid->hid_open(hid); 865} 866 867static void hidinput_close(struct input_dev *dev) 868{ |
868 struct hid_device *hid = dev->private; | 869 struct hid_device *hid = input_get_drvdata(dev); 870 |
869 hid->hid_close(hid); 870} 871 872/* 873 * Register the input device; print a message. 874 * Configure the input layer interface 875 * Read all reports and initialize the absolute field values. 876 */ --- 31 unchanged lines hidden (view full) --- 908 input_dev = input_allocate_device(); 909 if (!hidinput || !input_dev) { 910 kfree(hidinput); 911 input_free_device(input_dev); 912 err("Out of memory during hid input probe"); 913 return -1; 914 } 915 | 871 hid->hid_close(hid); 872} 873 874/* 875 * Register the input device; print a message. 876 * Configure the input layer interface 877 * Read all reports and initialize the absolute field values. 878 */ --- 31 unchanged lines hidden (view full) --- 910 input_dev = input_allocate_device(); 911 if (!hidinput || !input_dev) { 912 kfree(hidinput); 913 input_free_device(input_dev); 914 err("Out of memory during hid input probe"); 915 return -1; 916 } 917 |
916 input_dev->private = hid; | 918 input_set_drvdata(input_dev, hid); |
917 input_dev->event = hid->hidinput_input_event; 918 input_dev->open = hidinput_open; 919 input_dev->close = hidinput_close; 920 921 input_dev->name = hid->name; 922 input_dev->phys = hid->phys; 923 input_dev->uniq = hid->uniq; 924 input_dev->id.bustype = hid->bus; 925 input_dev->id.vendor = hid->vendor; 926 input_dev->id.product = hid->product; 927 input_dev->id.version = hid->version; | 919 input_dev->event = hid->hidinput_input_event; 920 input_dev->open = hidinput_open; 921 input_dev->close = hidinput_close; 922 923 input_dev->name = hid->name; 924 input_dev->phys = hid->phys; 925 input_dev->uniq = hid->uniq; 926 input_dev->id.bustype = hid->bus; 927 input_dev->id.vendor = hid->vendor; 928 input_dev->id.product = hid->product; 929 input_dev->id.version = hid->version; |
928 input_dev->cdev.dev = hid->dev; | 930 input_dev->dev.parent = hid->dev; |
929 hidinput->input = input_dev; 930 list_add_tail(&hidinput->list, &hid->inputs); 931 } 932 933 for (i = 0; i < report->maxfield; i++) 934 for (j = 0; j < report->field[i]->maxusage; j++) 935 hidinput_configure_usage(hidinput, report->field[i], 936 report->field[i]->usage + j); --- 32 unchanged lines hidden --- | 931 hidinput->input = input_dev; 932 list_add_tail(&hidinput->list, &hid->inputs); 933 } 934 935 for (i = 0; i < report->maxfield; i++) 936 for (j = 0; j < report->field[i]->maxusage; j++) 937 hidinput_configure_usage(hidinput, report->field[i], 938 report->field[i]->usage + j); --- 32 unchanged lines hidden --- |