Skip to content

Commit

Permalink
platform/x86:intel/pmc: Add support to handle multiple PMCs
Browse files Browse the repository at this point in the history
To support platforms with multiple PMCs, add a PMC device structure to
support each PMC instance.

Signed-off-by: Xi Pardee <xi.pardee@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230613225347.2720665-4-rajvi.jingar@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Xi Pardee authored and Hans de Goede committed Jun 20, 2023
1 parent 8049512 commit 1c709ae
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 141 deletions.
5 changes: 3 additions & 2 deletions drivers/platform/x86/intel/pmc/adl.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,11 @@ const struct pmc_reg_map adl_reg_map = {

int adl_core_init(struct pmc_dev *pmcdev)
{
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret;

pmcdev->map = &adl_reg_map;
ret = get_primary_reg_base(pmcdev);
pmc->map = &adl_reg_map;
ret = get_primary_reg_base(pmc);
if (ret)
return ret;

Expand Down
5 changes: 3 additions & 2 deletions drivers/platform/x86/intel/pmc/cnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ const struct pmc_reg_map cnp_reg_map = {

int cnp_core_init(struct pmc_dev *pmcdev)
{
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret;

pmcdev->map = &cnp_reg_map;
ret = get_primary_reg_base(pmcdev);
pmc->map = &cnp_reg_map;
ret = get_primary_reg_base(pmc);
if (ret)
return ret;

Expand Down
Loading

0 comments on commit 1c709ae

Please sign in to comment.