本文整理汇总了C++中pci_set_power_state函数的典型用法代码示例。如果您正苦于以下问题:C++ pci_set_power_state函数的具体用法?C++ pci_set_power_state怎么用?C++ pci_set_power_state使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pci_set_power_state函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rtsx_resume
static int rtsx_resume(struct pci_dev *pci)
{
struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci);
struct rtsx_chip *chip;
printk(KERN_INFO "Ready to resume\n");
if (!dev) {
printk(KERN_ERR "Invalid memory\n");
return 0;
}
chip = dev->chip;
/* lock the device pointers */
mutex_lock(&(dev->dev_mutex));
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "%s: pci_enable_device failed, "
"disabling device\n", CR_DRIVER_NAME);
/* unlock the device pointers */
mutex_unlock(&dev->dev_mutex);
return -EIO;
}
pci_set_master(pci);
if (chip->msi_en) {
if (pci_enable_msi(pci) < 0)
chip->msi_en = 0;
}
if (rtsx_acquire_irq(dev) < 0) {
/* unlock the device pointers */
mutex_unlock(&dev->dev_mutex);
return -EIO;
}
rtsx_write_register(chip, HOST_SLEEP_STATE, 0x03, 0x00);
rtsx_init_chip(chip);
/* unlock the device pointers */
mutex_unlock(&dev->dev_mutex);
return 0;
}
开发者ID:adis1313,项目名称:android_kernel_samsung_msm8974,代码行数:47,代码来源:rtsx.c
示例2: snd_cs5535audio_resume
int snd_cs5535audio_resume(struct pci_dev *pci)
{
struct snd_card *card = pci_get_drvdata(pci);
struct cs5535audio *cs5535au = card->private_data;
u32 tmp;
int timeout;
int i;
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "cs5535audio: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);
/* set LNK_WRM_RST to reset AC link */
cs_writel(cs5535au, ACC_CODEC_CNTL, ACC_CODEC_CNTL_LNK_WRM_RST);
timeout = 50;
do {
tmp = cs_readl(cs5535au, ACC_CODEC_STATUS);
if (tmp & PRM_RDY_STS)
break;
udelay(1);
} while (--timeout);
if (!timeout)
snd_printk(KERN_ERR "Failure getting AC Link ready\n");
/* set up rate regs, dma. actual initiation is done in trig */
for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {
struct cs5535audio_dma *dma = &cs5535au->dmas[i];
if (dma && dma->substream) {
dma->substream->ops->prepare(dma->substream);
dma->ops->setup_prd(cs5535au, dma->saved_prd);
}
}
/* we depend on ac97 to perform the codec power up */
snd_ac97_resume(cs5535au->ac97);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:47,代码来源:cs5535audio_pm.c
示例3: rtl8192E_suspend
int rtl8192E_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct r8192_priv *priv = rtllib_priv(dev);
u32 ulRegRead;
netdev_info(dev, "============> r8192E suspend call.\n");
del_timer_sync(&priv->gpio_polling_timer);
cancel_delayed_work(&priv->gpio_change_rf_wq);
priv->polling_timer_on = 0;
if (!netif_running(dev)) {
netdev_info(dev,
"RTL819XE:UI is open out of suspend function\n");
goto out_pci_suspend;
}
if (dev->netdev_ops->ndo_stop)
dev->netdev_ops->ndo_stop(dev);
netif_device_detach(dev);
if (!priv->rtllib->bSupportRemoteWakeUp) {
MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT, true);
ulRegRead = read_nic_dword(dev, CPU_GEN);
ulRegRead |= CPU_GEN_SYSTEM_RESET;
write_nic_dword(dev, CPU_GEN, ulRegRead);
} else {
write_nic_dword(dev, WFCRC0, 0xffffffff);
write_nic_dword(dev, WFCRC1, 0xffffffff);
write_nic_dword(dev, WFCRC2, 0xffffffff);
write_nic_byte(dev, PMR, 0x5);
write_nic_byte(dev, MacBlkCtrl, 0xa);
}
out_pci_suspend:
netdev_info(dev, "WOL is %s\n", priv->rtllib->bSupportRemoteWakeUp ?
"Supported" : "Not supported");
pci_save_state(pdev);
pci_disable_device(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev, state),
priv->rtllib->bSupportRemoteWakeUp ? 1 : 0);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
mdelay(20);
return 0;
}
开发者ID:lovejavaee,项目名称:linux-2,代码行数:46,代码来源:rtl_pm.c
示例4: snd_vx222_resume
static int snd_vx222_resume(struct device *dev)
{
struct pci_dev *pci = to_pci_dev(dev);
struct snd_card *card = dev_get_drvdata(dev);
struct snd_vx222 *vx = card->private_data;
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "vx222: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);
return snd_vx_resume(&vx->core);
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:17,代码来源:vx222.c
示例5: bbswitch_on
static void bbswitch_on(void) {
if (!is_card_disabled())
return;
printk(KERN_INFO "bbswitch: enabling discrete graphics\n");
if (bbswitch_acpi_on())
printk(KERN_WARNING "bbswitch: The discrete card could not be enabled"
" by a _DSM call\n");
pci_set_power_state(dis_dev, PCI_D0);
pci_restore_state(dis_dev);
if (pci_enable_device(dis_dev))
printk(KERN_WARNING "bbswitch: failed to enable %s\n",
dev_name(&dis_dev->dev));
pci_set_master(dis_dev);
}
开发者ID:TheFrozenFire,项目名称:bumblebeed,代码行数:17,代码来源:bbswitch.c
示例6: pch_phub_suspend
static int pch_phub_suspend(struct pci_dev *pdev, pm_message_t state)
{
int ret;
pch_phub_save_reg_conf(pdev);
ret = pci_save_state(pdev);
if (ret) {
dev_err(&pdev->dev,
" %s -pci_save_state returns %d\n", __func__, ret);
return ret;
}
pci_enable_wake(pdev, PCI_D3hot, 0);
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:17,代码来源:pch_phub.c
示例7: ahc_linux_pci_dev_suspend
static int
ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
struct ahc_softc *ahc = pci_get_drvdata(pdev);
int rc;
if ((rc = ahc_suspend(ahc)))
return rc;
pci_save_state(pdev);
pci_disable_device(pdev);
if (mesg.event == PM_EVENT_SUSPEND)
pci_set_power_state(pdev, PCI_D3hot);
return rc;
}
开发者ID:BackupTheBerlios,项目名称:grasshopper-svn,代码行数:17,代码来源:aic7xxx_osm_pci.c
示例8: mhi_turn_on_pcie_link
MHI_STATUS mhi_turn_on_pcie_link(mhi_device_ctxt *mhi_dev_ctxt)
{
int r = 0;
struct pci_dev *pcie_dev;
MHI_STATUS ret_val = MHI_STATUS_SUCCESS;
pcie_dev = mhi_dev_ctxt->dev_info->pcie_device;
mutex_lock(&mhi_dev_ctxt->mhi_link_state);
mhi_log(MHI_MSG_INFO, "Entered...\n");
if (mhi_dev_ctxt->flags.link_up)
goto exit;
r = exynos_pcie_pm_resume(0);
if (r) {
mhi_log(MHI_MSG_CRITICAL | MHI_DBG_POWER,
"Failed to resume PCIe RC driver ret %d\n", r);
ret_val = MHI_STATUS_ERROR;
goto exit;
}
atomic_dec(&mhi_dev_ctxt->flags.mhi_link_off);
r = pci_set_power_state(mhi_dev_ctxt->dev_info->pcie_device,
PCI_D0);
if (r) {
mhi_log(MHI_MSG_CRITICAL | MHI_DBG_POWER,
"Failed to load stored state ret %d\n", r);
ret_val = MHI_STATUS_ERROR;
goto exit;
}
/* Restore pcie config space */
r = exynos_pcie_restore_config(mhi_dev_ctxt->dev_info->pcie_device);
if (r) {
mhi_log(MHI_MSG_CRITICAL | MHI_DBG_POWER,
"Failed to save pcie config space: %x\n", r);
ret_val = MHI_STATUS_ERROR;
goto exit;
}
mhi_dev_ctxt->flags.link_up = 1;
exit:
mutex_unlock(&mhi_dev_ctxt->mhi_link_state);
mhi_log(MHI_MSG_INFO, "Exited...\n");
return ret_val;
}
开发者ID:Jackeagle,项目名称:S6-UniKernel,代码行数:46,代码来源:mhi_pm.c
示例9: usb_hcd_pci_resume
/**
* usb_hcd_pci_resume - power management resume of a PCI-based HCD
* @dev: USB Host Controller being resumed
*
* Store this function in the HCD's struct pci_driver as resume().
*/
int usb_hcd_pci_resume (struct pci_dev *dev)
{
struct usb_hcd *hcd;
int retval;
int has_pci_pm;
hcd = pci_get_drvdata(dev);
has_pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);
if (has_pci_pm)
dev_dbg(hcd->self.controller, "resume from state D%d\n",
dev->current_state);
if (hcd->state != HCD_STATE_SUSPENDED) {
dev_dbg (hcd->self.controller,
"can't resume, not suspended!\n");
return -EL3HLT;
}
hcd->state = USB_STATE_RESUMING;
if (has_pci_pm)
pci_set_power_state (dev, 0);
dev->dev.power.power_state = 0;
retval = request_irq (dev->irq, usb_hcd_irq, SA_SHIRQ,
hcd->description, hcd);
if (retval < 0) {
dev_err (hcd->self.controller,
"can't restore IRQ after resume!\n");
return retval;
}
pci_set_master (dev);
pci_restore_state (dev, hcd->pci_state);
#ifdef CONFIG_USB_SUSPEND
pci_enable_wake (dev, dev->current_state, 0);
pci_enable_wake (dev, 4, 0);
#endif
retval = hcd->driver->resume (hcd);
if (!HCD_IS_RUNNING (hcd->state)) {
dev_dbg (hcd->self.controller,
"resume fail, retval %d\n", retval);
usb_hc_died (hcd);
}
return retval;
}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:51,代码来源:hcd-pci.c
示例10: pch_phub_resume
static int pch_phub_resume(struct pci_dev *pdev)
{
int ret;
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
ret = pci_enable_device(pdev);
if (ret) {
dev_err(&pdev->dev,
"%s-pci_enable_device failed(ret=%d) ", __func__, ret);
return ret;
}
pci_enable_wake(pdev, PCI_D3hot, 0);
pch_phub_restore_reg_conf(pdev);
return 0;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:18,代码来源:pch_phub.c
示例11: snd_atiixp_suspend
/*
* power management
*/
static int snd_atiixp_suspend(snd_card_t *card, unsigned int state)
{
atiixp_t *chip = card->pm_private_data;
int i;
for (i = 0; i < NUM_ATI_PCMDEVS; i++)
if (chip->pcmdevs[i])
snd_pcm_suspend_all(chip->pcmdevs[i]);
for (i = 0; i < NUM_ATI_CODECS; i++)
if (chip->ac97[i])
snd_ac97_suspend(chip->ac97[i]);
snd_atiixp_aclink_down(chip);
snd_atiixp_chip_stop(chip);
pci_set_power_state(chip->pci, 3);
pci_disable_device(chip->pci);
return 0;
}
开发者ID:idtek,项目名称:linux-2.6.11,代码行数:21,代码来源:atiixp.c
示例12: snd_atiixp_resume
static int snd_atiixp_resume(snd_card_t *card, unsigned int state)
{
atiixp_t *chip = card->pm_private_data;
int i;
pci_enable_device(chip->pci);
pci_set_power_state(chip->pci, 0);
pci_set_master(chip->pci);
snd_atiixp_aclink_reset(chip);
snd_atiixp_chip_start(chip);
for (i = 0; i < NUM_ATI_CODECS; i++)
if (chip->ac97[i])
snd_ac97_resume(chip->ac97[i]);
return 0;
}
开发者ID:idtek,项目名称:linux-2.6.11,代码行数:18,代码来源:atiixp.c
示例13: rtl8180_suspend
int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
// struct r8180_priv *priv = ieee80211_priv(dev);
if (!netif_running(dev))
goto out_pci_suspend;
dev->stop(dev);
netif_device_detach(dev);
out_pci_suspend:
pci_save_state(pdev);
pci_disable_device(pdev);
pci_set_power_state(pdev,pci_choose_state(pdev,state));
return 0;
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:18,代码来源:r8180_pm.c
示例14: tw68_suspend
static int tw68_suspend(struct pci_dev *pci_dev , pm_message_t state)
{
struct v4l2_device *v4l2_dev = pci_get_drvdata(pci_dev);
struct tw68_dev *dev = container_of(v4l2_dev,
struct tw68_dev, v4l2_dev);
tw_clearl(TW68_DMAC, TW68_DMAP_EN | TW68_FIFO_EN);
dev->pci_irqmask &= ~TW68_VID_INTS;
tw_writel(TW68_INTMASK, 0);
synchronize_irq(pci_dev->irq);
pci_save_state(pci_dev);
pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
vb2_discard_done(&dev->vidq);
return 0;
}
开发者ID:ParrotSec,项目名称:linux-psec,代码行数:18,代码来源:tw68-core.c
示例15: rtl8192E_resume
int rtl8192E_resume(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct r8192_priv *priv = rtllib_priv(dev);
int err;
u32 val;
netdev_info(dev, "================>r8192E resume call.\n");
pci_set_power_state(pdev, PCI_D0);
err = pci_enable_device(pdev);
if (err) {
netdev_err(dev, "pci_enable_device failed on resume\n");
return err;
}
pci_restore_state(pdev);
pci_read_config_dword(pdev, 0x40, &val);
if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
pci_enable_wake(pdev, PCI_D0, 0);
if (priv->polling_timer_on == 0)
check_rfctrl_gpio_timer((unsigned long)dev);
if (!netif_running(dev)) {
netdev_info(dev,
"RTL819XE:UI is open out of resume function\n");
goto out;
}
netif_device_attach(dev);
if (dev->netdev_ops->ndo_open)
dev->netdev_ops->ndo_open(dev);
if (!priv->rtllib->bSupportRemoteWakeUp)
MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_INIT, true);
out:
RT_TRACE(COMP_POWER, "<================r8192E resume call.\n");
return 0;
}
开发者ID:lovejavaee,项目名称:linux-2,代码行数:44,代码来源:rtl_pm.c
示例16: rtsx_resume
static int rtsx_resume(struct pci_dev *pci)
{
struct rtsx_dev *dev = pci_get_drvdata(pci);
struct rtsx_chip *chip;
if (!dev)
return 0;
chip = dev->chip;
/* lock the device pointers */
mutex_lock(&dev->dev_mutex);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
dev_err(&dev->pci->dev,
"%s: pci_enable_device failed, disabling device\n",
CR_DRIVER_NAME);
/* unlock the device pointers */
mutex_unlock(&dev->dev_mutex);
return -EIO;
}
pci_set_master(pci);
if (chip->msi_en) {
if (pci_enable_msi(pci) < 0)
chip->msi_en = 0;
}
if (rtsx_acquire_irq(dev) < 0) {
/* unlock the device pointers */
mutex_unlock(&dev->dev_mutex);
return -EIO;
}
rtsx_write_register(chip, HOST_SLEEP_STATE, 0x03, 0x00);
rtsx_init_chip(chip);
/* unlock the device pointers */
mutex_unlock(&dev->dev_mutex);
return 0;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:44,代码来源:rtsx.c
示例17: delkin_cb_resume
static int delkin_cb_resume(struct pci_dev *dev)
{
struct ide_host *host = pci_get_drvdata(dev);
int rc;
pci_set_power_state(dev, PCI_D0);
rc = pci_enable_device(dev);
if (rc)
return rc;
pci_restore_state(dev);
pci_set_master(dev);
if (host->init_chipset)
host->init_chipset(dev);
return 0;
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:19,代码来源:delkin_cb.c
示例18: brcmf_pcie_resume
static int brcmf_pcie_resume(struct pci_dev *pdev)
{
int err;
brcmf_dbg(PCIE, "Enter, pdev=%p\n", pdev);
err = pci_set_power_state(pdev, PCI_D0);
if (err) {
brcmf_err("pci_set_power_state failed, err=%d\n", err);
return err;
}
pci_restore_state(pdev);
err = brcmf_pcie_probe(pdev, NULL);
if (err)
brcmf_err("probe after resume failed, err=%d\n", err);
return err;
}
开发者ID:andyqee,项目名称:linux,代码行数:19,代码来源:pcie.c
示例19: i915_switcheroo_set_state
static void i915_switcheroo_set_state(struct pci_dev *pdev, enum vga_switcheroo_state state)
{
struct drm_device *dev = pci_get_drvdata(pdev);
pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
if (state == VGA_SWITCHEROO_ON) {
pr_info("switched on\n");
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
/* i915 resume handler doesn't set to D0 */
pci_set_power_state(dev->pdev, PCI_D0);
i915_resume_legacy(dev);
dev->switch_power_state = DRM_SWITCH_POWER_ON;
} else {
pr_err("switched off\n");
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
i915_suspend_legacy(dev, pmm);
dev->switch_power_state = DRM_SWITCH_POWER_OFF;
}
}
开发者ID:titanxxh,项目名称:xengt-ha-kernel,代码行数:19,代码来源:i915_dma.c
示例20: bbswitch_on
static void bbswitch_on(void) {
if (!is_card_disabled()) {
pr_info("discrete graphics already enabled\n");
return;
}
pr_info("enabling discrete graphics\n");
if (bbswitch_acpi_on())
pr_warn("The discrete card could not be enabled by a _DSM call\n");
if (pci_set_power_state(dis_dev, PCI_D0))
pr_warn("The discrete card could not be set to D0 (awake) state\n");
pci_restore_state(dis_dev);
if (pci_enable_device(dis_dev))
pr_warn("failed to enable %s\n", dev_name(&dis_dev->dev));
pci_set_master(dis_dev);
}
开发者ID:doudou,项目名称:bbswitch,代码行数:19,代码来源:bbswitch.c
注:本文中的pci_set_power_state函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论