当前位置: 首页>>代码示例>>C++>>正文


C++ dvb_usb_device_init函数代码示例

本文整理汇总了C++中dvb_usb_device_init函数的典型用法代码示例。如果您正苦于以下问题:C++ dvb_usb_device_init函数的具体用法?C++ dvb_usb_device_init怎么用?C++ dvb_usb_device_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dvb_usb_device_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lme2510_probe

static int lme2510_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	struct usb_device *udev = interface_to_usbdev(intf);
	int ret = 0;

	usb_reset_configuration(udev);

	usb_set_interface(udev, intf->cur_altsetting->desc.bInterfaceNumber, 1);

	if (udev->speed != USB_SPEED_HIGH) {
		ret = usb_reset_device(udev);
		info("DEV Failed to connect in HIGH SPEED mode");
		return -ENODEV;
	}

	lme_firmware_switch(udev, 0);

	if (0 == dvb_usb_device_init(intf, &lme2510_properties,
				     THIS_MODULE, NULL, adapter_nr)) {
		info("DEV registering device driver");
		return 0;
	}
	if (0 == dvb_usb_device_init(intf, &lme2510c_properties,
				     THIS_MODULE, NULL, adapter_nr)) {
		info("DEV registering device driver");
		return 0;
	}

	info("DEV lme2510 Error");
	return -ENODEV;

}
开发者ID:3null,项目名称:fastsocket,代码行数:33,代码来源:lmedm04.c

示例2: gl861_probe

static int gl861_probe(struct usb_interface *intf,
		       const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	struct usb_host_interface *alt;
	int ret;

	if (intf->num_altsetting < 2)
		return -ENODEV;

	ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d,
				  adapter_nr);
	if (ret == 0) {
		alt = usb_altnum_to_altsetting(intf, 0);

		if (alt == NULL) {
			deb_rc("not alt found!\n");
			return -ENODEV;
		}

		ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber,
					alt->desc.bAlternateSetting);
	}

	return ret;
}
开发者ID:71eh,项目名称:open80211s,代码行数:26,代码来源:gl861.c

示例3: m920x_probe

static int m920x_probe(struct usb_interface *intf,
		       const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	struct usb_host_interface *alt;
	int ret;

	if ((ret = dvb_usb_device_init(intf, &megasky_properties, THIS_MODULE, &d)) == 0) {
		deb_rc("probed!\n");

		alt = usb_altnum_to_altsetting(intf, 1);
		if (alt == NULL) {
			deb_rc("not alt found!\n");
			return -ENODEV;
		}

		ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber,
					alt->desc.bAlternateSetting);
		if (ret < 0)
			return ret;

		deb_rc("Changed to alternate setting!\n");

		if ((ret = m9206_rc_init(d->udev)) != 0)
			return ret;
	}
	return ret;
}
开发者ID:ManiacTwister,项目名称:linux-hnd,代码行数:28,代码来源:m920x.c

示例4: anysee_probe

static int anysee_probe(struct usb_interface *intf,
			const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	struct usb_host_interface *alt;
	int ret;

	/* There is one interface with two alternate settings.
	   Alternate setting 0 is for bulk transfer.
	   Alternate setting 1 is for isochronous transfer.
	   We use bulk transfer (alternate setting 0). */
	if (intf->num_altsetting < 1)
		return -ENODEV;

	ret = dvb_usb_device_init(intf, &anysee_properties, THIS_MODULE, &d,
		adapter_nr);
	if (ret)
		return ret;

	alt = usb_altnum_to_altsetting(intf, 0);
	if (alt == NULL) {
		deb_info("%s: no alt found!\n", __func__);
		return -ENODEV;
	}

	ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber,
		alt->desc.bAlternateSetting);
	if (ret)
		return ret;

	if (d)
		ret = anysee_init(d);

	return ret;
}
开发者ID:E-LLP,项目名称:n900,代码行数:35,代码来源:anysee.c

示例5: dtv5100_probe

