Lines Matching refs:pdev

38 void rt_pci_pme_init(struct rt_pci_device *pdev)  in rt_pci_pme_init()  argument
42 if (!pdev || !(pdev->pme_cap = rt_pci_find_capability(pdev, PCIY_PMG))) in rt_pci_pme_init()
47 rt_pci_read_config_u16(pdev, pdev->pme_cap + PCIR_POWER_CAP, &pmc); in rt_pci_pme_init()
52 rt_dm_dev_get_name(&pdev->parent), pmc & PCIM_PCAP_SPEC); in rt_pci_pme_init()
61 pdev->pme_support = RT_FIELD_GET(PCIM_PCAP_PMEMASK, pmc); in rt_pci_pme_init()
63 rt_pci_pme_active(pdev, RT_FALSE); in rt_pci_pme_init()
67 rt_err_t rt_pci_enable_wake(struct rt_pci_device *pdev, in rt_pci_enable_wake() argument
70 if (!pdev || state >= RT_PCI_PME_MAX) in rt_pci_enable_wake()
77 if (rt_pci_pme_capable(pdev, state) || in rt_pci_enable_wake()
78 rt_pci_pme_capable(pdev, RT_PCI_D3COLD)) in rt_pci_enable_wake()
80 rt_pci_pme_active(pdev, RT_EOK); in rt_pci_enable_wake()
85 rt_pci_pme_active(pdev, RT_FALSE); in rt_pci_enable_wake()
91 static void pci_pme_active(struct rt_pci_device *pdev, rt_bool_t enable) in pci_pme_active() argument
95 if (!pdev->pme_support) in pci_pme_active()
100 rt_pci_read_config_u16(pdev, pdev->pme_cap + PCIR_POWER_STATUS, &pmcsr); in pci_pme_active()
109 rt_pci_write_config_u16(pdev, pdev->pme_cap + PCIR_POWER_STATUS, pmcsr); in pci_pme_active()
110 pdev->pm_enabled = enable; in pci_pme_active()
113 void rt_pci_pme_active(struct rt_pci_device *pdev, rt_bool_t enable) in rt_pci_pme_active() argument
115 if (!pdev) in rt_pci_pme_active()
120 pci_pme_active(pdev, enable); in rt_pci_pme_active()
121 rt_dm_power_domain_attach(&pdev->parent, enable); in rt_pci_pme_active()