Skip to content

Commit 63345b4

Browse files
committed
Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
Pull x86 platform driver updates from Matthew Garrett: "Nothing overly exciting here - a couple of new drivers that don't do a great deal, along with some miscellaneous fixes and a couple of small feature enablement patches" * 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: x86 platform drivers: fix gpio leak toshiba_acpi: Add dependency on SERIO_I8042 asus-nb-wmi: set wapf=4 for ASUSTeK COMPUTER INC. 1015E/U Add trivial driver to disable Intel Smart Connect Add support driver for Intel Rapid Start Technology hp-wmi: add supports for POST code error asus-wmi: control wlan-led only if wapf == 4 drivers/platform/x86/intel_ips: Convert to module_pci_driver asus-nb-wmi: ignore ALS notification key code asus-wmi: append newline to messages x86: asus-laptop: fix invalid point access x86: msi-laptop: fix memleak amilo-rfkill: Add dependency on SERIO_I8042 dell-laptop: fix error return code in dell_init() hp-wmi: Enable hotkeys on some systems
2 parents 18fb38e + fef8ce1 commit 63345b4

File tree

13 files changed

+462
-40
lines changed

13 files changed

+462
-40
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
What: /sys/bus/acpi/intel-rapid-start/wakeup_events
2+
Date: July 2, 2013
3+
KernelVersion: 3.11
4+
Contact: Matthew Garrett <[email protected]>
5+
Description: An integer representing a set of wakeup events as follows:
6+
1: Wake to enter hibernation when the wakeup timer expires
7+
2: Wake to enter hibernation when the battery reaches a
8+
critical level
9+
10+
These values are ORed together. For example, a value of 3
11+
indicates that the system will wake to enter hibernation when
12+
either the wakeup timer expires or the battery reaches a
13+
critical level.
14+
15+
What: /sys/bus/acpi/intel-rapid-start/wakeup_time
16+
Date: July 2, 2013
17+
KernelVersion: 3.11
18+
Contact: Matthew Garrett <[email protected]>
19+
Description: An integer representing the length of time the system will
20+
remain asleep before waking up to enter hibernation.
21+
This value is in minutes.

drivers/platform/x86/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ config FUJITSU_TABLET
176176
config AMILO_RFKILL
177177
tristate "Fujitsu-Siemens Amilo rfkill support"
178178
depends on RFKILL
179+
depends on SERIO_I8042
179180
---help---
180181
This is a driver for enabling wifi on some Fujitsu-Siemens Amilo
181182
laptops.
@@ -591,6 +592,7 @@ config ACPI_TOSHIBA
591592
depends on BACKLIGHT_CLASS_DEVICE
592593
depends on INPUT
593594
depends on RFKILL || RFKILL = n
595+
depends on SERIO_I8042 || SERIO_I8042 = n
594596
select INPUT_POLLDEV
595597
select INPUT_SPARSEKMAP
596598
---help---
@@ -781,6 +783,32 @@ config APPLE_GMUX
781783
graphics as well as the backlight. Currently only backlight
782784
control is supported by the driver.
783785

786+
config INTEL_RST
787+
tristate "Intel Rapid Start Technology Driver"
788+
depends on ACPI
789+
---help---
790+
This driver provides support for modifying paramaters on systems
791+
equipped with Intel's Rapid Start Technology. When put in an ACPI
792+
sleep state, these devices will wake after either a configured
793+
timeout or when the system battery reaches a critical state,
794+
automatically copying memory contents to disk. On resume, the
795+
firmware will copy the memory contents back to RAM and resume the OS
796+
as usual.
797+
798+
config INTEL_SMARTCONNECT
799+
tristate "Intel Smart Connect disabling driver"
800+
depends on ACPI
801+
---help---
802+
Intel Smart Connect is a technology intended to permit devices to
803+
update state by resuming for a short period of time at regular
804+
intervals. If a user enables this functionality under Windows and
805+
then reboots into Linux, the system may remain configured to resume
806+
on suspend. In the absence of any userspace to support it, the system
807+
will then remain awake until something triggers another suspend.
808+
809+
This driver checks to determine whether the device has Intel Smart
810+
Connect enabled, and if so disables it.
811+
784812
config PVPANIC
785813
tristate "pvpanic device support"
786814
depends on ACPI

