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

C++ pm_runtime_get函数代码示例

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

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



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

示例1: gma_power_begin

/**
 *	gma_power_begin		-	begin requiring power
 *	@dev: our DRM device
 *	@force_on: true to force power on
 *
 *	Begin an action that requires the display power island is enabled.
 *	We refcount the islands.
 */
bool gma_power_begin(struct drm_device *dev, bool force_on)
{
	struct drm_psb_private *dev_priv = dev->dev_private;
	int ret;
	unsigned long flags;

	spin_lock_irqsave(&power_ctrl_lock, flags);
	/* Power already on ? */
	if (dev_priv->display_power) {
		dev_priv->display_count++;
		pm_runtime_get(&dev->pdev->dev);
		spin_unlock_irqrestore(&power_ctrl_lock, flags);
		return true;
	}
	if (force_on == false)
		goto out_false;

	/* Ok power up needed */
	ret = gma_resume_pci(dev->pdev);
	if (ret == 0) {
		psb_irq_preinstall(dev);
		psb_irq_postinstall(dev);
		pm_runtime_get(&dev->pdev->dev);
		dev_priv->display_count++;
		spin_unlock_irqrestore(&power_ctrl_lock, flags);
		return true;
	}
out_false:
	spin_unlock_irqrestore(&power_ctrl_lock, flags);
	return false;
}
开发者ID:020gzh,项目名称:linux,代码行数:39,代码来源:power.c


示例2: cyttsp4_mt_open

static int cyttsp4_mt_open(struct input_dev *input)
{
	struct device *dev = input->dev.parent;
	struct cyttsp4_device *ttsp =
		container_of(dev, struct cyttsp4_device, dev);

	dev_dbg(dev, "%s\n", __func__);

	pm_runtime_get(dev);

	dev_vdbg(dev, "%s: setup subscriptions\n", __func__);

	/* set up touch call back */
	cyttsp4_subscribe_attention(ttsp, CY_ATTEN_IRQ,
		cyttsp4_mt_attention, CY_MODE_OPERATIONAL);

	/* set up startup call back */
	cyttsp4_subscribe_attention(ttsp, CY_ATTEN_STARTUP,
		cyttsp4_startup_attention, 0);

	/* set up wakeup call back */
	cyttsp4_subscribe_attention(ttsp, CY_ATTEN_WAKE,
		cyttsp4_mt_wake_attention, 0);

	return 0;
}
开发者ID:Brooklyn2001,项目名称:android_kernel_ZTE_NX505J,代码行数:26,代码来源:cyttsp4_mt_common.c


示例3: vpif_probe

static int vpif_probe(struct platform_device *pdev)
{
	int status = 0;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res)
		return -ENOENT;

	res_len = resource_size(res);

	res = request_mem_region(res->start, res_len, res->name);
	if (!res)
		return -EBUSY;

	vpif_base = ioremap(res->start, res_len);
	if (!vpif_base) {
		status = -EBUSY;
		goto fail;
	}

	pm_runtime_enable(&pdev->dev);
	pm_runtime_get(&pdev->dev);

	spin_lock_init(&vpif_lock);
	dev_info(&pdev->dev, "vpif probe success\n");
	return 0;

fail:
	release_mem_region(res->start, res_len);
	return status;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:31,代码来源:vpif.c


示例4: intel_mid_gps_hostwake_isr

static irqreturn_t intel_mid_gps_hostwake_isr(int irq, void *dev)
{
	struct intel_mid_gps_platform_data *pdata = dev_get_drvdata(dev);
	int hostwake;

	hostwake = gpio_get_value(pdata->gpio_hostwake);

	tty_dev = intel_mid_hsu_set_wake_peer(pdata->hsu_port, NULL);
	if (!tty_dev) {
		pr_err("%s: unable to get the HSU tty device \n", __func__);
	}

	irq_set_irq_type(irq, hostwake ? IRQF_TRIGGER_FALLING :
			 IRQF_TRIGGER_RISING);

	if (hostwake) {
		wake_lock(&hostwake_lock);
		if (tty_dev)
			pm_runtime_get(tty_dev);
	}
	else {
		if (tty_dev)
			pm_runtime_put(tty_dev);
		wake_unlock(&hostwake_lock);
	}

	return IRQ_HANDLED;
}
开发者ID:matheusgcdj,项目名称:android_kernel_asus_T00F,代码行数:28,代码来源:intel_mid_gps.c


