Skip to content

Commit 921863f

Browse files
committed
Merge tag 'platform-drivers-x86-v6.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Hans de Goede: - Fix lg-laptop driver not working with 2024 LG laptop models - Add missing MODULE_DESCRIPTION() macros to various modules - nvsw-sn2201: Add check for platform_device_add_resources * tag 'platform-drivers-x86-v6.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: add missing MODULE_DESCRIPTION() macros platform/x86/intel: add missing MODULE_DESCRIPTION() macros platform/x86/siemens: add missing MODULE_DESCRIPTION() macros platform/x86: lg-laptop: Use ACPI device handle when evaluating WMAB/WMBB platform/x86: lg-laptop: Change ACPI device id platform/x86: lg-laptop: Remove LGEX0815 hotkey handling platform/x86: wireless-hotkey: Add support for LG Airplane Button platform/mellanox: nvsw-sn2201: Add check for platform_device_add_resources
2 parents a893858 + 7add1ee commit 921863f

18 files changed

+56
-56
lines changed

drivers/platform/mellanox/nvsw-sn2201.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,15 +1198,18 @@ static int nvsw_sn2201_config_pre_init(struct nvsw_sn2201 *nvsw_sn2201)
11981198
static int nvsw_sn2201_probe(struct platform_device *pdev)
11991199
{
12001200
struct nvsw_sn2201 *nvsw_sn2201;
1201+
int ret;
12011202

12021203
nvsw_sn2201 = devm_kzalloc(&pdev->dev, sizeof(*nvsw_sn2201), GFP_KERNEL);
12031204
if (!nvsw_sn2201)
12041205
return -ENOMEM;
12051206

12061207
nvsw_sn2201->dev = &pdev->dev;
12071208
platform_set_drvdata(pdev, nvsw_sn2201);
1208-
platform_device_add_resources(pdev, nvsw_sn2201_lpc_io_resources,
1209+
ret = platform_device_add_resources(pdev, nvsw_sn2201_lpc_io_resources,
12091210
ARRAY_SIZE(nvsw_sn2201_lpc_io_resources));
1211+
if (ret)
1212+
return ret;
12101213

12111214
nvsw_sn2201->main_mux_deferred_nr = NVSW_SN2201_MAIN_MUX_DEFER_NR;
12121215
nvsw_sn2201->main_mux_devs = nvsw_sn2201_main_mux_brdinfo;

drivers/platform/x86/amilo-rfkill.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ static void __exit amilo_rfkill_exit(void)
171171
}
172172

173173
MODULE_AUTHOR("Ben Hutchings <[email protected]>");
174+
MODULE_DESCRIPTION("Fujitsu-Siemens Amilo rfkill support");
174175
MODULE_LICENSE("GPL");
175176
MODULE_DEVICE_TABLE(dmi, amilo_rfkill_id_table);
176177

drivers/platform/x86/firmware_attributes_class.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ int fw_attributes_class_put(void)
4949
EXPORT_SYMBOL_GPL(fw_attributes_class_put);
5050

5151
MODULE_AUTHOR("Mark Pearson <[email protected]>");
52+
MODULE_DESCRIPTION("Firmware attributes class helper module");
5253
MODULE_LICENSE("GPL");

drivers/platform/x86/ibm_rtl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ static bool debug;
2929
module_param(debug, bool, 0644);
3030
MODULE_PARM_DESC(debug, "Show debug output");
3131

32+
MODULE_DESCRIPTION("IBM Premium Real Time Mode (PRTM) driver");
3233
MODULE_LICENSE("GPL");
3334
MODULE_AUTHOR("Keith Mannthey <[email protected]>");
3435
MODULE_AUTHOR("Vernon Mauery <[email protected]>");

drivers/platform/x86/intel/hid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ MODULE_PARM_DESC(enable_sw_tablet_mode,
3838
/* When NOT in tablet mode, VGBS returns with the flag 0x40 */
3939
#define TABLET_MODE_FLAG BIT(6)
4040

41+
MODULE_DESCRIPTION("Intel HID Event hotkey driver");
4142
MODULE_LICENSE("GPL");
4243
MODULE_AUTHOR("Alex Hung");
4344

drivers/platform/x86/intel/pmc/pltdrv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,5 @@ static void __exit pmc_core_platform_exit(void)
8686

8787
module_init(pmc_core_platform_init);
8888
module_exit(pmc_core_platform_exit);
89+
MODULE_DESCRIPTION("Intel PMC Core platform driver");
8990
MODULE_LICENSE("GPL v2");

drivers/platform/x86/intel/rst.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/module.h>
88
#include <linux/slab.h>
99

10+
MODULE_DESCRIPTION("Intel Rapid Start Technology Driver");
1011
MODULE_LICENSE("GPL");
1112

1213
static ssize_t irst_show_wakeup_events(struct device *dev,

drivers/platform/x86/intel/smartconnect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/acpi.h>
77
#include <linux/module.h>
88

9+
MODULE_DESCRIPTION("Intel Smart Connect disabling driver");
910
MODULE_LICENSE("GPL");
1011

1112
static int smartconnect_acpi_init(struct acpi_device *acpi)

drivers/platform/x86/intel/vbtn.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#define VGBS_TABLET_MODE_FLAGS (VGBS_TABLET_MODE_FLAG | VGBS_TABLET_MODE_FLAG_ALT)
2626

27+
MODULE_DESCRIPTION("Intel Virtual Button driver");
2728
MODULE_LICENSE("GPL");
2829
MODULE_AUTHOR("AceLan Kao");
2930

drivers/platform/x86/lg-laptop.c

Lines changed: 34 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ MODULE_LICENSE("GPL");
3939
#define WMI_METHOD_WMBB "2B4F501A-BD3C-4394-8DCF-00A7D2BC8210"
4040
#define WMI_EVENT_GUID WMI_EVENT_GUID0
4141

42-
#define WMAB_METHOD "\\XINI.WMAB"
43-
#define WMBB_METHOD "\\XINI.WMBB"
4442
#define SB_GGOV_METHOD "\\_SB.GGOV"
4543
#define GOV_TLED 0x2020008
4644
#define WM_GET 1
@@ -74,7 +72,7 @@ static u32 inited;
7472

7573
static int battery_limit_use_wmbb;
7674
static struct led_classdev kbd_backlight;
77-
static enum led_brightness get_kbd_backlight_level(void);
75+
static enum led_brightness get_kbd_backlight_level(struct device *dev);
7876

7977
static const struct key_entry wmi_keymap[] = {
8078
{KE_KEY, 0x70, {KEY_F15} }, /* LG control panel (F1) */
@@ -84,7 +82,6 @@ static const struct key_entry wmi_keymap[] = {
8482
* this key both sends an event and
8583
* changes backlight level.
8684
*/
87-
{KE_KEY, 0x80, {KEY_RFKILL} },
8885
{KE_END, 0}
8986
};
9087

@@ -128,11 +125,10 @@ static int ggov(u32 arg0)
128125
return res;
129126
}
130127

131-
static union acpi_object *lg_wmab(u32 method, u32 arg1, u32 arg2)
128+
static union acpi_object *lg_wmab(struct device *dev, u32 method, u32 arg1, u32 arg2)
132129
{
133130
union acpi_object args[3];
134131
acpi_status status;
135-
acpi_handle handle;
136132
struct acpi_object_list arg;
137133
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
138134

@@ -143,29 +139,22 @@ static union acpi_object *lg_wmab(u32 method, u32 arg1, u32 arg2)
143139
args[2].type = ACPI_TYPE_INTEGER;
144140
args[2].integer.value = arg2;
145141

146-
status = acpi_get_handle(NULL, (acpi_string) WMAB_METHOD, &handle);
147-
if (ACPI_FAILURE(status)) {
148-
pr_err("Cannot get handle");
149-
return NULL;
150-
}
151-
152142
arg.count = 3;
153143
arg.pointer = args;
154144

155-
status = acpi_evaluate_object(handle, NULL, &arg, &buffer);
145+
status = acpi_evaluate_object(ACPI_HANDLE(dev), "WMAB", &arg, &buffer);
156146
if (ACPI_FAILURE(status)) {
157-
acpi_handle_err(handle, "WMAB: call failed.\n");
147+
dev_err(dev, "WMAB: call failed.\n");
158148
return NULL;
159149
}
160150

161151
return buffer.pointer;
162152
}
163153

164-
static union acpi_object *lg_wmbb(u32 method_id, u32 arg1, u32 arg2)
154+
static union acpi_object *lg_wmbb(struct device *dev, u32 method_id, u32 arg1, u32 arg2)
165155
{
166156
union acpi_object args[3];
167157
acpi_status status;
168-
acpi_handle handle;
169158
struct acpi_object_list arg;
170159
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
171160
u8 buf[32];
@@ -181,18 +170,12 @@ static union acpi_object *lg_wmbb(u32 method_id, u32 arg1, u32 arg2)
181170
args[2].buffer.length = 32;
182171
args[2].buffer.pointer = buf;
183172

184-
status = acpi_get_handle(NULL, (acpi_string)WMBB_METHOD, &handle);
185-
if (ACPI_FAILURE(status)) {
186-
pr_err("Cannot get handle");
187-
return NULL;
188-
}
189-
190173
arg.count = 3;
191174
arg.pointer = args;
192175

193-
status = acpi_evaluate_object(handle, NULL, &arg, &buffer);
176+
status = acpi_evaluate_object(ACPI_HANDLE(dev), "WMBB", &arg, &buffer);
194177
if (ACPI_FAILURE(status)) {
195-
acpi_handle_err(handle, "WMAB: call failed.\n");
178+
dev_err(dev, "WMBB: call failed.\n");
196179
return NULL;
197180
}
198181

@@ -223,7 +206,7 @@ static void wmi_notify(u32 value, void *context)
223206

224207
if (eventcode == 0x10000000) {
225208
led_classdev_notify_brightness_hw_changed(
226-
&kbd_backlight, get_kbd_backlight_level());
209+
&kbd_backlight, get_kbd_backlight_level(kbd_backlight.dev->parent));
227210
} else {
228211
key = sparse_keymap_entry_from_scancode(
229212
wmi_input_dev, eventcode);
@@ -272,14 +255,7 @@ static void wmi_input_setup(void)
272255

273256
static void acpi_notify(struct acpi_device *device, u32 event)
274257
{
275-
struct key_entry *key;
276-
277258
acpi_handle_debug(device->handle, "notify: %d\n", event);
278-
if (inited & INIT_SPARSE_KEYMAP) {
279-
key = sparse_keymap_entry_from_scancode(wmi_input_dev, 0x80);
280-
if (key && key->type == KE_KEY)
281-
sparse_keymap_report_entry(wmi_input_dev, key, 1, true);
282-
}
283259
}
284260

285261
static ssize_t fan_mode_store(struct device *dev,
@@ -295,7 +271,7 @@ static ssize_t fan_mode_store(struct device *dev,
295271
if (ret)
296272
return ret;
297273

298-
r = lg_wmab(WM_FAN_MODE, WM_GET, 0);
274+
r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0);
299275
if (!r)
300276
return -EIO;
301277

@@ -306,9 +282,9 @@ static ssize_t fan_mode_store(struct device *dev,
306282

307283
m = r->integer.value;
308284
kfree(r);
309-
r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4));
285+
r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4));
310286
kfree(r);
311-
r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value);
287+
r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value);
312288
kfree(r);
313289