drivers/platform/x86/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,7 @@ obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o
5151
obj-$(CONFIG_SAMSUNG_Q10) += samsung-q10.o
5252
obj-$(CONFIG_APPLE_GMUX) += apple-gmux.o
5353
obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o
54+
obj-$(CONFIG_INTEL_RST) += intel-rst.o
55+
obj-$(CONFIG_INTEL_SMARTCONNECT) += intel-smartconnect.o
5456

5557
obj-$(CONFIG_PVPANIC) += pvpanic.o

drivers/platform/x86/asus-laptop.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1935,7 +1935,6 @@ static int asus_acpi_add(struct acpi_device *device)
19351935
fail_backlight:
19361936
asus_platform_exit(asus);
19371937
fail_platform:
1938-
kfree(asus->name);
19391938
kfree(asus);
19401939

19411940
return result;

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,24 @@ static struct dmi_system_id asus_quirks[] = {
180180
},
181181
.driver_data = &quirk_asus_x401u,
182182
},
183+
{
184+
.callback = dmi_matched,
185+
.ident = "ASUSTeK COMPUTER INC. 1015E",
186+
.matches = {
187+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
188+
DMI_MATCH(DMI_PRODUCT_NAME, "1015E"),
189+
},
190+
.driver_data = &quirk_asus_x401u,
191+
},
192+
{
193+
.callback = dmi_matched,
194+
.ident = "ASUSTeK COMPUTER INC. 1015U",
195+
.matches = {
196+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
197+
DMI_MATCH(DMI_PRODUCT_NAME, "1015U"),
198+
},
199+
.driver_data = &quirk_asus_x401u,
200+
},
183201
{},
184202
};
185203

@@ -256,6 +274,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
256274
{ KE_KEY, 0xB5, { KEY_CALC } },
257275
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
258276
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
277+
{ KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */
259278
{ KE_END, 0},
260279
};
261280

drivers/platform/x86/asus-wmi.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
558558
goto error;
559559
}
560560

561-
if (wlan_led_presence(asus)) {
561+
if (wlan_led_presence(asus) && (asus->driver->quirks->wapf == 4)) {
562562
INIT_WORK(&asus->wlan_led_work, wlan_led_update);
563563

564564
asus->wlan_led.name = "asus::wlan";
@@ -886,7 +886,8 @@ static int asus_new_rfkill(struct asus_wmi *asus,
886886
if (!*rfkill)
887887
return -EINVAL;
888888

889-
if (dev_id == ASUS_WMI_DEVID_WLAN)
889+
if ((dev_id == ASUS_WMI_DEVID_WLAN) &&
890+
(asus->driver->quirks->wapf == 4))
890891
rfkill_set_led_trigger_name(*rfkill, "asus-wlan");
891892

892893
rfkill_init_sw_state(*rfkill, !result);
@@ -1045,7 +1046,7 @@ static ssize_t asus_hwmon_pwm1(struct device *dev,
10451046
else if (value == 3)
10461047
value = 255;
10471048
else if (value != 0) {
1048-
pr_err("Unknown fan speed %#x", value);
1049+
pr_err("Unknown fan speed %#x\n", value);
10491050
value = -1;
10501051
}
10511052

@@ -1557,11 +1558,11 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
15571558

15581559
/* INIT enable hotkeys on some models */
15591560
if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_INIT, 0, 0, &rv))
1560-
pr_info("Initialization: %#x", rv);
1561+
pr_info("Initialization: %#x\n", rv);
15611562

15621563
/* We don't know yet what to do with this version... */
15631564
if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_SPEC, 0, 0x9, &rv)) {
1564-
pr_info("BIOS WMI version: %d.%d", rv >> 16, rv & 0xFF);
1565+
pr_info("BIOS WMI version: %d.%d\n", rv >> 16, rv & 0xFF);
15651566
asus->spec = rv;
15661567
}
15671568