示例5: byt_gpio_request

static int byt_gpio_request(struct gpio_chip *chip, unsigned offset)
{
	struct byt_gpio *vg = to_byt_gpio(chip);
	void __iomem *reg = byt_gpio_reg(chip, offset, BYT_CONF0_REG);
	u32 value;
	bool special;

	/*
	 * In most cases, func pin mux 000 means GPIO function.
	 * But, some pins may have func pin mux 001 represents
	 * GPIO function. Only allow user to export pin with
	 * func pin mux preset as GPIO function by BIOS/FW.
	 */
	value = readl(reg) & BYT_PIN_MUX;
	special = is_special_pin(vg, offset);
	if ((special && value != 1) || (!special && value)) {
		dev_err(&vg->pdev->dev,
			"pin %u cannot be used as GPIO.\n", offset);
		return -EINVAL;
	}

	pm_runtime_get(&vg->pdev->dev);

	return 0;
}
开发者ID:AkyZero,项目名称:wrapfs-latest,代码行数:25,代码来源:pinctrl-baytrail.c


示例6: res_trk_vidc_pwr_up

static u32 res_trk_vidc_pwr_up(void)
{
	mutex_lock(&resource_context.lock);

	if (pm_runtime_get(resource_context.device) < 0) {
		VCDRES_MSG_ERROR("Error : pm_runtime_get failed\n");
		goto bail_out;
	}
	if (!resource_context.footswitch)
		resource_context.footswitch =
			regulator_get(resource_context.device, "vdd");
	if (IS_ERR(resource_context.footswitch)) {
		VCDRES_MSG_ERROR("foot switch get failed\n");
		resource_context.footswitch = NULL;
	} else
		regulator_enable(resource_context.footswitch);
	if (!res_trk_get_clk())
		goto rel_vidc_pm_runtime;
	mutex_unlock(&resource_context.lock);
	return true;

rel_vidc_pm_runtime:
	if (pm_runtime_put(resource_context.device) < 0)
		VCDRES_MSG_ERROR("Error : pm_runtime_put failed");
bail_out:
	mutex_unlock(&resource_context.lock);
	return false;
}
开发者ID:a937287837,项目名称:android_kernel_htc_m7wlj,代码行数:28,代码来源:vcd_res_tracker.c


示例7: tdisc_interrupt

