Skip to content

Commit 3dcf147

Browse files
committed
Merge tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform drivers fixes from Hans de Goede: - lenovo-ymc driver causes keyboard + touchpad to not work with >= 6.4 on some Thinkbook models, fix this - A set of small fixes for mlx-platform - Other small fixes and hw-id additions * tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type platform: mellanox: Change register offset addresses platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask platform: mellanox: mlx-platform: Fix signals polarity and latch mask platform: mellanox: Fix order in exit flow platform/x86: ISST: Reduce noise for missing numa information in logs platform/x86: msi-ec: Fix the build ACPI: scan: Create platform device for CS35L56 platform/x86/amd/pmf: Fix unsigned comparison with less than zero
2 parents 7308e92 + 2b6aa66 commit 3dcf147

File tree

7 files changed

+64
-24
lines changed

7 files changed

+64
-24
lines changed

drivers/acpi/scan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,6 +1714,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
17141714
{"BSG1160", },
17151715
{"BSG2150", },
17161716
{"CSC3551", },
1717+
{"CSC3556", },
17171718
{"INT33FE", },
17181719
{"INT3515", },
17191720
/* Non-conforming _HID for Cirrus Logic already released */

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ int amd_pmf_get_pprof_modes(struct amd_pmf_dev *pmf)
176176

177177
int amd_pmf_power_slider_update_event(struct amd_pmf_dev *dev)
178178
{
179-
u8 mode, flag = 0;
179+
u8 flag = 0;
180+
int mode;
180181
int src;
181182

182183
mode = amd_pmf_get_pprof_modes(dev);

drivers/platform/x86/intel/speed_select_if/isst_if_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ static struct pci_dev *_isst_if_get_pci_dev(int cpu, int bus_no, int dev, int fn
335335

336336
node = dev_to_node(&_pci_dev->dev);
337337
if (node == NUMA_NO_NODE) {
338-
pr_info("Fail to get numa node for CPU:%d bus:%d dev:%d fn:%d\n",
339-
cpu, bus_no, dev, fn);
338+
pr_info_once("Fail to get numa node for CPU:%d bus:%d dev:%d fn:%d\n",
339+
cpu, bus_no, dev, fn);
340340
continue;
341341
}
342342

drivers/platform/x86/lenovo-ymc.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ static bool ec_trigger __read_mostly;
2424
module_param(ec_trigger, bool, 0444);
2525
MODULE_PARM_DESC(ec_trigger, "Enable EC triggering work-around to force emitting tablet mode events");
2626

27+
static bool force;
28+
module_param(force, bool, 0444);
29+
MODULE_PARM_DESC(force, "Force loading on boards without a convertible DMI chassis-type");
30+
2731
static const struct dmi_system_id ec_trigger_quirk_dmi_table[] = {
2832
{
2933
/* Lenovo Yoga 7 14ARB7 */
@@ -35,6 +39,20 @@ static const struct dmi_system_id ec_trigger_quirk_dmi_table[] = {
3539
{ }
3640
};
3741

42+
static const struct dmi_system_id allowed_chasis_types_dmi_table[] = {
43+
{
44+
.matches = {
45+
DMI_EXACT_MATCH(DMI_CHASSIS_TYPE, "31" /* Convertible */),
46+
},
47+
},
48+
{
49+
.matches = {
50+
DMI_EXACT_MATCH(DMI_CHASSIS_TYPE, "32" /* Detachable */),
51+
},
52+
},
53+
{ }
54+
};
55+
3856
struct lenovo_ymc_private {
3957
struct input_dev *input_dev;
4058
struct acpi_device *ec_acpi_dev;
@@ -111,6 +129,13 @@ static int lenovo_ymc_probe(struct wmi_device *wdev, const void *ctx)
111129
struct input_dev *input_dev;
112130
int err;
113131

132+
if (!dmi_check_system(allowed_chasis_types_dmi_table)) {
133+
if (force)
134+
dev_info(&wdev->dev, "Force loading Lenovo YMC support\n");
135+
else
136+
return -ENODEV;
137+
}
138+
114139
ec_trigger |= dmi_check_system(ec_trigger_quirk_dmi_table);
115140

116141
priv = devm_kzalloc(&wdev->dev, sizeof(*priv), GFP_KERNEL);

drivers/platform/x86/mlx-platform.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@
6262
#define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37
6363
#define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a
6464
#define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b
65-
#define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0x3c
66-
#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0x3d
67-
#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0x3e
68-
#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0x3f
6965
#define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40
7066
#define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41
7167
#define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42
@@ -126,6 +122,10 @@
126122
#define MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET 0xaa
127123
#define MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET 0xab
128124
#define MLXPLAT_CPLD_LPC_REG_LC_PWR_ON 0xb2
125+
#define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0xb6
126+
#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0xb7
127+
#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0xb8
128+
#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9
129129
#define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2
130130
#define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3
131131
#define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7
@@ -222,7 +222,7 @@
222222
MLXPLAT_CPLD_AGGR_MASK_LC_SDWN)
223223
#define MLXPLAT_CPLD_LOW_AGGR_MASK_LOW 0xc1
224224
#define MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2 BIT(2)
225-
#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT BIT(4)
225+
#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT GENMASK(5, 4)
226226
#define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C BIT(6)
227227
#define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0)
228228
#define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0)
@@ -237,7 +237,7 @@
237237
#define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0)
238238
#define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0)
239239
#define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0)
240-
#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(5)
240+
#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6)
241241
#define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3)
242242
#define MLXPLAT_CPLD_THERMAL2_PDB_MASK BIT(4)
243243
#define MLXPLAT_CPLD_INTRUSION_MASK BIT(6)
@@ -2356,7 +2356,7 @@ mlxplat_mlxcpld_l1_switch_pwr_events_handler(void *handle, enum mlxreg_hotplug_k
23562356
u8 action)
23572357
{
23582358
dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button");
2359-
kernel_halt();
2359+
kernel_power_off();
23602360
return 0;
23612361
}
23622362

@@ -2475,7 +2475,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] = {
24752475
.reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET,
24762476
.mask = MLXPLAT_CPLD_PWR_BUTTON_MASK,
24772477
.count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_pwr_events_items_data),
2478-
.inversed = 0,
2478+
.inversed = 1,
24792479
.health = false,
24802480
},
24812481
{
@@ -2484,7 +2484,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] = {
24842484
.reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET,
24852485
.mask = MLXPLAT_CPLD_L1_CHA_HEALTH_MASK,
24862486
.count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_health_events_items_data),
2487-
.inversed = 0,
2487+
.inversed = 1,
24882488
.health = false,
24892489
.ind = 8,
24902490
},
@@ -3677,7 +3677,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = {
36773677
{
36783678
.label = "latch_reset",
36793679
.reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET,
3680-
.mask = GENMASK(7, 0) & ~BIT(5),
3680+
.mask = GENMASK(7, 0) & ~BIT(6),
36813681
.mode = 0200,
36823682
},
36833683
{
@@ -6238,8 +6238,6 @@ static void mlxplat_i2c_mux_topolgy_exit(struct mlxplat_priv *priv)
62386238
if (priv->pdev_mux[i])
62396239
platform_device_unregister(priv->pdev_mux[i]);
62406240
}
6241-
6242-
mlxplat_post_exit();
62436241
}
62446242

62456243
static int mlxplat_i2c_main_complition_notify(void *handle, int id)
@@ -6369,6 +6367,7 @@ static void __exit mlxplat_exit(void)
63696367
pm_power_off = NULL;
63706368
mlxplat_pre_exit(priv);
63716369
mlxplat_i2c_main_exit(priv);
6370+
mlxplat_post_exit();
63726371
}
63736372
module_exit(mlxplat_exit);
63746373

