platform/x86/amd/pmf: Make source_as_str() as non-static
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Tue, 12 Dec 2023 01:47:02 +0000 (07:17 +0530)
committerHans de Goede <hdegoede@redhat.com>
Mon, 18 Dec 2023 11:47:46 +0000 (12:47 +0100)
Add amd_pmf prefix to source_as_str() function, so that the function name
does not look generic. As this is a helper function make it as non-static
so that it can be reused across multiple PMF features.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20231212014705.2017474-10-Shyam-sundar.S-k@amd.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/amd/pmf/pmf.h
drivers/platform/x86/amd/pmf/sps.c

index 50f98c398727900fe752a008817f3a17bfb77b62..25e369477f863690fa0b3cc0a0ce365094d4523e 100644 (file)
@@ -600,6 +600,7 @@ int apmf_get_static_slider_granular(struct amd_pmf_dev *pdev,
                                    struct apmf_static_slider_granular_output *output);
 bool is_pprof_balanced(struct amd_pmf_dev *pmf);
 int amd_pmf_power_slider_update_event(struct amd_pmf_dev *dev);
+const char *amd_pmf_source_as_str(unsigned int state);
 
 
 int apmf_update_fan_idx(struct amd_pmf_dev *pdev, bool manual, u32 idx);
index a70e67749be33476be9a3ba178cd88a55b87410f..33e23e25c8b1efe6c2c032ecdcbfdb6672949128 100644 (file)
@@ -27,7 +27,7 @@ static const char *slider_as_str(unsigned int state)
        }
 }
 
-static const char *source_as_str(unsigned int state)
+const char *amd_pmf_source_as_str(unsigned int state)
 {
        switch (state) {
        case POWER_SOURCE_AC:
@@ -47,7 +47,8 @@ static void amd_pmf_dump_sps_defaults(struct amd_pmf_static_slider_granular *dat
 
        for (i = 0; i < POWER_SOURCE_MAX; i++) {
                for (j = 0; j < POWER_MODE_MAX; j++) {
-                       pr_debug("--- Source:%s Mode:%s ---\n", source_as_str(i), slider_as_str(j));
+                       pr_debug("--- Source:%s Mode:%s ---\n", amd_pmf_source_as_str(i),
+                                slider_as_str(j));
                        pr_debug("SPL: %u mW\n", data->prop[i][j].spl);
                        pr_debug("SPPT: %u mW\n", data->prop[i][j].sppt);
                        pr_debug("SPPT_ApuOnly: %u mW\n", data->prop[i][j].sppt_apu_only);