314290
return count;
@@ -320,7 +296,7 @@ static ssize_t fan_mode_show(struct device *dev,
320296
unsigned int status;
321297
union acpi_object *r;
322298

323-
r = lg_wmab(WM_FAN_MODE, WM_GET, 0);
299+
r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0);
324300
if (!r)
325301
return -EIO;
326302

@@ -347,7 +323,7 @@ static ssize_t usb_charge_store(struct device *dev,
347323
if (ret)
348324
return ret;
349325

350-
r = lg_wmbb(WMBB_USB_CHARGE, WM_SET, value);
326+
r = lg_wmbb(dev, WMBB_USB_CHARGE, WM_SET, value);
351327
if (!r)
352328
return -EIO;
353329

@@ -361,7 +337,7 @@ static ssize_t usb_charge_show(struct device *dev,
361337
unsigned int status;
362338
union acpi_object *r;
363339

364-
r = lg_wmbb(WMBB_USB_CHARGE, WM_GET, 0);
340+
r = lg_wmbb(dev, WMBB_USB_CHARGE, WM_GET, 0);
365341
if (!r)
366342
return -EIO;
367343

@@ -389,7 +365,7 @@ static ssize_t reader_mode_store(struct device *dev,
389365
if (ret)
390366
return ret;
391367

392-
r = lg_wmab(WM_READER_MODE, WM_SET, value);
368+
r = lg_wmab(dev, WM_READER_MODE, WM_SET, value);
393369
if (!r)
394370
return -EIO;
395371

@@ -403,7 +379,7 @@ static ssize_t reader_mode_show(struct device *dev,
403379
unsigned int status;
404380
union acpi_object *r;
405381

406-
r = lg_wmab(WM_READER_MODE, WM_GET, 0);
382+
r = lg_wmab(dev, WM_READER_MODE, WM_GET, 0);
407383
if (!r)
408384
return -EIO;
409385

@@ -431,7 +407,7 @@ static ssize_t fn_lock_store(struct device *dev,
431407
if (ret)
432408
return ret;
433409

434-
r = lg_wmab(WM_FN_LOCK, WM_SET, value);
410+
r = lg_wmab(dev, WM_FN_LOCK, WM_SET, value);
435411
if (!r)
436412
return -EIO;
437413

@@ -445,7 +421,7 @@ static ssize_t fn_lock_show(struct device *dev,
445421
unsigned int status;
446422
union acpi_object *r;
447423

448-
r = lg_wmab(WM_FN_LOCK, WM_GET, 0);
424+
r = lg_wmab(dev, WM_FN_LOCK, WM_GET, 0);
449425
if (!r)
450426
return -EIO;
451427

@@ -475,9 +451,9 @@ static ssize_t charge_control_end_threshold_store(struct device *dev,
475451
union acpi_object *r;
476452

477453
if (battery_limit_use_wmbb)
478-
r = lg_wmbb(WMBB_BATT_LIMIT, WM_SET, value);
454+
r = lg_wmbb(&pf_device->dev, WMBB_BATT_LIMIT, WM_SET, value);
479455
else
480-
r = lg_wmab(WM_BATT_LIMIT, WM_SET, value);
456+
r = lg_wmab(&pf_device->dev, WM_BATT_LIMIT, WM_SET, value);
481457
if (!r)
482458
return -EIO;
483459

@@ -496,7 +472,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device,
496472
union acpi_object *r;
497473

498474
if (battery_limit_use_wmbb) {
499-
r = lg_wmbb(WMBB_BATT_LIMIT, WM_GET, 0);
475+
r = lg_wmbb(&pf_device->dev, WMBB_BATT_LIMIT, WM_GET, 0);
500476
if (!r)
501477
return -EIO;
502478

@@ -507,7 +483,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device,
507483

508484
status = r->buffer.pointer[0x10];
509485
} else {
510-
r = lg_wmab(WM_BATT_LIMIT, WM_GET, 0);
486+
r = lg_wmab(&pf_device->dev, WM_BATT_LIMIT, WM_GET, 0);
511487
if (!r)
512488
return -EIO;
513489

@@ -586,7 +562,7 @@ static void tpad_led_set(struct led_classdev *cdev,
586562
{
587563
union acpi_object *r;
588564

589-
r = lg_wmab(WM_TLED, WM_SET, brightness > LED_OFF);
565+
r = lg_wmab(cdev->dev->parent, WM_TLED, WM_SET, brightness > LED_OFF);
590566
kfree(r);
591567
}
592568

@@ -608,16 +584,16 @@ static void kbd_backlight_set(struct led_classdev *cdev,
608584
val = 0;
609585
if (brightness >= LED_FULL)
610586
val = 0x24;
611-
r = lg_wmab(WM_KEY_LIGHT, WM_SET, val);
587+
r = lg_wmab(cdev->dev->parent, WM_KEY_LIGHT, WM_SET, val);
612588
kfree(r);
613589
}
614590

615-
static enum led_brightness get_kbd_backlight_level(void)
591+
static enum led_brightness get_kbd_backlight_level(struct device *dev)
616592
{
617593
union acpi_object *r;
618594
int val;
619595

620-
r = lg_wmab(WM_KEY_LIGHT, WM_GET, 0);
596+
r = lg_wmab(dev, WM_KEY_LIGHT, WM_GET, 0);
621597

622598
if (!r)
623599
return LED_OFF;
@@ -645,7 +621,7 @@ static enum led_brightness get_kbd_backlight_level(void)
645621

646622
static enum led_brightness kbd_backlight_get(struct led_classdev *cdev)
647623
{
648-
return get_kbd_backlight_level();
624+
return get_kbd_backlight_level(cdev->dev->parent);
649625
}
650626

651627
static LED_DEVICE(kbd_backlight, 255, LED_BRIGHT_HW_CHANGED);
@@ -672,6 +648,11 @@ static struct platform_driver pf_driver = {
672648

673649
static int acpi_add(struct acpi_device *device)
674650
{
651+
struct platform_device_info pdev_info = {
652+
.fwnode = acpi_fwnode_handle(device),
653+
.name = PLATFORM_NAME,
654+
.id = PLATFORM_DEVID_NONE,
655+
};
675656
int ret;
676657
const char *product;
677658
int year = 2017;
@@ -683,9 +664,7 @@ static int acpi_add(struct acpi_device *device)
683664
if (ret)
684665
return ret;
685666

686-
pf_device = platform_device_register_simple(PLATFORM_NAME,
687-
PLATFORM_DEVID_NONE,
688-
NULL, 0);
667+
pf_device = platform_device_register_full(&pdev_info);
689668
if (IS_ERR(pf_device)) {
690669
ret = PTR_ERR(pf_device);
691670
pf_device = NULL;
@@ -776,7 +755,7 @@ static void acpi_remove(struct acpi_device *device)
776755
}
777756

778757
static const struct acpi_device_id device_ids[] = {
779-
{"LGEX0815", 0},
758+
{"LGEX0820", 0},
780759
{"", 0}
781760
};
782761
MODULE_DEVICE_TABLE(acpi, device_ids);

0 commit comments

Comments
 (0)