mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: "Werner Sembach" <wse@tuxedocomputers.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] platform/x86: uniwill-laptop: Remove cTGP control from unsupported devices
Date: Thu, 3 Dec 2026 16:15:56 +0100	[thread overview]
Message-ID: <e0e7ee44-4dc2-4bdb-98a2-c9d13aa26022@gmx.de> (raw)
In-Reply-To: <20261124165230.680864-1-wse@tuxedocomputers.com>

Am 24.11.26 um 17:39 schrieb Werner Sembach:
> Some devices like the InfinityBook Pro series have Dynamic Boost support,
> but the cTGP setting is actually ignored.
> 
> This commit adds the ability to still initialize DB, but hide the noop cTGP
> sysfs attribute and applies this to the respective devices.
> 
> Currently there is no functional difference between setting only
> UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL and UNIWILL_FEATURE_NVIDIA_DB_SUPPORT +
> UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL. In both cases the initialization
> procedure is still the same and UNIWILL_FEATURE_NVIDIA_DB_SUPPORT has no
> sysfs attributes to show or hide. However for the possibillity of this to
> change in the future and semantical reasons, the bits should still be set
> accordingly.

Hi,

this is much better, but i think without support for cTGP control, the
EC_ADDR_CTGP_DB_CTGP_OFFSET register should not be touched at all during
initialization. Also setting CTGP_DB_CTGP_ENABLE inside 
EC_ADDR_CTGP_DB_CTRL should be skipped in such cases, so the EC knows 
that we do not intent to take control of the cTGP setting.

Do you know if EC_ADDR_CTGP_DB_TPP_OFFSET has some meaning with dynamic 
boost?

Thanks,
Armin Wolf

> Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
> ---
> V2: Fix "force" mode not respecting mutual exclusivity of new feature bit.
> V3: Change semantics from "DB only" to "DB support" undoing V2 changes in
>      the process.
> 
>   drivers/platform/x86/uniwill/uniwill-acpi.c | 39 +++++++++++++++------
>   1 file changed, 29 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform/x86/uniwill/uniwill-acpi.c
> index e2a6a704e942e..3d8f40239708c 100644
> --- a/drivers/platform/x86/uniwill/uniwill-acpi.c
> +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c
> @@ -365,11 +365,12 @@
>   #define UNIWILL_FEATURE_GPU_TEMP		BIT(7)
>   #define UNIWILL_FEATURE_PRIMARY_FAN		BIT(8)
>   #define UNIWILL_FEATURE_SECONDARY_FAN		BIT(9)
> -#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL	BIT(10)
> -#define UNIWILL_FEATURE_USB_C_POWER_PRIORITY	BIT(11)
> -#define UNIWILL_FEATURE_KEYBOARD_BACKLIGHT	BIT(12)
> -#define UNIWILL_FEATURE_AC_AUTO_BOOT		BIT(13)
> -#define UNIWILL_FEATURE_USB_POWERSHARE		BIT(14)
> +#define UNIWILL_FEATURE_NVIDIA_DB_SUPPORT	BIT(10)
> +#define UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL	BIT(11)
> +#define UNIWILL_FEATURE_USB_C_POWER_PRIORITY	BIT(12)
> +#define UNIWILL_FEATURE_KEYBOARD_BACKLIGHT	BIT(13)
> +#define UNIWILL_FEATURE_AC_AUTO_BOOT		BIT(14)
> +#define UNIWILL_FEATURE_USB_POWERSHARE		BIT(15)
>   UNIWILL_FEATURE_NVIDIA_DB_SUPPORT
>   enum usb_c_power_priority_options {
>   	USB_C_POWER_PRIORITY_CHARGING = 0,
> @@ -1004,7 +1005,9 @@ static int uniwill_nvidia_ctgp_init(struct uniwill_data *data)
>   {
>   	int ret;
>   
> -	if (!uniwill_device_supports(data, UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
> +	if (!uniwill_device_supports_any(data,
> +					 UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
> +					 UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
>   		return 0;
>   
>   	ret = regmap_write(data->regmap, EC_ADDR_CTGP_DB_CTGP_OFFSET, 0);
> @@ -2577,7 +2580,9 @@ static int uniwill_suspend_usb_powershare(struct uniwill_data *data)
>   
>   static int uniwill_suspend_nvidia_ctgp(struct uniwill_data *data)
>   {
> -	if (!uniwill_device_supports(data, UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
> +	if (!uniwill_device_supports_any(data,
> +					 UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
> +					 UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
>   		return 0;
>   
>   	return regmap_clear_bits(data->regmap, EC_ADDR_CTGP_DB_CTRL,
> @@ -2686,7 +2691,9 @@ static int uniwill_resume_usb_powershare(struct uniwill_data *data)
>   
>   static int uniwill_resume_nvidia_ctgp(struct uniwill_data *data)
>   {
> -	if (!uniwill_device_supports(data, UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
> +	if (!uniwill_device_supports_any(data,
> +					 UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
> +					 UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL))
>   		return 0;
>   
>   	return regmap_set_bits(data->regmap, EC_ADDR_CTGP_DB_CTRL,
> @@ -2773,6 +2780,7 @@ static struct uniwill_device_descriptor machenike_l16p_descriptor __initdata = {
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_KEYBOARD_BACKLIGHT |
>   		    UNIWILL_FEATURE_AC_AUTO_BOOT |
> @@ -2789,6 +2797,7 @@ static struct uniwill_device_descriptor mechrevo_yilong15pro_descriptor __initda
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_KEYBOARD_BACKLIGHT |
>   		    UNIWILL_FEATURE_AC_AUTO_BOOT |
> @@ -2805,6 +2814,7 @@ static struct uniwill_device_descriptor mechrevo_jiaolong_series_x6xr55xk __init
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_KEYBOARD_BACKLIGHT |
>   		    UNIWILL_FEATURE_AC_AUTO_BOOT |
> @@ -2845,6 +2855,7 @@ static struct uniwill_device_descriptor lapkc71e_descriptor __initdata = {
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL,
>   	.lightbar_max_intensity = 200,
>   };
> @@ -2910,7 +2921,7 @@ static struct uniwill_device_descriptor phxtqxx_phxagxx_phxaqxx_phxpgxx_descript
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> -		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_USB_C_POWER_PRIORITY |
>   		    UNIWILL_FEATURE_KEYBOARD_BACKLIGHT,
>   	.kbd_led_single_color = true,
> @@ -2925,6 +2936,7 @@ static struct uniwill_device_descriptor gmxmgxx_gmxngxx_gmxxgxx_descriptor __ini
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_USB_C_POWER_PRIORITY |
>   		    UNIWILL_FEATURE_KEYBOARD_BACKLIGHT,
> @@ -2940,6 +2952,7 @@ static struct uniwill_device_descriptor gmxzgxx_gmxtgxx_pol_descriptor __initdat
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_USB_C_POWER_PRIORITY |
>   		    UNIWILL_FEATURE_KEYBOARD_BACKLIGHT,
> @@ -2956,6 +2969,7 @@ static struct uniwill_device_descriptor gmxzgxx_gmxtgxx_ste_descriptor __initdat
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_USB_C_POWER_PRIORITY,
>   	.lightbar_max_intensity = 36,
> @@ -2996,6 +3010,7 @@ static struct uniwill_device_descriptor gmxrgxx_descriptor __initdata = {
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL,
>   	.probe = gmxrgxx_probe,
>   };
> @@ -3009,6 +3024,7 @@ static struct uniwill_device_descriptor gmxagxx_descriptor __initdata = {
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL,
>   	.lightbar_max_intensity = 36,
>   };
> @@ -3021,6 +3037,7 @@ static struct uniwill_device_descriptor gmxxgxx_gmxpxxx_descriptor __initdata =
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL,
>   };
>   
> @@ -3046,6 +3063,7 @@ static struct uniwill_device_descriptor gmxhgxx_descriptor __initdata = {
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_AC_AUTO_BOOT |
>   		    UNIWILL_FEATURE_USB_POWERSHARE |
> @@ -3062,6 +3080,7 @@ static struct uniwill_device_descriptor gmxixxx_xxxx45xx_xxxx55xx_xxxx57xx_descr
>   		    UNIWILL_FEATURE_GPU_TEMP |
>   		    UNIWILL_FEATURE_PRIMARY_FAN |
>   		    UNIWILL_FEATURE_SECONDARY_FAN |
> +		    UNIWILL_FEATURE_NVIDIA_DB_SUPPORT |
>   		    UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL |
>   		    UNIWILL_FEATURE_AC_AUTO_BOOT |
>   		    UNIWILL_FEATURE_USB_POWERSHARE,
> @@ -3106,7 +3125,7 @@ static int phxarxx_phxaqxx_probe(struct uniwill_data *data)
>   
>   	if (value & HAS_GPU)
>   		data->features |= UNIWILL_FEATURE_GPU_TEMP |
> -				  UNIWILL_FEATURE_NVIDIA_CTGP_CONTROL;
> +				  UNIWILL_FEATURE_NVIDIA_DB_SUPPORT;
>   
>   	return 0;
>   };


      reply	other threads:[~2026-12-03 15:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 16:39 Werner Sembach
2026-12-03 15:15 ` Armin Wolf [this message]

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=e0e7ee44-4dc2-4bdb-98a2-c9d13aa26022@gmx.de \
    --to=w_armin@gmx.de \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=wse@tuxedocomputers.com \
    /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

all inboxes | Powered by JetHome®