static irqreturn_t tdisc_interrupt(int irq, void *dev_id)
{
	/*
	 * The touch disc intially generates an interrupt on any
	 * touch. The interrupt line is pulled low and remains low
	 * untill there are touch operations being performed. In case
	 * there are no further touch operations, the line goes high. The
	 * same process repeats again the next time,when the disc is touched.
	 *
	 * We do the following operations once we receive an interrupt.
	 * 1. Disable the IRQ for any further interrutps.
	 * 2. Schedule work every 25ms if the GPIO is still low.
	 * 3. In the work queue do a I2C read to get the touch data.
	 * 4. If the GPIO is pulled high, enable the IRQ and cancel the work.
	 */
	struct tdisc_data *dd = dev_id;
	int rc;

	rc = pm_runtime_get(&dd->clientp->dev);
	if (rc < 0)
		dev_dbg(&dd->clientp->dev, "%s: pm_runtime_get"
			" failed\n", __func__);
	pr_debug("%s: TDISC IRQ ! :-)\n", __func__);

	/* Schedule the work immediately */
	disable_irq_nosync(dd->clientp->irq);
	schedule_delayed_work(&dd->tdisc_work, 0);
	return IRQ_HANDLED;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:29,代码来源:tdisc_vtd518_shinetsu.c


示例8: request_autopm_lock

void request_autopm_lock(int status)
{
	struct diag_bridge	*dev = __dev;

	if (!dev || !dev->udev)
		return;

	pr_info("%s: set runtime pm lock : %d\n", __func__, status);

	if (status) {
		if (!atomic_read(&dev->pmlock_cnt)) {
			atomic_inc(&dev->pmlock_cnt);
			pr_info("get lock\n");
			pm_runtime_get(&dev->udev->dev);
			pm_runtime_forbid(&dev->udev->dev);
		} else
			atomic_inc(&dev->pmlock_cnt);
	} else {
		if (!atomic_read(&dev->pmlock_cnt))
			pr_info("unbalanced release\n");
		else if (atomic_dec_and_test(&dev->pmlock_cnt)) {
			pr_info("release lock\n");
			pm_runtime_allow(&dev->udev->dev);
			pm_runtime_put(&dev->udev->dev);
		}

	}
}
开发者ID:QweJay,项目名称:GT-I9505,代码行数:28,代码来源:diag_bridge.c


示例9: arizona_start_mic

static void arizona_start_mic(struct arizona_extcon_info *info)
{
	struct arizona *arizona = info->arizona;
	bool change;
	int ret;

	info->detecting = true;
	info->mic = false;
	info->jack_flips = 0;

	/* Microphone detection can't use idle mode */
	pm_runtime_get(info->dev);

	ret = regulator_enable(info->micvdd);
	if (ret != 0) {
		dev_err(arizona->dev, "Failed to enable MICVDD: %d\n",
			ret);
	}

	if (info->micd_reva) {
		regmap_write(arizona->regmap, 0x80, 0x3);
		regmap_write(arizona->regmap, 0x294, 0);
		regmap_write(arizona->regmap, 0x80, 0x0);
	}

	regmap_update_bits_check(arizona->regmap, ARIZONA_MIC_DETECT_1,
				 ARIZONA_MICD_ENA, ARIZONA_MICD_ENA,
				 &change);
	if (!change) {
		regulator_disable(info->micvdd);
		pm_runtime_put_autosuspend(info->dev);
	}
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:33,代码来源:extcon-arizona.c


示例10: debug_write_phy_data

static ssize_t debug_write_phy_data(struct file *file, const char __user *buf,
				 size_t count, loff_t *ppos)
{
	struct msm_hcd *mhcd = file->private_data;
	char kbuf[10];
	u32 data = 0;

	memset(kbuf, 0, 10);

	if (copy_from_user(kbuf, buf, min_t(size_t, sizeof(kbuf) - 1, count)))
		return -EFAULT;

	if (sscanf(kbuf, "%x", &data) != 1)
		return -EINVAL;

	pm_runtime_get(mhcd->dev);
	if (msm_ulpi_write(mhcd, data, addr) < 0) {
		dev_err(mhcd->dev,
				"%s(): ulpi write timeout\n", __func__);
		return -ETIMEDOUT;
	}
	pm_runtime_put(mhcd->dev);

	return count;
}
开发者ID:Runner85sx,项目名称:android_kernel_huawei_msm8909,代码行数:25,代码来源:ehci-msm2.c


示例11: msm_async_irq

static irqreturn_t msm_async_irq(int irq, void *data)
{
	struct msm_hcd *mhcd = data;
	int ret;

	mhcd->async_int_cnt++;
	dev_dbg(mhcd->dev, "%s: hsusb host remote wakeup interrupt cnt: %u\n",
			__func__, mhcd->async_int_cnt);

	pm_stay_awake(mhcd->dev);

	spin_lock(&mhcd->wakeup_lock);
	if (mhcd->async_irq_enabled) {
		mhcd->async_irq_enabled = 0;
		disable_irq_wake(irq);
		disable_irq_nosync(irq);
	}
	spin_unlock(&mhcd->wakeup_lock);

	if (!atomic_read(&mhcd->pm_usage_cnt)) {
		ret = pm_runtime_get(mhcd->dev);
		if ((ret == 1) || (ret == -EINPROGRESS))
			pm_runtime_put_noidle(mhcd->dev);
		else
			atomic_set(&mhcd->pm_usage_cnt, 1);
	}

	return IRQ_HANDLED;
}
开发者ID:Runner85sx,项目名称:android_kernel_huawei_msm8909,代码行数:29,代码来源:ehci-msm2.c


示例12: lnw_irq_type

static int lnw_irq_type(struct irq_data *d, unsigned type)
{
	struct lnw_gpio *lnw = irq_data_get_irq_chip_data(d);
	u32 gpio = irqd_to_hwirq(d);
	unsigned long flags;
	u32 value;
	void __iomem *grer = gpio_reg(&lnw->chip, gpio, GRER);
	void __iomem *gfer = gpio_reg(&lnw->chip, gpio, GFER);

	if (gpio >= lnw->chip.ngpio)
		return -EINVAL;

	if (lnw->pdev)
		pm_runtime_get(&lnw->pdev->dev);

	spin_lock_irqsave(&lnw->lock, flags);
	if (type & IRQ_TYPE_EDGE_RISING)
		value = readl(grer) | BIT(gpio % 32);
	else
		value = readl(grer) & (~BIT(gpio % 32));
	writel(value, grer);

	if (type & IRQ_TYPE_EDGE_FALLING)
		value = readl(gfer) | BIT(gpio % 32);
	else
		value = readl(gfer) & (~BIT(gpio % 32));
	writel(value, gfer);
	spin_unlock_irqrestore(&lnw->lock, flags);

	if (lnw->pdev)
		pm_runtime_put(&lnw->pdev->dev);

	return 0;
}
开发者ID:1ee7,项目名称:linux_l4t_tx1,代码行数:34,代码来源:gpio-langwell.c


示例13: debug_read_phy_data

static ssize_t debug_read_phy_data(struct file *file, char __user *ubuf,
				 size_t count, loff_t *ppos)
{
	struct msm_hcd *mhcd = file->private_data;
	char *kbuf;
	size_t c = 0;
	u32 data = 0;
	int ret = 0;

	kbuf = kzalloc(sizeof(char) * BUF_SIZE, GFP_KERNEL);
	if (!kbuf)
		return -ENOMEM;
	pm_runtime_get(mhcd->dev);
	data = msm_ulpi_read(mhcd, addr);
	pm_runtime_put(mhcd->dev);
	if (data < 0) {
		dev_err(mhcd->dev,
				"%s(): ulpi read timeout\n", __func__);
		return -ETIMEDOUT;
	}

	c = scnprintf(kbuf, BUF_SIZE, "addr: 0x%x: data: 0x%x\n", addr, data);

	ret = simple_read_from_buffer(ubuf, count, ppos, kbuf, c);

	kfree(kbuf);

	return ret;
}
开发者ID:Runner85sx,项目名称:android_kernel_huawei_msm8909,代码行数:29,代码来源:ehci-msm2.c


示例14: msm_hsic_wakeup_irq

static irqreturn_t msm_hsic_wakeup_irq(int irq, void *data)
{
	struct msm_hsic_hcd *mehci = data;
	int ret;

	mehci->wakeup_int_cnt++;
	dbg_log_event(NULL, "Remote Wakeup IRQ", mehci->wakeup_int_cnt);
	dev_dbg(mehci->dev, "%s: hsic remote wakeup interrupt cnt: %u\n",
			__func__, mehci->wakeup_int_cnt);

	wake_lock(&mehci->wlock);

	if (mehci->wakeup_irq_enabled) {
		mehci->wakeup_irq_enabled = 0;
		disable_irq_wake(irq);
		disable_irq_nosync(irq);
	}

	if (!atomic_read(&mehci->pm_usage_cnt)) {
		ret = pm_runtime_get(mehci->dev);
		/*
		 * HSIC runtime resume can race with us.
		 * if we are active (ret == 1) or resuming
		 * (ret == -EINPROGRESS), decrement the
		 * PM usage counter before returning.
		 */
		if ((ret == 1) || (ret == -EINPROGRESS))
			pm_runtime_put_noidle(mehci->dev);
		else
			atomic_set(&mehci->pm_usage_cnt, 1);
	}

	return IRQ_HANDLED;
}
开发者ID:x942,项目名称:GuardianKernel-Mako,代码行数:34,代码来源:ehci-msm-hsic.c


示例15: msm_ehci_host_wakeup_irq

static irqreturn_t msm_ehci_host_wakeup_irq(int irq, void *data)
{

	struct msm_hcd *mhcd = data;

	mhcd->pmic_gpio_int_cnt++;
	dev_dbg(mhcd->dev, "%s: hsusb host remote wakeup interrupt cnt: %u\n",
			__func__, mhcd->pmic_gpio_int_cnt);


	wake_lock(&mhcd->wlock);

	if (mhcd->pmic_gpio_dp_irq_enabled) {
		mhcd->pmic_gpio_dp_irq_enabled = 0;
		disable_irq_wake(irq);
		disable_irq_nosync(irq);
	}

	if (!atomic_read(&mhcd->pm_usage_cnt)) {
		atomic_set(&mhcd->pm_usage_cnt, 1);
		pm_runtime_get(mhcd->dev);
	}

	return IRQ_HANDLED;
}
开发者ID:joutcast,项目名称:ASUS_A80_source,代码行数:25,代码来源:ehci-msm2.c


示例16: dwc3_pci_remove

static void dwc3_pci_remove(struct pci_dev *pci)
{
	struct dwc3_pci		*dwc = pci_get_drvdata(pci);

	device_init_wakeup(&pci->dev, false);
	pm_runtime_get(&pci->dev);
	platform_device_unregister(dwc->dwc3);
}
开发者ID:mkrufky,项目名称:linux,代码行数:8,代码来源:dwc3-pci.c


示例17: byt_gpio_request

static int byt_gpio_request(struct gpio_chip *chip, unsigned offset)
{
	struct byt_gpio *vg = to_byt_gpio(chip);

	pm_runtime_get(&vg->pdev->dev);

	return 0;
}
开发者ID:ExtremeGTX,项目名称:Devkit8500_Linux_BSP,代码行数:8,代码来源:pinctrl-baytrail.c


示例18: dwc3_pci_remove

static void dwc3_pci_remove(struct pci_dev *pci)
{
	struct dwc3_pci		*dwc = pci_get_drvdata(pci);

	device_init_wakeup(&pci->dev, false);
	pm_runtime_get(&pci->dev);
	acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pci->dev));
	platform_device_unregister(dwc->dwc3);
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:9,代码来源:dwc3-pci.c


示例19: store_pm_get

static ssize_t store_pm_get(struct device *_dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
	struct platform_device		*pdev = to_platform_device(_dev);
	struct usb_hcd		*hcd = platform_get_drvdata(pdev);

	pm_runtime_get(hcd->self.controller);
	return count;

}
开发者ID:wejgomi,项目名称:nexus-player,代码行数:10,代码来源:dwc3-host-intel.c


示例20: dwc3_pci_remove

static void dwc3_pci_remove(struct pci_dev *pci)
{
	struct dwc3_pci		*dwc = pci_get_drvdata(pci);

#ifdef CONFIG_PM
	cancel_work_sync(&dwc->wakeup_work);
#endif
	device_init_wakeup(&pci->dev, false);
	pm_runtime_get(&pci->dev);
	platform_device_unregister(dwc->dwc3);
}
开发者ID:krzk,项目名称:linux,代码行数:11,代码来源:dwc3-pci.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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