static int dtv5100_probe(struct usb_interface *intf,
			 const struct usb_device_id *id)
{
	int i, ret;
	struct usb_device *udev = interface_to_usbdev(intf);

	/*                                     */
	for (i = 0; dtv5100_init[i].request; i++) {
		ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
				      dtv5100_init[i].request,
				      USB_TYPE_VENDOR | USB_DIR_OUT,
				      dtv5100_init[i].value,
				      dtv5100_init[i].index, NULL, 0,
				      DTV5100_USB_TIMEOUT);
		if (ret)
			return ret;
	}

	ret = dvb_usb_device_init(intf, &dtv5100_properties,
				  THIS_MODULE, NULL, adapter_nr);
	if (ret)
		return ret;

	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:25,代码来源:dtv5100.c

示例6: friio_probe

static int friio_probe(struct usb_interface *intf,
		       const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	struct usb_host_interface *alt;
	int ret;

	if (intf->num_altsetting < GL861_ALTSETTING_COUNT)
		return -ENODEV;

	alt = usb_altnum_to_altsetting(intf, FRIIO_BULK_ALTSETTING);
	if (alt == NULL) {
		deb_rc("not alt found!\n");
		return -ENODEV;
	}
	ret = usb_set_interface(interface_to_usbdev(intf),
				alt->desc.bInterfaceNumber,
				alt->desc.bAlternateSetting);
	if (ret != 0) {
		deb_rc("failed to set alt-setting!\n");
		return ret;
	}

	ret = dvb_usb_device_init(intf, &friio_properties,
				  THIS_MODULE, &d, adapter_nr);
	if (ret == 0)
		friio_streaming_ctrl(&d->adapter[0], 1);

	return ret;
}
开发者ID:OpenStbV4l-dvb,项目名称:v4l-dvb,代码行数:30,代码来源:friio.c

示例7: af9015_usb_probe

static int af9015_usb_probe(struct usb_interface *intf,
			    const struct usb_device_id *id)
{
	int ret = 0;
	struct dvb_usb_device *d = NULL;
	struct usb_device *udev = interface_to_usbdev(intf);
	u8 i;

	deb_info("%s: interface:%d\n", __func__,
		intf->cur_altsetting->desc.bInterfaceNumber);

	/* interface 0 is used by DVB-T receiver and
	   interface 1 is for remote controller (HID) */
	if (intf->cur_altsetting->desc.bInterfaceNumber == 0) {
		ret = af9015_read_config(udev);
		if (ret)
			return ret;

		for (i = 0; i < af9015_properties_count; i++) {
			ret = dvb_usb_device_init(intf, &af9015_properties[i],
				THIS_MODULE, &d, adapter_nr);
			if (!ret)
				break;
			if (ret != -ENODEV)
				return ret;
		}
		if (ret)
			return ret;

		if (d)
			ret = af9015_init(d);
	}

	return ret;
}
开发者ID:beam,项目名称:linux-tbs-drivers,代码行数:35,代码来源:af9015.c

示例8: vp702x_usb_probe

static int vp702x_usb_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	struct vp702x_device_state *st;
	int ret;

	ret = dvb_usb_device_init(intf, &vp702x_properties,
				   THIS_MODULE, &d, adapter_nr);
	if (ret)
		goto out;

	st = d->priv;
	st->buf_len = 16;
	st->buf = kmalloc(st->buf_len, GFP_KERNEL);
	if (!st->buf) {
		ret = -ENOMEM;
		dvb_usb_device_exit(intf);
		goto out;
	}
	mutex_init(&st->buf_mutex);

out:
	return ret;

}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:26,代码来源:vp702x.c

示例9: au6610_probe

static int au6610_probe(struct usb_interface *intf,
			const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	struct usb_host_interface *alt;
	int ret;

	if (intf->num_altsetting < AU6610_ALTSETTING_COUNT)
		return -ENODEV;

	ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d,
				  adapter_nr);
	if (ret == 0) {
		alt = usb_altnum_to_altsetting(intf, AU6610_ALTSETTING);

		if (alt == NULL) {
			deb_info("%s: no alt found!\n", __func__);
			return -ENODEV;
		}
		ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber,
					alt->desc.bAlternateSetting);
	}

	return ret;
}
开发者ID:beam,项目名称:linux-tbs-drivers,代码行数:25,代码来源:au6610.c

