• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dvb_usb_device_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: rtl28xxu_probe

static int rtl28xxu_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	int ret, i;
	int properties_count = ARRAY_SIZE(rtl28xxu_properties);
	struct dvb_usb_device *d;

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

	if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
		return 0;

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

	if (ret)
		goto err;

	
	ret = rtl2831_wr_reg(d, USB_SYSCTL_0, 0x09);
	if (ret)
		goto err;

	ret = rtl2831_wr_regs(d, USB_EPA_MAXPKT, "\x00\x02\x00\x00", 4);
	if (ret)
		goto err;

	ret = rtl2831_wr_regs(d, USB_EPA_FIFO_CFG, "\x14\x00\x00\x00", 4);
	if (ret)
		goto err;

	return ret;
err:
	deb_info("%s: failed=%d\n", __func__, ret);
	return ret;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:41,代码来源:rtl28xxu.c


示例17: 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;

	/*
	 * Anysee is always warm (its USB-bridge, Cypress FX2, uploads
	 * firmware from eeprom).  If dvb_usb_device_init() succeeds that
	 * means d is a valid pointer.
	 */
	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;

	return anysee_init(d);
}
开发者ID:3null,项目名称:fastsocket,代码行数:37,代码来源:anysee.c


示例18: rtl28xxu_probe

static int rtl28xxu_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	int ret, i;
	u8 val;
	int properties_count = ARRAY_SIZE(rtl28xxu_properties);
	struct dvb_usb_device *d;
	struct usb_device *udev;
	bool found;

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

	if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
		return 0;

	/* Dynamic USB ID support. Replaces first device ID with current one .*/
	udev = interface_to_usbdev(intf);

	for (i = 0, found = false; i < ARRAY_SIZE(rtl28xxu_table) - 1; i++) {
		if (rtl28xxu_table[i].idVendor ==
				le16_to_cpu(udev->descriptor.idVendor) &&
				rtl28xxu_table[i].idProduct ==
				le16_to_cpu(udev->descriptor.idProduct)) {
			found = true;
			break;
		}
	}

	if (!found) {
		deb_info("%s: using dynamic ID %04x:%04x\n", __func__,
				le16_to_cpu(udev->descriptor.idVendor),
				le16_to_cpu(udev->descriptor.idProduct));
		rtl28xxu_properties[0].devices[0].warm_ids[0]->idVendor =
				le16_to_cpu(udev->descriptor.idVendor);
		rtl28xxu_properties[0].devices[0].warm_ids[0]->idProduct =
				le16_to_cpu(udev->descriptor.idProduct);
	}

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

	if (ret)
		goto err;


	/* init USB endpoints */
	ret = rtl28xx_rd_reg(d, USB_SYSCTL_0, &val);
	if (ret)
			goto err;

	/* enable DMA and Full Packet Mode*/
	val |= 0x09;
	ret = rtl28xx_wr_reg(d, USB_SYSCTL_0, val);
	if (ret)
		goto err;

	/* set EPA maximum packet size to 0x0200 */
	ret = rtl28xx_wr_regs(d, USB_EPA_MAXPKT, "\x00\x02\x00\x00", 4);
	if (ret)
		goto err;

	/* change EPA FIFO length */
	ret = rtl28xx_wr_regs(d, USB_EPA_FIFO_CFG, "\x14\x00\x00\x00", 4);
	if (ret)
		goto err;

	return ret;
err:
	deb_info("%s: failed=%d\n", __func__, ret);
	return ret;
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:76,代码来源:rtl28xxu.c


示例19: dibusb_mc_probe

static int dibusb_mc_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE);
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:5,代码来源:dibusb-mc.c


示例20: ttusb2_probe

static int ttusb2_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{
	return dvb_usb_device_init(intf,&ttusb2_properties,THIS_MODULE,NULL);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:5,代码来源:ttusb2.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dvector函数代码示例发布时间:2022-05-30
下一篇:
C++ dvb_register_adapter函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap