/* enable pci dev */
err = pcim_enable_device(pdev); if (err) {
dev_err(&pdev->dev, "failed to enable pci device.\n"); goto end;
} /* set PCI host mastering */
pci_set_master(pdev); /* pci request regions and mapping IO device memory for mei driver */
err = pcim_iomap_regions(pdev, mask, KBUILD_MODNAME); if (err) {
dev_err(&pdev->dev, "failed to get pci regions.\n"); goto end;
}
err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(36)); if (err) {
err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); if (err) {
dev_err(&pdev->dev, "No suitable DMA available.\n"); goto end;
}
}
/* allocates and initializes the mei dev structure */
dev = mei_txe_dev_init(pdev); if (!dev) {
err = -ENOMEM; goto end;
}
hw = to_txe_hw(dev);
hw->mem_addr = pcim_iomap_table(pdev);
err = mei_register(dev, &pdev->dev); if (err) goto stop;
pci_set_drvdata(pdev, dev);
/* * MEI requires to resume from runtime suspend mode * in order to perform link reset flow upon system suspend.
*/
dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NO_DIRECT_COMPLETE);
/* * TXE maps runtime suspend/resume to own power gating states, * hence we need to go around native PCI runtime service which * eventually brings the device into D3cold/hot state. * But the TXE device cannot wake up from D3 unlike from own * power gating. To get around PCI device native runtime pm, * TXE uses runtime pm domain handlers which take precedence.
*/
mei_txe_set_pm_domain(dev);
/** * mei_txe_shutdown- Device Shutdown Routine * * @pdev: PCI device structure * * mei_txe_shutdown is called from the reboot notifier * it's a simplified version of remove so we go down * faster.
*/ staticvoid mei_txe_shutdown(struct pci_dev *pdev)
{ struct mei_device *dev = pci_get_drvdata(pdev);
/** * mei_txe_remove - Device Removal Routine * * @pdev: PCI device structure * * mei_remove is called by the PCI subsystem to alert the driver * that it should release a PCI device.
*/ staticvoid mei_txe_remove(struct pci_dev *pdev)
{ struct mei_device *dev = pci_get_drvdata(pdev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.