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

C++ peripheral_free_list函数代码示例

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

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



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

示例1: bfin_tdm_probe

static int __devinit bfin_tdm_probe(struct platform_device *pdev)
{
	int ret = 0;

	if (peripheral_request_list(&sport_req[sport_num][0], "soc-audio")) {
		pr_err("Requesting Peripherals failed\n");
		return -EFAULT;
	}

	/* request DMA for SPORT */
	sport_handle = sport_init(&sport_params[sport_num], 4, \
		8 * sizeof(u32), NULL);
	if (!sport_handle) {
		peripheral_free_list(&sport_req[sport_num][0]);
		return -ENODEV;
	}

	/* SPORT works in TDM mode */
	ret = sport_set_multichannel(sport_handle, 8, 0xFF, 1);
	if (ret) {
		pr_err("SPORT is busy!\n");
		ret = -EBUSY;
		goto sport_config_err;
	}

	ret = sport_config_rx(sport_handle, IRFS, 0x1F, 0, 0);
	if (ret) {
		pr_err("SPORT is busy!\n");
		ret = -EBUSY;
		goto sport_config_err;
	}

	ret = sport_config_tx(sport_handle, ITFS, 0x1F, 0, 0);
	if (ret) {
		pr_err("SPORT is busy!\n");
		ret = -EBUSY;
		goto sport_config_err;
	}

	ret = snd_soc_register_dai(&bf5xx_tdm_dai);
	if (ret) {
		pr_err("Failed to register DAI: %d\n", ret);
		goto sport_config_err;
	}

	sport_handle->private_data = &bf5xx_tdm;
	return 0;

sport_config_err:
	peripheral_free_list(&sport_req[sport_num][0]);
	return ret;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:52,代码来源:bf5xx-tdm.c


示例2: free_ports

static void free_ports(void)
{
	u16 tmr_req[] = TIMERS;

	peripheral_free_list(ppi_pins);
	peripheral_free_list(tmr_req);

#if defined(UD) && defined(LBR)
	gpio_free(LBR);
	gpio_free(UD);
#endif
	gpio_free(MOD);
}
开发者ID:020gzh,项目名称:linux,代码行数:13,代码来源:bf537-lq035.c


示例3: bfin_tdm_remove

static int __devexit bfin_tdm_remove(struct platform_device *pdev)
{
	peripheral_free_list(&sport_req[sport_num][0]);
	snd_soc_unregister_dai(&bf5xx_tdm_dai);

	return 0;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:7,代码来源:bf5xx-tdm.c


示例4: sport_free_resource

static void sport_free_resource(struct sport_device *sport)
{
	free_irq(sport->rx_err_irq, sport);
	free_irq(sport->tx_err_irq, sport);
	free_dma(sport->rx_dma_chan);
	free_dma(sport->tx_dma_chan);
	peripheral_free_list(sport->pin_req);
}
开发者ID:020gzh,项目名称:linux,代码行数:8,代码来源:bf6xx-sport.c


示例5: bfin_kpad_remove

static int bfin_kpad_remove(struct platform_device *pdev)
{
	struct bfin_kpad_platform_data *pdata = dev_get_platdata(&pdev->dev);
	struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);

	del_timer_sync(&bf54x_kpad->timer);
	free_irq(bf54x_kpad->irq, pdev);

	input_unregister_device(bf54x_kpad->input);

	peripheral_free_list((u16 *)&per_rows[MAX_RC - pdata->rows]);
	peripheral_free_list((u16 *)&per_cols[MAX_RC - pdata->cols]);

	kfree(bf54x_kpad->keycode);
	kfree(bf54x_kpad);

	return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:18,代码来源:bf54x-keys.c


示例6: bfin_mii_bus_remove

static int __devexit bfin_mii_bus_remove(struct platform_device *pdev)
{
	struct mii_bus *miibus = platform_get_drvdata(pdev);
	platform_set_drvdata(pdev, NULL);
	mdiobus_unregister(miibus);
	mdiobus_free(miibus);
	peripheral_free_list(pin_req);
	return 0;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:9,代码来源:bfin_mac.c


示例7: bf5xx_ac97_remove

static void bf5xx_ac97_remove(struct platform_device *pdev,
			      struct snd_soc_dai *dai)
{
	free_page((unsigned long)cmd_count);
	cmd_count = NULL;
	peripheral_free_list(sport_req[sport_num]);
#ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET
	gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM);
#endif
}
开发者ID:Atrix-Dev-Team,项目名称:kernel-MB860,代码行数:10,代码来源:bf5xx-ac97.c


示例8: ppifcd_uninit

/*
 * FUNCTION NAME: ppifcd_uninit / cleanup_module
 *
 * INPUTS/OUTPUTS:
 *
 * RETURN:
 *
 * FUNCTION(S) CALLED:
 *
 * GLOBAL VARIABLES REFERENCED: ppiinfo
 *
 * GLOBAL VARIABLES MODIFIED: NIL
 *
 * DESCRIPTION: It will be invoked when using 'rmmod' command.
 *              or, you invoke it directly when it needs remove
 *              ppi module.
 *
 * CAUTION:
 */
void __exit ppifcd_uninit(void)
{

	if (ppiinfo.ppi_trigger_gpio != NO_TRIGGER)
		gpio_free(ppiinfo.ppi_trigger_gpio);

	peripheral_free_list(ppifcd_ppi_req);

	misc_deregister(&bfin_ppi_dev);
	printk(KERN_ALERT "Goodbye PPI\n");
}
开发者ID:ysei,项目名称:linux-2.6.x,代码行数:30,代码来源:bfin_ppifcd.c


示例9: request_ports

static int __devinit request_ports(void)
{
	u16 tmr_req[] = TIMERS;

	/*
		UD:      PF13
		MOD:     PF10
		LBR:     PF14
		PPI_CLK: PF15
	*/

	if (peripheral_request_list(ppi_pins, KBUILD_MODNAME)) {
		pr_err("requesting PPI peripheral failed\n");
		return -EBUSY;
	}

	if (peripheral_request_list(tmr_req, KBUILD_MODNAME)) {
		peripheral_free_list(ppi_pins);
		pr_err("requesting timer peripheral failed\n");
		return -EBUSY;
	}

#if (defined(UD) && defined(LBR))
	if (gpio_request(UD, KBUILD_MODNAME)) {
		pr_err("requesting GPIO %d failed\n", UD);
		return -EBUSY;
	}

	if (gpio_request(LBR, KBUILD_MODNAME)) {
		pr_err("requesting GPIO %d failed\n", LBR);
		gpio_free(UD);
		return -EBUSY;
	}

	gpio_direction_output(UD, 0);
	gpio_direction_output(LBR, 1);

#endif

	if (gpio_request(MOD, KBUILD_MODNAME)) {
		pr_err("requesting GPIO %d failed\n", MOD);
#if (defined(UD) && defined(LBR))
		gpio_free(LBR);
		gpio_free(UD);
#endif
		return -EBUSY;
	}

	gpio_direction_output(MOD, 1);

	SSYNC();
	return 0;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:53,代码来源:bf537-lq035.c


示例10: bf609_nor_flash_exit

void bf609_nor_flash_exit(struct platform_device *dev)
{
	const unsigned short pins[] = {
		P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12,
		P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21,
		P_A22, P_A23, P_A24, P_A25, P_NORCK, 0,
	};

	peripheral_free_list(pins);

	bfin_write32(SMC_GCTL, 0);
}
开发者ID:03199618,项目名称:linux,代码行数:12,代码来源:ezkit.c


示例11: spi_release_bus

void spi_release_bus(struct spi_slave *slave)
{
	struct bfin_spi_slave *bss = to_bfin_spi_slave(slave);

	debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);

	peripheral_free_list(pins[slave->bus]);
	if (is_gpio_cs(slave->cs))
		gpio_free(gpio_cs(slave->cs));

	write_SPI_CTL(bss, 0);
	SSYNC();
}
开发者ID:AeroGirl,项目名称:u-boot-kern3.2,代码行数:13,代码来源:bfin_spi.c


示例12: bf5xx_tdm_suspend

static int bf5xx_tdm_suspend(struct snd_soc_dai *dai)
{
	struct sport_device *sport = snd_soc_dai_get_drvdata(dai);

	if (dai->playback_active)
		sport_tx_stop(sport);
	if (dai->capture_active)
		sport_rx_stop(sport);

	/* isolate sync/clock pins from codec while sports resume */
	peripheral_free_list(sport->pin_req);

	return 0;
}
开发者ID:1yankeedt,项目名称:D710BST_FL24_Kernel,代码行数:14,代码来源:bf5xx-tdm.c


示例13: sport_request_resource

static int sport_request_resource(struct sport_device *sport)
{
	struct device *dev = &sport->pdev->dev;
	int ret;

	ret = peripheral_request_list(sport->pin_req, "soc-audio");
	if (ret) {
		dev_err(dev, "Unable to request sport pin\n");
		return ret;
	}

	ret = request_dma(sport->tx_dma_chan, "SPORT TX Data");
	if (ret) {
		dev_err(dev, "Unable to allocate DMA channel for sport tx\n");
		goto err_tx_dma;
	}
	set_dma_callback(sport->tx_dma_chan, sport_tx_irq, sport);

	ret = request_dma(sport->rx_dma_chan, "SPORT RX Data");
	if (ret) {
		dev_err(dev, "Unable to allocate DMA channel for sport rx\n");
		goto err_rx_dma;
	}
	set_dma_callback(sport->rx_dma_chan, sport_rx_irq, sport);

	ret = request_irq(sport->tx_err_irq, sport_err_irq,
			0, "SPORT TX ERROR", sport);
	if (ret) {
		dev_err(dev, "Unable to allocate tx error IRQ for sport\n");
		goto err_tx_irq;
	}

	ret = request_irq(sport->rx_err_irq, sport_err_irq,
			0, "SPORT RX ERROR", sport);
	if (ret) {
		dev_err(dev, "Unable to allocate rx error IRQ for sport\n");
		goto err_rx_irq;
	}

	return 0;
err_rx_irq:
	free_irq(sport->tx_err_irq, sport);
err_tx_irq:
	free_dma(sport->rx_dma_chan);
err_rx_dma:
	free_dma(sport->tx_dma_chan);
err_tx_dma:
	peripheral_free_list(sport->pin_req);
	return ret;
}
开发者ID:020gzh,项目名称:linux,代码行数:50,代码来源:bf6xx-sport.c


示例14: spi_release_bus

void spi_release_bus(struct spi_slave *slave)
{
	struct bfin_spi_slave *bss = to_bfin_spi_slave(slave);

	debug("%s: bus:%i cs:%i\n", __func__, slave->bus, slave->cs);

	peripheral_free_list(pins[slave->bus]);
	if (is_gpio_cs(slave->cs))
		gpio_free(gpio_cs(slave->cs));

	bfin_write32(&bss->regs->rx_control, 0x0);
	bfin_write32(&bss->regs->tx_control, 0x0);
	bfin_write32(&bss->regs->control, 0x0);
	SSYNC();
}
开发者ID:CheezeCake,项目名称:edison-u-boot,代码行数:15,代码来源:bfin_spi6xx.c


示例15: bfin_mii_bus_probe

static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
{
	struct mii_bus *miibus;
	int rc, i;

	/*
	 * We are setting up a network card,
	 * so set the GPIO pins to Ethernet mode
	 */
	rc = peripheral_request_list(pin_req, DRV_NAME);
	if (rc) {
		dev_err(&pdev->dev, "Requesting peripherals failed!\n");
		return rc;
	}

	rc = -ENOMEM;
	miibus = mdiobus_alloc();
	if (miibus == NULL)
		goto out_err_alloc;
	miibus->read = bfin_mdiobus_read;
	miibus->write = bfin_mdiobus_write;
	miibus->reset = bfin_mdiobus_reset;

	miibus->parent = &pdev->dev;
	miibus->name = "bfin_mii_bus";
	snprintf(miibus->id, MII_BUS_ID_SIZE, "0");
	miibus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
	if (miibus->irq == NULL)
		goto out_err_alloc;
	for (i = 0; i < PHY_MAX_ADDR; ++i)
		miibus->irq[i] = PHY_POLL;

	rc = mdiobus_register(miibus);
	if (rc) {
		dev_err(&pdev->dev, "Cannot register MDIO bus!\n");
		goto out_err_mdiobus_register;
	}

	platform_set_drvdata(pdev, miibus);
	return 0;

out_err_mdiobus_register:
	mdiobus_free(miibus);
out_err_alloc:
	peripheral_free_list(pin_req);

	return rc;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:48,代码来源:bfin_mac.c


示例16: bf5xx_ac97_warm_reset

static void bf5xx_ac97_warm_reset(struct snd_ac97 *ac97)
{
	struct sport_device *sport_handle = ac97_sport_handle;
	u16 gpio = P_IDENT(sport_handle->pin_req[3]);

	pr_debug("%s enter\n", __func__);

	peripheral_free_list(sport_handle->pin_req);
	gpio_request(gpio, "bf5xx-ac97");
	gpio_direction_output(gpio, 1);
	udelay(2);
	gpio_set_value(gpio, 0);
	udelay(1);
	gpio_free(gpio);
	peripheral_request_list(sport_handle->pin_req, "soc-audio");
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:16,代码来源:bf5xx-ac97.c


示例17: bfin_rotary_remove

static int __devexit bfin_rotary_remove(struct platform_device *pdev)
{
	struct bfin_rot *rotary = platform_get_drvdata(pdev);

	bfin_write_CNT_CONFIG(0);
	bfin_write_CNT_IMASK(0);

	free_irq(rotary->irq, pdev);
	input_unregister_device(rotary->input);
	peripheral_free_list(per_cnt);

	kfree(rotary);
	platform_set_drvdata(pdev, NULL);

	return 0;
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:16,代码来源:bfin_rotary.c


示例18: request_ports

static int request_ports(void)
{
	u16 tmr_req[] = TIMERS;

	/*
		UD:      PF13
		MOD:     PF10
		LBR:     PF14
		PPI_CLK: PF15
	*/

	if (peripheral_request_list(ppi_pins, KBUILD_MODNAME)) {
		pr_err("requesting PPI peripheral failed\n");
		return -EBUSY;
	}

	if (peripheral_request_list(tmr_req, KBUILD_MODNAME)) {
		peripheral_free_list(ppi_pins);
		pr_err("requesting timer peripheral failed\n");
		return -EBUSY;
	}

#if (defined(UD) && defined(LBR))
	if (gpio_request_one(UD, GPIOF_OUT_INIT_LOW, KBUILD_MODNAME)) {
		pr_err("requesting GPIO %d failed\n", UD);
		return -EBUSY;
	}

	if (gpio_request_one(LBR, GPIOF_OUT_INIT_HIGH, KBUILD_MODNAME)) {
		pr_err("requesting GPIO %d failed\n", LBR);
		gpio_free(UD);
		return -EBUSY;
	}
#endif

	if (gpio_request_one(MOD, GPIOF_OUT_INIT_HIGH, KBUILD_MODNAME)) {
		pr_err("requesting GPIO %d failed\n", MOD);
#if (defined(UD) && defined(LBR))
		gpio_free(LBR);
		gpio_free(UD);
#endif
		return -EBUSY;
	}

	SSYNC();
	return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:47,代码来源:bf537-lq035.c


示例19: bfin_mac_remove

static int __devexit bfin_mac_remove(struct platform_device *pdev)
{
	struct net_device *ndev = platform_get_drvdata(pdev);
	struct bfin_mac_local *lp = netdev_priv(ndev);

	platform_set_drvdata(pdev, NULL);

	lp->mii_bus->priv = NULL;

	unregister_netdev(ndev);

	free_irq(IRQ_MAC_RX, ndev);

	free_netdev(ndev);

	peripheral_free_list(pin_req);

	return 0;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:19,代码来源:bfin_mac.c


示例20: bfin_mac_probe

static int __devinit bfin_mac_probe(struct platform_device *pdev)
{
	struct net_device *ndev;
	struct bfin_mac_local *lp;
	struct platform_device *pd;
	int rc;

	ndev = alloc_etherdev(sizeof(struct bfin_mac_local));
	if (!ndev) {
		dev_err(&pdev->dev, "Cannot allocate net device!\n");
		return -ENOMEM;
	}

	SET_NETDEV_DEV(ndev, &pdev->dev);
	platform_set_drvdata(pdev, ndev);
	lp = netdev_priv(ndev);

	/* Grab the MAC address in the MAC */
	*(__le32 *) (&(ndev->dev_addr[0])) = cpu_to_le32(bfin_read_EMAC_ADDRLO());
	*(__le16 *) (&(ndev->dev_addr[4])) = cpu_to_le16((u16) bfin_read_EMAC_ADDRHI());

	/* probe mac */
	/*todo: how to proble? which is revision_register */
	bfin_write_EMAC_ADDRLO(0x12345678);
	if (bfin_read_EMAC_ADDRLO() != 0x12345678) {
		dev_err(&pdev->dev, "Cannot detect Blackfin on-chip ethernet MAC controller!\n");
		rc = -ENODEV;
		goto out_err_probe_mac;
	}


	/*
	 * Is it valid? (Did bootloader initialize it?)
	 * Grab the MAC from the board somehow
	 * this is done in the arch/blackfin/mach-bfxxx/boards/eth_mac.c
	 */
	if (!is_valid_ether_addr(ndev->dev_addr))
		bfin_get_ether_addr(ndev->dev_addr);

	/* If still not valid, get a random one */
	if (!is_valid_ether_addr(ndev->dev_addr))
		random_ether_addr(ndev->dev_addr);

	setup_mac_addr(ndev->dev_addr);

	if (!pdev->dev.platform_data) {
		dev_err(&pdev->dev, "Cannot get platform device bfin_mii_bus!\n");
		rc = -ENODEV;
		goto out_err_probe_mac;
	}
	pd = pdev->dev.platform_data;
	lp->mii_bus = platform_get_drvdata(pd);
	lp->mii_bus->priv = ndev;

	rc = mii_probe(ndev);
	if (rc) {
		dev_err(&pdev->dev, "MII Probe failed!\n");
		goto out_err_mii_probe;
	}

	/* Fill in the fields of the device structure with ethernet values. */
	ether_setup(ndev);

	ndev->netdev_ops = &bfin_mac_netdev_ops;
	ndev->ethtool_ops = &bfin_mac_ethtool_ops;

	spin_lock_init(&lp->lock);

	/* now, enable interrupts */
	/* register irq handler */
	rc = request_irq(IRQ_MAC_RX, bfin_mac_interrupt,
			IRQF_DISABLED, "EMAC_RX", ndev);
	if (rc) {
		dev_err(&pdev->dev, "Cannot request Blackfin MAC RX IRQ!\n");
		rc = -EBUSY;
		goto out_err_request_irq;
	}

	rc = register_netdev(ndev);
	if (rc) {
		dev_err(&pdev->dev, "Cannot register net device!\n");
		goto out_err_reg_ndev;
	}

	/* now, print out the card info, in a short format.. */
	dev_info(&pdev->dev, "%s, Version %s\n", DRV_DESC, DRV_VERSION);

	return 0;

out_err_reg_ndev:
	free_irq(IRQ_MAC_RX, ndev);
out_err_request_irq:
out_err_mii_probe:
	mdiobus_unregister(lp->mii_bus);
	mdiobus_free(lp->mii_bus);
	peripheral_free_list(pin_req);
out_err_probe_mac:
	platform_set_drvdata(pdev, NULL);
	free_netdev(ndev);

//.........这里部分代码省略.........
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:101,代码来源:bfin_mac.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ perl_alloc函数代码示例发布时间:2022-05-30
下一篇:
C++ period函数代码示例发布时间: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