Lines Matching refs:pdev
90 struct pci_dev *pdev; member
183 struct pci_dev *pdev, in __find_weakest_power_state() argument
191 if (lss[j].pdev == pdev || !lss[j].pdev) in __find_weakest_power_state()
197 lss[j].pdev = pdev; in __find_weakest_power_state()
200 dev_WARN(&pdev->dev, "No room for device in PWRMU LSS cache\n"); in __find_weakest_power_state()
213 static int __set_power_state(struct mid_pwr *pwr, struct pci_dev *pdev, in __set_power_state() argument
219 state = __find_weakest_power_state(pwr->lss[id], pdev, state); in __set_power_state()
224 dev_warn(&pdev->dev, "Can't set power state %s: %d\n", name, ret); in __set_power_state()
228 dev_vdbg(&pdev->dev, "Set power state %s\n", name); in __set_power_state()
232 static int mid_pwr_set_power_state(struct mid_pwr *pwr, struct pci_dev *pdev, in mid_pwr_set_power_state() argument
238 id = intel_mid_pwr_get_lss_id(pdev); in mid_pwr_set_power_state()
252 ret = __set_power_state(pwr, pdev, state, id, reg, bit); in mid_pwr_set_power_state()
257 int intel_mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state) in intel_mid_pci_set_power_state() argument
265 ret = mid_pwr_set_power_state(pwr, pdev, state); in intel_mid_pci_set_power_state()
266 dev_vdbg(&pdev->dev, "set_power_state() returns %d\n", ret); in intel_mid_pci_set_power_state()
271 pci_power_t intel_mid_pci_get_power_state(struct pci_dev *pdev) in intel_mid_pci_get_power_state() argument
280 id = intel_mid_pwr_get_lss_id(pdev); in intel_mid_pci_get_power_state()
304 int intel_mid_pwr_get_lss_id(struct pci_dev *pdev) in intel_mid_pwr_get_lss_id() argument
313 vndr = pci_find_capability(pdev, PCI_CAP_ID_VNDR); in intel_mid_pwr_get_lss_id()
318 pci_read_config_byte(pdev, vndr + INTEL_MID_PWR_LSS_OFFSET, &id); in intel_mid_pwr_get_lss_id()
348 static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id) in mid_pwr_probe() argument
351 struct device *dev = &pdev->dev; in mid_pwr_probe()
355 ret = pcim_enable_device(pdev); in mid_pwr_probe()
357 dev_err(&pdev->dev, "error: could not enable device\n"); in mid_pwr_probe()
361 ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev)); in mid_pwr_probe()
363 dev_err(&pdev->dev, "I/O memory remapping failed\n"); in mid_pwr_probe()
372 pwr->regs = pcim_iomap_table(pdev)[0]; in mid_pwr_probe()
373 pwr->irq = pdev->irq; in mid_pwr_probe()
386 ret = devm_request_irq(dev, pdev->irq, mid_pwr_irq_handler, in mid_pwr_probe()
387 IRQF_NO_SUSPEND, pci_name(pdev), pwr); in mid_pwr_probe()
394 pci_set_drvdata(pdev, pwr); in mid_pwr_probe()