本文整理汇总了C++中pm_runtime_forbid函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_runtime_forbid函数的具体用法?C++ pm_runtime_forbid怎么用?C++ pm_runtime_forbid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_runtime_forbid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: store_ehci_power
static ssize_t store_ehci_power(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 = dev_get_drvdata(dev);
struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
int power_on;
int irq;
int retval;
if (sscanf(buf, "%d", &power_on) != 1)
return -EINVAL;
device_lock(dev);
if (!power_on && s5p_ehci->power_on) {
dev_info(dev, "EHCI turn off\n");
pm_runtime_forbid(dev);
s5p_ehci->power_on = 0;
usb_remove_hcd(hcd);
if (s5p_ehci->phy) {
/* Shutdown PHY only if it wasn't shutdown before */
if (!s5p_ehci->post_lpa_resume)
usb_phy_shutdown(s5p_ehci->phy);
} else if (s5p_ehci->pdata->phy_exit) {
s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
}
} else if (power_on) {
dev_info(dev, "EHCI turn on\n");
if (s5p_ehci->power_on) {
pm_runtime_forbid(dev);
usb_remove_hcd(hcd);
} else {
s5p_ehci_phy_init(pdev);
}
irq = platform_get_irq(pdev, 0);
retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (retval < 0) {
dev_err(dev, "Power On Fail\n");
goto exit;
}
/*
* EHCI root hubs are expected to handle remote wakeup.
* So, wakeup flag init defaults for root hubs.
*/
device_wakeup_enable(&hcd->self.root_hub->dev);
s5p_ehci->power_on = 1;
pm_runtime_allow(dev);
}
exit:
device_unlock(dev);
return count;
}
示例2: store_ohci_power
static ssize_t store_ohci_power(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data;
struct exynos_ohci_hcd *exynos_ohci = platform_get_drvdata(pdev);
struct usb_hcd *hcd = exynos_ohci->hcd;
int power_on;
int irq;
int retval;
if (sscanf(buf, "%d", &power_on) != 1)
return -EINVAL;
device_lock(dev);
if (!power_on && exynos_ohci->power_on) {
printk(KERN_DEBUG "%s: EHCI turns off\n", __func__);
pm_runtime_forbid(dev);
exynos_ohci->power_on = 0;
usb_remove_hcd(hcd);
if (pdata && pdata->phy_exit)
pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
} else if (power_on) {
printk(KERN_DEBUG "%s: EHCI turns on\n", __func__);
if (exynos_ohci->power_on) {
pm_runtime_forbid(dev);
usb_remove_hcd(hcd);
} else {
if (pdata && pdata->phy_init)
pdata->phy_init(pdev, S5P_USB_PHY_HOST);
}
irq = platform_get_irq(pdev, 0);
retval = usb_add_hcd(hcd, irq,
IRQF_DISABLED | IRQF_SHARED);
if (retval < 0) {
dev_err(dev, "Power On Fail\n");
goto exit;
}
/*
* OHCI root hubs are expected to handle remote wakeup.
* So, wakeup flag init defaults for root hubs.
*/
device_wakeup_enable(&hcd->self.root_hub->dev);
exynos_ohci->power_on = 1;
pm_runtime_allow(dev);
}
exit:
device_unlock(dev);
return count;
}
示例3: xhci_ush_pci_remove
static void xhci_ush_pci_remove(struct pci_dev *dev)
{
struct xhci_hcd *xhci;
xhci = hcd_to_xhci(pci_get_drvdata(dev));
if (xhci->shared_hcd) {
usb_remove_hcd(xhci->shared_hcd);
usb_put_hcd(xhci->shared_hcd);
}
if (!pci_dev_run_wake(dev))
pm_runtime_get_noresume(&dev->dev);
pm_runtime_forbid(&dev->dev);
usb_hcd_pci_remove(dev);
/* Free the aux irq */
hsic_aux_irq_free();
hsic_wakeup_irq_free();
gpio_free(hsic.aux_gpio);
gpio_free(hsic.wakeup_gpio);
hsic.hsic_stopped = 1;
hsic_enable = 0;
kfree(xhci);
}
示例4: s5p_ehci_remove
static int __devexit s5p_ehci_remove(struct platform_device *pdev)
{
struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
struct s5p_ehci_hcd *s5p_ehci = platform_get_drvdata(pdev);
struct usb_hcd *hcd = s5p_ehci->hcd;
#ifdef CONFIG_USB_SUSPEND
#ifdef CONFIG_MDM_HSIC_PM
pm_runtime_forbid(&pdev->dev);
#else
pm_runtime_put(hcd->self.controller);
pm_runtime_disable(&pdev->dev);
#endif
#endif
s5p_ehci->power_on = 0;
remove_ehci_sys_file(hcd_to_ehci(hcd));
usb_remove_hcd(hcd);
if (pdata && pdata->phy_exit)
pdata->phy_exit(pdev, S5P_USB_PHY_HOST);
iounmap(hcd->regs);
clk_disable(s5p_ehci->clk);
clk_put(s5p_ehci->clk);
usb_put_hcd(hcd);
kfree(s5p_ehci);
return 0;
}
示例5: amdgpu_driver_unload_kms
/**
* amdgpu_driver_unload_kms - Main unload function for KMS.
*
* @dev: drm dev pointer
*
* This is the main unload function for KMS (all asics).
* Returns 0 on success.
*/
void amdgpu_driver_unload_kms(struct drm_device *dev)
{
struct amdgpu_device *adev = dev->dev_private;
if (adev == NULL)
return;
if (adev->rmmio == NULL)
goto done_free;
if (amdgpu_sriov_vf(adev))
amdgpu_virt_request_full_gpu(adev, false);
if (amdgpu_device_is_px(dev)) {
pm_runtime_get_sync(dev->dev);
pm_runtime_forbid(dev->dev);
}
amdgpu_amdkfd_device_fini(adev);
amdgpu_acpi_fini(adev);
amdgpu_device_fini(adev);
done_free:
kfree(adev);
dev->dev_private = NULL;
}
示例6: intel_sst_remove
/**
* intel_sst_remove - PCI remove function
*
* @pci: PCI device structure
*
* This function is called by OS when a device is unloaded
* This frees the interrupt etc
*/
static void __devexit intel_sst_remove(struct pci_dev *pci)
{
pm_runtime_get_noresume(&pci->dev);
pm_runtime_forbid(&pci->dev);
pci_dev_put(sst_drv_ctx->pci);
mutex_lock(&sst_drv_ctx->sst_lock);
sst_drv_ctx->sst_state = SST_UN_INIT;
mutex_unlock(&sst_drv_ctx->sst_lock);
misc_deregister(&lpe_ctrl);
free_irq(pci->irq, sst_drv_ctx);
iounmap(sst_drv_ctx->dram);
iounmap(sst_drv_ctx->iram);
iounmap(sst_drv_ctx->mailbox);
iounmap(sst_drv_ctx->shim);
sst_drv_ctx->pmic_state = SND_MAD_UN_INIT;
if (sst_drv_ctx->pci_id == SST_MRST_PCI_ID) {
misc_deregister(&lpe_dev);
kfree(sst_drv_ctx->mmap_mem);
} else
kfree(sst_drv_ctx->fw_cntx);
flush_scheduled_work();
destroy_workqueue(sst_drv_ctx->process_reply_wq);
destroy_workqueue(sst_drv_ctx->process_msg_wq);
destroy_workqueue(sst_drv_ctx->post_msg_wq);
destroy_workqueue(sst_drv_ctx->mad_wq);
kfree(pci_get_drvdata(pci));
sst_drv_ctx = NULL;
pci_release_regions(pci);
pci_disable_device(pci);
pci_set_drvdata(pci, NULL);
}
示例7: edac_create_dimm_object
/* Create a DIMM object under specifed memory controller device */
static int edac_create_dimm_object(struct mem_ctl_info *mci,
struct dimm_info *dimm,
int index)
{
int err;
dimm->mci = mci;
dimm->dev.type = &dimm_attr_type;
dimm->dev.bus = mci->bus;
device_initialize(&dimm->dev);
dimm->dev.parent = &mci->dev;
if (mci->csbased)
dev_set_name(&dimm->dev, "rank%d", index);
else
dev_set_name(&dimm->dev, "dimm%d", index);
dev_set_drvdata(&dimm->dev, dimm);
pm_runtime_forbid(&mci->dev);
err = device_add(&dimm->dev);
edac_dbg(0, "creating rank/dimm device %s\n", dev_name(&dimm->dev));
return err;
}
示例8: dwc_otg_remove
static void dwc_otg_remove(struct pci_dev *pdev)
{
struct dwc_otg2 *otg = the_transceiver;
int resource, len;
if (otg->gadget)
platform_device_unregister(otg->gadget);
if (otg->host)
platform_device_unregister(otg->host);
wake_lock_destroy(&wakelock);
pm_runtime_forbid(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
kfree(platform_par);
iounmap(otg->usb2_phy.io_priv);
usb_remove_phy(&otg->usb2_phy);
usb_remove_phy(&otg->usb3_phy);
kfree(otg);
otg = NULL;
resource = pci_resource_start(pdev, 0);
len = pci_resource_len(pdev, 0);
release_mem_region(resource, len);
pci_disable_device(pdev);
the_transceiver = NULL;
}
示例9: serial_omap_pm
static void
serial_omap_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate)
{
struct uart_omap_port *up = (struct uart_omap_port *)port;
unsigned char efr;
dev_dbg(up->port.dev, "serial_omap_pm+%d\n", up->port.line);
pm_runtime_get_sync(&up->pdev->dev);
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
efr = serial_in(up, UART_EFR);
serial_out(up, UART_EFR, efr | UART_EFR_ECB);
serial_out(up, UART_LCR, 0);
serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0);
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
serial_out(up, UART_EFR, efr);
serial_out(up, UART_LCR, 0);
if (!device_may_wakeup(&up->pdev->dev)) {
if (!state)
pm_runtime_forbid(&up->pdev->dev);
else
pm_runtime_allow(&up->pdev->dev);
}
pm_runtime_put(&up->pdev->dev);
}
示例10: intel_lpss_pci_remove
static void intel_lpss_pci_remove(struct pci_dev *pdev)
{
pm_runtime_forbid(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
intel_lpss_remove(&pdev->dev);
}
示例11: store_autosuspend
static ssize_t store_autosuspend(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct miscdevice *miscdev = dev_get_drvdata(dev);
struct link_pm_data *pm_data = container_of(miscdev,
struct link_pm_data, miscdev);
struct usb_link_device *usb_ld = pm_data->usb_ld;
struct task_struct *task = get_current();
char taskname[TASK_COMM_LEN];
mif_info("autosuspend: %s: %s(%d)'\n",
buf, get_task_comm(taskname, task), task->pid);
if (!strncmp(buf, "on", 2)) {
pm_data->autosuspend = true;
if (usb_ld->usbdev)
pm_runtime_allow(&usb_ld->usbdev->dev);
} else if (!strncmp(buf, "off", 3)) {
pm_data->autosuspend = false;
if (usb_ld->usbdev)
pm_runtime_forbid(&usb_ld->usbdev->dev);
}
return count;
}
示例12: wil_pm_runtime_forbid
void wil_pm_runtime_forbid(struct wil6210_priv *wil)
{
struct device *dev = wil_to_dev(wil);
pm_runtime_forbid(dev);
pm_runtime_get_noresume(dev);
}
示例13: amdgpu_driver_unload_kms
/**
* amdgpu_driver_unload_kms - Main unload function for KMS.
*
* @dev: drm dev pointer
*
* This is the main unload function for KMS (all asics).
* Returns 0 on success.
*/
int amdgpu_driver_unload_kms(struct drm_device *dev)
{
struct amdgpu_device *adev = dev->dev_private;
if (adev == NULL)
return 0;
if (adev->rmmio == NULL)
goto done_free;
if (amdgpu_device_is_px(dev)) {
pm_runtime_get_sync(dev->dev);
pm_runtime_forbid(dev->dev);
}
amdgpu_amdkfd_device_fini(adev);
amdgpu_acpi_fini(adev);
amdgpu_device_fini(adev);
done_free:
kfree(adev);
dev->dev_private = NULL;
return 0;
}
示例14: xhci_ush_pci_remove
static void xhci_ush_pci_remove(struct pci_dev *dev)
{
struct xhci_hcd *xhci;
xhci = hcd_to_xhci(pci_get_drvdata(dev));
if (xhci->shared_hcd) {
usb_remove_hcd(xhci->shared_hcd);
usb_put_hcd(xhci->shared_hcd);
}
if (!pci_dev_run_wake(dev))
pm_runtime_get_noresume(&dev->dev);
pm_runtime_forbid(&dev->dev);
usb_hcd_pci_remove(dev);
/* Free the aux irq */
hsic_aux_irq_free();
hsic_wakeup_irq_free();
gpio_free(hsic.aux_gpio);
gpio_free(hsic.wakeup_gpio);
hsic.port_disconnect = 1;
hsic_enable = 0;
wake_lock_destroy(&(hsic.resume_wake_lock));
wake_lock_destroy(&hsic.s3_wake_lock);
usb_unregister_notify(&hsic.hsic_pm_nb);
unregister_pm_notifier(&hsic.hsic_s3_entry_nb);
kfree(xhci);
}
示例15: if_usb_disconnect
static void if_usb_disconnect(struct usb_interface *intf)
{
struct usb_link_device *usb_ld = usb_get_intfdata(intf);
struct usb_device *usbdev = usb_ld->usbdev;
struct link_pm_data *pm_data = usb_ld->link_pm_data;
int dev_id = intf->altsetting->desc.bInterfaceNumber;
struct if_usb_devdata *pipe_data = &usb_ld->devdata[dev_id];
usb_set_intfdata(intf, NULL);
pipe_data->disconnected = 1;
smp_wmb();
wake_up(&usb_ld->l2_wait);
usb_ld->if_usb_connected = 0;
usb_ld->flow_suspend = 1;
dev_dbg(&usbdev->dev, "%s\n", __func__);
usb_ld->dev_count--;
usb_driver_release_interface(&if_usb_driver, pipe_data->data_intf);
usb_kill_anchored_urbs(&pipe_data->reading);
usb_free_urbs(usb_ld, pipe_data);
if (usb_ld->dev_count == 0) {
cancel_delayed_work_sync(&usb_ld->runtime_pm_work);
cancel_delayed_work_sync(&usb_ld->post_resume_work);
cancel_delayed_work_sync(&usb_ld->ld.tx_delayed_work);
usb_put_dev(usbdev);
usb_ld->usbdev = NULL;
pm_runtime_forbid(pm_data->root_hub);
}
}