]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/misc/mei/pci-me.c
mei: me: store irq number in the hw struct.
[linux.git] / drivers / misc / mei / pci-me.c
index 541538eff8b110490420099be16b6bd0b5c18601..6233b3ca1c1dabba46f7d0c4097a4a58a89d47dd 100644 (file)
@@ -61,13 +61,13 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
        {MEI_PCI_DEVICE(MEI_DEV_ID_ICH10_3, MEI_ME_ICH10_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_ICH10_4, MEI_ME_ICH10_CFG)},
 
-       {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_1, MEI_ME_PCH_CFG)},
-       {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_2, MEI_ME_PCH_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_1, MEI_ME_PCH6_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_IBXPK_2, MEI_ME_PCH6_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_CPT_1, MEI_ME_PCH_CPT_PBG_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_PBG_1, MEI_ME_PCH_CPT_PBG_CFG)},
-       {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, MEI_ME_PCH_CFG)},
-       {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, MEI_ME_PCH_CFG)},
-       {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, MEI_ME_PCH_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_1, MEI_ME_PCH7_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_2, MEI_ME_PCH7_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_PPT_3, MEI_ME_PCH7_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_H, MEI_ME_PCH8_SPS_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_W, MEI_ME_PCH8_SPS_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_LPT_LP, MEI_ME_PCH8_CFG)},
@@ -96,6 +96,10 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
        {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH12_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_4, MEI_ME_PCH8_CFG)},
 
+       {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP, MEI_ME_PCH12_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP_3, MEI_ME_PCH8_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_V, MEI_ME_PCH12_CFG)},
+
        {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)},
 
        {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH12_CFG)},
@@ -188,13 +192,14 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
        /* allocates and initializes the mei dev structure */
-       dev = mei_me_dev_init(pdev, cfg);
+       dev = mei_me_dev_init(&pdev->dev, cfg);
        if (!dev) {
                err = -ENOMEM;
                goto end;
        }
        hw = to_me_hw(dev);
        hw->mem_addr = pcim_iomap_table(pdev)[0];
+       hw->irq = pdev->irq;
 
        pci_enable_msi(pdev);
 
@@ -383,12 +388,11 @@ static int mei_me_pci_resume(struct device *device)
 #ifdef CONFIG_PM
 static int mei_me_pm_runtime_idle(struct device *device)
 {
-       struct pci_dev *pdev = to_pci_dev(device);
        struct mei_device *dev;
 
-       dev_dbg(&pdev->dev, "rpm: me: runtime_idle\n");
+       dev_dbg(device, "rpm: me: runtime_idle\n");
 
-       dev = pci_get_drvdata(pdev);
+       dev = dev_get_drvdata(device);
        if (!dev)
                return -ENODEV;
        if (mei_write_is_idle(dev))
@@ -399,13 +403,12 @@ static int mei_me_pm_runtime_idle(struct device *device)
 
 static int mei_me_pm_runtime_suspend(struct device *device)
 {
-       struct pci_dev *pdev = to_pci_dev(device);
        struct mei_device *dev;
        int ret;
 
-       dev_dbg(&pdev->dev, "rpm: me: runtime suspend\n");
+       dev_dbg(device, "rpm: me: runtime suspend\n");
 
-       dev = pci_get_drvdata(pdev);
+       dev = dev_get_drvdata(device);
        if (!dev)
                return -ENODEV;
 
@@ -418,7 +421,7 @@ static int mei_me_pm_runtime_suspend(struct device *device)
 
        mutex_unlock(&dev->device_lock);
 
-       dev_dbg(&pdev->dev, "rpm: me: runtime suspend ret=%d\n", ret);
+       dev_dbg(device, "rpm: me: runtime suspend ret=%d\n", ret);
 
        if (ret && ret != -EAGAIN)
                schedule_work(&dev->reset_work);
@@ -428,13 +431,12 @@ static int mei_me_pm_runtime_suspend(struct device *device)
 
 static int mei_me_pm_runtime_resume(struct device *device)
 {
-       struct pci_dev *pdev = to_pci_dev(device);
        struct mei_device *dev;
        int ret;
 
-       dev_dbg(&pdev->dev, "rpm: me: runtime resume\n");
+       dev_dbg(device, "rpm: me: runtime resume\n");
 
-       dev = pci_get_drvdata(pdev);
+       dev = dev_get_drvdata(device);
        if (!dev)
                return -ENODEV;
 
@@ -444,7 +446,7 @@ static int mei_me_pm_runtime_resume(struct device *device)
 
        mutex_unlock(&dev->device_lock);
 
-       dev_dbg(&pdev->dev, "rpm: me: runtime resume ret = %d\n", ret);
+       dev_dbg(device, "rpm: me: runtime resume ret = %d\n", ret);
 
        if (ret)
                schedule_work(&dev->reset_work);