Lines Matching refs:d
176 static int lme2510_usb_talk(struct dvb_usb_device *d, in lme2510_usb_talk() argument
179 struct lme2510_state *st = d->priv; in lme2510_usb_talk()
192 ret = mutex_lock_interruptible(&d->usb_mutex); in lme2510_usb_talk()
200 ret |= lme2510_bulk_write(d->udev, buff, wlen , 0x01); in lme2510_usb_talk()
202 ret |= lme2510_bulk_read(d->udev, buff, (rlen < 64) ? in lme2510_usb_talk()
208 mutex_unlock(&d->usb_mutex); in lme2510_usb_talk()
213 static int lme2510_stream_restart(struct dvb_usb_device *d) in lme2510_stream_restart() argument
215 struct lme2510_state *st = d->priv; in lme2510_stream_restart()
221 ret = lme2510_usb_talk(d, all_pids, sizeof(all_pids), in lme2510_stream_restart()
224 ret = lme2510_usb_talk(d, stream_on, sizeof(stream_on), in lme2510_stream_restart()
229 static int lme2510_enable_pid(struct dvb_usb_device *d, u8 index, u16 pid_out) in lme2510_enable_pid() argument
231 struct lme2510_state *st = d->priv; in lme2510_enable_pid()
240 ret |= lme2510_stream_restart(d); in lme2510_enable_pid()
251 ret |= lme2510_usb_talk(d, pid_buff , in lme2510_enable_pid()
255 ret |= lme2510_stream_restart(d); in lme2510_enable_pid()
361 struct dvb_usb_device *d = adap_to_d(adap); in lme2510_int_read() local
370 lme_int->buffer = usb_alloc_coherent(d->udev, 128, GFP_ATOMIC, in lme2510_int_read()
377 d->udev, in lme2510_int_read()
378 usb_rcvintpipe(d->udev, 0xa), in lme2510_int_read()
386 ep = usb_pipe_endpoint(d->udev, lme_int->lme_urb->pipe); in lme2510_int_read()
389 lme_int->lme_urb->pipe = usb_rcvbulkpipe(d->udev, 0xa), in lme2510_int_read()
401 struct dvb_usb_device *d = adap_to_d(adap); in lme2510_pid_filter_ctrl() local
409 mutex_lock(&d->i2c_mutex); in lme2510_pid_filter_ctrl()
412 ret |= lme2510_usb_talk(d, clear_pid_reg, in lme2510_pid_filter_ctrl()
420 mutex_unlock(&d->i2c_mutex); in lme2510_pid_filter_ctrl()
428 struct dvb_usb_device *d = adap_to_d(adap); in lme2510_pid_filter() local
435 mutex_lock(&d->i2c_mutex); in lme2510_pid_filter()
436 ret |= lme2510_enable_pid(d, index, pid); in lme2510_pid_filter()
437 mutex_unlock(&d->i2c_mutex); in lme2510_pid_filter()
445 static int lme2510_return_status(struct dvb_usb_device *d) in lme2510_return_status() argument
454 ret |= usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), in lme2510_return_status()
463 static int lme2510_msg(struct dvb_usb_device *d, in lme2510_msg() argument
466 struct lme2510_state *st = d->priv; in lme2510_msg()
470 return lme2510_usb_talk(d, wbuf, wlen, rbuf, rlen); in lme2510_msg()
476 struct dvb_usb_device *d = i2c_get_adapdata(adap); in lme2510_i2c_xfer() local
477 struct lme2510_state *st = d->priv; in lme2510_i2c_xfer()
483 mutex_lock(&d->i2c_mutex); in lme2510_i2c_xfer()
518 if (lme2510_msg(d, obuf, len, ibuf, 64) < 0) { in lme2510_i2c_xfer()
520 mutex_unlock(&d->i2c_mutex); in lme2510_i2c_xfer()
534 mutex_unlock(&d->i2c_mutex); in lme2510_i2c_xfer()
551 struct dvb_usb_device *d = adap_to_d(adap); in lme2510_streaming_ctrl() local
565 mutex_lock(&d->i2c_mutex); in lme2510_streaming_ctrl()
567 ret = lme2510_usb_talk(d, clear_reg_3, in lme2510_streaming_ctrl()
572 mutex_unlock(&d->i2c_mutex); in lme2510_streaming_ctrl()
586 static int lme2510_download_firmware(struct dvb_usb_device *d, in lme2510_download_firmware() argument
625 lme2510_usb_talk(d, data, wlen, data, len_in); in lme2510_download_firmware()
633 lme2510_usb_talk(d, data, len_in, data, len_in); in lme2510_download_firmware()
645 static void lme_coldreset(struct dvb_usb_device *d) in lme_coldreset() argument
651 lme2510_usb_talk(d, data, sizeof(data), data, sizeof(data)); in lme_coldreset()
663 static const char *lme_firmware_switch(struct dvb_usb_device *d, int cold) in lme_firmware_switch() argument
665 struct lme2510_state *st = d->priv; in lme_firmware_switch()
666 struct usb_device *udev = d->udev; in lme_firmware_switch()
742 lme_coldreset(d); in lme_firmware_switch()
807 struct dvb_usb_device *d = fe_to_d(fe); in dm04_lme2510_set_voltage() local
814 mutex_lock(&d->i2c_mutex); in dm04_lme2510_set_voltage()
818 ret |= lme2510_usb_talk(d, in dm04_lme2510_set_voltage()
825 ret |= lme2510_usb_talk(d, in dm04_lme2510_set_voltage()
830 mutex_unlock(&d->i2c_mutex); in dm04_lme2510_set_voltage()
842 struct dvb_usb_device *d = fe_to_d(fe); in dm04_read_status() local
843 struct lme2510_state *st = d->priv; in dm04_read_status()
856 mutex_lock(&d->i2c_mutex); in dm04_read_status()
859 ret = lme2510_stream_restart(d); in dm04_read_status()
861 mutex_unlock(&d->i2c_mutex); in dm04_read_status()
954 struct dvb_usb_device *d = adap_to_d(adap); in lme_name() local
956 const char *desc = d->name; in lme_name()
969 struct dvb_usb_device *d = adap_to_d(adap); in dm04_lme2510_frontend_attach() local
970 struct lme2510_state *st = d->priv; in dm04_lme2510_frontend_attach()
974 switch (le16_to_cpu(d->udev->descriptor.idProduct)) { in dm04_lme2510_frontend_attach()
979 &tda10086_config, &d->i2c_adap); in dm04_lme2510_frontend_attach()
988 ret = lme_firmware_switch(d, 1) ? 0 : -ENODEV; in dm04_lme2510_frontend_attach()
995 &sharp_z0194_config, &d->i2c_adap); in dm04_lme2510_frontend_attach()
1004 ret = lme_firmware_switch(d, 1) ? 0 : -ENODEV; in dm04_lme2510_frontend_attach()
1011 &d->i2c_adap); in dm04_lme2510_frontend_attach()
1021 ret = lme_firmware_switch(d, 1) ? 0 : -ENODEV; in dm04_lme2510_frontend_attach()
1028 &m88rs2000_config, &d->i2c_adap); in dm04_lme2510_frontend_attach()
1033 &d->i2c_adap); in dm04_lme2510_frontend_attach()
1054 d->rc_map = NULL; in dm04_lme2510_frontend_attach()
1077 struct dvb_usb_device *d = adap_to_d(adap); in dm04_lme2510_tuner() local
1085 &d->i2c_adap, 1)) in dm04_lme2510_tuner()
1090 &d->i2c_adap)) in dm04_lme2510_tuner()
1095 &d->i2c_adap, DVB_PLL_OPERA1)) in dm04_lme2510_tuner()
1109 lme_coldreset(d); in dm04_lme2510_tuner()
1123 static int lme2510_powerup(struct dvb_usb_device *d, int onoff) in lme2510_powerup() argument
1125 struct lme2510_state *st = d->priv; in lme2510_powerup()
1131 mutex_lock(&d->i2c_mutex); in lme2510_powerup()
1134 ret = lme2510_usb_talk(d, lnb_on, len, rbuf, rlen); in lme2510_powerup()
1136 ret = lme2510_usb_talk(d, lnb_off, len, rbuf, rlen); in lme2510_powerup()
1140 mutex_unlock(&d->i2c_mutex); in lme2510_powerup()
1145 static int lme2510_get_adapter_count(struct dvb_usb_device *d) in lme2510_get_adapter_count() argument
1150 static int lme2510_identify_state(struct dvb_usb_device *d, const char **name) in lme2510_identify_state() argument
1152 struct lme2510_state *st = d->priv; in lme2510_identify_state()
1154 usb_reset_configuration(d->udev); in lme2510_identify_state()
1156 usb_set_interface(d->udev, in lme2510_identify_state()
1157 d->props->bInterfaceNumber, 1); in lme2510_identify_state()
1161 if (lme2510_return_status(d) == 0x44) { in lme2510_identify_state()
1162 *name = lme_firmware_switch(d, 0); in lme2510_identify_state()
1173 struct dvb_usb_device *d; in lme2510_get_stream_config() local
1178 d = adap_to_d(adap); in lme2510_get_stream_config()
1186 if (!(le16_to_cpu(d->udev->descriptor.idProduct) in lme2510_get_stream_config()
1193 static int lme2510_get_rc_config(struct dvb_usb_device *d, in lme2510_get_rc_config() argument
1200 static void *lme2510_exit_int(struct dvb_usb_device *d) in lme2510_exit_int() argument
1202 struct lme2510_state *st = d->priv; in lme2510_exit_int()
1203 struct dvb_usb_adapter *adap = &d->adapter[0]; in lme2510_exit_int()
1219 usb_free_coherent(d->udev, 128, st->buffer, in lme2510_exit_int()
1227 static void lme2510_exit(struct dvb_usb_device *d) in lme2510_exit() argument
1231 if (d != NULL) { in lme2510_exit()
1232 usb_buffer = lme2510_exit_int(d); in lme2510_exit()