Lines Matching refs:d

48 	struct dvb_usb_device *d = input_get_drvdata(dev);  in legacy_dvb_usb_getkeycode()  local
49 struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; in legacy_dvb_usb_getkeycode()
50 unsigned int keymap_size = d->props.rc.legacy.rc_map_size; in legacy_dvb_usb_getkeycode()
71 struct dvb_usb_device *d = input_get_drvdata(dev); in legacy_dvb_usb_setkeycode() local
72 struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; in legacy_dvb_usb_setkeycode()
73 unsigned int keymap_size = d->props.rc.legacy.rc_map_size; in legacy_dvb_usb_setkeycode()
111 struct dvb_usb_device *d = in legacy_dvb_usb_read_remote_control() local
123 if (d->props.rc.legacy.rc_query(d,&event,&state)) { in legacy_dvb_usb_read_remote_control()
134 d->last_event = event; in legacy_dvb_usb_read_remote_control()
135 input_event(d->input_dev, EV_KEY, event, 1); in legacy_dvb_usb_read_remote_control()
136 input_sync(d->input_dev); in legacy_dvb_usb_read_remote_control()
137 input_event(d->input_dev, EV_KEY, d->last_event, 0); in legacy_dvb_usb_read_remote_control()
138 input_sync(d->input_dev); in legacy_dvb_usb_read_remote_control()
142 input_event(d->input_dev, EV_KEY, event, 1); in legacy_dvb_usb_read_remote_control()
143 input_sync(d->input_dev); in legacy_dvb_usb_read_remote_control()
144 input_event(d->input_dev, EV_KEY, d->last_event, 0); in legacy_dvb_usb_read_remote_control()
145 input_sync(d->input_dev); in legacy_dvb_usb_read_remote_control()
187 schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc.legacy.rc_interval)); in legacy_dvb_usb_read_remote_control()
190 static int legacy_dvb_usb_remote_init(struct dvb_usb_device *d) in legacy_dvb_usb_remote_init() argument
201 input_dev->phys = d->rc_phys; in legacy_dvb_usb_remote_init()
202 usb_to_input_id(d->udev, &input_dev->id); in legacy_dvb_usb_remote_init()
203 input_dev->dev.parent = &d->udev->dev; in legacy_dvb_usb_remote_init()
204 d->input_dev = input_dev; in legacy_dvb_usb_remote_init()
205 d->rc_dev = NULL; in legacy_dvb_usb_remote_init()
211 deb_rc("key map size: %d\n", d->props.rc.legacy.rc_map_size); in legacy_dvb_usb_remote_init()
212 for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) { in legacy_dvb_usb_remote_init()
214 d->props.rc.legacy.rc_map_table[i].keycode, i); in legacy_dvb_usb_remote_init()
215 set_bit(d->props.rc.legacy.rc_map_table[i].keycode, input_dev->keybit); in legacy_dvb_usb_remote_init()
219 input_dev->rep[REP_PERIOD] = d->props.rc.legacy.rc_interval; in legacy_dvb_usb_remote_init()
220 input_dev->rep[REP_DELAY] = d->props.rc.legacy.rc_interval + 150; in legacy_dvb_usb_remote_init()
222 input_set_drvdata(input_dev, d); in legacy_dvb_usb_remote_init()
228 rc_interval = d->props.rc.legacy.rc_interval; in legacy_dvb_usb_remote_init()
230 INIT_DELAYED_WORK(&d->rc_query_work, legacy_dvb_usb_read_remote_control); in legacy_dvb_usb_remote_init()
233 schedule_delayed_work(&d->rc_query_work, in legacy_dvb_usb_remote_init()
236 d->state |= DVB_USB_STATE_REMOTE; in legacy_dvb_usb_remote_init()
248 struct dvb_usb_device *d = in dvb_usb_read_remote_control() local
258 if (dvb_usb_disable_rc_polling || d->props.rc.core.bulk_mode) in dvb_usb_read_remote_control()
261 err = d->props.rc.core.rc_query(d); in dvb_usb_read_remote_control()
265 schedule_delayed_work(&d->rc_query_work, in dvb_usb_read_remote_control()
266 msecs_to_jiffies(d->props.rc.core.rc_interval)); in dvb_usb_read_remote_control()
269 static int rc_core_dvb_usb_remote_init(struct dvb_usb_device *d) in rc_core_dvb_usb_remote_init() argument
274 dev = rc_allocate_device(d->props.rc.core.driver_type); in rc_core_dvb_usb_remote_init()
278 dev->driver_name = d->props.rc.core.module_name; in rc_core_dvb_usb_remote_init()
279 dev->map_name = d->props.rc.core.rc_codes; in rc_core_dvb_usb_remote_init()
280 dev->change_protocol = d->props.rc.core.change_protocol; in rc_core_dvb_usb_remote_init()
281 dev->allowed_protocols = d->props.rc.core.allowed_protos; in rc_core_dvb_usb_remote_init()
282 usb_to_input_id(d->udev, &dev->input_id); in rc_core_dvb_usb_remote_init()
283 dev->device_name = d->desc->name; in rc_core_dvb_usb_remote_init()
284 dev->input_phys = d->rc_phys; in rc_core_dvb_usb_remote_init()
285 dev->dev.parent = &d->udev->dev; in rc_core_dvb_usb_remote_init()
286 dev->priv = d; in rc_core_dvb_usb_remote_init()
287 dev->scancode_mask = d->props.rc.core.scancode_mask; in rc_core_dvb_usb_remote_init()
295 d->input_dev = NULL; in rc_core_dvb_usb_remote_init()
296 d->rc_dev = dev; in rc_core_dvb_usb_remote_init()
298 if (!d->props.rc.core.rc_query || d->props.rc.core.bulk_mode) in rc_core_dvb_usb_remote_init()
302 INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control); in rc_core_dvb_usb_remote_init()
304 rc_interval = d->props.rc.core.rc_interval; in rc_core_dvb_usb_remote_init()
307 schedule_delayed_work(&d->rc_query_work, in rc_core_dvb_usb_remote_init()
313 int dvb_usb_remote_init(struct dvb_usb_device *d) in dvb_usb_remote_init() argument
320 if (d->props.rc.legacy.rc_map_table && d->props.rc.legacy.rc_query) in dvb_usb_remote_init()
321 d->props.rc.mode = DVB_RC_LEGACY; in dvb_usb_remote_init()
322 else if (d->props.rc.core.rc_codes) in dvb_usb_remote_init()
323 d->props.rc.mode = DVB_RC_CORE; in dvb_usb_remote_init()
327 usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys)); in dvb_usb_remote_init()
328 strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys)); in dvb_usb_remote_init()
331 if (d->props.rc.legacy.rc_interval < 40) in dvb_usb_remote_init()
332 d->props.rc.legacy.rc_interval = 100; /* default */ in dvb_usb_remote_init()
334 if (d->props.rc.mode == DVB_RC_LEGACY) in dvb_usb_remote_init()
335 err = legacy_dvb_usb_remote_init(d); in dvb_usb_remote_init()
337 err = rc_core_dvb_usb_remote_init(d); in dvb_usb_remote_init()
341 d->state |= DVB_USB_STATE_REMOTE; in dvb_usb_remote_init()
346 int dvb_usb_remote_exit(struct dvb_usb_device *d) in dvb_usb_remote_exit() argument
348 if (d->state & DVB_USB_STATE_REMOTE) { in dvb_usb_remote_exit()
349 cancel_delayed_work_sync(&d->rc_query_work); in dvb_usb_remote_exit()
350 if (d->props.rc.mode == DVB_RC_LEGACY) in dvb_usb_remote_exit()
351 input_unregister_device(d->input_dev); in dvb_usb_remote_exit()
353 rc_unregister_device(d->rc_dev); in dvb_usb_remote_exit()
355 d->state &= ~DVB_USB_STATE_REMOTE; in dvb_usb_remote_exit()
362 int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, in dvb_usb_nec_rc_key_to_event() argument
366 struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; in dvb_usb_nec_rc_key_to_event()
379 for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) in dvb_usb_nec_rc_key_to_event()