示例10: rtl2832u_usb_probe

//#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
static int rtl2832u_usb_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	if ( ( 0== dvb_usb_device_init(intf,&rtl2832u_1st_properties,THIS_MODULE,NULL,adapter_nr) )||
		( 0== dvb_usb_device_init(intf,&rtl2832u_2nd_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_3th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_4th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_5th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_6th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_7th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_8th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_9th_properties,THIS_MODULE,NULL,adapter_nr) ) )
		return 0;

	return -ENODEV;
}
开发者ID:ambrosa,项目名称:DVB-Realtek-RTL2832U-2.2.2-10_tuner,代码行数:17,代码来源:rtl2832u.c

示例11: lme2510_probe

static int lme2510_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	struct usb_device *udev = usb_get_dev(interface_to_usbdev(intf));

	if (usb_set_interface(udev,0,1) < 0)
		err("set interface to alts=1 failed");

	if (0 == dvb_usb_device_init(intf, &lme2510_properties,
				     THIS_MODULE, NULL, adapter_nr))
		return 0;
	return -ENODEV;
}
开发者ID:gentooo,项目名称:s2-liplianin,代码行数:13,代码来源:lme2510.c

示例12: rtl2832u_usb_probe

//#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
static int rtl2832u_usb_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	/* Thats avoids bugs with 2 instances of driver that operate same hardware */
	/* https://gitorious.org/rtl2832/rtl2832/commit/5495b3fda9e2c3bf4feef5d5751f6f2343380ea9 */
	if (!intf->altsetting->desc.bNumEndpoints)
		return -ENODEV;

	if ( ( 0== dvb_usb_device_init(intf,&rtl2832u_1st_properties,THIS_MODULE,NULL,adapter_nr) )||
		( 0== dvb_usb_device_init(intf,&rtl2832u_2nd_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_3th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_4th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_5th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_6th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_7th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_8th_properties,THIS_MODULE,NULL,adapter_nr) ) ||
		( 0== dvb_usb_device_init(intf,&rtl2832u_9th_properties,THIS_MODULE,NULL,adapter_nr) ) )
		return 0;

	return -ENODEV;
}
开发者ID:dunkpa,项目名称:DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0,代码行数:22,代码来源:rtl2832u.c

示例13: digitv_probe

static int digitv_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	int ret;
	if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
		u8 b[4] = { 0 };

		b[0] = 1;
		digitv_ctrl_msg(d,USB_WRITE_REMOTE_TYPE,0,b,4,NULL,0);

		b[0] = 0;
		digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0);
	}
	return ret;
}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:16,代码来源:digitv.c

示例14: vp7045_usb_probe

static int vp7045_usb_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	struct dvb_usb_device *d;
	int ret = dvb_usb_device_init(intf, &vp7045_properties,
				   THIS_MODULE, &d, adapter_nr);
	if (ret)
		return ret;

	d->priv = kmalloc(20, GFP_KERNEL);
	if (!d->priv) {
		dvb_usb_device_exit(intf);
		return -ENOMEM;
	}

	return ret;
}
开发者ID:JamesAng,项目名称:lx-sk,代码行数:17,代码来源:vp7045.c

示例15: digitv_probe

static int digitv_probe(struct usb_interface *intf,
                        const struct usb_device_id *id)
{
    struct dvb_usb_device *d;
    int ret;
    if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
        u8 b[4] = { 0 };

        if (d != NULL) { /* do that only when the firmware is loaded */
            b[0] = 1;
            digitv_ctrl_msg(d,USB_WRITE_REMOTE_TYPE,0,b,4,NULL,0);

            b[0] = 0;
            digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0);
        }
    }
    return ret;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:18,代码来源:digitv.c


注:本文中的dvb_usb_device_init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。