Commit dc56c5ac authored by Linus Torvalds's avatar Linus Torvalds

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
parents 47cf1b42 f8a31eca
...@@ -515,9 +515,33 @@ static struct asus_wmi_driver asus_nb_wmi_driver = { ...@@ -515,9 +515,33 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
.detect_quirks = asus_nb_wmi_quirks, .detect_quirks = asus_nb_wmi_quirks,
}; };
static const struct dmi_system_id asus_nb_wmi_blacklist[] __initconst = {
{
/*
* asus-nb-wm adds no functionality. The T100TA has a detachable
* USB kbd, so no hotkeys and it has no WMI rfkill; and loading
* asus-nb-wm causes the camera LED to turn and _stay_ on.
*/
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
},
},
{
/* The Asus T200TA has the same issue as the T100TA */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"),
},
},
{} /* Terminating entry */
};
static int __init asus_nb_wmi_init(void) static int __init asus_nb_wmi_init(void)
{ {
if (dmi_check_system(asus_nb_wmi_blacklist))
return -ENODEV;
return asus_wmi_register_driver(&asus_nb_wmi_driver); return asus_wmi_register_driver(&asus_nb_wmi_driver);
} }
......
...@@ -53,7 +53,7 @@ static int uncore_max_entries __read_mostly; ...@@ -53,7 +53,7 @@ static int uncore_max_entries __read_mostly;
/* Storage for uncore data for all instances */ /* Storage for uncore data for all instances */
static struct uncore_data *uncore_instances; static struct uncore_data *uncore_instances;
/* Root of the all uncore sysfs kobjs */ /* Root of the all uncore sysfs kobjs */
struct kobject *uncore_root_kobj; static struct kobject *uncore_root_kobj;
/* Stores the CPU mask of the target CPUs to use during uncore read/write */ /* Stores the CPU mask of the target CPUs to use during uncore read/write */
static cpumask_t uncore_cpu_mask; static cpumask_t uncore_cpu_mask;
/* CPU online callback register instance */ /* CPU online callback register instance */
......
...@@ -255,7 +255,7 @@ static const struct pmc_bit_map *ext_cnp_pfear_map[] = { ...@@ -255,7 +255,7 @@ static const struct pmc_bit_map *ext_cnp_pfear_map[] = {
}; };
static const struct pmc_bit_map icl_pfear_map[] = { static const struct pmc_bit_map icl_pfear_map[] = {
/* Ice Lake generation onwards only */ /* Ice Lake and Jasper Lake generation onwards only */
{"RES_65", BIT(0)}, {"RES_65", BIT(0)},
{"RES_66", BIT(1)}, {"RES_66", BIT(1)},
{"RES_67", BIT(2)}, {"RES_67", BIT(2)},
...@@ -274,7 +274,7 @@ static const struct pmc_bit_map *ext_icl_pfear_map[] = { ...@@ -274,7 +274,7 @@ static const struct pmc_bit_map *ext_icl_pfear_map[] = {
}; };
static const struct pmc_bit_map tgl_pfear_map[] = { static const struct pmc_bit_map tgl_pfear_map[] = {
/* Tiger Lake, Elkhart Lake and Jasper Lake generation onwards only */ /* Tiger Lake and Elkhart Lake generation onwards only */
{"PSF9", BIT(0)}, {"PSF9", BIT(0)},
{"RES_66", BIT(1)}, {"RES_66", BIT(1)},
{"RES_67", BIT(2)}, {"RES_67", BIT(2)},
...@@ -692,7 +692,6 @@ static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev, ...@@ -692,7 +692,6 @@ static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
kfree(lpm_regs); kfree(lpm_regs);
} }
#if IS_ENABLED(CONFIG_DEBUG_FS)
static bool slps0_dbg_latch; static bool slps0_dbg_latch;
static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset) 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) ...@@ -1133,15 +1132,6 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
&pmc_core_substate_l_sts_regs_fops); &pmc_core_substate_l_sts_regs_fops);
} }
} }
#else
static inline void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
{
}
static inline void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
{
}
#endif /* CONFIG_DEBUG_FS */
static const struct x86_cpu_id intel_pmc_core_ids[] = { static const struct x86_cpu_id intel_pmc_core_ids[] = {
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, &spt_reg_map), X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, &spt_reg_map),
...@@ -1156,7 +1146,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = { ...@@ -1156,7 +1146,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &tgl_reg_map), X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &tgl_reg_map),
X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &tgl_reg_map), X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &tgl_reg_map),
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, &tgl_reg_map), X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT, &tgl_reg_map),
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &tgl_reg_map), X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L, &icl_reg_map),
{} {}
}; };
...@@ -1260,13 +1250,11 @@ static int pmc_core_remove(struct platform_device *pdev) ...@@ -1260,13 +1250,11 @@ static int pmc_core_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static bool warn_on_s0ix_failures; static bool warn_on_s0ix_failures;
module_param(warn_on_s0ix_failures, bool, 0644); module_param(warn_on_s0ix_failures, bool, 0644);
MODULE_PARM_DESC(warn_on_s0ix_failures, "Check and warn for S0ix failures"); MODULE_PARM_DESC(warn_on_s0ix_failures, "Check and warn for S0ix failures");
static int pmc_core_suspend(struct device *dev) static __maybe_unused int pmc_core_suspend(struct device *dev)
{ {
struct pmc_dev *pmcdev = dev_get_drvdata(dev); struct pmc_dev *pmcdev = dev_get_drvdata(dev);
...@@ -1318,7 +1306,7 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev) ...@@ -1318,7 +1306,7 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev)
return false; return false;
} }
static int pmc_core_resume(struct device *dev) static __maybe_unused int pmc_core_resume(struct device *dev)
{ {
struct pmc_dev *pmcdev = dev_get_drvdata(dev); struct pmc_dev *pmcdev = dev_get_drvdata(dev);
const struct pmc_bit_map **maps = pmcdev->map->lpm_sts; const struct pmc_bit_map **maps = pmcdev->map->lpm_sts;
...@@ -1348,8 +1336,6 @@ static int pmc_core_resume(struct device *dev) ...@@ -1348,8 +1336,6 @@ static int pmc_core_resume(struct device *dev)
return 0; return 0;
} }
#endif
static const struct dev_pm_ops pmc_core_pm_ops = { static const struct dev_pm_ops pmc_core_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(pmc_core_suspend, pmc_core_resume) SET_LATE_SYSTEM_SLEEP_PM_OPS(pmc_core_suspend, pmc_core_resume)
}; };
......
...@@ -282,9 +282,7 @@ struct pmc_dev { ...@@ -282,9 +282,7 @@ struct pmc_dev {
u32 base_addr; u32 base_addr;
void __iomem *regbase; void __iomem *regbase;
const struct pmc_reg_map *map; const struct pmc_reg_map *map;
#if IS_ENABLED(CONFIG_DEBUG_FS)
struct dentry *dbgfs_dir; struct dentry *dbgfs_dir;
#endif /* CONFIG_DEBUG_FS */
int pmc_xram_read_bit; int pmc_xram_read_bit;
struct mutex lock; /* generic mutex lock for PMC Core */ struct mutex lock; /* generic mutex lock for PMC Core */
......
...@@ -522,8 +522,8 @@ static int mshw0011_probe(struct i2c_client *client) ...@@ -522,8 +522,8 @@ static int mshw0011_probe(struct i2c_client *client)
strlcpy(board_info.type, "MSHW0011-bat0", I2C_NAME_SIZE); strlcpy(board_info.type, "MSHW0011-bat0", I2C_NAME_SIZE);
bat0 = i2c_acpi_new_device(dev, 1, &board_info); bat0 = i2c_acpi_new_device(dev, 1, &board_info);
if (!bat0) if (IS_ERR(bat0))
return -ENOMEM; return PTR_ERR(bat0);
data->bat0 = bat0; data->bat0 = bat0;
i2c_set_clientdata(bat0, data); i2c_set_clientdata(bat0, data);
......
...@@ -9548,7 +9548,7 @@ static ssize_t tpacpi_battery_store(int what, ...@@ -9548,7 +9548,7 @@ static ssize_t tpacpi_battery_store(int what,
if (!battery_info.batteries[battery].start_support) if (!battery_info.batteries[battery].start_support)
return -ENODEV; return -ENODEV;
/* valid values are [0, 99] */ /* valid values are [0, 99] */
if (value < 0 || value > 99) if (value > 99)
return -EINVAL; return -EINVAL;
if (value > battery_info.batteries[battery].charge_stop) if (value > battery_info.batteries[battery].charge_stop)
return -EINVAL; return -EINVAL;
......
...@@ -23,7 +23,7 @@ struct xiaomi_wmi { ...@@ -23,7 +23,7 @@ struct xiaomi_wmi {
unsigned int key_code; unsigned int key_code;
}; };
int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context) static int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
{ {
struct xiaomi_wmi *data; struct xiaomi_wmi *data;
...@@ -48,7 +48,7 @@ int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context) ...@@ -48,7 +48,7 @@ int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)
return input_register_device(data->input_dev); return input_register_device(data->input_dev);
} }
void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy) static void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)
{ {
struct xiaomi_wmi *data; struct xiaomi_wmi *data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment