Skip to content

Commit dbbdf54

Browse files
committed
Merge tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Darren Hart: - use MODULE_DEVICE_TABLE across several wmi drivers, keeping wmi_device_id and MODULE_ALIAS() declarations in sync - add several Ideapad models to the no_hw_rfkill list - add support for new Mellanox platforms, including new fan and LED functionality - address Dell keyboard backlight change event and power button release issues - update dell_rbu to use appropriate memory allocation mechanisms - several small fixes and Ice Lake support for intel_pmc_core - fix a suspend regression for Cherry Trail based devices in intel_int0002_vgpio - a few other routine fixes * tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86: (50 commits) MAINTAINERS: Include mlxreg.h in Mellanox Platform Driver files platform/x86: ideapad-laptop: Add S130-14IGM to no_hw_rfkill list platform/x86: mlx-platform: Fix access mode for fan_dir attribute platform/x86: mlx-platform: Add UID LED for the next generation systems platform/x86: mlx-platform: Add extra CPLD for next generation systems platform/x86: wmi-bmof: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: intel-wmi-thunderbolt: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: huawei-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: dell-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: dell-wmi-descriptor: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: dell-smbios-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE() platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h modpost: file2alias: define size of alias platform/x86: touchscreen_dmi: Add info for the CHUWI Hi10 Air tablet platform/x86: ideapad-laptop: Add Ideapad 530S-14ARR to no_hw_rfkill list platform/x86: ideapad-laptop: Add Yoga C930 to no_hw_rfkill_list platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown platform/x86: intel_pmc_core: Add Package cstates residency info platform/x86: intel_pmc_core: Add ICL platform support ...
2 parents 45ba8d5 + 9c22cc0 commit dbbdf54

27 files changed

+541
-100
lines changed

Documentation/ABI/stable/sysfs-driver-mlxreg-io

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@ Description: These files show with which CPLD versions have been burned
2121
The files are read only.
2222

2323
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/
24-
cpld3_version
24+
fan_dir
25+
26+
Date: December 2018
27+
KernelVersion: 5.0
28+
Contact: Vadim Pasternak <vadimpmellanox.com>
29+
Description: This file shows the system fans direction:
30+
forward direction - relevant bit is set 0;
31+
reversed direction - relevant bit is set 1.
32+
33+
The files are read only.
34+
35+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/
36+
jtag_enable
2537

2638
Date: November 2018
2739
KernelVersion: 5.0

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9900,6 +9900,7 @@ M: Vadim Pasternak <vadimp@mellanox.com>
99009900
L: platform-driver-x86@vger.kernel.org
99019901
S: Supported
99029902
F: drivers/platform/mellanox/
9903+
F: include/linux/platform_data/mlxreg.h
99039904

99049905
MELLANOX MLX4 core VPI driver
99059906
M: Tariq Toukan <tariqt@mellanox.com>

drivers/acpi/scan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
15451545
*/
15461546
static const struct acpi_device_id i2c_multi_instantiate_ids[] = {
15471547
{"BSG1160", },
1548+
{"BSG2150", },
15481549
{"INT33FE", },
15491550
{"INT3515", },
15501551
{}

drivers/leds/leds-mlxreg.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define MLXREG_LED_AMBER_SOLID 0x09 /* Solid amber */
2323
#define MLXREG_LED_BLINK_3HZ 167 /* ~167 msec off/on - HW support */
2424
#define MLXREG_LED_BLINK_6HZ 83 /* ~83 msec off/on - HW support */
25+
#define MLXREG_LED_CAPABILITY_CLEAR GENMASK(31, 8) /* Clear mask */
2526

2627
/**
2728
* struct mlxreg_led_data - led control data:
@@ -187,6 +188,7 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
187188
struct mlxreg_led_data *led_data;
188189
struct led_classdev *led_cdev;
189190
enum led_brightness brightness;
191+
u32 regval;
190192
int i;
191193
int err;
192194

@@ -196,6 +198,23 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
196198
if (!led_data)
197199
return -ENOMEM;
198200

201+
if (data->capability) {
202+
err = regmap_read(led_pdata->regmap, data->capability,
203+
&regval);
204+
if (err) {
205+
dev_err(&priv->pdev->dev, "Failed to query capability register\n");
206+
return err;
207+
}
208+
if (!(regval & data->bit))
209+
continue;
210+
/*
211+
* Field "bit" can contain one capability bit in 0 byte
212+
* and offset bit in 1-3 bytes. Clear capability bit and
213+
* keep only offset bit.
214+
*/
215+
data->bit &= MLXREG_LED_CAPABILITY_CLEAR;
216+
}
217+
199218
led_cdev = &led_data->led_cdev;
200219
led_data->data_parent = priv;
201220
if (strstr(data->label, "red") ||

drivers/platform/mellanox/mlxreg-hotplug.c

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
248248
struct mlxreg_core_item *item)
249249
{
250250
struct mlxreg_core_data *data;
251-
u32 asserted, regval, bit;
251+
unsigned long asserted;
252+
u32 regval, bit;
252253
int ret;
253254

254255
/*
@@ -281,7 +282,7 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
281282
asserted = item->cache ^ regval;
282283
item->cache = regval;
283284

284-
for_each_set_bit(bit, (unsigned long *)&asserted, 8) {
285+
for_each_set_bit(bit, &asserted, 8) {
285286
data = item->data + bit;
286287
if (regval & BIT(bit)) {
287288
if (item->inversed)
@@ -495,7 +496,9 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv)
495496
{
496497
struct mlxreg_core_hotplug_platform_data *pdata;
497498
struct mlxreg_core_item *item;
498-
int i, ret;
499+
struct mlxreg_core_data *data;
500+
u32 regval;
501+
int i, j, ret;
499502

500503
pdata = dev_get_platdata(&priv->pdev->dev);
501504
item = pdata->items;
@@ -507,6 +510,25 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv)
507510
if (ret)
508511
goto out;
509512

513+
/*
514+
* Verify if hardware configuration requires to disable
515+
* interrupt capability for some of components.
516+
*/
517+
data = item->data;
518+
for (j = 0; j < item->count; j++, data++) {
519+
/* Verify if the attribute has capability register. */
520+
if (data->capability) {
521+
/* Read capability register. */
522+
ret = regmap_read(priv->regmap,
523+
data->capability, &regval);
524+
if (ret)
525+
goto out;
526+
527+
if (!(regval & data->bit))
528+
item->mask &= ~BIT(j);
529+
}
530+
}
531+
510532
/* Set group initial status as mask and unmask group event. */
511533
if (item->inversed) {
512534
item->cache = item->mask;

drivers/platform/x86/asus-wmi.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,12 +2265,12 @@ static int asus_wmi_probe(struct platform_device *pdev)
22652265
int ret;
22662266

22672267
if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
2268-
pr_warn("Management GUID not found\n");
2268+
pr_warn("ASUS Management GUID not found\n");
22692269
return -ENODEV;
22702270
}
22712271

22722272
if (wdrv->event_guid && !wmi_has_guid(wdrv->event_guid)) {
2273-
pr_warn("Event GUID not found\n");
2273+
pr_warn("ASUS Event GUID not found\n");
22742274
return -ENODEV;
22752275
}
22762276

@@ -2320,11 +2320,6 @@ EXPORT_SYMBOL_GPL(asus_wmi_unregister_driver);
23202320

23212321
static int __init asus_wmi_init(void)
23222322
{
2323-
if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
2324-
pr_info("Asus Management GUID not found\n");
2325-
return -ENODEV;
2326-
}
2327-
23282323
pr_info("ASUS WMI generic driver loaded\n");
23292324
return 0;
23302325
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,4 @@ void exit_dell_smbios_wmi(void)
277277
wmi_driver_unregister(&dell_smbios_wmi_driver);
278278
}
279279

280-
MODULE_ALIAS("wmi:" DELL_WMI_SMBIOS_GUID);
280+
MODULE_DEVICE_TABLE(wmi, dell_smbios_wmi_id_table);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static struct wmi_driver dell_wmi_descriptor_driver = {
207207

208208
module_wmi_driver(dell_wmi_descriptor_driver);
209209

210-
MODULE_ALIAS("wmi:" DELL_WMI_DESCRIPTOR_GUID);
210+
MODULE_DEVICE_TABLE(wmi, dell_wmi_descriptor_id_table);
211211
MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>");
212212
MODULE_DESCRIPTION("Dell WMI descriptor driver");
213213
MODULE_LICENSE("GPL");

drivers/platform/x86/dell-wmi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ MODULE_LICENSE("GPL");
5050

5151
static bool wmi_requires_smbios_request;
5252

53-
MODULE_ALIAS("wmi:"DELL_EVENT_GUID);
54-
5553
struct dell_wmi_priv {
5654
struct input_dev *input_dev;
5755
u32 interface_version;
@@ -267,6 +265,9 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = {
267265
/* Fn-lock switched to multimedia keys */
268266
{ KE_IGNORE, 0x1, { KEY_RESERVED } },
269267

268+
/* Keyboard backlight change notification */
269+
{ KE_IGNORE, 0x3f, { KEY_RESERVED } },
270+
270271
/* Mic mute */
271272
{ KE_KEY, 0x150, { KEY_MICMUTE } },
272273

@@ -738,3 +739,5 @@ static void __exit dell_wmi_exit(void)
738739
wmi_driver_unregister(&dell_wmi_driver);
739740
}
740741
module_exit(dell_wmi_exit);
742+
743+
MODULE_DEVICE_TABLE(wmi, dell_wmi_id_table);

drivers/platform/x86/dell_rbu.c

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ static struct _rbu_data {
5959
unsigned long image_update_buffer_size;
6060
unsigned long bios_image_size;
6161
int image_update_ordernum;
62-
int dma_alloc;
6362
spinlock_t lock;
6463
unsigned long packet_read_count;
6564
unsigned long num_packets;
@@ -89,7 +88,6 @@ static struct packet_data packet_data_head;
8988

9089
static struct platform_device *rbu_device;
9190
static int context;
92-
static dma_addr_t dell_rbu_dmaaddr;
9391

9492
static void init_packet_head(void)
9593
{
@@ -380,12 +378,8 @@ static void img_update_free(void)
380378
*/
381379
memset(rbu_data.image_update_buffer, 0,
382380
rbu_data.image_update_buffer_size);
383-
if (rbu_data.dma_alloc == 1)
384-
dma_free_coherent(NULL, rbu_data.bios_image_size,
385-
rbu_data.image_update_buffer, dell_rbu_dmaaddr);
386-
else
387-
free_pages((unsigned long) rbu_data.image_update_buffer,
388-
rbu_data.image_update_ordernum);
381+
free_pages((unsigned long) rbu_data.image_update_buffer,
382+
rbu_data.image_update_ordernum);
389383

390384
/*
391385
* Re-initialize the rbu_data variables after a free
@@ -394,7 +388,6 @@ static void img_update_free(void)
394388
rbu_data.image_update_buffer = NULL;
395389
rbu_data.image_update_buffer_size = 0;
396390
rbu_data.bios_image_size = 0;
397-
rbu_data.dma_alloc = 0;
398391
}
399392

400393
/*
@@ -410,10 +403,8 @@ static void img_update_free(void)
410403
static int img_update_realloc(unsigned long size)
411404
{
412405
unsigned char *image_update_buffer = NULL;
413-
unsigned long rc;
414406
unsigned long img_buf_phys_addr;
415407
int ordernum;
416-
int dma_alloc = 0;
417408

418409
/*
419410
* check if the buffer of sufficient size has been
@@ -444,36 +435,23 @@ static int img_update_realloc(unsigned long size)
444435

445436
ordernum = get_order(size);
446437
image_update_buffer =
447-
(unsigned char *) __get_free_pages(GFP_KERNEL, ordernum);
448-
449-
img_buf_phys_addr =
450-
(unsigned long) virt_to_phys(image_update_buffer);
451-
452-
if (img_buf_phys_addr > BIOS_SCAN_LIMIT) {
453-
free_pages((unsigned long) image_update_buffer, ordernum);
454-
ordernum = -1;
455-
image_update_buffer = dma_alloc_coherent(NULL, size,
456-
&dell_rbu_dmaaddr, GFP_KERNEL);
457-
dma_alloc = 1;
458-
}
459-
438+
(unsigned char *)__get_free_pages(GFP_DMA32, ordernum);
460439
spin_lock(&rbu_data.lock);
461-
462-
if (image_update_buffer != NULL) {
463-
rbu_data.image_update_buffer = image_update_buffer;
464-
rbu_data.image_update_buffer_size = size;
465-
rbu_data.bios_image_size =
466-
rbu_data.image_update_buffer_size;
467-
rbu_data.image_update_ordernum = ordernum;
468-
rbu_data.dma_alloc = dma_alloc;
469-
rc = 0;
470-
} else {
440+
if (!image_update_buffer) {
471441
pr_debug("Not enough memory for image update:"
472442
"size = %ld\n", size);
473-
rc = -ENOMEM;
443+
return -ENOMEM;
474444
}
475445

476-
return rc;
446+
img_buf_phys_addr = (unsigned long)virt_to_phys(image_update_buffer);
447+
if (WARN_ON_ONCE(img_buf_phys_addr > BIOS_SCAN_LIMIT))
448+
return -EINVAL; /* can't happen per definition */
449+
450+
rbu_data.image_update_buffer = image_update_buffer;
451+
rbu_data.image_update_buffer_size = size;
452+
rbu_data.bios_image_size = rbu_data.image_update_buffer_size;
453+
rbu_data.image_update_ordernum = ordernum;
454+
return 0;
477455
}
478456

479457
static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)

drivers/platform/x86/huawei-wmi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ static struct wmi_driver huawei_wmi_driver = {
201201

202202
module_wmi_driver(huawei_wmi_driver);
203203

204-
MODULE_ALIAS("wmi:"WMI0_EVENT_GUID);
205-
MODULE_ALIAS("wmi:"AMW0_EVENT_GUID);
204+
MODULE_DEVICE_TABLE(wmi, huawei_wmi_id_table);
206205
MODULE_AUTHOR("Ayman Bagabas <ayman.bagabas@gmail.com>");
207206
MODULE_DESCRIPTION("Huawei WMI hotkeys");
208207
MODULE_LICENSE("GPL v2");

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ static const struct i2c_inst_data bsg1160_data[] = {
159159
{}
160160
};
161161

162+
static const struct i2c_inst_data bsg2150_data[] = {
163+
{ "bmc150_accel", IRQ_RESOURCE_GPIO, 0 },
164+
{ "bmc150_magn" },
165+
/* The resources describe a 3th client, but it is not really there. */
166+
{ "bsg2150_dummy_dev" },
167+
{}
168+
};
169+
162170
static const struct i2c_inst_data int3515_data[] = {
163171
{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
164172
{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
@@ -173,6 +181,7 @@ static const struct i2c_inst_data int3515_data[] = {
173181
*/
174182
static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
175183
{ "BSG1160", (unsigned long)bsg1160_data },
184+
{ "BSG2150", (unsigned long)bsg2150_data },
176185
{ "INT3515", (unsigned long)int3515_data },
177186
{ }
178187
};

drivers/platform/x86/ideapad-laptop.c

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
989989
.ident = "Lenovo RESCUER R720-15IKBN",
990990
.matches = {
991991
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
992-
DMI_MATCH(DMI_BOARD_NAME, "80WW"),
992+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo R720-15IKBN"),
993993
},
994994
},
995995
{
@@ -1090,6 +1090,27 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
10901090
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ISK"),
10911091
},
10921092
},
1093+
{
1094+
.ident = "Lenovo ideapad 330-15ICH",
1095+
.matches = {
1096+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1097+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 330-15ICH"),
1098+
},
1099+
},
1100+
{
1101+
.ident = "Lenovo ideapad 530S-14ARR",
1102+
.matches = {
1103+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1104+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 530S-14ARR"),
1105+
},
1106+
},
1107+
{
1108+
.ident = "Lenovo ideapad S130-14IGM",
1109+
.matches = {
1110+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1111+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad S130-14IGM"),
1112+
},
1113+
},
10931114
{
10941115
.ident = "Lenovo ideapad Y700-14ISK",
10951116
.matches = {
@@ -1153,6 +1174,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
11531174
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion Y530-15ICH"),
11541175
},
11551176
},
1177+
{
1178+
.ident = "Lenovo Legion Y530-15ICH-1060",
1179+
.matches = {
1180+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1181+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion Y530-15ICH-1060"),
1182+
},
1183+
},
11561184
{
11571185
.ident = "Lenovo Legion Y720-15IKB",
11581186
.matches = {
@@ -1244,6 +1272,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
12441272
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 920-13IKB"),
12451273
},
12461274
},
1275+
{
1276+
.ident = "Lenovo YOGA C930-13IKB",
1277+
.matches = {
1278+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1279+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA C930-13IKB"),
1280+
},
1281+
},
12471282
{
12481283
.ident = "Lenovo Zhaoyang E42-80",
12491284
.matches = {

0 commit comments

Comments
 (0)