Skip to content

Commit dc56c5a

Browse files
committed
Merge tag 'platform-drivers-x86-v5.7-2' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver fixes from Andy Shevchenko: - Avoid loading asus-nb-wmi module on selected laptop models - Fix S0ix debug support for Jasper Lake PMC - Few fixes which have been reported by Hulk bot and others * tag 'platform-drivers-x86-v5.7-2' of git://git.infradead.org/linux-platform-drivers-x86: platform/x86: thinkpad_acpi: Remove always false 'value < 0' statement platform/x86: intel_pmc_core: avoid unused-function warnings platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA platform/x86: intel_pmc_core: Change Jasper Lake S0ix debug reg map back to ICL platform/x86/intel-uncore-freq: make uncore_root_kobj static platform/x86: wmi: Make two functions static platform/x86: surface3_power: Fix a NULL vs IS_ERR() check in probe
2 parents 47cf1b4 + f8a31ec commit dc56c5a

File tree

7 files changed

+35
-27
lines changed

7 files changed

+35
-27
lines changed

drivers/platform/x86/asus-nb-wmi.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,33 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
515515
.detect_quirks = asus_nb_wmi_quirks,
516516
};
517517

518+
static const struct dmi_system_id asus_nb_wmi_blacklist[] __initconst = {
519+
{
520+
/*
521+
* asus-nb-wm adds no functionality. The T100TA has a detachable
522+
* USB kbd, so no hotkeys and it has no WMI rfkill; and loading
523+
* asus-nb-wm causes the camera LED to turn and _stay_ on.
524+
*/
525+
.matches = {
526+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
527+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
528+
},
529+
},
530+
{
531+
/* The Asus T200TA has the same issue as the T100TA */
532+
.matches = {
533+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
534+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"),
535+
},
536+
},
537+
{} /* Terminating entry */
538+
};
518539

519540
static int __init asus_nb_wmi_init(void)
520541
{
542+
if (dmi_check_system(asus_nb_wmi_blacklist))
543+
return -ENODEV;
544+
521545
return asus_wmi_register_driver(&asus_nb_wmi_driver);
522546
}
523547

drivers/platform/x86/intel-uncore-frequency.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int uncore_max_entries __read_mostly;
5353
/* Storage for uncore data for all instances */
5454
static struct uncore_data *uncore_instances;
5555
/* Root of the all uncore sysfs kobjs */
56-
struct kobject *uncore_root_kobj;
56+
static struct kobject *uncore_root_kobj;
5757
/* Stores the CPU mask of the target CPUs to use during uncore read/write */
5858
static cpumask_t uncore_cpu_mask;
5959
/* CPU online callback register instance */

drivers/platform/x86/intel_pmc_core.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static const struct pmc_bit_map *ext_cnp_pfear_map[] = {
255255
};
256256

257257
static const struct pmc_bit_map icl_pfear_map[] = {
258-
/* Ice Lake generation onwards only */
258+
/* Ice Lake and Jasper Lake generation onwards only */
259259
{"RES_65", BIT(0)},
260260
{"RES_66", BIT(1)},
261261
{"RES_67", BIT(2)},
@@ -274,7 +274,7 @@ static const struct pmc_bit_map *ext_icl_pfear_map[] = {
274274
};
275275

276276
static const struct pmc_bit_map tgl_pfear_map[] = {
277-
/* Tiger Lake, Elkhart Lake and Jasper Lake generation onwards only */
277+
/* Tiger Lake and Elkhart Lake generation onwards only */
278278
{"PSF9", BIT(0)},
279279
{"RES_66", BIT(1)},
280280
{"RES_67", BIT(2)},
@@ -692,7 +692,6 @@ static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
692692
kfree(lpm_regs);
693693
}
694694

695-
#if IS_ENABLED(CONFIG_DEBUG_FS)
696695
static bool slps0_dbg_latch;
697696

698697
static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset)
@@ -1133,15 +1132,6 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
11331132
&pmc_core_substate_l_sts_regs_fops);
11341133
}
11351134
}
1136-
#else
1137-
static inline void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
1138-
{
1139-
}
1140-
1141-
static inline void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
1142-
{
1143-
}
1144-
#endif /* CONFIG_DEBUG_FS */
11451135

