Skip to content

Commit b226d01

Browse files
committed
Merge tag 'platform-drivers-x86-v6.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Hans de Goede: - AMD PMF: Add new hardware id - AMD PMC: Fix crash when loaded with enable_stb=1 on devices without STB - Dell: Add Alienware hwid for Alienware systems with Dell WMI interface - thinkpad_acpi: Quirk to fix wrong fan speed readings on L480 - New hotkey mappings for Dell and Lenovo laptops * tag 'platform-drivers-x86-v6.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: thinkpad_acpi: Fix for ThinkPad's with ECFW showing incorrect fan speed platform/x86: ideapad-laptop: add missing Ideapad Pro 5 fn keys platform/x86: dell-wmi-base: Handle META key Lock/Unlock events platform/x86: dell-smbios-base: Extends support to Alienware products platform/x86/amd/pmc: Detect when STB is not available platform/x86/amd/pmf: Add SMU metrics table support for 1Ah family 60h model
2 parents 9e23acf + 1be765b commit b226d01

File tree

7 files changed

+42
-3
lines changed

7 files changed

+42
-3
lines changed

drivers/platform/x86/amd/pmc/pmc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,11 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
998998
amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true);
999999
amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true);
10001000

1001+
if (!phys_addr_hi && !phys_addr_low) {
1002+
dev_err(dev->dev, "STB is not enabled on the system; disable enable_stb or contact system vendor\n");
1003+
return -EINVAL;
1004+
}
1005+
10011006
stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low);
10021007

10031008
/* Clear msg_port for other SMU operation */

drivers/platform/x86/amd/pmf/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ int amd_pmf_set_dram_addr(struct amd_pmf_dev *dev, bool alloc_buffer)
261261
dev->mtable_size = sizeof(dev->m_table);
262262
break;
263263
case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
264+
case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT:
264265
dev->mtable_size = sizeof(dev->m_table_v2);
265266
break;
266267
default:

drivers/platform/x86/amd/pmf/spc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static void amd_pmf_get_smu_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_ta
8686
ARRAY_SIZE(dev->m_table.avg_core_c0residency), in);
8787
break;
8888
case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
89+
case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT:
8990
memcpy(&dev->m_table_v2, dev->buf, dev->mtable_size);
9091
in->ev_info.socket_power = dev->m_table_v2.apu_power + dev->m_table_v2.dgpu_power;
9192
in->ev_info.skin_temperature = dev->m_table_v2.skin_temp;

drivers/platform/x86/dell/dell-smbios-base.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ static int __init dell_smbios_init(void)
576576
int ret, wmi, smm;
577577

578578
if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) &&
579+
!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Alienware", NULL) &&
579580
!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL)) {
580581
pr_err("Unable to run on non-Dell system\n");
581582
return -ENODEV;

drivers/platform/x86/dell/dell-wmi-base.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ static const struct dmi_system_id dell_wmi_smbios_list[] __initconst = {
8080
static const struct key_entry dell_wmi_keymap_type_0000[] = {
8181
{ KE_IGNORE, 0x003a, { KEY_CAPSLOCK } },
8282

83+
/* Meta key lock */
84+
{ KE_IGNORE, 0xe000, { KEY_RIGHTMETA } },
85+
86+
/* Meta key unlock */
87+
{ KE_IGNORE, 0xe001, { KEY_RIGHTMETA } },
88+
8389
/* Key code is followed by brightness level */
8490
{ KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } },
8591
{ KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } },

drivers/platform/x86/ideapad-laptop.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,9 @@ static const struct key_entry ideapad_keymap[] = {
12941294
{ KE_KEY, 0x27 | IDEAPAD_WMI_KEY, { KEY_HELP } },
12951295
/* Refresh Rate Toggle */
12961296
{ KE_KEY, 0x0a | IDEAPAD_WMI_KEY, { KEY_REFRESH_RATE_TOGGLE } },
1297+
/* Specific to some newer models */
1298+
{ KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } },
1299+
{ KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } },
12971300

