Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86:intel/pmc: Improve function to show substate header

Refactor pmc_core_substate_req_header_show() to accept a new argument.
This is a preparation patch to introduce a new way to show Low Power
Mode substate requirement data for platforms starting from Panther
Lake. Increased the size for the name column as the Low Power Mode
requirement register name is longer in newer platforms.

Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
Link: https://patch.msgid.link/20250910210629.11198-4-xi.pardee@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Xi Pardee and committed by
Ilpo Järvinen
612326e0 1e508af6

+16 -6
+16 -6
drivers/platform/x86/intel/pmc/core.c
··· 11 11 12 12 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 13 13 14 + enum header_type { 15 + HEADER_STATUS, 16 + HEADER_VALUE, 17 + }; 18 + 14 19 #include <linux/bitfield.h> 15 20 #include <linux/debugfs.h> 16 21 #include <linux/delay.h> ··· 833 828 } 834 829 DEFINE_SHOW_ATTRIBUTE(pmc_core_substate_l_sts_regs); 835 830 836 - static void pmc_core_substate_req_header_show(struct seq_file *s, int pmc_index) 831 + static void pmc_core_substate_req_header_show(struct seq_file *s, int pmc_index, 832 + enum header_type type) 837 833 { 838 834 struct pmc_dev *pmcdev = s->private; 839 835 int mode; 840 836 841 - seq_printf(s, "%30s |", "Element"); 837 + seq_printf(s, "%40s |", "Element"); 842 838 pmc_for_each_mode(mode, pmcdev) 843 839 seq_printf(s, " %9s |", pmc_lpm_modes[mode]); 844 840 845 - seq_printf(s, " %9s |", "Status"); 846 - seq_printf(s, " %11s |\n", "Live Status"); 841 + if (type == HEADER_STATUS) { 842 + seq_printf(s, " %9s |", "Status"); 843 + seq_printf(s, " %11s |\n", "Live Status"); 844 + } else { 845 + seq_printf(s, " %9s |\n", "Value"); 846 + } 847 847 } 848 848 849 849 static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unused) ··· 882 872 continue; 883 873 884 874 /* Display the header */ 885 - pmc_core_substate_req_header_show(s, pmc_index); 875 + pmc_core_substate_req_header_show(s, pmc_index, HEADER_STATUS); 886 876 887 877 /* Loop over maps */ 888 878 for (mp = 0; mp < num_maps; mp++) { ··· 920 910 } 921 911 922 912 /* Display the element name in the first column */ 923 - seq_printf(s, "pmc%d: %26s |", pmc_index, map[i].name); 913 + seq_printf(s, "pmc%d: %34s |", pmc_index, map[i].name); 924 914 925 915 /* Loop over the enabled states and display if required */ 926 916 pmc_for_each_mode(mode, pmcdev) {