11461136
static const struct x86_cpu_id intel_pmc_core_ids[] = {
11471137
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, &spt_reg_map),
@@ -1156,7 +1146,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
11561146
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &tgl_reg_map),
11571147
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &tgl_reg_map),
11581148
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, &tgl_reg_map),
1159-
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &tgl_reg_map),
1149+
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &icl_reg_map),
11601150
{}
11611151
};
11621152

@@ -1260,13 +1250,11 @@ static int pmc_core_remove(struct platform_device *pdev)
12601250
return 0;
12611251
}
12621252

1263-
#ifdef CONFIG_PM_SLEEP
1264-
12651253
static bool warn_on_s0ix_failures;
12661254
module_param(warn_on_s0ix_failures, bool, 0644);
12671255
MODULE_PARM_DESC(warn_on_s0ix_failures, "Check and warn for S0ix failures");
12681256

1269-
static int pmc_core_suspend(struct device *dev)
1257+
static __maybe_unused int pmc_core_suspend(struct device *dev)
12701258
{
12711259
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
12721260

@@ -1318,7 +1306,7 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev)
13181306
return false;
13191307
}
13201308

1321-
static int pmc_core_resume(struct device *dev)
1309+
static __maybe_unused int pmc_core_resume(struct device *dev)
13221310
{
13231311
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
13241312
const struct pmc_bit_map **maps = pmcdev->map->lpm_sts;
@@ -1348,8 +1336,6 @@ static int pmc_core_resume(struct device *dev)
13481336
return 0;
13491337
}
13501338

1351-
#endif
1352-
13531339
static const struct dev_pm_ops pmc_core_pm_ops = {
13541340
SET_LATE_SYSTEM_SLEEP_PM_OPS(pmc_core_suspend, pmc_core_resume)
13551341
};

drivers/platform/x86/intel_pmc_core.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,7 @@ struct pmc_dev {
282282
u32 base_addr;
283283
void __iomem *regbase;
284284
const struct pmc_reg_map *map;
285-
#if IS_ENABLED(CONFIG_DEBUG_FS)
286285
struct dentry *dbgfs_dir;
287-
#endif /* CONFIG_DEBUG_FS */
288286
int pmc_xram_read_bit;
289287
struct mutex lock; /* generic mutex lock for PMC Core */
290288

drivers/platform/x86/surface3_power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ static int mshw0011_probe(struct i2c_client *client)
522522
strlcpy(board_info.type, "MSHW0011-bat0", I2C_NAME_SIZE);
523523

524524
bat0 = i2c_acpi_new_device(dev, 1, &board_info);
525-
if (!bat0)
526-
return -ENOMEM;
525+
if (IS_ERR(bat0))
526+
return PTR_ERR(bat0);
527527

528528
data->bat0 = bat0;
529529
i2c_set_clientdata(bat0, data);

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9548,7 +9548,7 @@ static ssize_t tpacpi_battery_store(int what,
95489548
if (!battery_info.batteries[battery].start_support)
95499549
return -ENODEV;
95509550
/* valid values are [0, 99] */
9551-
if (value < 0 || value > 99)
9551+
if (value > 99)
95529552
return -EINVAL;
95539553
if (value > battery_info.batteries[battery].charge_stop)
95549554
return -EINVAL;

drivers/platform/x86/xiaomi-wmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct xiaomi_wmi {
2323
unsigned int key_code;
2424
};
2525

26-
int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
26+
static int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
2727
{
2828
struct xiaomi_wmi *data;
2929

@@ -48,7 +48,7 @@ int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
4848
return input_register_device(data->input_dev);
4949
}
5050

51-
void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
51+
static void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
5252
{
5353
struct xiaomi_wmi *data;
5454

0 commit comments

Comments
 (0)