12981301
{ KE_END },
12991302
};

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7936,6 +7936,7 @@ static u8 fan_control_resume_level;
79367936
static int fan_watchdog_maxinterval;
79377937

79387938
static bool fan_with_ns_addr;
7939+
static bool ecfw_with_fan_dec_rpm;
79397940

79407941
static struct mutex fan_mutex;
79417942

@@ -8682,7 +8683,11 @@ static ssize_t fan_fan1_input_show(struct device *dev,
86828683
if (res < 0)
86838684
return res;
86848685

8685-
return sysfs_emit(buf, "%u\n", speed);
8686+
/* Check for fan speeds displayed in hexadecimal */
8687+
if (!ecfw_with_fan_dec_rpm)
8688+
return sysfs_emit(buf, "%u\n", speed);
8689+
else
8690+
return sysfs_emit(buf, "%x\n", speed);
86868691
}
86878692

86888693
static DEVICE_ATTR(fan1_input, S_IRUGO, fan_fan1_input_show, NULL);
@@ -8699,7 +8704,11 @@ static ssize_t fan_fan2_input_show(struct device *dev,
86998704
if (res < 0)
87008705
return res;
87018706

8702-
return sysfs_emit(buf, "%u\n", speed);
8707+
/* Check for fan speeds displayed in hexadecimal */
8708+
if (!ecfw_with_fan_dec_rpm)
8709+
return sysfs_emit(buf, "%u\n", speed);
8710+
else
8711+
return sysfs_emit(buf, "%x\n", speed);
87038712
}
87048713

87058714
static DEVICE_ATTR(fan2_input, S_IRUGO, fan_fan2_input_show, NULL);
@@ -8775,6 +8784,7 @@ static const struct attribute_group fan_driver_attr_group = {
87758784
#define TPACPI_FAN_2CTL 0x0004 /* selects fan2 control */
87768785
#define TPACPI_FAN_NOFAN 0x0008 /* no fan available */
87778786
#define TPACPI_FAN_NS 0x0010 /* For EC with non-Standard register addresses */
8787+
#define TPACPI_FAN_DECRPM 0x0020 /* For ECFW's with RPM in register as decimal */
87788788

87798789
static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
87808790
TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1),
@@ -8803,6 +8813,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
88038813
TPACPI_Q_LNV3('R', '1', 'D', TPACPI_FAN_NS), /* 11e Gen5 GL-R */
88048814
TPACPI_Q_LNV3('R', '0', 'V', TPACPI_FAN_NS), /* 11e Gen5 KL-Y */
88058815
TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) */
8816+
TPACPI_Q_LNV3('R', '0', 'Q', TPACPI_FAN_DECRPM),/* L480 */
88068817
};
88078818

88088819
static int __init fan_init(struct ibm_init_struct *iibm)
@@ -8847,6 +8858,13 @@ static int __init fan_init(struct ibm_init_struct *iibm)
88478858
tp_features.fan_ctrl_status_undef = 1;
88488859
}
88498860

8861+
/* Check for the EC/BIOS with RPM reported in decimal*/
8862+
if (quirks & TPACPI_FAN_DECRPM) {
8863+
pr_info("ECFW with fan RPM as decimal in EC register\n");
8864+
ecfw_with_fan_dec_rpm = 1;
8865+
tp_features.fan_ctrl_status_undef = 1;
8866+
}
8867+
88508868
if (gfan_handle) {
88518869
/* 570, 600e/x, 770e, 770x */
88528870
fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN;
@@ -9067,7 +9085,11 @@ static int fan_read(struct seq_file *m)
90679085
if (rc < 0)
90689086
return rc;
90699087

9070-
seq_printf(m, "speed:\t\t%d\n", speed);
9088+
/* Check for fan speeds displayed in hexadecimal */
9089+
if (!ecfw_with_fan_dec_rpm)
9090+
seq_printf(m, "speed:\t\t%d\n", speed);
9091+
else
9092+
seq_printf(m, "speed:\t\t%x\n", speed);
90719093

90729094
if (fan_status_access_mode == TPACPI_FAN_RD_TPEC_NS) {
90739095
/*

0 commit comments

Comments
 (0)