Lines Matching refs:dev
22 static unsigned int sparse_keymap_get_key_index(struct input_dev *dev, in sparse_keymap_get_key_index() argument
28 for (key = dev->keycode; key->type != KE_END; key++) { in sparse_keymap_get_key_index()
39 static struct key_entry *sparse_keymap_entry_by_index(struct input_dev *dev, in sparse_keymap_entry_by_index() argument
45 for (key = dev->keycode; key->type != KE_END; key++) in sparse_keymap_entry_by_index()
61 struct key_entry *sparse_keymap_entry_from_scancode(struct input_dev *dev, in sparse_keymap_entry_from_scancode() argument
66 for (key = dev->keycode; key->type != KE_END; key++) in sparse_keymap_entry_from_scancode()
82 struct key_entry *sparse_keymap_entry_from_keycode(struct input_dev *dev, in sparse_keymap_entry_from_keycode() argument
87 for (key = dev->keycode; key->type != KE_END; key++) in sparse_keymap_entry_from_keycode()
95 static struct key_entry *sparse_keymap_locate(struct input_dev *dev, in sparse_keymap_locate() argument
102 key = sparse_keymap_entry_by_index(dev, ke->index); in sparse_keymap_locate()
104 key = sparse_keymap_entry_from_scancode(dev, scancode); in sparse_keymap_locate()
111 static int sparse_keymap_getkeycode(struct input_dev *dev, in sparse_keymap_getkeycode() argument
116 if (dev->keycode) { in sparse_keymap_getkeycode()
117 key = sparse_keymap_locate(dev, ke); in sparse_keymap_getkeycode()
122 sparse_keymap_get_key_index(dev, key); in sparse_keymap_getkeycode()
132 static int sparse_keymap_setkeycode(struct input_dev *dev, in sparse_keymap_setkeycode() argument
138 if (dev->keycode) { in sparse_keymap_setkeycode()
139 key = sparse_keymap_locate(dev, ke); in sparse_keymap_setkeycode()
143 set_bit(ke->keycode, dev->keybit); in sparse_keymap_setkeycode()
144 if (!sparse_keymap_entry_from_keycode(dev, *old_keycode)) in sparse_keymap_setkeycode()
145 clear_bit(*old_keycode, dev->keybit); in sparse_keymap_setkeycode()
166 int sparse_keymap_setup(struct input_dev *dev, in sparse_keymap_setup() argument
179 map = devm_kmemdup(&dev->dev, keymap, map_size * sizeof(*map), in sparse_keymap_setup()
188 error = setup(dev, entry); in sparse_keymap_setup()
195 __set_bit(EV_KEY, dev->evbit); in sparse_keymap_setup()
196 __set_bit(entry->keycode, dev->keybit); in sparse_keymap_setup()
201 __set_bit(EV_SW, dev->evbit); in sparse_keymap_setup()
202 __set_bit(entry->sw.code, dev->swbit); in sparse_keymap_setup()
207 if (test_bit(EV_KEY, dev->evbit)) { in sparse_keymap_setup()
208 __set_bit(KEY_UNKNOWN, dev->keybit); in sparse_keymap_setup()
209 __set_bit(EV_MSC, dev->evbit); in sparse_keymap_setup()
210 __set_bit(MSC_SCAN, dev->mscbit); in sparse_keymap_setup()
213 dev->keycode = map; in sparse_keymap_setup()
214 dev->keycodemax = map_size; in sparse_keymap_setup()
215 dev->getkeycode = sparse_keymap_getkeycode; in sparse_keymap_setup()
216 dev->setkeycode = sparse_keymap_setkeycode; in sparse_keymap_setup()
234 void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *ke, in sparse_keymap_report_entry() argument
239 input_event(dev, EV_MSC, MSC_SCAN, ke->code); in sparse_keymap_report_entry()
240 input_report_key(dev, ke->keycode, value); in sparse_keymap_report_entry()
241 input_sync(dev); in sparse_keymap_report_entry()
243 input_report_key(dev, ke->keycode, 0); in sparse_keymap_report_entry()
244 input_sync(dev); in sparse_keymap_report_entry()
253 input_report_switch(dev, ke->sw.code, value); in sparse_keymap_report_entry()
254 input_sync(dev); in sparse_keymap_report_entry()
273 bool sparse_keymap_report_event(struct input_dev *dev, unsigned int code, in sparse_keymap_report_event() argument
277 sparse_keymap_entry_from_scancode(dev, code); in sparse_keymap_report_event()
281 sparse_keymap_report_entry(dev, ke, value, autorelease); in sparse_keymap_report_event()
289 sparse_keymap_report_entry(dev, &unknown_ke, value, true); in sparse_keymap_report_event()