X86 platform drivers
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,  Patil.Reddy@amd.com
Subject: Re: [PATCH 5/7] platform/x86/amd/pmf: Add support to get APTS index numbers for static slider
Date: Tue, 27 Feb 2024 16:13:33 +0200 (EET)	[thread overview]
Message-ID: <91a406cd-bf71-ab86-09ba-97d90f2ae1fd@linux.intel.com> (raw)
In-Reply-To: <20240227125520.3153140-6-Shyam-sundar.S-k@amd.com>

On Tue, 27 Feb 2024, Shyam Sundar S K wrote:

> APMF spec has a newer section called the APTS (AMD Performance and
> Thermal State) information, where each slider/power mode is associated
> with an index number.
> 
> Add support to get these indices for the Static Slider.
> 
> Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
>  drivers/platform/x86/amd/pmf/acpi.c | 10 +++++++
>  drivers/platform/x86/amd/pmf/pmf.h  | 24 +++++++++++++++++
>  drivers/platform/x86/amd/pmf/sps.c  | 42 ++++++++++++++++++++++++++++-
>  3 files changed, 75 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c
> index 0fc8ad0ac3e9..28df45c058db 100644
> --- a/drivers/platform/x86/amd/pmf/acpi.c
> +++ b/drivers/platform/x86/amd/pmf/acpi.c
> @@ -96,6 +96,16 @@ int is_apmf_func_supported(struct amd_pmf_dev *pdev, unsigned long index)
>  	return !!(pdev->supported_func & BIT(index - 1));
>  }
>  
> +int apmf_get_static_slider_granular_v2(struct amd_pmf_dev *pdev,
> +				       struct apmf_static_slider_granular_output_v2 *data)
> +{
> +	if (!is_apmf_func_supported(pdev, APMF_FUNC_STATIC_SLIDER_GRANULAR))
> +		return -EINVAL;
> +
> +	return apmf_if_call_store_buffer(pdev, APMF_FUNC_STATIC_SLIDER_GRANULAR,
> +								data, sizeof(*data));
> +}
> +
>  int apmf_get_static_slider_granular(struct amd_pmf_dev *pdev,
>  				    struct apmf_static_slider_granular_output *data)
>  {
> diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h
> index 5cad11369697..b27e96aeac23 100644
> --- a/drivers/platform/x86/amd/pmf/pmf.h
> +++ b/drivers/platform/x86/amd/pmf/pmf.h
> @@ -85,6 +85,7 @@
>  #define MAX_OPERATION_PARAMS					4
>  
>  #define PMF_IF_V1		1
> +#define PMF_IF_V2		2
>  
>  struct sbios_hb_event_v2 {
>  	u16 size;
> @@ -264,6 +265,17 @@ struct amd_pmf_dev {
>  	u16 pmf_if_version;
>  };
>  
> +struct apmf_sps_prop_granular_v2 {
> +	u8 ac_best_perf;
> +	u8 ac_balanced;
> +	u8 ac_best_pwr_efficiency;
> +	u8 ac_energy_saver;
> +	u8 dc_best_perf;
> +	u8 dc_balanced;
> +	u8 dc_best_pwr_efficiency;
> +	u8 dc_battery_saver;

I started to wonder if these could be made into an two element array with 
4xu8 in each, one for AC and DC because it would simplify some other code 
in the subsequent patches (and perhaps even in this patch)?

-- 
 i.


  parent reply	other threads:[~2024-02-27 14:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 12:55 [PATCH 0/7] platform/x86/amd/pmf: Updates to amd-pmf driver Shyam Sundar S K
2024-02-27 12:55 ` [PATCH 1/7] platform/x86/amd/pmf: Differentiate PMF ACPI versions Shyam Sundar S K
2024-02-27 18:47   ` Kuppuswamy Sathyanarayanan
2024-02-27 12:55 ` [PATCH 2/7] platform/x86/amd/pmf: Disable debugfs support for querying power thermals Shyam Sundar S K
2024-02-27 15:55   ` Kuppuswamy Sathyanarayanan
2024-02-28  6:31     ` Shyam Sundar S K
2024-02-27 12:55 ` [PATCH 3/7] platform/x86/amd/pmf: Add support to get sbios requests in PMF driver Shyam Sundar S K
2024-02-27 13:28   ` Ilpo Järvinen
2024-02-28  6:26     ` Shyam Sundar S K
2024-02-29 13:19       ` Ilpo Järvinen
2024-03-06  5:07         ` Shyam Sundar S K
2024-03-06 10:34           ` Ilpo Järvinen
2024-03-06 10:45             ` Shyam Sundar S K
2024-03-06 10:49               ` Ilpo Järvinen
2024-02-27 12:55 ` [PATCH 4/7] platform/x86/amd/pmf: Add support to notify sbios heart beat event Shyam Sundar S K
2024-02-27 13:36   ` Ilpo Järvinen
2024-02-27 12:55 ` [PATCH 5/7] platform/x86/amd/pmf: Add support to get APTS index numbers for static slider Shyam Sundar S K
2024-02-27 13:48   ` Ilpo Järvinen
2024-02-27 14:13   ` Ilpo Järvinen [this message]
2024-02-28  6:31     ` Shyam Sundar S K
2024-02-27 12:55 ` [PATCH 6/7] platform/x86/amd/pmf: Add support to get sps default APTS index values Shyam Sundar S K
2024-02-27 13:59   ` Ilpo Järvinen
2024-02-27 12:55 ` [PATCH 7/7] platform/x86/amd/pmf: Update sps power thermals according to the platform-profiles Shyam Sundar S K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91a406cd-bf71-ab86-09ba-97d90f2ae1fd@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Patil.Reddy@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox