From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796189615; b=vTlSFQz9V2lScykKkbHhLQHtM0eBl+ir9Pj2uV4u1r+NQ23rKXqWKCcnnYDmJy4yymhA K0HdpByt2VF5/npSNDyaEv3aqWyrkjAqIk6eqbtARKY+WTaGgM90PQHwT9RmQpptgRS4X nu/Sw0EDdjiLEn/LbSfbri8rzPdEAELJ0J4xtAla7607czzzJX1Pv7Nrp2nce2M6jesrg CkoRdKrQJ83DMaduLmx7xdM2jZ+L4LomAiT7gJn0wp/Q1kr+U8xmJoE2FrQOj+igfOPib 0QqsCj0CKYEYQIucuoeN8B9VMM0CzkPf2DY+VZzBHrwoGsQtTmbLvogQy1QiQV7oPlA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796189615; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=oNdkHq8YcsFWnADFZPLrA8NmvLWbbVhBWn6hRJmQrOk=; b=nv7jrxoU6UIAmQfC6idPWyB5lDLmB912vkkFgmMFJVOPaHl3yNeI6SUjOZrGrrDngJ4B lF7aUd5GCoMIJtOJV4YnnsNwfQeoV9XCp94TmqQZctZ7WVI5h1AZWde9qNwu5msjY+LBy Bh2otDdNNlcOXXiEApX6V7WCwUNBj+hixLgVosDeI6E5liD0GjLH8rOT+S8iuRyDCCxsg iWdJhYpwtAMpSJqYf2bQ0ssh5rLLG0o8p81kMD/w6viN1lMrrcGAk76ajzAhXv//8U7F9 9J8uwys0JHriqsmGFtHSePwg/aQ0Ft3QW8wjONYN9BRs7cqQRZwCPJU3fxblNnFY2Xw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yDIoYm0U; arc=none smtp.remote-ip=209.85.216.44 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B8C3606A322 for ; Wed, 2 Dec 2026 05:33:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9B8C3606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yDIoYm0U Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-3b4cd193b50so4459339a91.1 for ; Tue, 01 Dec 2026 21:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796189614; x=1796794414; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=oNdkHq8YcsFWnADFZPLrA8NmvLWbbVhBWn6hRJmQrOk=; b=yDIoYm0UsusUgks6GIz/pVkhECG3ElFNfBiL1mAvk2nU3EjHuGuQjHV9PUioMbg/q9 KGtRRfBx06qf2LS5XZovNhXetfUJ9N/0pve8iw/ooNRBhc6+MAZjY4eQNqILtJzgCQyr SVEhM3mfB4LatfTWGKyCKl4D8DZ7Bw365WufwpQ7vtVjeyIzgdIVVhXawjFO+q+Tr97z 3V4ldgssFQW3dGxDwT4jiM2yQzQC54iaQS/S5xexEdycXnwH5Y/5qdUiylbPIaPCQhJC ryhBkfKAl0m9WUUEJNsJnOnXHEyyZTfz95CJPCwWkOj9EB8cMxoD5Y2iXMEyXf8igh77 j/dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796189614; x=1796794414; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=oNdkHq8YcsFWnADFZPLrA8NmvLWbbVhBWn6hRJmQrOk=; b=cwP9xGef/66UlBWkWTXLJbTSch9g4belZuHUmnhxXqdH1zFKDVKXcfODz3xic3wyHV cnKnN8q9lumcxzK/TPqKUJfBZ5BSsFXQ++5QTPlyzDAp/bdd1dkW9lVJzAlecL8nSN61 oDP37stsSy6rhTBMKWKRXQYpi3BdUrwzhz4vrTnhGpNFJsyIp9dvH7Dhy9HF5RRaomBq b8AyhjBGAyKy0KkgvXK/R4rSKg21sdw9aXJNzTQrl3XWjSMvXxbQ0tnBAtrl5M3YrMMt 2fwYVU6pZzcYHLvPiFwAftNSap0R4gxIcILtpCDL/zQSg+HJudirecCJ6SsVKqixRoj0 Hj6w== X-Forwarded-Encrypted: i=1; AL+hErGJ/9WkItVGOxk/GHLeKFQDsbqfRjllMPFt/+CQrgfonwdH13uJfu9a2AeOsoqY95Iv3K9AmLD4sG2Smnw=@vger.kernel.org X-Gm-Message-State: APuU4Z/TGeVC/J7nFXGYfuug8Y4aNSAMul+O32usgkvBdNWwNyrduEZW T7xfSTeUnc1kt6gwrtfjw0iYJ6+jFRaMrOj6bbKCNamF1obtjpSsfa5c X-Gm-Gg: AZFdTZdUtepmBrAo/dwNCm5a2mkychSnGKxyCHHW8IvDTR+xPP1DaA/5i5v3pwuyM9m I2AYUATq02dp0B2eaW3GaDMw5M4/w2ie85zw3sizz4BHhtD45CrCzXfdG4XPVNNtL2603nWn/CK aUrBs3SeST6ej5NsMsRiKbRUlf1scspafjWzeRojkqUXHMpvfc+5I7Ycy6uwJPVGgs5qYc3Lg2S 3KcWaIxeqUqnl4+MstIhXINjx33LLmA68KmWq5WMURd+J7ToW6cEpG5YpaiEB3Ed+pyCheZgZ+x r4MJjZervExA4OphQDsj/59EvILTvQKhqanJqDslsCy6U8fKz0/1d2BXhdHIfmwrIFLZZZeAwmy ZhJ5biGVwoo4psmaKG6RAUEiXyT+k3jJDt2I2STry03tnUNa0ALgZYGPVmtmcBNFOMcZenHeXRv 8yPJ3CpC5+EO/LvN4qz7Cnln57akmh/sET4l71g9xG4F+k9vI/aOr+UDDPttqC/V7G3YhqBFQDk WK00McExRuNEeSyvPQBKcJqCCWJnzpYmsA/hq8LoMcoAYuIEql/j/dCwYANU3ozblHV7fp5OUQW /GV9jhibhYd4BXQN5XhdpIAJKXGO X-Received: by 2002:a17:90b:5887:b0:3aa:fc22:8aad with SMTP id 98e67ed59e1d1-3b41c97c995mr40910323a91.54.1796189613703; Tue, 01 Dec 2026 21:33:33 -0800 (PST) Received: from localhost ([2408:8210:2436:950:d967:5f76:cd5a:951d]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b4b3c71192sm45247631a91.5.2026.12.01.21.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 21:33:33 -0800 (PST) Date: Wed, 2 Dec 2026 13:33:26 +0800 From: Mingyou Chen To: Bozhen Peng Cc: Ilpo Jarvinen , Ilya Gladyshev , Hans de Goede , Armin Wolf , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Message-ID: References: <90c6fa9e-6f3a-4618-af97-e39d8daf18ed@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 26/12/01 08:04PM, Bozhen Peng wrote: > My WUJIE15 PRO HPT uses performance (0), balanced (1) and low-power (2), > which differ from the default mapping. > > USB-C is its only external power input. I use the ACPI adapter's _PSR to > check power because the USB-C supply's cached ONLINE value can be stale > after unplugging during suspend. Failed or invalid queries return an error. I don't agree with this method, here's why: I think this is just a temporary workaround, it doesn't solve the actual stale state problem in the power_supply subsystem. Is there a reason this can't be fixed in the underlying USB-C driver's resume path instead (likely under drivers/usb/typec/ucsi/)? > > HPT reports two fans, in Fan 2/Fan 1 order, and no CPU temperature. I hide > the unsupported GPU mode, keyboard RGB mode and fan-boost controls, while > keeping keyboard backlight brightness available. > > Signed-off-by: Bozhen Peng > --- > drivers/platform/x86/bitland-mifs-wmi.c | 64 +++++++++++++++++++++++++ > 1 file changed, 64 insertions(+) > > diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c > index 9fa77e667a1a8ec7e152555fd47a56711e484095..88b35afe02a3ce65d53433387e23b848e4e64d29 100644 > --- a/drivers/platform/x86/bitland-mifs-wmi.c > +++ b/drivers/platform/x86/bitland-mifs-wmi.c > @@ -101,6 +101,9 @@ struct bitland_hwmon_config { > }; > > static const struct bitland_hwmon_config default_hwmon_config; > +static const struct bitland_hwmon_config hpt_hwmon_config; > + > +static int bitland_hpt_check_performance_capability(void); > > struct bitland_mifs_quirks { > const struct bitland_profile_entry *profile_entries; > @@ -151,6 +154,20 @@ static const struct bitland_mifs_quirks tm2424_quirks = { > .skip_ac_type_check = true, > }; > > +static const struct bitland_profile_entry hpt_profile_entries[] = { > + { PLATFORM_PROFILE_LOW_POWER, 0x02 }, > + { PLATFORM_PROFILE_BALANCED, 0x01 }, > + { PLATFORM_PROFILE_PERFORMANCE, 0x00 }, > +}; > + > +static const struct bitland_mifs_quirks hpt_quirks = { > + .profile_entries = hpt_profile_entries, > + .num_profile_entries = ARRAY_SIZE(hpt_profile_entries), > + .check_performance_capability = bitland_hpt_check_performance_capability, > + .hwmon = &hpt_hwmon_config, > + .disable_extra_controls = true, > +}; > + > static const struct dmi_system_id bitland_mifs_dmi_table[] = { > { > .matches = { > @@ -166,6 +183,14 @@ static const struct dmi_system_id bitland_mifs_dmi_table[] = { > }, > .driver_data = (void *)&tm2424_quirks, > }, > + { > + .matches = { > + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "MECHREVO"), > + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "WUJIE15 PRO"), > + DMI_EXACT_MATCH(DMI_BOARD_NAME, "WUJIE15 Series-HPT"), > + }, > + .driver_data = (void *)&hpt_quirks, > + }, > {} > }; > > @@ -355,6 +380,25 @@ static int laptop_profile_get(struct device *dev, > return -EINVAL; > } > > +static int bitland_hpt_check_performance_capability(void) > +{ > + struct acpi_device *adapter; > + unsigned long long online; > + acpi_status status; > + > + adapter = acpi_dev_get_first_match_dev("ACPI0003", NULL, -1); > + if (!adapter) > + return -ENODEV; > + > + /* USB-C ONLINE may be stale on resume; _PSR reads current EC state. */ > + status = acpi_evaluate_integer(adapter->handle, "_PSR", NULL, &online); > + acpi_dev_put(adapter); > + if (ACPI_FAILURE(status) || online > 1) > + return -EIO; > + > + return online ? 0 : -EOPNOTSUPP; > +} > + > static int bitland_pp_check_capability(struct bitland_mifs_wmi_data *data) > { > struct bitland_mifs_input input = { > @@ -572,6 +616,9 @@ static const char * const default_fan_labels[] = { > "SYS", /* 2 */ > }; > > +/* The HPT firmware returns Fan 2 before Fan 1. */ > +static const char * const hpt_fan_labels[] = { "Fan 2", "Fan 1" }; > + > static const struct bitland_hwmon_config * > bitland_hwmon_config(const struct bitland_mifs_wmi_data *data) > { > @@ -642,6 +689,12 @@ static const struct hwmon_channel_info *laptop_hwmon_info[] = { > NULL > }; > > +static const struct hwmon_channel_info *hpt_hwmon_info[] = { > + HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT | HWMON_F_LABEL, > + HWMON_F_INPUT | HWMON_F_LABEL), > + NULL > +}; > + > static const struct hwmon_ops laptop_hwmon_ops = { > .visible = 0444, > .read = laptop_hwmon_read, > @@ -653,12 +706,23 @@ static const struct hwmon_chip_info laptop_chip_info = { > .info = laptop_hwmon_info, > }; > > +static const struct hwmon_chip_info hpt_chip_info = { > + .ops = &laptop_hwmon_ops, > + .info = hpt_hwmon_info, > +}; > + > static const struct bitland_hwmon_config default_hwmon_config = { > .chip_info = &laptop_chip_info, > .fan_labels = default_fan_labels, > .num_fans = ARRAY_SIZE(default_fan_labels), > }; > > +static const struct bitland_hwmon_config hpt_hwmon_config = { > + .chip_info = &hpt_chip_info, > + .fan_labels = hpt_fan_labels, > + .num_fans = ARRAY_SIZE(hpt_fan_labels), > +}; > + > static int laptop_kbd_led_set(struct led_classdev *led_cdev, > enum led_brightness value) > {