aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel_pmc_ipc.c
diff options
context:
space:
mode:
authorAubrey Li <aubrey.li@linux.intel.com>2016-03-31 15:28:09 -0400
committerDarren Hart <dvhart@linux.intel.com>2016-04-19 16:51:41 -0400
commit5d07163334ba016c053b033cd0bb3c92d7dc0229 (patch)
tree2e67c38ce79b0a4906dffe9ff89db1eed87bc7de /drivers/platform/x86/intel_pmc_ipc.c
parenta7718360d91eedbedd58978ec8fff4a67a866f86 (diff)
platform:x86 decouple telemetry driver from the optional IPC resources
Currently the optional IPC resources prevent telemetry driver from probing if these resources are not in ACPI table. This patch decouples telemetry driver from these optional resources, so that telemetry driver has dependency only on the necessary ACPI resources. Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/intel_pmc_ipc.c')
-rw-r--r--drivers/platform/x86/intel_pmc_ipc.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c
index 3fb1d85c70a8..6f497e80c9df 100644
--- a/drivers/platform/x86/intel_pmc_ipc.c
+++ b/drivers/platform/x86/intel_pmc_ipc.c
@@ -687,8 +687,8 @@ static int ipc_plat_get_res(struct platform_device *pdev)
687 ipcdev.acpi_io_size = size; 687 ipcdev.acpi_io_size = size;
688 dev_info(&pdev->dev, "io res: %pR\n", res); 688 dev_info(&pdev->dev, "io res: %pR\n", res);
689 689
690 /* This is index 0 to cover BIOS data register */
691 punit_res = punit_res_array; 690 punit_res = punit_res_array;
691 /* This is index 0 to cover BIOS data register */
692 res = platform_get_resource(pdev, IORESOURCE_MEM, 692 res = platform_get_resource(pdev, IORESOURCE_MEM,
693 PLAT_RESOURCE_BIOS_DATA_INDEX); 693 PLAT_RESOURCE_BIOS_DATA_INDEX);
694 if (!res) { 694 if (!res) {
@@ -698,55 +698,51 @@ static int ipc_plat_get_res(struct platform_device *pdev)
698 *punit_res = *res; 698 *punit_res = *res;
699 dev_info(&pdev->dev, "punit BIOS data res: %pR\n", res); 699 dev_info(&pdev->dev, "punit BIOS data res: %pR\n", res);
700 700
701 /* This is index 1 to cover BIOS interface register */
701 res = platform_get_resource(pdev, IORESOURCE_MEM, 702 res = platform_get_resource(pdev, IORESOURCE_MEM,
702 PLAT_RESOURCE_BIOS_IFACE_INDEX); 703 PLAT_RESOURCE_BIOS_IFACE_INDEX);
703 if (!res) { 704 if (!res) {
704 dev_err(&pdev->dev, "Failed to get res of punit BIOS iface\n"); 705 dev_err(&pdev->dev, "Failed to get res of punit BIOS iface\n");
705 return -ENXIO; 706 return -ENXIO;
706 } 707 }
707 /* This is index 1 to cover BIOS interface register */
708 *++punit_res = *res; 708 *++punit_res = *res;
709 dev_info(&pdev->dev, "punit BIOS interface res: %pR\n", res); 709 dev_info(&pdev->dev, "punit BIOS interface res: %pR\n", res);
710 710
711 /* This is index 2 to cover ISP data register, optional */
711 res = platform_get_resource(pdev, IORESOURCE_MEM, 712 res = platform_get_resource(pdev, IORESOURCE_MEM,
712 PLAT_RESOURCE_ISP_DATA_INDEX); 713 PLAT_RESOURCE_ISP_DATA_INDEX);
713 if (!res) { 714 ++punit_res;
714 dev_err(&pdev->dev, "Failed to get res of punit ISP data\n"); 715 if (res) {
715 return -ENXIO; 716 *punit_res = *res;
717 dev_info(&pdev->dev, "punit ISP data res: %pR\n", res);
716 } 718 }
717 /* This is index 2 to cover ISP data register */
718 *++punit_res = *res;
719 dev_info(&pdev->dev, "punit ISP data res: %pR\n", res);
720 719
720 /* This is index 3 to cover ISP interface register, optional */
721 res = platform_get_resource(pdev, IORESOURCE_MEM, 721 res = platform_get_resource(pdev, IORESOURCE_MEM,
722 PLAT_RESOURCE_ISP_IFACE_INDEX); 722 PLAT_RESOURCE_ISP_IFACE_INDEX);
723 if (!res) { 723 ++punit_res;
724 dev_err(&pdev->dev, "Failed to get res of punit ISP iface\n"); 724 if (res) {
725 return -ENXIO; 725 *punit_res = *res;
726 dev_info(&pdev->dev, "punit ISP interface res: %pR\n", res);
726 } 727 }
727 /* This is index 3 to cover ISP interface register */
728 *++punit_res = *res;
729 dev_info(&pdev->dev, "punit ISP interface res: %pR\n", res);
730 728
729 /* This is index 4 to cover GTD data register, optional */
731 res = platform_get_resource(pdev, IORESOURCE_MEM, 730 res = platform_get_resource(pdev, IORESOURCE_MEM,
732 PLAT_RESOURCE_GTD_DATA_INDEX); 731 PLAT_RESOURCE_GTD_DATA_INDEX);
733 if (!res) { 732 ++punit_res;
734 dev_err(&pdev->dev, "Failed to get res of punit GTD data\n"); 733 if (res) {
735 return -ENXIO; 734 *punit_res = *res;
735 dev_info(&pdev->dev, "punit GTD data res: %pR\n", res);
736 } 736 }
737 /* This is index 4 to cover GTD data register */
738 *++punit_res = *res;
739 dev_info(&pdev->dev, "punit GTD data res: %pR\n", res);
740 737
738 /* This is index 5 to cover GTD interface register, optional */
741 res = platform_get_resource(pdev, IORESOURCE_MEM, 739 res = platform_get_resource(pdev, IORESOURCE_MEM,
742 PLAT_RESOURCE_GTD_IFACE_INDEX); 740 PLAT_RESOURCE_GTD_IFACE_INDEX);
743 if (!res) { 741 ++punit_res;
744 dev_err(&pdev->dev, "Failed to get res of punit GTD iface\n"); 742 if (res) {
745 return -ENXIO; 743 *punit_res = *res;
744 dev_info(&pdev->dev, "punit GTD interface res: %pR\n", res);
746 } 745 }
747 /* This is index 5 to cover GTD interface register */
748 *++punit_res = *res;
749 dev_info(&pdev->dev, "punit GTD interface res: %pR\n", res);
750 746
751 res = platform_get_resource(pdev, IORESOURCE_MEM, 747 res = platform_get_resource(pdev, IORESOURCE_MEM,
752 PLAT_RESOURCE_IPC_INDEX); 748 PLAT_RESOURCE_IPC_INDEX);