本文整理汇总了C++中pm_runtime_allow函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_runtime_allow函数的具体用法?C++ pm_runtime_allow怎么用?C++ pm_runtime_allow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_runtime_allow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hsic_pm_runtime_start
static void hsic_pm_runtime_start(struct work_struct *work)
{
struct link_pm_data *pm_data =
container_of(work, struct link_pm_data, hsic_pm_start.work);
struct usb_device *usbdev = pm_data->usb_ld->usbdev;
struct device *dev, *ppdev;
if (!pm_data->usb_ld->if_usb_connected) {
MIF_DEBUG("disconnect status, ignore\n");
return;
}
dev = &usbdev->dev;
/* wait interface driver resumming */
if (dev->power.runtime_status == RPM_SUSPENDED) {
MIF_ERR("suspended yet, delayed work\n");
queue_delayed_work(pm_data->wq, &pm_data->hsic_pm_start,
msecs_to_jiffies(10));
return;
}
if (usbdev && dev->parent) {
MIF_DEBUG("rpm_status: %d\n", dev->power.runtime_status);
ppdev = dev->parent->parent;
pm_runtime_set_autosuspend_delay(&usbdev->dev, 200);
pm_runtime_allow(dev);
pm_runtime_allow(ppdev);
pm_data->resume_requested = false;
pm_data->resume_retry_cnt = 0;
pm_data->rpm_suspending_cnt = 0;
}
}
示例2: usbsvn_runtime_start
static void usbsvn_runtime_start(struct work_struct *work)
{
struct usbsvn *svn =
container_of(work, struct usbsvn, pm_runtime_work.work);
struct device *dev, *ppdev;
dev = &svn->usbdev->dev;
if (svn->usbdev && dev->parent) {
ppdev = dev->parent->parent;
/*enable runtime feature - once after boot*/
pm_runtime_allow(dev);
dev_dbg(dev, "usbsvn Runtime PM Start!!\n");
pm_runtime_allow(ppdev); /*ehci*/
}
}
示例3: 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);
}
}
}
示例4: intel_lpss_pci_probe
static int intel_lpss_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
struct intel_lpss_platform_info *info;
int ret;
ret = pcim_enable_device(pdev);
if (ret)
return ret;
info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info),
GFP_KERNEL);
if (!info)
return -ENOMEM;
info->mem = &pdev->resource[0];
info->irq = pdev->irq;
/* Probably it is enough to set this for iDMA capable devices only */
pci_set_master(pdev);
ret = intel_lpss_probe(&pdev->dev, info);
if (ret)
return ret;
pm_runtime_put(&pdev->dev);
pm_runtime_allow(&pdev->dev);
return 0;
}
示例5: 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);
}
示例6: dwc3_remove
static int dwc3_remove(struct platform_device *pdev)
{
struct dwc3 *dwc = platform_get_drvdata(pdev);
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pm_runtime_get_sync(&pdev->dev);
/*
* restore res->start back to its original value so that, in case the
* probe is deferred, we don't end up getting error in request the
* memory region the next time probe is called.
*/
res->start -= DWC3_GLOBALS_REGS_START;
dwc3_debugfs_exit(dwc);
dwc3_core_exit_mode(dwc);
dwc3_core_exit(dwc);
dwc3_ulpi_exit(dwc);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_allow(&pdev->dev);
pm_runtime_disable(&pdev->dev);
dwc3_free_event_buffers(dwc);
dwc3_free_scratch_buffers(dwc);
return 0;
}
示例7: 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;
}
示例8: 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;
}
示例9: amdgpu_driver_load_kms
/**
* amdgpu_driver_load_kms - Main load function for KMS.
*
* @dev: drm dev pointer
* @flags: device flags
*
* This is the main load function for KMS (all asics).
* Returns 0 on success, error on failure.
*/
int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
{
struct amdgpu_device *adev;
int r, acpi_status;
adev = kzalloc(sizeof(struct amdgpu_device), GFP_KERNEL);
if (adev == NULL) {
return -ENOMEM;
}
dev->dev_private = (void *)adev;
if ((amdgpu_runtime_pm != 0) &&
amdgpu_has_atpx() &&
((flags & AMD_IS_APU) == 0))
flags |= AMD_IS_PX;
/* amdgpu_device_init should report only fatal error
* like memory allocation failure or iomapping failure,
* or memory manager initialization failure, it must
* properly initialize the GPU MC controller and permit
* VRAM allocation
*/
r = amdgpu_device_init(adev, dev, dev->pdev, flags);
if (r) {
dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
goto out;
}
/* Call ACPI methods: require modeset init
* but failure is not fatal
*/
if (!r) {
acpi_status = amdgpu_acpi_init(adev);
if (acpi_status)
dev_dbg(&dev->pdev->dev,
"Error during ACPI methods call\n");
}
amdgpu_amdkfd_load_interface(adev);
amdgpu_amdkfd_device_probe(adev);
amdgpu_amdkfd_device_init(adev);
if (amdgpu_device_is_px(dev)) {
pm_runtime_use_autosuspend(dev->dev);
pm_runtime_set_autosuspend_delay(dev->dev, 5000);
pm_runtime_set_active(dev->dev);
pm_runtime_allow(dev->dev);
pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put_autosuspend(dev->dev);
}
out:
if (r)
amdgpu_driver_unload_kms(dev);
return r;
}
示例10: wil_pm_runtime_allow
void wil_pm_runtime_allow(struct wil6210_priv *wil)
{
struct device *dev = wil_to_dev(wil);
pm_runtime_put_noidle(dev);
pm_runtime_set_autosuspend_delay(dev, WIL6210_AUTOSUSPEND_DELAY_MS);
pm_runtime_use_autosuspend(dev);
pm_runtime_allow(dev);
}
示例11: 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;
}
示例12: link_pm_runtime_start
static void link_pm_runtime_start(struct work_struct *work)
{
struct link_pm_data *pm_data =
container_of(work, struct link_pm_data, link_pm_start.work);
struct usb_device *usbdev = pm_data->usb_ld->usbdev;
struct device *dev, *hdev;
struct link_device *ld = &pm_data->usb_ld->ld;
if (!pm_data->usb_ld->if_usb_connected
|| pm_data->usb_ld->ld.com_state == COM_NONE) {
mif_err("disconnect status, ignore\n");
return;
}
dev = &pm_data->usb_ld->usbdev->dev;
/* wait interface driver resumming */
if (dev->power.runtime_status == RPM_SUSPENDED) {
mif_info("suspended yet, delayed work\n");
queue_delayed_work(pm_data->wq, &pm_data->link_pm_start,
msecs_to_jiffies(20));
return;
}
if (pm_data->usb_ld->usbdev && dev->parent) {
mif_info("rpm_status: %d\n",
dev->power.runtime_status);
pm_runtime_set_autosuspend_delay(dev, 200);
hdev = usbdev->bus->root_hub->dev.parent;
mif_info("EHCI runtime %s, %s\n", dev_driver_string(hdev),
dev_name(hdev));
pm_runtime_allow(dev);
pm_runtime_allow(hdev);/*ehci*/
pm_data->link_pm_active = true;
pm_data->resume_requested = false;
pm_data->link_reconnect_cnt = 5;
pm_data->resume_retry_cnt = 0;
/* retry prvious link tx q */
queue_delayed_work(ld->tx_wq, &ld->tx_delayed_work, 0);
}
}
示例13: i915_rpm_enable
void i915_rpm_enable(struct device *dev)
{
int cur_status = pm_runtime_enabled(dev);
if (!cur_status) {
pm_runtime_enable(dev);
pm_runtime_allow(dev);
}
return;
}
示例14: 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 s5p_ohci_platdata *pdata = pdev->dev.platform_data;
struct s5p_ohci_hcd *s5p_ohci = platform_get_drvdata(pdev);
struct usb_hcd *hcd = s5p_ohci->hcd;
int power_on;
int irq;
int retval;
if (sscanf(buf, "%d", &power_on) != 1)
return -EINVAL;
device_lock(dev);
if (!power_on && s5p_ohci->power_on) {
printk(KERN_DEBUG "%s: EHCI turns off\n", __func__);
pm_runtime_forbid(dev);
s5p_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 (s5p_ohci->power_on) {
usb_remove_hcd(hcd);
}
if (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;
}
s5p_ohci->power_on = 1;
pm_runtime_allow(dev);
}
exit:
device_unlock(dev);
return count;
}
示例15: control_store
static ssize_t control_store(struct device * dev, struct device_attribute *attr,
const char * buf, size_t n)
{
char *cp;
int len = n;
cp = memchr(buf, '\n', n);
if (cp)
len = cp - buf;
if (len == sizeof ctrl_auto - 1 && strncmp(buf, ctrl_auto, len) == 0)
pm_runtime_allow(dev);
else if (len == sizeof ctrl_on - 1 && strncmp(buf, ctrl_on, len) == 0)
pm_runtime_forbid(dev);
else
return -EINVAL;
return n;
}