Update Linux kernel release to v7.2.8-2 for base and BORE kernels
Signed-off-by: Krzysztof Wilczyński <kwilczynski@omarchy.org>
This commit is contained in:
524 files changed
+147294
-88760
No files matched your search
@@ -364,78 +364,6 @@ diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_interface.c b/drivers/hid/am
|
||||
pr_warn_once("Undefined laptop placement\n");
|
||||
}
|
||||
|
||||
diff --git a/drivers/platform/arm64/qcom-hamoa-ec.c b/drivers/platform/arm64/qcom-hamoa-ec.c
|
||||
--- a/drivers/platform/arm64/qcom-hamoa-ec.c
|
||||
+++ b/drivers/platform/arm64/qcom-hamoa-ec.c
|
||||
@@ -92,8 +92,10 @@ static int qcom_ec_read(struct qcom_ec *ec, u8 cmd, u8 resp_len, u8 *resp)
|
||||
return ret;
|
||||
else if (ret == 0 || ret == 0xff)
|
||||
return -EOPNOTSUPP;
|
||||
+ else if (ret != resp_len)
|
||||
+ return -EIO;
|
||||
|
||||
- if (resp[0] >= resp_len)
|
||||
+ if (resp[0] != resp_len - 1)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c
|
||||
--- a/drivers/platform/mellanox/mlxbf-bootctl.c
|
||||
+++ b/drivers/platform/mellanox/mlxbf-bootctl.c
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/arm-smccc.h>
|
||||
+#include <linux/bitfield.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/iopoll.h>
|
||||
diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c
|
||||
--- a/drivers/platform/mellanox/mlxbf-pmc.c
|
||||
+++ b/drivers/platform/mellanox/mlxbf-pmc.c
|
||||
@@ -2262,13 +2262,19 @@ static int mlxbf_pmc_map_counters(struct device *dev)
|
||||
|
||||
static int mlxbf_pmc_probe(struct platform_device *pdev)
|
||||
{
|
||||
- struct acpi_device *acpi_dev = ACPI_COMPANION(&pdev->dev);
|
||||
- const char *hid = acpi_device_hid(acpi_dev);
|
||||
struct device *dev = &pdev->dev;
|
||||
+ struct acpi_device *acpi_dev;
|
||||
struct arm_smccc_res res;
|
||||
+ const char *hid;
|
||||
guid_t guid;
|
||||
int ret;
|
||||
|
||||
+ acpi_dev = ACPI_COMPANION(&pdev->dev);
|
||||
+ if (!acpi_dev)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ hid = acpi_device_hid(acpi_dev);
|
||||
+
|
||||
/* Ensure we have the UUID we expect for this service. */
|
||||
arm_smccc_smc(MLXBF_PMC_SIP_SVC_UID, 0, 0, 0, 0, 0, 0, 0, &res);
|
||||
guid_parse(mlxbf_pmc_svc_uuid_str, &guid);
|
||||
diff --git a/drivers/platform/surface/surface_acpi_notify.c b/drivers/platform/surface/surface_acpi_notify.c
|
||||
--- a/drivers/platform/surface/surface_acpi_notify.c
|
||||
+++ b/drivers/platform/surface/surface_acpi_notify.c
|
||||
@@ -777,12 +777,16 @@ static int san_consumer_links_setup(struct platform_device *pdev)
|
||||
|
||||
static int san_probe(struct platform_device *pdev)
|
||||
{
|
||||
- struct acpi_device *san = ACPI_COMPANION(&pdev->dev);
|
||||
struct ssam_controller *ctrl;
|
||||
+ struct acpi_device *san;
|
||||
struct san_data *data;
|
||||
acpi_status astatus;
|
||||
int status;
|
||||
|
||||
+ san = ACPI_COMPANION(&pdev->dev);
|
||||
+ if (!san)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
ctrl = ssam_client_bind(&pdev->dev);
|
||||
if (IS_ERR(ctrl))
|
||||
return PTR_ERR(ctrl) == -ENODEV ? -EPROBE_DEFER : PTR_ERR(ctrl);
|
||||
diff --git a/drivers/platform/surface/surface_aggregator_hub.c b/drivers/platform/surface/surface_aggregator_hub.c
|
||||
--- a/drivers/platform/surface/surface_aggregator_hub.c
|
||||
+++ b/drivers/platform/surface/surface_aggregator_hub.c
|
||||
@@ -520,20 +448,6 @@ diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
|
||||
depends on INPUT
|
||||
select INPUT_SPARSEKMAP
|
||||
select NEW_LEDS
|
||||
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
|
||||
--- a/drivers/platform/x86/acer-wmi.c
|
||||
+++ b/drivers/platform/x86/acer-wmi.c
|
||||
@@ -1581,7 +1581,9 @@ static int WMI_gaming_execute_u32_u64(u32 method_id, u32 in, u64 *out)
|
||||
return -EIO;
|
||||
|
||||
obj = result.pointer;
|
||||
- if (obj && out) {
|
||||
+ if (!obj && out) {
|
||||
+ ret = -ENOMSG;
|
||||
+ } else if (obj && out) {
|
||||
switch (obj->type) {
|
||||
case ACPI_TYPE_INTEGER:
|
||||
*out = obj->integer.value;
|
||||
diff --git a/drivers/platform/x86/amd/Kconfig b/drivers/platform/x86/amd/Kconfig
|
||||
--- a/drivers/platform/x86/amd/Kconfig
|
||||
+++ b/drivers/platform/x86/amd/Kconfig
|
||||
@@ -1795,19 +1709,6 @@ diff --git a/drivers/platform/x86/amd/hsmp/hsmp.h b/drivers/platform/x86/amd/hsm
|
||||
+ */
|
||||
+extern struct rw_semaphore hsmp_sock_rwsem;
|
||||
#endif /* HSMP_H */
|
||||
diff --git a/drivers/platform/x86/amd/hsmp/hwmon.c b/drivers/platform/x86/amd/hsmp/hwmon.c
|
||||
--- a/drivers/platform/x86/amd/hsmp/hwmon.c
|
||||
+++ b/drivers/platform/x86/amd/hsmp/hwmon.c
|
||||
@@ -31,6 +31,9 @@ static int hsmp_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
if (attr != hwmon_power_cap)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
+ if (val < 0)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
msg.num_args = 1;
|
||||
msg.args[0] = val / MICROWATT_PER_MILLIWATT;
|
||||
msg.msg_id = HSMP_SET_SOCKET_POWER_LIMIT;
|
||||
diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
|
||||
--- a/drivers/platform/x86/amd/hsmp/plat.c
|
||||
+++ b/drivers/platform/x86/amd/hsmp/plat.c
|
||||
@@ -3763,41 +3664,6 @@ diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-w
|
||||
{ KE_KEY, 0x8C, { KEY_SWITCHVIDEOMODE } }, /* SDSP DVI only */
|
||||
{ KE_KEY, 0x8D, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + DVI */
|
||||
{ KE_KEY, 0x8E, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + DVI */
|
||||
diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c
|
||||
--- a/drivers/platform/x86/asus-wireless.c
|
||||
+++ b/drivers/platform/x86/asus-wireless.c
|
||||
@@ -132,6 +132,10 @@ static int asus_wireless_probe(struct platform_device *pdev)
|
||||
const struct acpi_device_id *id;
|
||||
int err;
|
||||
|
||||
+ id = acpi_match_acpi_device(device_ids, adev);
|
||||
+ if (!id)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
@@ -139,6 +143,7 @@ static int asus_wireless_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, data);
|
||||
|
||||
data->adev = adev;
|
||||
+ data->hswc_params = (const struct hswc_params *)id->driver_data;
|
||||
|
||||
data->idev = devm_input_allocate_device(&pdev->dev);
|
||||
if (!data->idev)
|
||||
@@ -153,12 +158,6 @@ static int asus_wireless_probe(struct platform_device *pdev)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- id = acpi_match_acpi_device(device_ids, adev);
|
||||
- if (!id)
|
||||
- return 0;
|
||||
-
|
||||
- data->hswc_params = (const struct hswc_params *)id->driver_data;
|
||||
-
|
||||
data->wq = create_singlethread_workqueue("asus_wireless_workqueue");
|
||||
if (!data->wq)
|
||||
return -ENOMEM;
|
||||
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
|
||||
--- a/drivers/platform/x86/asus-wmi.c
|
||||
+++ b/drivers/platform/x86/asus-wmi.c
|
||||
@@ -3832,30 +3698,6 @@ diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
|
||||
/* Throttle thermal policy ****************************************************/
|
||||
static int throttle_thermal_policy_write(struct asus_wmi *asus)
|
||||
{
|
||||
@@ -5244,20 +5268,20 @@ static int asus_wmi_add(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
fail_wmi_handler:
|
||||
+ asus_screenpad_exit(asus);
|
||||
+fail_screenpad:
|
||||
asus_wmi_backlight_exit(asus);
|
||||
fail_backlight:
|
||||
asus_wmi_rfkill_exit(asus);
|
||||
-fail_screenpad:
|
||||
- asus_screenpad_exit(asus);
|
||||
fail_rfkill:
|
||||
asus_wmi_led_exit(asus);
|
||||
fail_leds:
|
||||
+fail_custom_fan_curve:
|
||||
fail_hwmon:
|
||||
asus_wmi_input_exit(asus);
|
||||
fail_input:
|
||||
asus_wmi_sysfs_exit(asus->platform_device);
|
||||
fail_sysfs:
|
||||
-fail_custom_fan_curve:
|
||||
fail_platform_profile_setup:
|
||||
fail_fan_boost_mode:
|
||||
fail_platform:
|
||||
diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c
|
||||
--- a/drivers/platform/x86/dell/dell-smbios-base.c
|
||||
+++ b/drivers/platform/x86/dell/dell-smbios-base.c
|
||||
@@ -4164,43 +4006,6 @@ diff --git a/drivers/platform/x86/dell/dell-smbios.h b/drivers/platform/x86/dell
|
||||
void dell_smbios_unregister_device(struct device *d);
|
||||
|
||||
int dell_smbios_error(int value);
|
||||
diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
|
||||
--- a/drivers/platform/x86/dell/dell-wmi-base.c
|
||||
+++ b/drivers/platform/x86/dell/dell-wmi-base.c
|
||||
@@ -456,7 +456,7 @@ static int dell_wmi_process_key(struct wmi_device *wdev, int type, int code, __l
|
||||
key++;
|
||||
used = 1;
|
||||
} else if (type == 0x0012 && code == 0x000d && remaining > 0) {
|
||||
- value = (le16_to_cpu(buffer[2]) == 2);
|
||||
+ value = (le16_to_cpu(buffer[0]) == 2);
|
||||
used = 1;
|
||||
}
|
||||
|
||||
@@ -843,9 +843,22 @@ static int __init dell_wmi_init(void)
|
||||
|
||||
err = dell_privacy_register_driver();
|
||||
if (err)
|
||||
- return err;
|
||||
+ goto out_smbios;
|
||||
|
||||
- return wmi_driver_register(&dell_wmi_driver);
|
||||
+ err = wmi_driver_register(&dell_wmi_driver);
|
||||
+ if (err)
|
||||
+ goto out_privacy;
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+out_privacy:
|
||||
+ dell_privacy_unregister_driver();
|
||||
+
|
||||
+out_smbios:
|
||||
+ if (wmi_requires_smbios_request)
|
||||
+ dell_wmi_events_set_enabled(false);
|
||||
+
|
||||
+ return err;
|
||||
}
|
||||
late_initcall(dell_wmi_init);
|
||||
|
||||
diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c
|
||||
--- a/drivers/platform/x86/dell/dell-wmi-ddv.c
|
||||
+++ b/drivers/platform/x86/dell/dell-wmi-ddv.c
|
||||
@@ -4251,35 +4056,6 @@ diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/del
|
||||
}
|
||||
|
||||
static ssize_t dell_wmi_ddv_query_string(struct wmi_device *wdev, enum dell_ddv_method method,
|
||||
diff --git a/drivers/platform/x86/dell/dell-wmi-privacy.c b/drivers/platform/x86/dell/dell-wmi-privacy.c
|
||||
--- a/drivers/platform/x86/dell/dell-wmi-privacy.c
|
||||
+++ b/drivers/platform/x86/dell/dell-wmi-privacy.c
|
||||
@@ -92,11 +92,11 @@ bool dell_privacy_has_mic_mute(void)
|
||||
{
|
||||
struct privacy_wmi_data *priv;
|
||||
|
||||
- mutex_lock(&list_mutex);
|
||||
+ guard(mutex)(&list_mutex);
|
||||
+
|
||||
priv = list_first_entry_or_null(&wmi_list,
|
||||
struct privacy_wmi_data,
|
||||
list);
|
||||
- mutex_unlock(&list_mutex);
|
||||
|
||||
return priv && (priv->features_present & BIT(DELL_PRIVACY_TYPE_AUDIO));
|
||||
}
|
||||
diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h b/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h
|
||||
--- a/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h
|
||||
+++ b/drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h
|
||||
@@ -107,7 +107,7 @@ enum {
|
||||
static int get_##type##_instance_id(struct kobject *kobj) \
|
||||
{ \
|
||||
int i; \
|
||||
- for (i = 0; i <= wmi_priv.type##_instances_count; i++) { \
|
||||
+ for (i = 0; i < wmi_priv.type##_instances_count; i++) { \
|
||||
if (!(strcmp(kobj->name, wmi_priv.type##_data[i].attribute_name)))\
|
||||
return i; \
|
||||
} \
|
||||
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
|
||||
--- a/drivers/platform/x86/eeepc-laptop.c
|
||||
+++ b/drivers/platform/x86/eeepc-laptop.c
|
||||
@@ -4415,21 +4191,6 @@ diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujits
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
|
||||
--- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
|
||||
+++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
|
||||
@@ -353,6 +353,11 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor
|
||||
case PSWD_ENCODINGS:
|
||||
size = min_t(u32, password_data->encodings_size, MAX_ENCODINGS_SIZE);
|
||||
for (pos_values = 0; pos_values < size; pos_values++) {
|
||||
+ if (elem + pos_values >= password_obj_count) {
|
||||
+ pr_err("Error elem-objects package is too small\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
ret = hp_convert_hexstr_to_str(password_obj[elem + pos_values].string.pointer,
|
||||
password_obj[elem + pos_values].string.length,
|
||||
&str_value, &value_len);
|
||||
diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
--- a/drivers/platform/x86/hp/hp-wmi.c
|
||||
+++ b/drivers/platform/x86/hp/hp-wmi.c
|
||||
@@ -4463,22 +4224,17 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
|
||||
#define zero_if_sup(tmp) (zero_insize_support?0:sizeof(tmp)) // use when zero insize is required
|
||||
|
||||
@@ -133,11 +142,52 @@ static const struct thermal_profile_params omen_v1_no_ec_thermal_params = {
|
||||
@@ -133,24 +142,41 @@ static const struct thermal_profile_params omen_v1_no_ec_thermal_params = {
|
||||
.ec_tp_offset = HP_NO_THERMAL_PROFILE_OFFSET,
|
||||
};
|
||||
|
||||
-/*
|
||||
- * A generic pointer for the currently-active board's thermal profile
|
||||
- * parameters.
|
||||
- */
|
||||
-static struct thermal_profile_params *active_thermal_profile_params;
|
||||
+struct hp_wmi_fan_profile_params {
|
||||
+ int (*get_fan_speed)(int fan);
|
||||
+ bool fan_table;
|
||||
+};
|
||||
+
|
||||
+struct hp_wmi_board_params {
|
||||
+ const struct thermal_profile_params *thermal_profile;
|
||||
struct hp_wmi_board_params {
|
||||
const struct thermal_profile_params *thermal_profile;
|
||||
+ const struct hp_wmi_fan_profile_params *fan_profile;
|
||||
+};
|
||||
+
|
||||
@@ -4487,41 +4243,30 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
+static const struct hp_wmi_fan_profile_params victus_s_fan_profile_params = {
|
||||
+ .get_fan_speed = hp_wmi_get_fan_speed_victus_s,
|
||||
+ .fan_table = true,
|
||||
+};
|
||||
+
|
||||
+static const struct hp_wmi_board_params victus_s_board_params = {
|
||||
+ .thermal_profile = &victus_s_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
+};
|
||||
+
|
||||
+static const struct hp_wmi_board_params omen_v1_board_params = {
|
||||
+ .thermal_profile = &omen_v1_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
+};
|
||||
+
|
||||
+static const struct hp_wmi_board_params omen_v1_legacy_board_params = {
|
||||
+ .thermal_profile = &omen_v1_legacy_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
+};
|
||||
+
|
||||
+static const struct hp_wmi_board_params omen_v1_no_ec_board_params = {
|
||||
+ .thermal_profile = &omen_v1_no_ec_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
+};
|
||||
+
|
||||
+static const struct hp_wmi_board_params *active_board_params;
|
||||
+
|
||||
+static const struct thermal_profile_params *hp_wmi_thermal_profile(void)
|
||||
+{
|
||||
+ if (!active_board_params)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return active_board_params->thermal_profile;
|
||||
+}
|
||||
};
|
||||
|
||||
/* DMI board names of devices that should use the omen specific path for
|
||||
* thermal profiles.
|
||||
@@ -157,7 +207,7 @@ static const char * const omen_thermal_profile_boards[] = {
|
||||
static const struct hp_wmi_board_params victus_s_board_params = {
|
||||
.thermal_profile = &victus_s_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
};
|
||||
|
||||
static const struct hp_wmi_board_params omen_v1_board_params = {
|
||||
.thermal_profile = &omen_v1_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
};
|
||||
|
||||
static const struct hp_wmi_board_params omen_v1_legacy_board_params = {
|
||||
.thermal_profile = &omen_v1_legacy_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
};
|
||||
|
||||
static const struct hp_wmi_board_params omen_v1_no_ec_board_params = {
|
||||
.thermal_profile = &omen_v1_no_ec_thermal_params,
|
||||
+ .fan_profile = &victus_s_fan_profile_params,
|
||||
};
|
||||
|
||||
static const struct hp_wmi_board_params *active_board_params;
|
||||
@@ -181,7 +207,7 @@ static const char * const omen_thermal_profile_boards[] = {
|
||||
"886B", "886C", "88C8", "88CB", "88D1", "88D2", "88F4", "88F5", "88F6",
|
||||
"88F7", "88FD", "88FE", "88FF",
|
||||
"8900", "8901", "8902", "8912", "8917", "8918", "8949", "894A", "89EB",
|
||||
@@ -4530,33 +4275,21 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
"8BAD",
|
||||
"8C58",
|
||||
"8E41",
|
||||
@@ -187,83 +237,103 @@ static const char * const victus_thermal_profile_boards[] = {
|
||||
"8A25",
|
||||
};
|
||||
|
||||
-/* DMI Board names of Victus 16-r and Victus 16-s laptops */
|
||||
-static const struct dmi_system_id victus_s_thermal_profile_boards[] __initconst = {
|
||||
+/* DMI board-specific feature data for Omen and Victus laptops. */
|
||||
+static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = {
|
||||
{
|
||||
@@ -217,6 +243,10 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = {
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8902") },
|
||||
- .driver_data = (void *)&omen_v1_legacy_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
+ },
|
||||
.driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
},
|
||||
+ {
|
||||
+ .matches = { DMI_MATCH(DMI_BOARD_NAME, "8A3D") },
|
||||
+ .driver_data = (void *)&victus_s_board_params,
|
||||
},
|
||||
+ },
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8A44") },
|
||||
- .driver_data = (void *)&omen_v1_legacy_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
},
|
||||
{
|
||||
.driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
@@ -225,6 +255,14 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = {
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8A4D") },
|
||||
- .driver_data = (void *)&omen_v1_legacy_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
+ },
|
||||
.driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
},
|
||||
+ {
|
||||
+ .matches = { DMI_MATCH(DMI_BOARD_NAME, "8BAA") },
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
@@ -4564,107 +4297,33 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
+ {
|
||||
+ .matches = { DMI_MATCH(DMI_BOARD_NAME, "8BA9") },
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
+ },
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8BAB") },
|
||||
- .driver_data = (void *)&omen_v1_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
{
|
||||
.driver_data = (void *)&omen_v1_board_params,
|
||||
@@ -233,6 +271,10 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = {
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8B2F") },
|
||||
- .driver_data = (void *)&victus_s_thermal_params,
|
||||
+ .driver_data = (void *)&victus_s_board_params,
|
||||
+ },
|
||||
.driver_data = (void *)&victus_s_board_params,
|
||||
},
|
||||
+ {
|
||||
+ .matches = { DMI_MATCH(DMI_BOARD_NAME, "8BB3") },
|
||||
+ .driver_data = (void *)&omen_v1_no_ec_board_params,
|
||||
},
|
||||
+ },
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8BBE") },
|
||||
- .driver_data = (void *)&victus_s_thermal_params,
|
||||
+ .driver_data = (void *)&victus_s_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8BC2") },
|
||||
- .driver_data = (void *)&omen_v1_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8BCA") },
|
||||
- .driver_data = (void *)&omen_v1_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8BCD") },
|
||||
- .driver_data = (void *)&omen_v1_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8BD4") },
|
||||
- .driver_data = (void *)&victus_s_thermal_params,
|
||||
+ .driver_data = (void *)&victus_s_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8BD5") },
|
||||
- .driver_data = (void *)&victus_s_thermal_params,
|
||||
+ .driver_data = (void *)&victus_s_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8C76") },
|
||||
- .driver_data = (void *)&omen_v1_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8C77") },
|
||||
- .driver_data = (void *)&omen_v1_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8C78") },
|
||||
- .driver_data = (void *)&omen_v1_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8C99") },
|
||||
- .driver_data = (void *)&victus_s_thermal_params,
|
||||
+ .driver_data = (void *)&victus_s_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8C9C") },
|
||||
- .driver_data = (void *)&victus_s_thermal_params,
|
||||
+ .driver_data = (void *)&victus_s_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8D26") },
|
||||
- .driver_data = (void *)&omen_v1_legacy_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8D41") },
|
||||
- .driver_data = (void *)&omen_v1_no_ec_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_no_ec_board_params,
|
||||
},
|
||||
{
|
||||
.driver_data = (void *)&victus_s_board_params,
|
||||
@@ -289,6 +331,10 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = {
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8D87") },
|
||||
- .driver_data = (void *)&omen_v1_no_ec_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_no_ec_board_params,
|
||||
+ },
|
||||
.driver_data = (void *)&omen_v1_no_ec_board_params,
|
||||
},
|
||||
+ {
|
||||
+ .matches = { DMI_MATCH(DMI_BOARD_NAME, "8D88") },
|
||||
+ .driver_data = (void *)&omen_v1_no_ec_board_params,
|
||||
},
|
||||
+ },
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") },
|
||||
@@ -271,7 +341,7 @@ static const struct dmi_system_id victus_s_thermal_profile_boards[] __initconst
|
||||
},
|
||||
{
|
||||
.matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },
|
||||
- .driver_data = (void *)&omen_v1_legacy_thermal_params,
|
||||
+ .driver_data = (void *)&omen_v1_legacy_board_params,
|
||||
},
|
||||
{},
|
||||
};
|
||||
@@ -336,6 +406,7 @@ enum hp_wmi_commandtype {
|
||||
.driver_data = (void *)&omen_v1_no_ec_board_params,
|
||||
@@ -360,6 +406,7 @@ enum hp_wmi_commandtype {
|
||||
HPWMI_POSTCODEERROR_QUERY = 0x2a,
|
||||
HPWMI_SYSTEM_DEVICE_MODE = 0x40,
|
||||
HPWMI_THERMAL_PROFILE_QUERY = 0x4c,
|
||||
@@ -4672,7 +4331,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
};
|
||||
|
||||
struct victus_power_limits {
|
||||
@@ -504,9 +575,9 @@ struct hp_wmi_hwmon_priv {
|
||||
@@ -528,9 +575,9 @@ struct hp_wmi_hwmon_priv {
|
||||
struct mutex lock; /* protects mode, pwm */
|
||||
u8 min_rpm;
|
||||
u8 max_rpm;
|
||||
@@ -4684,7 +4343,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
struct delayed_work keep_alive_dwork;
|
||||
};
|
||||
|
||||
@@ -833,24 +904,20 @@ static int hp_wmi_fan_speed_max_set(int enabled)
|
||||
@@ -857,24 +904,20 @@ static int hp_wmi_fan_speed_max_set(int enabled)
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@@ -4719,7 +4378,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
|
||||
ret = hp_wmi_get_fan_count_userdefine_trigger();
|
||||
if (ret < 0)
|
||||
@@ -867,7 +934,9 @@ static int hp_wmi_fan_speed_set(struct hp_wmi_hwmon_priv *priv, u8 speed)
|
||||
@@ -891,7 +934,9 @@ static int hp_wmi_fan_speed_set(struct hp_wmi_hwmon_priv *priv, u8 speed)
|
||||
|
||||
static int hp_wmi_fan_speed_reset(struct hp_wmi_hwmon_priv *priv)
|
||||
{
|
||||
@@ -4730,7 +4389,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
}
|
||||
|
||||
static int hp_wmi_fan_speed_max_reset(struct hp_wmi_hwmon_priv *priv)
|
||||
@@ -1128,12 +1197,134 @@ static int camera_shutter_input_setup(void)
|
||||
@@ -1152,12 +1197,134 @@ static int camera_shutter_input_setup(void)
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -4865,7 +4524,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
|
||||
static struct attribute *hp_wmi_attrs[] = {
|
||||
&dev_attr_display.attr,
|
||||
@@ -1142,6 +1333,7 @@ static struct attribute *hp_wmi_attrs[] = {
|
||||
@@ -1166,6 +1333,7 @@ static struct attribute *hp_wmi_attrs[] = {
|
||||
&dev_attr_dock.attr,
|
||||
&dev_attr_tablet.attr,
|
||||
&dev_attr_postcode.attr,
|
||||
@@ -4873,7 +4532,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(hp_wmi);
|
||||
@@ -1793,6 +1985,38 @@ static bool is_victus_s_thermal_profile(void)
|
||||
@@ -1817,6 +1985,38 @@ static bool is_victus_s_thermal_profile(void)
|
||||
return is_victus_s_board;
|
||||
}
|
||||
|
||||
@@ -4912,77 +4571,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
static int victus_s_gpu_thermal_profile_get(bool *ctgp_enable,
|
||||
bool *ppab_enable,
|
||||
u8 *dstate,
|
||||
@@ -1878,7 +2102,10 @@ static int platform_profile_victus_s_get_ec(enum platform_profile_option *profil
|
||||
u8 current_dstate, current_gpu_slowdown_temp, tp;
|
||||
const struct thermal_profile_params *params;
|
||||
|
||||
- params = active_thermal_profile_params;
|
||||
+ params = hp_wmi_thermal_profile();
|
||||
+ if (!params)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
if (params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN ||
|
||||
params->ec_tp_offset == HP_NO_THERMAL_PROFILE_OFFSET) {
|
||||
*profile = active_platform_profile;
|
||||
@@ -1890,10 +2117,10 @@ static int platform_profile_victus_s_get_ec(enum platform_profile_option *profil
|
||||
return ret;
|
||||
|
||||
/*
|
||||
- * We cannot use active_thermal_profile_params here, because boards
|
||||
- * like 8C78 have tp == 0x0 || tp == 0x1 after cold boot, but logically
|
||||
- * it should have tp == 0x30 || tp == 0x31, as corrected by the Omen
|
||||
- * Gaming Hub on windows. Hence accept both of these values.
|
||||
+ * Boards like 8C78 have tp == 0x0 || tp == 0x1 after cold boot,
|
||||
+ * but logically it should have tp == 0x30 || tp == 0x31, as
|
||||
+ * corrected by the Omen Gaming Hub on windows. Hence accept both
|
||||
+ * of these values.
|
||||
*/
|
||||
if (tp == victus_s_thermal_params.performance ||
|
||||
tp == omen_v1_thermal_params.performance) {
|
||||
@@ -1928,12 +2155,12 @@ static int platform_profile_victus_s_get_ec(enum platform_profile_option *profil
|
||||
|
||||
static int platform_profile_victus_s_set_ec(enum platform_profile_option profile)
|
||||
{
|
||||
- struct thermal_profile_params *params;
|
||||
+ const struct thermal_profile_params *params;
|
||||
bool gpu_ctgp_enable, gpu_ppab_enable;
|
||||
u8 gpu_dstate; /* Test shows 1 = 100%, 2 = 50%, 3 = 25%, 4 = 12.5% */
|
||||
int err, tp;
|
||||
|
||||
- params = active_thermal_profile_params;
|
||||
+ params = hp_wmi_thermal_profile();
|
||||
if (!params)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -2199,6 +2426,7 @@ static const struct platform_profile_ops hp_wmi_platform_profile_ops = {
|
||||
static int thermal_profile_setup(struct platform_device *device)
|
||||
{
|
||||
const struct platform_profile_ops *ops;
|
||||
+ const struct thermal_profile_params *params;
|
||||
int err, tp;
|
||||
|
||||
if (is_omen_thermal_profile()) {
|
||||
@@ -2230,13 +2458,17 @@ static int thermal_profile_setup(struct platform_device *device)
|
||||
|
||||
ops = &platform_profile_victus_ops;
|
||||
} else if (is_victus_s_thermal_profile()) {
|
||||
+ params = hp_wmi_thermal_profile();
|
||||
+ if (!params)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
/*
|
||||
* For an unknown EC layout board, platform_profile_victus_s_get_ec(),
|
||||
* behaves like a wrapper around active_platform_profile, to avoid using
|
||||
* uninitialized data, we default to PLATFORM_PROFILE_BALANCED.
|
||||
*/
|
||||
- if (active_thermal_profile_params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN ||
|
||||
- active_thermal_profile_params->ec_tp_offset == HP_NO_THERMAL_PROFILE_OFFSET) {
|
||||
+ if (params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN ||
|
||||
+ params->ec_tp_offset == HP_NO_THERMAL_PROFILE_OFFSET) {
|
||||
active_platform_profile = PLATFORM_PROFILE_BALANCED;
|
||||
} else {
|
||||
err = platform_profile_victus_s_get_ec(&active_platform_profile);
|
||||
@@ -2404,7 +2636,7 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
@@ -2436,7 +2636,7 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
|
||||
switch (priv->mode) {
|
||||
case PWM_MODE_MAX:
|
||||
@@ -4991,7 +4580,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
ret = hp_wmi_get_fan_count_userdefine_trigger();
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -2416,16 +2648,16 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
@@ -2448,16 +2648,16 @@ static int hp_wmi_apply_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
secs_to_jiffies(KEEP_ALIVE_DELAY_SECS));
|
||||
return 0;
|
||||
case PWM_MODE_MANUAL:
|
||||
@@ -5011,7 +4600,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
ret = hp_wmi_get_fan_count_userdefine_trigger();
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -2449,12 +2681,12 @@ static umode_t hp_wmi_hwmon_is_visible(const void *data,
|
||||
@@ -2481,12 +2681,12 @@ static umode_t hp_wmi_hwmon_is_visible(const void *data,
|
||||
{
|
||||
switch (type) {
|
||||
case hwmon_pwm:
|
||||
@@ -5027,7 +4616,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
return 0444;
|
||||
} else {
|
||||
if (hp_wmi_get_fan_speed(channel) >= 0)
|
||||
@@ -2478,8 +2710,8 @@ static int hp_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
|
||||
@@ -2510,8 +2710,8 @@ static int hp_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
|
||||
priv = dev_get_drvdata(dev);
|
||||
switch (type) {
|
||||
case hwmon_fan:
|
||||
@@ -5038,7 +4627,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
else
|
||||
ret = hp_wmi_get_fan_speed(channel);
|
||||
if (ret < 0)
|
||||
@@ -2488,10 +2720,10 @@ static int hp_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
|
||||
@@ -2520,10 +2720,10 @@ static int hp_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
|
||||
return 0;
|
||||
case hwmon_pwm:
|
||||
if (attr == hwmon_pwm_input) {
|
||||
@@ -5051,7 +4640,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
if (rpm < 0)
|
||||
return rpm;
|
||||
*val = rpm_to_pwm(rpm / 100, priv);
|
||||
@@ -2518,14 +2750,15 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
@@ -2550,14 +2750,15 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
u32 attr, int channel, long val)
|
||||
{
|
||||
struct hp_wmi_hwmon_priv *priv;
|
||||
@@ -5069,7 +4658,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
return -EOPNOTSUPP;
|
||||
/* PWM input is invalid when not in manual mode */
|
||||
if (priv->mode != PWM_MODE_MANUAL)
|
||||
@@ -2534,7 +2767,10 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
@@ -2566,7 +2767,10 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
/* ensure PWM input is within valid fan speeds */
|
||||
rpm = pwm_to_rpm(val, priv);
|
||||
rpm = clamp_val(rpm, priv->min_rpm, priv->max_rpm);
|
||||
@@ -5081,7 +4670,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
return hp_wmi_apply_fan_settings(priv);
|
||||
}
|
||||
switch (val) {
|
||||
@@ -2542,16 +2778,20 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
@@ -2574,16 +2778,20 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
priv->mode = PWM_MODE_MAX;
|
||||
return hp_wmi_apply_fan_settings(priv);
|
||||
case PWM_MODE_MANUAL:
|
||||
@@ -5107,7 +4696,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
priv->mode = PWM_MODE_MANUAL;
|
||||
return hp_wmi_apply_fan_settings(priv);
|
||||
case PWM_MODE_AUTO:
|
||||
@@ -2567,7 +2807,7 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
@@ -2599,7 +2807,7 @@ static int hp_wmi_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|
||||
|
||||
static const struct hwmon_channel_info * const info[] = {
|
||||
HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT, HWMON_F_INPUT),
|
||||
@@ -5116,7 +4705,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -2608,14 +2848,14 @@ static int hp_wmi_setup_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
@@ -2640,14 +2848,14 @@ static int hp_wmi_setup_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
struct victus_s_fan_table *fan_table;
|
||||
u8 min_rpm, max_rpm;
|
||||
u8 cpu_rpm, gpu_rpm, noise_db;
|
||||
@@ -5134,7 +4723,7 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
return 0;
|
||||
|
||||
ret = hp_wmi_perform_query(HPWMI_VICTUS_S_GET_FAN_TABLE_QUERY,
|
||||
@@ -2654,10 +2894,8 @@ static int hp_wmi_setup_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
@@ -2686,10 +2894,8 @@ static int hp_wmi_setup_fan_settings(struct hp_wmi_hwmon_priv *priv)
|
||||
if (min_rpm == U8_MAX || max_rpm == 0)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -5145,54 +4734,6 @@ diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2697,24 +2935,25 @@ static int hp_wmi_hwmon_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void __init setup_active_thermal_profile_params(void)
|
||||
+static void __init setup_active_board_params(void)
|
||||
{
|
||||
const struct dmi_system_id *id;
|
||||
+ const struct thermal_profile_params *params;
|
||||
|
||||
- /*
|
||||
- * Currently only victus_s devices use the
|
||||
- * active_thermal_profile_params
|
||||
- */
|
||||
- id = dmi_first_match(victus_s_thermal_profile_boards);
|
||||
+ id = dmi_first_match(hp_wmi_feature_boards);
|
||||
if (id) {
|
||||
+ active_board_params = id->driver_data;
|
||||
+ params = hp_wmi_thermal_profile();
|
||||
+ if (!params)
|
||||
+ return;
|
||||
+
|
||||
/*
|
||||
* Marking this boolean is required to ensure that
|
||||
* is_victus_s_thermal_profile() behaves like a valid
|
||||
* wrapper.
|
||||
*/
|
||||
is_victus_s_board = true;
|
||||
- active_thermal_profile_params = id->driver_data;
|
||||
- if (active_thermal_profile_params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN) {
|
||||
+ if (params->ec_tp_offset == HP_EC_OFFSET_UNKNOWN) {
|
||||
pr_warn("Unknown EC layout for board %s. Thermal profile readback will be disabled. Please report this to platform-driver-x86@vger.kernel.org\n",
|
||||
dmi_get_system_info(DMI_BOARD_NAME));
|
||||
}
|
||||
@@ -2749,10 +2988,10 @@ static int __init hp_wmi_init(void)
|
||||
}
|
||||
|
||||
/*
|
||||
- * Setup active board's thermal profile parameters before
|
||||
- * starting platform driver probe.
|
||||
+ * Setup active board feature data before starting platform
|
||||
+ * driver probe.
|
||||
*/
|
||||
- setup_active_thermal_profile_params();
|
||||
+ setup_active_board_params();
|
||||
err = platform_driver_probe(&hp_wmi_driver, hp_wmi_bios_setup);
|
||||
if (err)
|
||||
goto err_unregister_device;
|
||||
diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
|
||||
--- a/drivers/platform/x86/huawei-wmi.c
|
||||
+++ b/drivers/platform/x86/huawei-wmi.c
|
||||
@@ -6042,7 +5583,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
|
||||
#define SB_GGOV_METHOD "\\_SB.GGOV"
|
||||
#define GOV_TLED 0x2020008
|
||||
@@ -78,42 +88,95 @@ MODULE_PARM_DESC(fw_debug, "Enable printing of firmware debug messages");
|
||||
@@ -78,26 +88,29 @@ MODULE_PARM_DESC(fw_debug, "Enable printing of firmware debug messages");
|
||||
#define WMBB_USB_CHARGE 0x10B
|
||||
#define WMBB_BATT_LIMIT 0x10C
|
||||
|
||||
@@ -6084,8 +5625,8 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
-#define INIT_SPARSE_KEYMAP 0x80
|
||||
|
||||
static int battery_limit_use_wmbb;
|
||||
+static bool kbd_backlight_available;
|
||||
static struct led_classdev kbd_backlight;
|
||||
static bool kbd_backlight_available;
|
||||
@@ -105,16 +118,65 @@ static struct led_classdev kbd_backlight;
|
||||
static enum led_brightness get_kbd_backlight_level(struct device *dev);
|
||||
|
||||
static const struct key_entry wmi_keymap[] = {
|
||||
@@ -6158,7 +5699,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
static int ggov(u32 arg0)
|
||||
{
|
||||
union acpi_object args[1];
|
||||
@@ -154,30 +217,97 @@ static int ggov(u32 arg0)
|
||||
@@ -155,30 +217,97 @@ static int ggov(u32 arg0)
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -6273,13 +5814,14 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
}
|
||||
|
||||
static union acpi_object *lg_wmbb(struct device *dev, u32 method_id, u32 arg1, u32 arg2)
|
||||
@@ -211,72 +341,11 @@ static union acpi_object *lg_wmbb(struct device *dev, u32 method_id, u32 arg1, u
|
||||
@@ -212,76 +341,11 @@ static union acpi_object *lg_wmbb(struct device *dev, u32 method_id, u32 arg1, u
|
||||
return (union acpi_object *)buffer.pointer;
|
||||
}
|
||||
|
||||
-static void wmi_notify(union acpi_object *obj, void *context)
|
||||
-{
|
||||
- long data = (long)context;
|
||||
- unsigned int brightness;
|
||||
-
|
||||
- pr_debug("event guid %li\n", data);
|
||||
- if (!obj)
|
||||
@@ -6290,8 +5832,11 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
- struct key_entry *key;
|
||||
-
|
||||
- if (eventcode == 0x10000000) {
|
||||
- led_classdev_notify_brightness_hw_changed(
|
||||
- &kbd_backlight, get_kbd_backlight_level(kbd_backlight.dev->parent));
|
||||
- if (kbd_backlight_available) {
|
||||
- brightness = get_kbd_backlight_level(kbd_backlight.dev->parent);
|
||||
- led_classdev_notify_brightness_hw_changed(&kbd_backlight,
|
||||
- brightness);
|
||||
- }
|
||||
- } else {
|
||||
- key = sparse_keymap_entry_from_scancode(
|
||||
- wmi_input_dev, eventcode);
|
||||
@@ -6346,7 +5891,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
int ret;
|
||||
|
||||
ret = kstrtoul(buffer, 10, &value);
|
||||
@@ -285,10 +354,10 @@ static ssize_t fan_mode_store(struct device *dev,
|
||||
@@ -290,10 +354,10 @@ static ssize_t fan_mode_store(struct device *dev,
|
||||
if (value >= 3)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -6361,7 +5906,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
|
||||
return count;
|
||||
}
|
||||
@@ -296,22 +365,14 @@ static ssize_t fan_mode_store(struct device *dev,
|
||||
@@ -301,22 +365,14 @@ static ssize_t fan_mode_store(struct device *dev,
|
||||
static ssize_t fan_mode_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buffer)
|
||||
{
|
||||
@@ -6390,7 +5935,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
}
|
||||
|
||||
static ssize_t usb_charge_store(struct device *dev,
|
||||
@@ -361,41 +422,30 @@ static ssize_t reader_mode_store(struct device *dev,
|
||||
@@ -366,41 +422,30 @@ static ssize_t reader_mode_store(struct device *dev,
|
||||
const char *buffer, size_t count)
|
||||
{
|
||||
bool value;
|
||||
@@ -6441,7 +5986,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
}
|
||||
|
||||
static ssize_t fn_lock_store(struct device *dev,
|
||||
@@ -403,40 +453,30 @@ static ssize_t fn_lock_store(struct device *dev,
|
||||
@@ -408,40 +453,30 @@ static ssize_t fn_lock_store(struct device *dev,
|
||||
const char *buffer, size_t count)
|
||||
{
|
||||
bool value;
|
||||
@@ -6491,7 +6036,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
}
|
||||
|
||||
static ssize_t charge_control_end_threshold_store(struct device *dev,
|
||||
@@ -453,14 +493,18 @@ static ssize_t charge_control_end_threshold_store(struct device *dev,
|
||||
@@ -458,14 +493,18 @@ static ssize_t charge_control_end_threshold_store(struct device *dev,
|
||||
if (value == 100 || value == 80) {
|
||||
union acpi_object *r;
|
||||
|
||||
@@ -6516,7 +6061,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -471,8 +515,9 @@ static ssize_t charge_control_end_threshold_show(struct device *device,
|
||||
@@ -476,8 +515,9 @@ static ssize_t charge_control_end_threshold_show(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
@@ -6527,7 +6072,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
|
||||
if (battery_limit_use_wmbb) {
|
||||
r = lg_wmbb(&pf_device->dev, WMBB_BATT_LIMIT, WM_GET, 0);
|
||||
@@ -485,19 +530,13 @@ static ssize_t charge_control_end_threshold_show(struct device *device,
|
||||
@@ -490,19 +530,13 @@ static ssize_t charge_control_end_threshold_show(struct device *device,
|
||||
}
|
||||
|
||||
status = r->buffer.pointer[0x10];
|
||||
@@ -6552,7 +6097,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
if (status != 80 && status != 100)
|
||||
status = 0;
|
||||
|
||||
@@ -563,10 +602,7 @@ static const struct attribute_group dev_attribute_group = {
|
||||
@@ -568,10 +602,7 @@ static const struct attribute_group dev_attribute_group = {
|
||||
static void tpad_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
@@ -6564,7 +6109,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
}
|
||||
|
||||
static enum led_brightness tpad_led_get(struct led_classdev *cdev)
|
||||
@@ -579,47 +615,50 @@ static LED_DEVICE(tpad_led, 1, 0);
|
||||
@@ -584,47 +615,50 @@ static LED_DEVICE(tpad_led, 1, 0);
|
||||
static void kbd_backlight_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
@@ -6644,7 +6189,7 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
}
|
||||
|
||||
static enum led_brightness kbd_backlight_get(struct led_classdev *cdev)
|
||||
@@ -629,26 +668,163 @@ static enum led_brightness kbd_backlight_get(struct led_classdev *cdev)
|
||||
@@ -634,26 +668,163 @@ static enum led_brightness kbd_backlight_get(struct led_classdev *cdev)
|
||||
|
||||
static LED_DEVICE(kbd_backlight, 255, LED_BRIGHT_HW_CHANGED);
|
||||
|
||||
@@ -6822,42 +6367,36 @@ diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
|
||||
static acpi_status lg_laptop_address_space_write(struct device *dev, acpi_physical_address address,
|
||||
size_t size, u64 value)
|
||||
{
|
||||
@@ -860,15 +1036,23 @@ static int acpi_probe(struct platform_device *pdev)
|
||||
@@ -865,10 +1036,6 @@ static int acpi_probe(struct platform_device *pdev)
|
||||
if (year >= 2019)
|
||||
battery_limit_use_wmbb = 1;
|
||||
|
||||
+ /* LEDs are optional */
|
||||
+ ret = devm_led_classdev_register(&pdev->dev, &kbd_backlight);
|
||||
+ if (ret < 0)
|
||||
+ kbd_backlight_available = false;
|
||||
+ else
|
||||
+ kbd_backlight_available = true;
|
||||
+
|
||||
+ devm_led_classdev_register(&pdev->dev, &tpad_led);
|
||||
+
|
||||
- ret = sysfs_create_group(&pf_device->dev.kobj, &dev_attribute_group);
|
||||
- if (ret)
|
||||
- goto out_platform_device;
|
||||
-
|
||||
/* LEDs are optional */
|
||||
ret = devm_led_classdev_register(&pdev->dev, &kbd_backlight);
|
||||
if (ret < 0)
|
||||
@@ -878,7 +1045,14 @@ static int acpi_probe(struct platform_device *pdev)
|
||||
|
||||
devm_led_classdev_register(&pdev->dev, &tpad_led);
|
||||
|
||||
- wmi_input_setup();
|
||||
+ ret = lg_laptop_input_init(&pdev->dev, device->handle);
|
||||
+ if (ret < 0)
|
||||
+ goto out_platform_device;
|
||||
+
|
||||
ret = sysfs_create_group(&pf_device->dev.kobj, &dev_attribute_group);
|
||||
if (ret)
|
||||
goto out_platform_device;
|
||||
|
||||
- /* LEDs are optional */
|
||||
- led_classdev_register(&pf_device->dev, &kbd_backlight);
|
||||
- led_classdev_register(&pf_device->dev, &tpad_led);
|
||||
-
|
||||
- wmi_input_setup();
|
||||
+ ret = sysfs_create_group(&pf_device->dev.kobj, &dev_attribute_group);
|
||||
+ if (ret)
|
||||
+ goto out_platform_device;
|
||||
+
|
||||
battery_hook_register(&battery_hook);
|
||||
|
||||
return 0;
|
||||
@@ -884,11 +1068,7 @@ static void acpi_remove(struct platform_device *pdev)
|
||||
{
|
||||
@@ -895,7 +1069,6 @@ static void acpi_remove(struct platform_device *pdev)
|
||||
sysfs_remove_group(&pf_device->dev.kobj, &dev_attribute_group);
|
||||
|
||||
- led_classdev_unregister(&tpad_led);
|
||||
- led_classdev_unregister(&kbd_backlight);
|
||||
-
|
||||
battery_hook_unregister(&battery_hook);
|
||||
- wmi_input_destroy();
|
||||
platform_device_unregister(pf_device);
|
||||
|
||||
Reference in new issue
Block a user