Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97ce6619 authored by Yan He's avatar Yan He
Browse files

msm: pcie: Read vendor ID and device ID from PCIe core



PCIe devices can have different vendor IDs and device IDs. Thus,
add the support to read the vendor ID and device ID of a PCIe
device from PCIe core.

Change-Id: I582750289537159b240f3e313fd07151b13bd27c
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
parent 4ae4d503
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1129,6 +1129,12 @@ int msm_pcie_enumerate(u32 rc_idx)
		if (!ret) {
			struct pci_dev *pcidev = NULL;
			bool found = false;
			u32 ids = readl_relaxed(msm_pcie_dev[rc_idx].dm_core);
			u32 vendor_id = ids & 0xffff;
			u32 device_id = (ids & 0xffff0000) >> 16;

			PCIE_DBG("vendor-id:0x%x device_id:0x%x\n",
					vendor_id, device_id);

			msm_pci[rc_idx].private_data = (void **)&dev;
			pci_common_init(&msm_pci[rc_idx]);
@@ -1136,8 +1142,8 @@ int msm_pcie_enumerate(u32 rc_idx)
			dev->enumerated = true;

			do {
				pcidev = pci_get_device(PCIE_VENDOR_ID_RCP,
					PCIE_DEVICE_ID_RCP, pcidev);
				pcidev = pci_get_device(vendor_id,
					device_id, pcidev);
				if (pcidev && (&msm_pcie_dev[rc_idx] ==
					(struct msm_pcie_dev_t *)
					PCIE_BUS_PRIV_DATA(pcidev))) {