本文整理汇总了C++中pm_runtime_allow函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_runtime_allow函数的具体用法?C++ pm_runtime_allow怎么用?C++ pm_runtime_allow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_runtime_allow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:hedongjie,项目名称:m35x,代码行数:33,代码来源:modem_hsic.c
示例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*/
}
}
开发者ID:myfluxi,项目名称:xxKernel,代码行数:15,代码来源:cdc-svnet.c
示例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);
}
}
}
开发者ID:QweJay,项目名称:GT-I9505,代码行数:28,代码来源:diag_bridge.c
示例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;
}
开发者ID:DenisLug,项目名称:mptcp,代码行数:30,代码来源:intel-lpss-pci.c
示例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);
}
开发者ID:mjduddin,项目名称:B14CKB1RD_kernel_m8,代码行数:29,代码来源:omap-serial.c
示例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;
}
开发者ID:asmalldev,项目名称:linux,代码行数:28,代码来源:core.c
示例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;
}
开发者ID:javilonas,项目名称:Thoth-GT-I9300-Sammy,代码行数:25,代码来源:modem_link_pm_usb.c
示例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;
}
开发者ID:ShedrockN4,项目名称:wiliteneo,代码行数:58,代码来源:ehci-s5p.c
示例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;
}
开发者ID:513855417,项目名称:linux,代码行数:67,代码来源:amdgpu_kms.c
示例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);
}
开发者ID:avagin,项目名称:linux,代码行数:9,代码来源:pm.c
示例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;
}
开发者ID:android-armv7a-belalang-tempur,项目名称:Adam-Kernel-GS4,代码行数:56,代码来源:ohci-exynos.c
示例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);
}
}
开发者ID:InhyukYee,项目名称:PeanutButterWolf,代码行数:42,代码来源:modem_link_device_hsic.c
示例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;
}
开发者ID:mariodebian,项目名称:oem-audio-i915-baytrail-dkms,代码行数:11,代码来源:i915_rpm.c
示例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;
}
开发者ID:Hackhao,项目名称:tzos,代码行数:48,代码来源:ohci-s5p.c
示例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;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:17,代码来源:sysfs.c
示例16: xhci_exit_test_mode
static int xhci_exit_test_mode(struct xhci_hcd *xhci)
{
int retval;
if (!xhci->test_mode) {
xhci_err(xhci, "Not in test mode, do nothing.\n");
return 0;
}
if (xhci->test_mode == TEST_FORCE_EN &&
!(xhci->xhc_state & XHCI_STATE_HALTED)) {
retval = xhci_halt(xhci);
if (retval)
return retval;
}
pm_runtime_allow(xhci_to_hcd(xhci)->self.controller);
xhci->test_mode = 0;
return xhci_reset(xhci);
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:18,代码来源:xhci-hub.c
示例17: smsc_hub_enable
static int smsc_hub_enable(struct hsic_hub *hub)
{
struct smsc_hub_platform_data *pdata = hub->pdata;
struct of_dev_auxdata *hsic_host_auxdata = dev_get_platdata(hub->dev);
struct device_node *node = hub->dev->of_node;
int ret;
ret = gpio_direction_output(pdata->xo_clk_gpio, 1);
if (ret < 0) {
dev_err(hub->dev, "fail to enable xo clk\n");
return ret;
}
ret = gpio_direction_output(pdata->hub_reset, 0);
if (ret < 0) {
dev_err(hub->dev, "fail to assert reset\n");
goto disable_xo;
}
udelay(5);
ret = gpio_direction_output(pdata->hub_reset, 1);
if (ret < 0) {
dev_err(hub->dev, "fail to de-assert reset\n");
goto disable_xo;
}
ret = of_platform_populate(node, NULL, hsic_host_auxdata,
hub->dev);
if (ret < 0) {
dev_err(smsc_hub->dev, "fail to add child with %d\n",
ret);
goto reset;
}
pm_runtime_allow(hub->dev);
return 0;
reset:
gpio_direction_output(pdata->hub_reset, 0);
disable_xo:
gpio_direction_output(pdata->xo_clk_gpio, 0);
return ret;
}
开发者ID:Leoyzen,项目名称:Charm-Eye,代码行数:44,代码来源:smsc_hub.c
示例18: ufshcd_pci_probe
/**
* ufshcd_pci_probe - probe routine of the driver
* @pdev: pointer to PCI device handle
* @id: PCI device id
*
* Returns 0 on success, non-zero value on failure
*/
static int
ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct ufs_hba *hba;
void __iomem *mmio_base;
int err;
err = pcim_enable_device(pdev);
if (err) {
dev_err(&pdev->dev, "pcim_enable_device failed\n");
return err;
}
pci_set_master(pdev);
err = pcim_iomap_regions(pdev, 1 << 0, UFSHCD);
if (err < 0) {
dev_err(&pdev->dev, "request and iomap failed\n");
return err;
}
mmio_base = pcim_iomap_table(pdev)[0];
err = ufshcd_alloc_host(&pdev->dev, &hba);
if (err) {
dev_err(&pdev->dev, "Allocation failed\n");
return err;
}
INIT_LIST_HEAD(&hba->clk_list_head);
err = ufshcd_init(hba, mmio_base, pdev->irq);
if (err) {
dev_err(&pdev->dev, "Initialization failed\n");
ufshcd_dealloc_host(hba);
return err;
}
pci_set_drvdata(pdev, hba);
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_allow(&pdev->dev);
return 0;
}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:51,代码来源:ufshcd-pci.c
示例19: drm_enable_locked
static void drm_enable_locked(struct secmem_info *info, bool enable)
{
if (drm_onoff != enable) {
#ifdef CONFIG_EXYNOS5_DEV_GSC
if (enable)
pm_runtime_forbid(info->dev->parent);
else
pm_runtime_allow(info->dev->parent);
#endif
drm_onoff = enable;
/*
* this will only allow this instance to turn drm_off either by
* calling the ioctl or by closing the fd
*/
info->drm_enabled = enable;
} else {
pr_err("%s: DRM is already %s\n", __func__,
drm_onoff ? "on" : "off");
}
}
开发者ID:EnJens,项目名称:android_kernel_samsung_p600,代码行数:20,代码来源:secmem.c
示例20: serial_hsu_pci_port_probe
static int serial_hsu_pci_port_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct uart_hsu_port *up;
int ret, port, hw_type;
resource_size_t start, len;
start = pci_resource_start(pdev, 0);
len = pci_resource_len(pdev, 0);
dev_info(&pdev->dev,
"FUNC: %d driver: %ld addr:%lx len:%lx\n",
PCI_FUNC(pdev->devfn), ent->driver_data,
(unsigned long) start, (unsigned long) len);
port = intel_mid_hsu_func_to_port(PCI_FUNC(pdev->devfn));
if (port == -1)
return 0;
ret = pci_enable_device(pdev);
if (ret)
return ret;
ret = pci_request_region(pdev, 0, "hsu");
if (ret)
goto err;
up = serial_hsu_port_setup(&pdev->dev, port, start, len,
pdev->irq);
if (IS_ERR(up))
goto err;
pci_set_drvdata(pdev, up);
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_allow(&pdev->dev);
return 0;
err:
pci_disable_device(pdev);
return ret;
}
开发者ID:Katarzynasrom,项目名称:android_kernel_lenovo_spark,代码行数:41,代码来源:mfd_pci.c
注:本文中的pm_runtime_allow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论