drivers/platform/x86/msi-ec.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
#include <linux/seq_file.h>
2828
#include <linux/string.h>
2929

30-
static const char *const SM_ECO_NAME = "eco";
31-
static const char *const SM_COMFORT_NAME = "comfort";
32-
static const char *const SM_SPORT_NAME = "sport";
33-
static const char *const SM_TURBO_NAME = "turbo";
34-
35-
static const char *const FM_AUTO_NAME = "auto";
36-
static const char *const FM_SILENT_NAME = "silent";
37-
static const char *const FM_BASIC_NAME = "basic";
38-
static const char *const FM_ADVANCED_NAME = "advanced";
30+
#define SM_ECO_NAME "eco"
31+
#define SM_COMFORT_NAME "comfort"
32+
#define SM_SPORT_NAME "sport"
33+
#define SM_TURBO_NAME "turbo"
34+
35+
#define FM_AUTO_NAME "auto"
36+
#define FM_SILENT_NAME "silent"
37+
#define FM_BASIC_NAME "basic"
38+
#define FM_ADVANCED_NAME "advanced"
3939

4040
static const char * const ALLOWED_FW_0[] __initconst = {
4141
"14C1EMS1.012",

drivers/platform/x86/serial-multi-instantiate.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,19 @@ static const struct smi_node cs35l41_hda = {
329329
.bus_type = SMI_AUTO_DETECT,
330330
};
331331

332+
static const struct smi_node cs35l56_hda = {
333+
.instances = {
334+
{ "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
335+
{ "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
336+
{ "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
337+
{ "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
338+
/* a 5th entry is an alias address, not a real device */
339+
{ "cs35l56-hda_dummy_dev" },
340+
{}
341+
},
342+
.bus_type = SMI_AUTO_DETECT,
343+
};
344+
332345
/*
333346
* Note new device-ids must also be added to ignore_serial_bus_ids in
334347
* drivers/acpi/scan.c: acpi_device_enumeration_by_parent().
@@ -337,6 +350,7 @@ static const struct acpi_device_id smi_acpi_ids[] = {
337350
{ "BSG1160", (unsigned long)&bsg1160_data },
338351
{ "BSG2150", (unsigned long)&bsg2150_data },
339352
{ "CSC3551", (unsigned long)&cs35l41_hda },
353+
{ "CSC3556", (unsigned long)&cs35l56_hda },
340354
{ "INT3515", (unsigned long)&int3515_data },
341355
/* Non-conforming _HID for Cirrus Logic already released */
342356
{ "CLSA0100", (unsigned long)&cs35l41_hda },

0 commit comments

Comments
 (0)