Lines Matching +full:event +full:- +full:touch +full:- +full:alt

1 // SPDX-License-Identifier: GPL-2.0-only
2 /* DVB USB compliant linux driver for MSI Mega Sky 580 DVB-T USB2.0 receiver
6 * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
19 #include "tuner-simple.h"
25 MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
46 return -EIO; in m920x_read()
65 ret = m920x_write(udev, request, seq->data, seq->address); in m920x_write_seq()
70 } while (seq->address); in m920x_write_seq()
81 if (d->props.rc.legacy.rc_query || d->props.rc.core.rc_query) { in m920x_init()
83 ret = m920x_write_seq(d->udev, M9206_CORE, rc_seq); in m920x_init()
92 for (i = 0; i < d->props.num_adapters; i++) in m920x_init()
93 flags |= d->adapter[i].props.fe[0].caps; in m920x_init()
95 /* Some devices(Dposh) might crash if we attempt touch at all. */ in m920x_init()
97 for (i = 0; i < d->props.num_adapters; i++) { in m920x_init()
98 epi = d->adapter[i].props.fe[0].stream.endpoint - 0x81; in m920x_init()
102 return -EINVAL; in m920x_init()
126 struct usb_host_interface *alt; in m920x_init_ep() local
128 if ((alt = usb_altnum_to_altsetting(intf, 1)) == NULL) { in m920x_init_ep()
129 deb("No alt found!\n"); in m920x_init_ep()
130 return -ENODEV; in m920x_init_ep()
133 return usb_set_interface(udev, alt->desc.bInterfaceNumber, in m920x_init_ep()
134 alt->desc.bAlternateSetting); in m920x_init_ep()
140 struct m920x_state *m = d->priv; in m920x_parse_rc_state()
152 m->rep_count = 0; in m920x_parse_rc_state()
159 m->rep_count = 0; in m920x_parse_rc_state()
165 /* prevent immediate auto-repeat */ in m920x_parse_rc_state()
166 if (++m->rep_count > 2) in m920x_parse_rc_state()
179 static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) in m920x_rc_query() argument
186 return -ENOMEM; in m920x_rc_query()
188 ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, in m920x_rc_query()
193 ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, in m920x_rc_query()
200 for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) in m920x_rc_query()
201 if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) { in m920x_rc_query()
202 *event = d->props.rc.legacy.rc_map_table[i].keycode; in m920x_rc_query()
224 return -ENOMEM; in m920x_rc_core_query()
226 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_STATE, &rc_state[0], 1)) != 0) in m920x_rc_core_query()
229 if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, &rc_state[1], 1)) != 0) in m920x_rc_core_query()
237 rc_keyup(d->rc_dev); in m920x_rc_core_query()
239 rc_repeat(d->rc_dev); in m920x_rc_core_query()
241 rc_keydown(d->rc_dev, RC_PROTO_UNKNOWN, rc_state[1], 0); in m920x_rc_core_query()
255 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in m920x_i2c_xfer()
256 return -EAGAIN; in m920x_i2c_xfer()
265 ret = -ENOTSUPP; in m920x_i2c_xfer()
270 if ((ret = m920x_write(d->udev, M9206_I2C, in m920x_i2c_xfer()
282 if ((ret = m920x_read(d->udev, M9206_I2C, 0x0, in m920x_i2c_xfer()
292 if ((ret = m920x_write(d->udev, M9206_I2C, msg[i].buf[j], stop)) != 0) in m920x_i2c_xfer()
301 mutex_unlock(&d->i2c_mutex); in m920x_i2c_xfer()
322 return -EINVAL; in m920x_set_filter()
326 if ((ret = m920x_write(d->udev, M9206_FILTER, pid, (type << 8) | (idx * 4) )) != 0) in m920x_set_filter()
329 if ((ret = m920x_write(d->udev, M9206_FILTER, 0, (type << 8) | (idx * 4) )) != 0) in m920x_set_filter()
337 struct m920x_state *m = adap->dev->priv; in m920x_update_filters()
338 int enabled = m->filtering_enabled[adap->id]; in m920x_update_filters()
340 int ep = adap->props.fe[0].stream.endpoint; in m920x_update_filters()
343 if (m->filters[adap->id][i] == 8192) in m920x_update_filters()
347 if ((ret = m920x_set_filter(adap->dev, ep, 1, enabled)) != 0) in m920x_update_filters()
351 if ((ret = m920x_set_filter(adap->dev, ep, i + 2, 0)) != 0) in m920x_update_filters()
357 if (m->filters[adap->id][i] == 0) in m920x_update_filters()
360 if ((ret = m920x_set_filter(adap->dev, ep, filter + 2, m->filters[adap->id][i])) != 0) in m920x_update_filters()
372 struct m920x_state *m = adap->dev->priv; in m920x_pid_filter_ctrl()
374 m->filtering_enabled[adap->id] = onoff ? 1 : 0; in m920x_pid_filter_ctrl()
381 struct m920x_state *m = adap->dev->priv; in m920x_pid_filter()
383 m->filters[adap->id][index] = onoff ? pid : 0; in m920x_pid_filter()
396 return -ENOMEM; in m920x_firmware_download()
401 return -ENOMEM; in m920x_firmware_download()
413 for (i = 0; i + (sizeof(u16) * 3) < fw->size;) { in m920x_firmware_download()
414 value = get_unaligned_le16(fw->data + i); in m920x_firmware_download()
417 index = get_unaligned_le16(fw->data + i); in m920x_firmware_download()
420 size = get_unaligned_le16(fw->data + i); in m920x_firmware_download()
424 /* Will stall if using fw->data ... */ in m920x_firmware_download()
425 memcpy(buff, fw->data + i, size); in m920x_firmware_download()
433 ret = -EIO; in m920x_firmware_download()
440 if (i != fw->size) { in m920x_firmware_download()
442 ret = -EINVAL; in m920x_firmware_download()
466 struct usb_host_interface *alt; in m920x_identify_state() local
468 alt = usb_altnum_to_altsetting(usb_ifnum_to_if(udev, 0), 1); in m920x_identify_state()
469 *cold = (alt == NULL) ? 1 : 0; in m920x_identify_state()
555 adap->fe_adap[0].fe = dvb_attach(mt352_attach, in m920x_mt352_frontend_attach()
557 &adap->dev->i2c_adap); in m920x_mt352_frontend_attach()
558 if ((adap->fe_adap[0].fe) == NULL) in m920x_mt352_frontend_attach()
559 return -EIO; in m920x_mt352_frontend_attach()
586 ret = m920x_write_seq(adap->dev->udev, M9206_CORE, vp7049_fe_init_seq); in m920x_mt352_frontend_attach_vp7049()
599 adap->fe_adap[0].fe = dvb_attach(tda10046_attach, in m920x_tda10046_08_frontend_attach()
601 &adap->dev->i2c_adap); in m920x_tda10046_08_frontend_attach()
602 if ((adap->fe_adap[0].fe) == NULL) in m920x_tda10046_08_frontend_attach()
603 return -EIO; in m920x_tda10046_08_frontend_attach()
612 adap->fe_adap[0].fe = dvb_attach(tda10046_attach, in m920x_tda10046_0b_frontend_attach()
614 &adap->dev->i2c_adap); in m920x_tda10046_0b_frontend_attach()
615 if ((adap->fe_adap[0].fe) == NULL) in m920x_tda10046_0b_frontend_attach()
616 return -EIO; in m920x_tda10046_0b_frontend_attach()
625 …if (dvb_attach(qt1010_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, &m920x_qt1010_config) == … in m920x_qt1010_tuner_attach()
626 return -ENODEV; in m920x_qt1010_tuner_attach()
635 if (dvb_attach(tda827x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, NULL) == NULL) in m920x_tda8275_60_tuner_attach()
636 return -ENODEV; in m920x_tda8275_60_tuner_attach()
645 if (dvb_attach(tda827x_attach, adap->fe_adap[0].fe, 0x61, &adap->dev->i2c_adap, NULL) == NULL) in m920x_tda8275_61_tuner_attach()
646 return -ENODEV; in m920x_tda8275_61_tuner_attach()
653 dvb_attach(simple_tuner_attach, adap->fe_adap[0].fe, in m920x_fmd1216me_tuner_attach()
654 &adap->dev->i2c_adap, 0x61, in m920x_fmd1216me_tuner_attach()
663 if (dvb_attach(mt2060_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, in m920x_mt2060_tuner_attach()
665 return -ENODEV; in m920x_mt2060_tuner_attach()
671 /* device-specific initialization */
818 int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber; in m920x_probe()
823 /* Single-tuner device, or first interface on in m920x_probe()
824 * multi-tuner device in m920x_probe()
872 /* Another interface on a multi-tuner device */ in m920x_probe()
910 .firmware = "dvb-usb-megasky-02.fw",
954 { "MSI Mega Sky 580 DVB-T USB2.0",
965 .firmware = "dvb-usb-digivox-02.fw",
1002 { "MSI DIGI VOX mini II DVB-T USB2.0",
1009 /* LifeView TV Walker Twin support by Nick Andrew <nick@nick-andrew.net>
1021 .firmware = "dvb-usb-tvwalkert.fw",
1089 { .name = "LifeView TV Walker Twin DVB-T USB2.0",
1100 .firmware = "dvb-usb-dposh-01.fw",
1131 { .name = "Dposh DVB-T USB2.0",
1198 .firmware = "dvb-usb-vp7049-0.95.fw",
1242 { "DTV-DVB UDTT7049",