@@ -1572,7 +1573,7 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
15721573
* The significance of others is yet to be found.
15731574
*/
15741575
if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_SFUN, 0, 0, &rv)) {
1575-
pr_info("SFUN value: %#x", rv);
1576+
pr_info("SFUN value: %#x\n", rv);
15761577
asus->sfun = rv;
15771578
}
15781579

@@ -1712,7 +1713,7 @@ static int asus_wmi_debugfs_init(struct asus_wmi *asus)
17121713

17131714
asus->debug.root = debugfs_create_dir(asus->driver->name, NULL);
17141715
if (!asus->debug.root) {
1715-
pr_err("failed to create debugfs directory");
1716+
pr_err("failed to create debugfs directory\n");
17161717
goto error_debugfs;
17171718
}
17181719

@@ -1985,17 +1986,17 @@ EXPORT_SYMBOL_GPL(asus_wmi_unregister_driver);
19851986
static int __init asus_wmi_init(void)
19861987
{
19871988
if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
1988-
pr_info("Asus Management GUID not found");
1989+
pr_info("Asus Management GUID not found\n");
19891990
return -ENODEV;
19901991
}
19911992

1992-
pr_info("ASUS WMI generic driver loaded");
1993+
pr_info("ASUS WMI generic driver loaded\n");
19931994
return 0;
19941995
}
19951996

19961997
static void __exit asus_wmi_exit(void)
19971998
{
1998-
pr_info("ASUS WMI generic driver unloaded");
1999+
pr_info("ASUS WMI generic driver unloaded\n");
19992000
}
20002001

20012002
module_init(asus_wmi_init);

drivers/platform/x86/dell-laptop.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,10 @@ static int __init dell_init(void)
551551
* is passed to SMI handler.
552552
*/
553553
bufferpage = alloc_page(GFP_KERNEL | GFP_DMA32);
554-
555-
if (!bufferpage)
554+
if (!bufferpage) {
555+
ret = -ENOMEM;
556556
goto fail_buffer;
557+
}
557558
buffer = page_address(bufferpage);
558559

559560
if (quirks && quirks->touchpad_led)

drivers/platform/x86/hp-wmi.c

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
5353
#define HPWMI_ALS_QUERY 0x3
5454
#define HPWMI_HARDWARE_QUERY 0x4
5555
#define HPWMI_WIRELESS_QUERY 0x5
56+
#define HPWMI_BIOS_QUERY 0x9
5657
#define HPWMI_HOTKEY_QUERY 0xc
5758
#define HPWMI_WIRELESS2_QUERY 0x1b
59+
#define HPWMI_POSTCODEERROR_QUERY 0x2a
5860

5961
enum hp_wmi_radio {
6062
HPWMI_WIFI = 0,
@@ -291,6 +293,19 @@ static int hp_wmi_tablet_state(void)
291293
return (state & 0x4) ? 1 : 0;
292294
}
293295

296+
static int hp_wmi_enable_hotkeys(void)
297+
{
298+
int ret;
299+
int query = 0x6e;
300+
301+
ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &query, sizeof(query),
302+
0);
303+
304+
if (ret)
305+
return -EINVAL;
306+
return 0;
307+
}
308+
294309
static int hp_wmi_set_block(void *data, bool blocked)
295310
{
296311
enum hp_wmi_radio r = (enum hp_wmi_radio) data;
@@ -386,6 +401,16 @@ static int hp_wmi_rfkill2_refresh(void)
386401
return 0;
387402
}
388403

404+
static int hp_wmi_post_code_state(void)
405+
{
406+
int state = 0;
407+
int ret = hp_wmi_perform_query(HPWMI_POSTCODEERROR_QUERY, 0, &state,
408+
sizeof(state), sizeof(state));
409+
if (ret)
410+
return -EINVAL;
411+
return state;
412+
}
413+
389414
static ssize_t show_display(struct device *dev, struct device_attribute *attr,
390415
char *buf)
391416
{
@@ -431,6 +456,16 @@ static ssize_t show_tablet(struct device *dev, struct device_attribute *attr,
431456
return sprintf(buf, "%d\n", value);
432457
}
433458

459+
static ssize_t show_postcode(struct device *dev, struct device_attribute *attr,
460+
char *buf)
461+
{
462+
/* Get the POST error code of previous boot failure. */
463+
int value = hp_wmi_post_code_state();
464+
if (value < 0)
465+
return -EINVAL;
466+
return sprintf(buf, "0x%x\n", value);
467+
}
468+
434469
static ssize_t set_als(struct device *dev, struct device_attribute *attr,
435470
const char *buf, size_t count)
436471
{
@@ -443,11 +478,33 @@ static ssize_t set_als(struct device *dev, struct device_attribute *attr,
443478
return count;
444479
}
445480

481+
static ssize_t set_postcode(struct device *dev, struct device_attribute *attr,
482+
const char *buf, size_t count)
483+
{
484+
int ret;
485+
u32 tmp;
486+
long unsigned int tmp2;
487+
488+
ret = kstrtoul(buf, 10, &tmp2);
489+
if (ret || tmp2 != 1)
490+
return -EINVAL;
491+
492+
/* Clear the POST error code. It is kept until until cleared. */
493+
tmp = (u32) tmp2;
494+
ret = hp_wmi_perform_query(HPWMI_POSTCODEERROR_QUERY, 1, &tmp,
495+
sizeof(tmp), sizeof(tmp));
496+
if (ret)
497+
return -EINVAL;
498+
499+
return count;
500+
}
501+
446502
static DEVICE_ATTR(display, S_IRUGO, show_display, NULL);
447503
static DEVICE_ATTR(hddtemp, S_IRUGO, show_hddtemp, NULL);
448504
static DEVICE_ATTR(als, S_IRUGO | S_IWUSR, show_als, set_als);
449505
static DEVICE_ATTR(dock, S_IRUGO, show_dock, NULL);
450506
static DEVICE_ATTR(tablet, S_IRUGO, show_tablet, NULL);
507+
static DEVICE_ATTR(postcode, S_IRUGO | S_IWUSR, show_postcode, set_postcode);
451508

452509
static void hp_wmi_notify(u32 value, void *context)
453510
{
@@ -628,6 +685,7 @@ static void cleanup_sysfs(struct platform_device *device)
628685
device_remove_file(&device->dev, &dev_attr_als);
629686
device_remove_file(&device->dev, &dev_attr_dock);
630687
device_remove_file(&device->dev, &dev_attr_tablet);
688+
device_remove_file(&device->dev, &dev_attr_postcode);
631689
}
632690

633691
static int hp_wmi_rfkill_setup(struct platform_device *device)
@@ -843,6 +901,9 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
843901
if (err)
844902
goto add_sysfs_error;
845903
err = device_create_file(&device->dev, &dev_attr_tablet);
904+
if (err)
905+
goto add_sysfs_error;
906+
err = device_create_file(&device->dev, &dev_attr_postcode);
846907
if (err)
847908
goto add_sysfs_error;
848909
return 0;
@@ -948,6 +1009,8 @@ static int __init hp_wmi_init(void)
9481009
err = hp_wmi_input_setup();
9491010
if (err)
9501011
return err;
1012+
1013+
hp_wmi_enable_hotkeys();
9511014
}
9521015

9531016
if (bios_capable) {

0 commit comments

Comments
 (0)