From patchwork Fri Jan 10 00:26:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Pardee X-Patchwork-Id: 856469 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DF42224D7; Fri, 10 Jan 2025 00:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736468781; cv=none; b=uWKuOaQslMs+QSRbx+SDX398qnbDq377GwrAwCuDBfvUi7HR4pcLzGfeCZwkK2Mdrls5NgeU+EmY4kAZoIutg8Sy+XP92PRIni6jiJe5l3DeL3rTp8jja+xKObHTXhdI+cQ+Fu3sBTyZOI8O6PkXLvV0aR6YK4y4QiB1koFe3sY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736468781; c=relaxed/simple; bh=yNjKm0ryVmsmgF8cOHIgjNV/kYzW222nLIGfjCHjwdM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FokdLnFRgttKu2uOUWpcR1XNJ/07WZXzvINOO4+juC91mggi3l5kWvNUQu51STUrzaqBcX+DwR32D2BD5BKsNaSLo/skfwjfZvTqzPehFaZ6OtvZC9n1wuBSq0YRvW9yFSxPX7ePoN34EIIGLhF2zDNt9PRnTM8buRtvy0vuka0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mWnvIAj3; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mWnvIAj3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736468780; x=1768004780; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=yNjKm0ryVmsmgF8cOHIgjNV/kYzW222nLIGfjCHjwdM=; b=mWnvIAj3ugPHH01qydF8l2nJL/4sAXRAlTueRrG17jCbcZc/ZMw8TnHY Xoxvu98Y6C8E72lXaDKjWsYtWHIa5PRLAataNAzB1jc97s0BaXTR3OTV3 kA6DhIYVYcvnwibBJeiTqN/hF4/jfljNxMW8V85ZG7nVzwLYAdUva0o7N UH1woRUjjsciK6r41rzga2DGUm9KQpMk4cWNgX+abfhXkVV/kBAXdbu/H ZqznD6cMbR/JtaDpJoUynH8guROwXVZ9FH9dlo6ODJim8jwd6v9Kopk2m WiIvGxyiVnvhaBqgUTqJagBsvZ3smlCkwmqCnmRWIZUAN5NvslCap+umK g==; X-CSE-ConnectionGUID: bdDPjLY3TDyplRRo5YzmmA== X-CSE-MsgGUID: Z+rrUc8sQVm7cAETgyZB0g== X-IronPort-AV: E=McAfee;i="6700,10204,11310"; a="36653483" X-IronPort-AV: E=Sophos;i="6.12,302,1728975600"; d="scan'208";a="36653483" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 16:26:18 -0800 X-CSE-ConnectionGUID: Tb/z4IQ1RjKj29QVsIxeGA== X-CSE-MsgGUID: K+paz7DoQ9K9vcvf2fV0Fg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="104097026" Received: from sramkris-mobl1.amr.corp.intel.com (HELO xpardee-desk.lan) ([10.124.222.100]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 16:26:18 -0800 From: Xi Pardee To: xi.pardee@linux.intel.com, rajvi0912@gmail.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v4 2/6] platform/x86/intel/pmc: Remove duplicate enum Date: Thu, 9 Jan 2025 16:26:04 -0800 Message-ID: <20250110002612.244782-3-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250110002612.244782-1-xi.pardee@linux.intel.com> References: <20250110002612.244782-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove duplicate enum PMC_IDX_SOC. PMC_IDX_SOC has the same value as PMC_IDX_MAIN. Replace it with PMC_IDX_MAIN to avoid confusion. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/arl.c | 2 +- drivers/platform/x86/intel/pmc/core.h | 1 - drivers/platform/x86/intel/pmc/lnl.c | 2 +- drivers/platform/x86/intel/pmc/mtl.c | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/arl.c b/drivers/platform/x86/intel/pmc/arl.c index 05dec4f5019f3..ad976cc83ecae 100644 --- a/drivers/platform/x86/intel/pmc/arl.c +++ b/drivers/platform/x86/intel/pmc/arl.c @@ -693,7 +693,7 @@ static int arl_resume(struct pmc_dev *pmcdev) int arl_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC]; + struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; int ret; int func = 0; bool ssram_init = true; diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h index a1886d8e1ef3e..a0f6cc427ddca 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -430,7 +430,6 @@ struct pmc_dev { enum pmc_index { PMC_IDX_MAIN, - PMC_IDX_SOC = PMC_IDX_MAIN, PMC_IDX_IOE, PMC_IDX_PCH, PMC_IDX_MAX diff --git a/drivers/platform/x86/intel/pmc/lnl.c b/drivers/platform/x86/intel/pmc/lnl.c index be029f12cdf40..09b13df90d685 100644 --- a/drivers/platform/x86/intel/pmc/lnl.c +++ b/drivers/platform/x86/intel/pmc/lnl.c @@ -553,7 +553,7 @@ static int lnl_resume(struct pmc_dev *pmcdev) int lnl_core_init(struct pmc_dev *pmcdev) { int ret; - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC]; + struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; lnl_d3_fixup(); diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c index 02949fed76e91..07687a3e436d5 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -992,7 +992,7 @@ static int mtl_resume(struct pmc_dev *pmcdev) int mtl_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC]; + struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; int ret; int func = 2; bool ssram_init = true; From patchwork Fri Jan 10 00:26:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Pardee X-Patchwork-Id: 856468 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA32D29D0C; Fri, 10 Jan 2025 00:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736468782; cv=none; b=M9N+8m7qe31fDDgwUWNcaODiKxvXqB32Jwuy4jw78UZYh+4VwdQnSovkmYw/CWEsUvl0gut9sqZH6ScFKC+cg2LMerS1V+9qbKbf3Q17YZM8jsPzmfq4qZyEIXa1AXa5ejtr8q2GkMUaEIlaxhyGJaKihHUkp/Op7zR23epyRso= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736468782; c=relaxed/simple; bh=zLWfyVcfMpcHXlE8cGirZPv/ZUYiMi1TsCMShVdm04o=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ddbe9dO8e61D76Jr01X88DDuu/2K+CugKUJ0mwBfeM91BRS1+ycLkDebrwcbxrbwinf0iUPMeywPYeuPUavWAAuuOUIO4FewTXL9TLHKpU82NzVe4VeRqyWSJ6nfvm7sYQOKMtKgmCI9QupOK8COjzW1paFsyaaKMc4FeoSsRgw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=lwBrXNJe; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lwBrXNJe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736468780; x=1768004780; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=zLWfyVcfMpcHXlE8cGirZPv/ZUYiMi1TsCMShVdm04o=; b=lwBrXNJeVvi/sfYcVn2ZS9h5CsdJ7B2RmKtn1t85HWbhkeNEhOajE4OK lkxqQzt20A9+q/Ttw75mHRFIOBKtIQXCmaYPyv1T3jBiW6odDE11UFxwz KWfkCWOm434sEMO1l3dPxnnpJWYTuJ73eVjMHspE7ilCx+zG8EKB/uia/ QNLttYU6Ody/g8z+5x27FKr7D7SmgpQ3+fhQUG1UQf4xYBco2fZAepVYT /FWnAL7+dqj3XRB/9D9dcnYfce5c+xmpP3a3oaAXUHXtV8AXWe5qBK6pr UFvFib/3j47rVyLkvl0KvqTGxlAGSwePDexG3bWjJYfco1tSB+w+Olf3p A==; X-CSE-ConnectionGUID: aa1LCafwRByQKXO9EnkFyg== X-CSE-MsgGUID: 999WZSe5QQy3DjKG6kggQg== X-IronPort-AV: E=McAfee;i="6700,10204,11310"; a="36653487" X-IronPort-AV: E=Sophos;i="6.12,302,1728975600"; d="scan'208";a="36653487" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 16:26:19 -0800 X-CSE-ConnectionGUID: DjRB82LKQSukiHtED6J0eA== X-CSE-MsgGUID: hmf0XNVEQP2IlzDPzm/B1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="104097029" Received: from sramkris-mobl1.amr.corp.intel.com (HELO xpardee-desk.lan) ([10.124.222.100]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 16:26:18 -0800 From: Xi Pardee To: xi.pardee@linux.intel.com, rajvi0912@gmail.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v4 3/6] platform/x86:intel/pmc: Create generic_core_init() for all platforms Date: Thu, 9 Jan 2025 16:26:05 -0800 Message-ID: <20250110002612.244782-4-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250110002612.244782-1-xi.pardee@linux.intel.com> References: <20250110002612.244782-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Create a generic_core_init() function for all architectures to reduce duplicate code in each architecture file. Create an info structure to catch the variations between each architecture and pass it to the generic init function. Convert all architectures to call the generic core init function. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/adl.c | 21 +++++-------- drivers/platform/x86/intel/pmc/arl.c | 43 ++++++++------------------- drivers/platform/x86/intel/pmc/cnp.c | 21 +++++-------- drivers/platform/x86/intel/pmc/core.c | 42 ++++++++++++++++++++++++++ drivers/platform/x86/intel/pmc/core.h | 22 ++++++++++++++ drivers/platform/x86/intel/pmc/icl.c | 17 ++++------- drivers/platform/x86/intel/pmc/lnl.c | 18 +++++------ drivers/platform/x86/intel/pmc/mtl.c | 42 ++++++++------------------ drivers/platform/x86/intel/pmc/spt.c | 17 ++++------- drivers/platform/x86/intel/pmc/tgl.c | 31 +++++++++---------- 10 files changed, 138 insertions(+), 136 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/adl.c b/drivers/platform/x86/intel/pmc/adl.c index e7878558fd909..ac37f4ece9c70 100644 --- a/drivers/platform/x86/intel/pmc/adl.c +++ b/drivers/platform/x86/intel/pmc/adl.c @@ -311,20 +311,13 @@ const struct pmc_reg_map adl_reg_map = { .pson_residency_counter_step = TGL_PSON_RES_COUNTER_STEP, }; +static struct pmc_dev_info adl_pmc_dev = { + .map = &adl_reg_map, + .suspend = cnl_suspend, + .resume = cnl_resume, +}; + int adl_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; - int ret; - - pmcdev->suspend = cnl_suspend; - pmcdev->resume = cnl_resume; - - pmc->map = &adl_reg_map; - ret = get_primary_reg_base(pmc); - if (ret) - return ret; - - pmc_core_get_low_power_modes(pmcdev); - - return 0; + return generic_core_init(pmcdev, &adl_pmc_dev); } diff --git a/drivers/platform/x86/intel/pmc/arl.c b/drivers/platform/x86/intel/pmc/arl.c index ad976cc83ecae..dedf752237ca0 100644 --- a/drivers/platform/x86/intel/pmc/arl.c +++ b/drivers/platform/x86/intel/pmc/arl.c @@ -691,40 +691,23 @@ static int arl_resume(struct pmc_dev *pmcdev) return cnl_resume(pmcdev); } +static struct pmc_dev_info arl_pmc_dev = { + .func = 0, + .dmu_guid = ARL_PMT_DMU_GUID, + .regmap_list = arl_pmc_info_list, + .map = &arl_socs_reg_map, + .suspend = cnl_suspend, + .resume = arl_resume, +}; + int arl_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; int ret; - int func = 0; - bool ssram_init = true; - - arl_d3_fixup(); - pmcdev->suspend = cnl_suspend; - pmcdev->resume = arl_resume; - pmcdev->regmap_list = arl_pmc_info_list; - - /* - * If ssram init fails use legacy method to at least get the - * primary PMC - */ - ret = pmc_core_ssram_init(pmcdev, func); - if (ret) { - ssram_init = false; - pmc->map = &arl_socs_reg_map; - - ret = get_primary_reg_base(pmc); - if (ret) - return ret; - } - pmc_core_get_low_power_modes(pmcdev); - pmc_core_punit_pmt_init(pmcdev, ARL_PMT_DMU_GUID); - - if (ssram_init) { - ret = pmc_core_ssram_get_lpm_reqs(pmcdev); - if (ret) - return ret; - } + ret = generic_core_init(pmcdev, &arl_pmc_dev); + if (ret) + return ret; + arl_d3_fixup(); return 0; } diff --git a/drivers/platform/x86/intel/pmc/cnp.c b/drivers/platform/x86/intel/pmc/cnp.c index fc5193fdf8a88..6d268058e40b9 100644 --- a/drivers/platform/x86/intel/pmc/cnp.c +++ b/drivers/platform/x86/intel/pmc/cnp.c @@ -274,20 +274,13 @@ int cnl_resume(struct pmc_dev *pmcdev) return pmc_core_resume_common(pmcdev); } +static struct pmc_dev_info cnp_pmc_dev = { + .map = &cnp_reg_map, + .suspend = cnl_suspend, + .resume = cnl_resume, +}; + int cnp_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; - int ret; - - pmcdev->suspend = cnl_suspend; - pmcdev->resume = cnl_resume; - - pmc->map = &cnp_reg_map; - ret = get_primary_reg_base(pmc); - if (ret) - return ret; - - pmc_core_get_low_power_modes(pmcdev); - - return 0; + return generic_core_init(pmcdev, &cnp_pmc_dev); } diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c index 3e7f99ac8c941..64b1c15e0c81d 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -1344,6 +1344,48 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev) } } +/* + * When supported, ssram init is used to achieve all available PMCs. + * If ssram init fails, this function uses legacy method to at least get the + * primary PMC. + */ +int generic_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info) +{ + struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; + bool ssram; + int ret; + + pmcdev->suspend = pmc_dev_info->suspend; + pmcdev->resume = pmc_dev_info->resume; + + ssram = pmc_dev_info->regmap_list != NULL; + if (ssram) { + pmcdev->regmap_list = pmc_dev_info->regmap_list; + ret = pmc_core_ssram_init(pmcdev, pmc_dev_info->func); + if (ret) { + dev_warn(&pmcdev->pdev->dev, + "ssram init failed, %d, using legacy init\n", ret); + ssram = false; + } + } + + if (!ssram) { + pmc->map = pmc_dev_info->map; + ret = get_primary_reg_base(pmc); + if (ret) + return ret; + } + + pmc_core_get_low_power_modes(pmcdev); + if (pmc_dev_info->dmu_guid) + pmc_core_punit_pmt_init(pmcdev, pmc_dev_info->dmu_guid); + + if (ssram) + return pmc_core_ssram_get_lpm_reqs(pmcdev); + + return 0; +} + static const struct x86_cpu_id intel_pmc_core_ids[] = { X86_MATCH_VFM(INTEL_SKYLAKE_L, spt_core_init), X86_MATCH_VFM(INTEL_SKYLAKE, spt_core_init), diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h index a0f6cc427ddca..80adae582ce5f 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -435,6 +435,27 @@ enum pmc_index { PMC_IDX_MAX }; +/** + * struct pmc_dev_info - Structure to keep PMC device info + * @func: Function number of the primary PMC + * @dmu_guid: DMU GUID + * @regmap_list: Pointer to a list of pmc_info structure that could be + * available for the platform. When set, this field implies + * SSRAM support. + * @map: Pointer to a pmc_reg_map struct that contains platform + * specific attributes of the primary PMC + * @suspend: Function to perform platform specific suspend + * @resume: Function to perform platform specific resume + */ +struct pmc_dev_info { + u8 func; + u32 dmu_guid; + struct pmc_info *regmap_list; + const struct pmc_reg_map *map; + void (*suspend)(struct pmc_dev *pmcdev); + int (*resume)(struct pmc_dev *pmcdev); +}; + extern const struct pmc_bit_map msr_map[]; extern const struct pmc_bit_map spt_pll_map[]; extern const struct pmc_bit_map spt_mphy_map[]; @@ -591,6 +612,7 @@ extern void pmc_core_set_device_d3(unsigned int device); extern int pmc_core_ssram_init(struct pmc_dev *pmcdev, int func); +int generic_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info); int spt_core_init(struct pmc_dev *pmcdev); int cnp_core_init(struct pmc_dev *pmcdev); int icl_core_init(struct pmc_dev *pmcdev); diff --git a/drivers/platform/x86/intel/pmc/icl.c b/drivers/platform/x86/intel/pmc/icl.c index 71b0fd6cb7d84..0e4565dea0452 100644 --- a/drivers/platform/x86/intel/pmc/icl.c +++ b/drivers/platform/x86/intel/pmc/icl.c @@ -50,18 +50,11 @@ const struct pmc_reg_map icl_reg_map = { .etr3_offset = ETR3_OFFSET, }; +static struct pmc_dev_info icl_pmc_dev = { + .map = &icl_reg_map, +}; + int icl_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; - int ret; - - pmc->map = &icl_reg_map; - - ret = get_primary_reg_base(pmc); - if (ret) - return ret; - - pmc_core_get_low_power_modes(pmcdev); - - return ret; + return generic_core_init(pmcdev, &icl_pmc_dev); } diff --git a/drivers/platform/x86/intel/pmc/lnl.c b/drivers/platform/x86/intel/pmc/lnl.c index 09b13df90d685..2e6d4fddd2858 100644 --- a/drivers/platform/x86/intel/pmc/lnl.c +++ b/drivers/platform/x86/intel/pmc/lnl.c @@ -550,22 +550,20 @@ static int lnl_resume(struct pmc_dev *pmcdev) return cnl_resume(pmcdev); } +static struct pmc_dev_info lnl_pmc_dev = { + .map = &lnl_socm_reg_map, + .suspend = cnl_suspend, + .resume = lnl_resume, +}; + int lnl_core_init(struct pmc_dev *pmcdev) { int ret; - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; - - lnl_d3_fixup(); - pmcdev->suspend = cnl_suspend; - pmcdev->resume = lnl_resume; - - pmc->map = &lnl_socm_reg_map; - ret = get_primary_reg_base(pmc); + ret = generic_core_init(pmcdev, &lnl_pmc_dev); if (ret) return ret; - pmc_core_get_low_power_modes(pmcdev); - + lnl_d3_fixup(); return 0; } diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c index 07687a3e436d5..3bc0b64d19141 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -990,39 +990,23 @@ static int mtl_resume(struct pmc_dev *pmcdev) return cnl_resume(pmcdev); } +static struct pmc_dev_info mtl_pmc_dev = { + .func = 2, + .dmu_guid = MTL_PMT_DMU_GUID, + .regmap_list = mtl_pmc_info_list, + .map = &mtl_socm_reg_map, + .suspend = cnl_suspend, + .resume = mtl_resume, +}; + int mtl_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; int ret; - int func = 2; - bool ssram_init = true; - mtl_d3_fixup(); - - pmcdev->suspend = cnl_suspend; - pmcdev->resume = mtl_resume; - pmcdev->regmap_list = mtl_pmc_info_list; - - /* - * If ssram init fails use legacy method to at least get the - * primary PMC - */ - ret = pmc_core_ssram_init(pmcdev, func); - if (ret) { - ssram_init = false; - dev_warn(&pmcdev->pdev->dev, - "ssram init failed, %d, using legacy init\n", ret); - pmc->map = &mtl_socm_reg_map; - ret = get_primary_reg_base(pmc); - if (ret) - return ret; - } - - pmc_core_get_low_power_modes(pmcdev); - pmc_core_punit_pmt_init(pmcdev, MTL_PMT_DMU_GUID); - - if (ssram_init) - return pmc_core_ssram_get_lpm_reqs(pmcdev); + ret = generic_core_init(pmcdev, &mtl_pmc_dev); + if (ret) + return ret; + mtl_d3_fixup(); return 0; } diff --git a/drivers/platform/x86/intel/pmc/spt.c b/drivers/platform/x86/intel/pmc/spt.c index ab993a69e33ee..ab5f66fcb0c30 100644 --- a/drivers/platform/x86/intel/pmc/spt.c +++ b/drivers/platform/x86/intel/pmc/spt.c @@ -134,18 +134,11 @@ const struct pmc_reg_map spt_reg_map = { .pm_vric1_offset = SPT_PMC_VRIC1_OFFSET, }; +static struct pmc_dev_info spt_pmc_dev = { + .map = &spt_reg_map, +}; + int spt_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; - int ret; - - pmc->map = &spt_reg_map; - - ret = get_primary_reg_base(pmc); - if (ret) - return ret; - - pmc_core_get_low_power_modes(pmcdev); - - return ret; + return generic_core_init(pmcdev, &spt_pmc_dev); } diff --git a/drivers/platform/x86/intel/pmc/tgl.c b/drivers/platform/x86/intel/pmc/tgl.c index 4fec43d212d01..bc3cb949c672e 100644 --- a/drivers/platform/x86/intel/pmc/tgl.c +++ b/drivers/platform/x86/intel/pmc/tgl.c @@ -285,35 +285,36 @@ void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev) ACPI_FREE(out_obj); } -static int tgl_core_generic_init(struct pmc_dev *pmcdev, int pch_tp) -{ - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; - int ret; +static struct pmc_dev_info tgl_l_pmc_dev = { + .map = &tgl_reg_map, + .suspend = cnl_suspend, + .resume = cnl_resume, +}; - if (pch_tp == PCH_H) - pmc->map = &tgl_h_reg_map; - else - pmc->map = &tgl_reg_map; +static struct pmc_dev_info tgl_pmc_dev = { + .map = &tgl_h_reg_map, + .suspend = cnl_suspend, + .resume = cnl_resume, +}; - pmcdev->suspend = cnl_suspend; - pmcdev->resume = cnl_resume; +static int tgl_core_generic_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info) +{ + int ret; - ret = get_primary_reg_base(pmc); + ret = generic_core_init(pmcdev, pmc_dev_info); if (ret) return ret; - pmc_core_get_low_power_modes(pmcdev); pmc_core_get_tgl_lpm_reqs(pmcdev->pdev); - return 0; } int tgl_l_core_init(struct pmc_dev *pmcdev) { - return tgl_core_generic_init(pmcdev, PCH_LP); + return tgl_core_generic_init(pmcdev, &tgl_l_pmc_dev); } int tgl_core_init(struct pmc_dev *pmcdev) { - return tgl_core_generic_init(pmcdev, PCH_H); + return tgl_core_generic_init(pmcdev, &tgl_pmc_dev); } From patchwork Fri Jan 10 00:26:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Pardee X-Patchwork-Id: 856467 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A26CF74E09; Fri, 10 Jan 2025 00:26:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736468783; cv=none; b=d3eaEMTAu885JpNzfmssSQzt0SiDJSkwQ1UB7iASHFwOqZAR7lP5s3o71VDMBRvrXH3En0rVAcdl1JwOJHWJwld7K1/nxFvDginJRgKTD8dAZn7DTen5kWPAIVQdZwQMihKoLHR7kok/5FqGulPqZjRscCHBo6oa+w0YoofGmyA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736468783; c=relaxed/simple; bh=/Coid9RXgij7omFqCHoPi58AJLg647MbYRd2eUBWt9o=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t0BMFmeBbkduACvyhelH9BoLeUt5K02J1BnEF9c/uyCbdTWOxIJc4AUb8pnvFUug9nVQ1bz2wxp9QgW2AFvY7NnIfSLNZ9/hOqisP2b3vfyX7bhlbNqdU8zOSzPnVHdjtKW9qUu0ROFwY2jtND6+R4mcgk+pXCh7QlnL7Bnxkq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MKDfHbyv; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MKDfHbyv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736468782; x=1768004782; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/Coid9RXgij7omFqCHoPi58AJLg647MbYRd2eUBWt9o=; b=MKDfHbyvIo/9yDeHVt41S508PRr6whTS6it+cmOoTV8+0DAhGu55dY3q bZGhYqJpG2EAm4P9IcO/kDyqnBFIIjg3tQ/D7Xxr1Ts6uKiGne4ugd1bA qZGvMKjlIHn4bZZdkNWPAIDPPXf2O4GbXgUfvtjZzrpJCgFm5eStzfaZb HujGFrKfEfNfy2nWv3qoWAGBOYG6gt09VUx3YQVa0c9D9WNC5kZEgbNRE I6/qzxagEH2vQl5Mt1apx7qq4/XzXvuQioFQj3o3R7Lt7E4mgf5132tis tvERq55e83VKYfRYPVcMQ6GRAHyRBOC+ERAOQL/cvcE3791rzMkY3MR87 Q==; X-CSE-ConnectionGUID: LSGm7KKSTEG3s31i1ghNvA== X-CSE-MsgGUID: KIDPpf89QQW5fZzE17zuyw== X-IronPort-AV: E=McAfee;i="6700,10204,11310"; a="36653494" X-IronPort-AV: E=Sophos;i="6.12,302,1728975600"; d="scan'208";a="36653494" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 16:26:20 -0800 X-CSE-ConnectionGUID: V/Ky/2eIRtKb3ajVdttMJw== X-CSE-MsgGUID: MVxBd/HITgqKZVKd3Nw2sA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="104097033" Received: from sramkris-mobl1.amr.corp.intel.com (HELO xpardee-desk.lan) ([10.124.222.100]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 16:26:20 -0800 From: Xi Pardee To: xi.pardee@linux.intel.com, rajvi0912@gmail.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v4 5/6] platform/x86/intel/pmc: Remove init functions per architecture Date: Thu, 9 Jan 2025 16:26:07 -0800 Message-ID: <20250110002612.244782-6-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250110002612.244782-1-xi.pardee@linux.intel.com> References: <20250110002612.244782-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove all init functions for each architecture. The architecture specific information for generic init function is stored in the corresponding pmc_dev_info structure and this structure is stored in X86_MATCH_VFM() instead of init function. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/adl.c | 7 +--- drivers/platform/x86/intel/pmc/arl.c | 7 +--- drivers/platform/x86/intel/pmc/cnp.c | 6 +-- drivers/platform/x86/intel/pmc/core.c | 56 +++++++++++++-------------- drivers/platform/x86/intel/pmc/core.h | 19 ++++----- drivers/platform/x86/intel/pmc/icl.c | 7 +--- drivers/platform/x86/intel/pmc/lnl.c | 7 +--- drivers/platform/x86/intel/pmc/mtl.c | 7 +--- drivers/platform/x86/intel/pmc/spt.c | 7 +--- drivers/platform/x86/intel/pmc/tgl.c | 14 +------ 10 files changed, 47 insertions(+), 90 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/adl.c b/drivers/platform/x86/intel/pmc/adl.c index ac37f4ece9c70..de361a316d51d 100644 --- a/drivers/platform/x86/intel/pmc/adl.c +++ b/drivers/platform/x86/intel/pmc/adl.c @@ -311,13 +311,8 @@ const struct pmc_reg_map adl_reg_map = { .pson_residency_counter_step = TGL_PSON_RES_COUNTER_STEP, }; -static struct pmc_dev_info adl_pmc_dev = { +struct pmc_dev_info adl_pmc_dev = { .map = &adl_reg_map, .suspend = cnl_suspend, .resume = cnl_resume, }; - -int adl_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &adl_pmc_dev); -} diff --git a/drivers/platform/x86/intel/pmc/arl.c b/drivers/platform/x86/intel/pmc/arl.c index 9ff90d32a635f..a55381640c23b 100644 --- a/drivers/platform/x86/intel/pmc/arl.c +++ b/drivers/platform/x86/intel/pmc/arl.c @@ -691,7 +691,7 @@ static int arl_resume(struct pmc_dev *pmcdev) return cnl_resume(pmcdev); } -static struct pmc_dev_info arl_pmc_dev = { +struct pmc_dev_info arl_pmc_dev = { .func = 0, .dmu_guid = ARL_PMT_DMU_GUID, .regmap_list = arl_pmc_info_list, @@ -705,8 +705,3 @@ void arl_specific_init(struct pmc_dev *pmcdev) { arl_d3_fixup(); } - -int arl_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &arl_pmc_dev); -} diff --git a/drivers/platform/x86/intel/pmc/cnp.c b/drivers/platform/x86/intel/pmc/cnp.c index 6d268058e40b9..f147ec51c7fd0 100644 --- a/drivers/platform/x86/intel/pmc/cnp.c +++ b/drivers/platform/x86/intel/pmc/cnp.c @@ -274,13 +274,9 @@ int cnl_resume(struct pmc_dev *pmcdev) return pmc_core_resume_common(pmcdev); } -static struct pmc_dev_info cnp_pmc_dev = { +struct pmc_dev_info cnp_pmc_dev = { .map = &cnp_reg_map, .suspend = cnl_suspend, .resume = cnl_resume, }; -int cnp_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &cnp_pmc_dev); -} diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c index 45efe0e948831..d2ce52366b1c4 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -1390,29 +1390,29 @@ int generic_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info) } static const struct x86_cpu_id intel_pmc_core_ids[] = { - X86_MATCH_VFM(INTEL_SKYLAKE_L, spt_core_init), - X86_MATCH_VFM(INTEL_SKYLAKE, spt_core_init), - X86_MATCH_VFM(INTEL_KABYLAKE_L, spt_core_init), - X86_MATCH_VFM(INTEL_KABYLAKE, spt_core_init), - X86_MATCH_VFM(INTEL_CANNONLAKE_L, cnp_core_init), - X86_MATCH_VFM(INTEL_ICELAKE_L, icl_core_init), - X86_MATCH_VFM(INTEL_ICELAKE_NNPI, icl_core_init), - X86_MATCH_VFM(INTEL_COMETLAKE, cnp_core_init), - X86_MATCH_VFM(INTEL_COMETLAKE_L, cnp_core_init), - X86_MATCH_VFM(INTEL_TIGERLAKE_L, tgl_l_core_init), - X86_MATCH_VFM(INTEL_TIGERLAKE, tgl_core_init), - X86_MATCH_VFM(INTEL_ATOM_TREMONT, tgl_l_core_init), - X86_MATCH_VFM(INTEL_ATOM_TREMONT_L, icl_core_init), - X86_MATCH_VFM(INTEL_ROCKETLAKE, tgl_core_init), - X86_MATCH_VFM(INTEL_ALDERLAKE_L, tgl_l_core_init), - X86_MATCH_VFM(INTEL_ATOM_GRACEMONT, tgl_l_core_init), - X86_MATCH_VFM(INTEL_ALDERLAKE, adl_core_init), - X86_MATCH_VFM(INTEL_RAPTORLAKE_P, tgl_l_core_init), - X86_MATCH_VFM(INTEL_RAPTORLAKE, adl_core_init), - X86_MATCH_VFM(INTEL_RAPTORLAKE_S, adl_core_init), - X86_MATCH_VFM(INTEL_METEORLAKE_L, mtl_core_init), - X86_MATCH_VFM(INTEL_ARROWLAKE, arl_core_init), - X86_MATCH_VFM(INTEL_LUNARLAKE_M, lnl_core_init), + X86_MATCH_VFM(INTEL_SKYLAKE_L, &spt_pmc_dev), + X86_MATCH_VFM(INTEL_SKYLAKE, &spt_pmc_dev), + X86_MATCH_VFM(INTEL_KABYLAKE_L, &spt_pmc_dev), + X86_MATCH_VFM(INTEL_KABYLAKE, &spt_pmc_dev), + X86_MATCH_VFM(INTEL_CANNONLAKE_L, &cnp_pmc_dev), + X86_MATCH_VFM(INTEL_ICELAKE_L, &icl_pmc_dev), + X86_MATCH_VFM(INTEL_ICELAKE_NNPI, &icl_pmc_dev), + X86_MATCH_VFM(INTEL_COMETLAKE, &cnp_pmc_dev), + X86_MATCH_VFM(INTEL_COMETLAKE_L, &cnp_pmc_dev), + X86_MATCH_VFM(INTEL_TIGERLAKE_L, &tgl_l_pmc_dev), + X86_MATCH_VFM(INTEL_TIGERLAKE, &tgl_pmc_dev), + X86_MATCH_VFM(INTEL_ATOM_TREMONT, &tgl_l_pmc_dev), + X86_MATCH_VFM(INTEL_ATOM_TREMONT_L, &icl_pmc_dev), + X86_MATCH_VFM(INTEL_ROCKETLAKE, &tgl_pmc_dev), + X86_MATCH_VFM(INTEL_ALDERLAKE_L, &tgl_l_pmc_dev), + X86_MATCH_VFM(INTEL_ATOM_GRACEMONT, &tgl_l_pmc_dev), + X86_MATCH_VFM(INTEL_ALDERLAKE, &adl_pmc_dev), + X86_MATCH_VFM(INTEL_RAPTORLAKE_P, &tgl_l_pmc_dev), + X86_MATCH_VFM(INTEL_RAPTORLAKE, &adl_pmc_dev), + X86_MATCH_VFM(INTEL_RAPTORLAKE_S, &adl_pmc_dev), + X86_MATCH_VFM(INTEL_METEORLAKE_L, &mtl_pmc_dev), + X86_MATCH_VFM(INTEL_ARROWLAKE, &arl_pmc_dev), + X86_MATCH_VFM(INTEL_LUNARLAKE_M, &lnl_pmc_dev), {} }; @@ -1496,7 +1496,7 @@ static int pmc_core_probe(struct platform_device *pdev) static bool device_initialized; struct pmc_dev *pmcdev; const struct x86_cpu_id *cpu_id; - int (*core_init)(struct pmc_dev *pmcdev); + struct pmc_dev_info *pmc_dev_info; struct pmc *primary_pmc; int ret; @@ -1516,7 +1516,7 @@ static int pmc_core_probe(struct platform_device *pdev) if (!cpu_id) return -ENODEV; - core_init = (int (*)(struct pmc_dev *))cpu_id->driver_data; + pmc_dev_info = (struct pmc_dev_info *)cpu_id->driver_data; /* Primary PMC */ primary_pmc = devm_kzalloc(&pdev->dev, sizeof(*primary_pmc), GFP_KERNEL); @@ -1538,11 +1538,11 @@ static int pmc_core_probe(struct platform_device *pdev) * Sunrisepoint PCH regmap can't be used. Use Cannon Lake PCH regmap * in this case. */ - if (core_init == spt_core_init && !pci_dev_present(pmc_pci_ids)) - core_init = cnp_core_init; + if (pmc_dev_info == &spt_pmc_dev && !pci_dev_present(pmc_pci_ids)) + pmc_dev_info = &cnp_pmc_dev; mutex_init(&pmcdev->lock); - ret = core_init(pmcdev); + ret = generic_core_init(pmcdev, pmc_dev_info); if (ret) { pmc_core_clean_structure(pdev); return ret; diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h index 9430e4209ce97..771f06b193c66 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -615,15 +615,16 @@ extern void pmc_core_set_device_d3(unsigned int device); extern int pmc_core_ssram_init(struct pmc_dev *pmcdev, int func); int generic_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info); -int spt_core_init(struct pmc_dev *pmcdev); -int cnp_core_init(struct pmc_dev *pmcdev); -int icl_core_init(struct pmc_dev *pmcdev); -int tgl_core_init(struct pmc_dev *pmcdev); -int tgl_l_core_init(struct pmc_dev *pmcdev); -int adl_core_init(struct pmc_dev *pmcdev); -int mtl_core_init(struct pmc_dev *pmcdev); -int arl_core_init(struct pmc_dev *pmcdev); -int lnl_core_init(struct pmc_dev *pmcdev); + +extern struct pmc_dev_info spt_pmc_dev; +extern struct pmc_dev_info cnp_pmc_dev; +extern struct pmc_dev_info icl_pmc_dev; +extern struct pmc_dev_info tgl_l_pmc_dev; +extern struct pmc_dev_info tgl_pmc_dev; +extern struct pmc_dev_info adl_pmc_dev; +extern struct pmc_dev_info mtl_pmc_dev; +extern struct pmc_dev_info arl_pmc_dev; +extern struct pmc_dev_info lnl_pmc_dev; void arl_specific_init(struct pmc_dev *pmcdev); void mtl_specific_init(struct pmc_dev *pmcdev); diff --git a/drivers/platform/x86/intel/pmc/icl.c b/drivers/platform/x86/intel/pmc/icl.c index 0e4565dea0452..6952c8ef58a01 100644 --- a/drivers/platform/x86/intel/pmc/icl.c +++ b/drivers/platform/x86/intel/pmc/icl.c @@ -50,11 +50,6 @@ const struct pmc_reg_map icl_reg_map = { .etr3_offset = ETR3_OFFSET, }; -static struct pmc_dev_info icl_pmc_dev = { +struct pmc_dev_info icl_pmc_dev = { .map = &icl_reg_map, }; - -int icl_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &icl_pmc_dev); -} diff --git a/drivers/platform/x86/intel/pmc/lnl.c b/drivers/platform/x86/intel/pmc/lnl.c index 957d7a9062397..bbe707c37703f 100644 --- a/drivers/platform/x86/intel/pmc/lnl.c +++ b/drivers/platform/x86/intel/pmc/lnl.c @@ -550,7 +550,7 @@ static int lnl_resume(struct pmc_dev *pmcdev) return cnl_resume(pmcdev); } -static struct pmc_dev_info lnl_pmc_dev = { +struct pmc_dev_info lnl_pmc_dev = { .map = &lnl_socm_reg_map, .suspend = cnl_suspend, .resume = lnl_resume, @@ -561,8 +561,3 @@ void lnl_specific_init(struct pmc_dev *pmcdev) { lnl_d3_fixup(); } - -int lnl_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &lnl_pmc_dev); -} diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c index 2a7d79dd37d6a..fe10726962733 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -990,7 +990,7 @@ static int mtl_resume(struct pmc_dev *pmcdev) return cnl_resume(pmcdev); } -static struct pmc_dev_info mtl_pmc_dev = { +struct pmc_dev_info mtl_pmc_dev = { .func = 2, .dmu_guid = MTL_PMT_DMU_GUID, .regmap_list = mtl_pmc_info_list, @@ -1004,8 +1004,3 @@ void mtl_specific_init(struct pmc_dev *pmcdev) { mtl_d3_fixup(); } - -int mtl_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &mtl_pmc_dev); -} diff --git a/drivers/platform/x86/intel/pmc/spt.c b/drivers/platform/x86/intel/pmc/spt.c index ab5f66fcb0c30..956b2ec1c7510 100644 --- a/drivers/platform/x86/intel/pmc/spt.c +++ b/drivers/platform/x86/intel/pmc/spt.c @@ -134,11 +134,6 @@ const struct pmc_reg_map spt_reg_map = { .pm_vric1_offset = SPT_PMC_VRIC1_OFFSET, }; -static struct pmc_dev_info spt_pmc_dev = { +struct pmc_dev_info spt_pmc_dev = { .map = &spt_reg_map, }; - -int spt_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &spt_pmc_dev); -} diff --git a/drivers/platform/x86/intel/pmc/tgl.c b/drivers/platform/x86/intel/pmc/tgl.c index 29a9109afc782..c2f935cb29a7a 100644 --- a/drivers/platform/x86/intel/pmc/tgl.c +++ b/drivers/platform/x86/intel/pmc/tgl.c @@ -285,14 +285,14 @@ void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev) ACPI_FREE(out_obj); } -static struct pmc_dev_info tgl_l_pmc_dev = { +struct pmc_dev_info tgl_l_pmc_dev = { .map = &tgl_reg_map, .suspend = cnl_suspend, .resume = cnl_resume, .arch_specific = tgl_specific_init, }; -static struct pmc_dev_info tgl_pmc_dev = { +struct pmc_dev_info tgl_pmc_dev = { .map = &tgl_h_reg_map, .suspend = cnl_suspend, .resume = cnl_resume, @@ -303,13 +303,3 @@ void tgl_specific_init(struct pmc_dev *pmcdev) { pmc_core_get_tgl_lpm_reqs(pmcdev->pdev); } - -int tgl_l_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &tgl_l_pmc_dev); -} - -int tgl_core_init(struct pmc_dev *pmcdev) -{ - return generic_core_init(pmcdev, &tgl_pmc_dev); -}