Skip to content

Commit 99a7583

Browse files
committed
Merge tag 'platform-drivers-x86-v4.12-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform-drivers update from Darren Hart: "This represents a significantly larger and more complex set of changes than those of prior merge windows. In particular, we had several changes with dependencies on other subsystems which we felt were best managed through merges of immutable branches, including one each from input, i2c, and leds. Two patches for the watchdog subsystem are included after discussion with Wim and Guenter following a collision in linux-next (this should be resolved and you should only see these two appear in this pull request). These are called out in the "External" section below. Summary of changes: - significant further cleanup of fujitsu-laptop and hp-wmi - new model support for ideapad, asus, silead, and xiaomi - new hotkeys for thinkpad and models using intel-vbtn - dell keyboard backlight improvements - build and dependency improvements - intel * ipc fixes, cleanups, and api updates - single isolated fixes noted below External: - watchdog: iTCO_wdt: Add PMC specific noreboot update api - watchdog: iTCO_wdt: cleanup set/unset no_reboot_bit functions - Merge branch 'ib/4.10-sparse-keymap-managed' - Merge branch 'i2c/for-INT33FE' - Merge branch 'linux-leds/dell-laptop-changes-for-4.12' platform/x86: - Add Intel Cherry Trail ACPI INT33FE device driver - remove sparse_keymap_free() calls - Make SILEAD_DMI depend on TOUCHSCREEN_SILEAD asus-wmi: - try to set als by default - fix cpufv sysfs file permission acer-wmi: - setup accelerometer when ACPI device was found ideapad-laptop: - Add IdeaPad V310-15ISK to no_hw_rfkill - Add IdeaPad 310-15IKB to no_hw_rfkill intel_pmc_ipc: - use gcr mem base for S0ix counter read - Fix iTCO_wdt GCS memory mapping failure - Add pmc gcr read/write/update api's - fix gcr offset dell-laptop: - Add keyboard backlight timeout AC settings - Handle return error form dell_get_intensity. - Protect kbd_state against races - Refactor kbd_led_triggers_store() hp-wireless: - reuse module_acpi_driver - add Xiaomi's hardware id to the supported list intel-vbtn: - add volume up and down INT33FE: - add i2c dependency hp-wmi: - Cleanup exit paths - Do not shadow errors in sysfs show functions - Use DEVICE_ATTR_(RO|RW) helper macros - Refactor dock and tablet state fetchers - Cleanup wireless get_(hw|sw)state functions - Refactor redundant HPWMI_READ functions - Standardize enum usage for constants - Cleanup local variable declarations - Do not shadow error values - Fix detection for dock and tablet mode - Fix error value for hp_wmi_tablet_state fujitsu-laptop: - simplify error handling in acpi_fujitsu_laptop_add() - do not log LED registration failures - switch to managed LED class devices - reorganize LED-related code - refactor LED registration - select LEDS_CLASS - remove redundant fields from struct fujitsu_bl - account for backlight power when determining brightness - do not log set_lcd_level() failures in bl_update_status() - ignore errors when setting backlight power - make disable_brightness_adjust a boolean - clean up use_alt_lcd_levels handling - sync brightness in set_lcd_level() - simplify set_lcd_level() - merge set_lcd_level_alt() into set_lcd_level() - switch to a managed backlight device - only handle backlight when appropriate - update debug message logged by call_fext_func() - rename call_fext_func() arguments - simplify call_fext_func() - clean up local variables in call_fext_func() - remove keycode fields from struct fujitsu_bl - model-dependent sparse keymap overrides - use a sparse keymap for hotkey event generation - switch to a managed hotkey input device - refactor hotkey input device setup - use a sparse keymap for brightness key events - switch to a managed backlight input device - refactor backlight input device setup - remove pf_device field from struct fujitsu_bl - only register platform device if FUJ02E3 is present - add and remove platform device in separate functions - simplify platform device attribute definitions - remove backlight-related attributes from the platform device - cleanup error labels in fujitsu_init() - only register backlight device if FUJ02B1 is present - sync backlight power status in acpi_fujitsu_laptop_add() - register backlight device in a separate function - simplify brightness key event generation logic - decrease indentation in acpi_fujitsu_bl_notify() intel-hid: - Add missing ->thaw callback - do not set parents of input devices explicitly - remove redundant set_bit() call - use devm_input_allocate_device() for HID events input device - make intel_hid_set_enable() take a boolean argument - simplify enabling/disabling HID events silead_dmi: - Add touchscreen info for Surftab Wintron 7.0 - Abort early if DMI does not match - Do not treat all devices as i2c_clients - Add entry for Insyde 7W tablets - Constify properties arrays intel_scu_ipc: - Introduce intel_scu_ipc_raw_command() - Introduce SCU_DEVICE() macro - Remove redundant subarch check - Rearrange init sequence - Platform data is mandatory asus-nb-wmi: - Add wapf4 quirk for the X302UA dell-*: - Call new led hw_changed API on kbd brightness change - Add a generic dell-laptop notifier chain eeepc-laptop: - Skip unknown key messages 0x50 0x51 thinkpad_acpi: - add mapping for new hotkeys - guard generic hotkey case" * tag 'platform-drivers-x86-v4.12-1' of git://git.infradead.org/linux-platform-drivers-x86: (108 commits) platform/x86: Make SILEAD_DMI depend on TOUCHSCREEN_SILEAD platform/x86: asus-wmi: try to set als by default platform/x86: asus-wmi: fix cpufv sysfs file permission platform/x86: acer-wmi: setup accelerometer when ACPI device was found platform/x86: ideapad-laptop: Add IdeaPad V310-15ISK to no_hw_rfkill platform/x86: intel_pmc_ipc: use gcr mem base for S0ix counter read platform/x86: intel_pmc_ipc: Fix iTCO_wdt GCS memory mapping failure watchdog: iTCO_wdt: Add PMC specific noreboot update api watchdog: iTCO_wdt: cleanup set/unset no_reboot_bit functions platform/x86: intel_pmc_ipc: Add pmc gcr read/write/update api's platform/x86: intel_pmc_ipc: fix gcr offset platform/x86: dell-laptop: Add keyboard backlight timeout AC settings platform/x86: dell-laptop: Handle return error form dell_get_intensity. platform/x86: hp-wireless: reuse module_acpi_driver platform/x86: intel-vbtn: add volume up and down platform/x86: INT33FE: add i2c dependency platform/x86: hp-wmi: Cleanup exit paths platform/x86: hp-wmi: Do not shadow errors in sysfs show functions platform/x86: hp-wmi: Use DEVICE_ATTR_(RO|RW) helper macros platform/x86: hp-wmi: Refactor dock and tablet state fetchers ...
2 parents c336bf8 + 6df97f8 commit 99a7583

34 files changed

+1620
-1296
lines changed

arch/x86/include/asm/intel_pmc_ipc.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#define IPC_ERR_EMSECURITY 6
2424
#define IPC_ERR_UNSIGNEDKERNEL 7
2525

26+
/* GCR reg offsets from gcr base*/
27+
#define PMC_GCR_PMC_CFG_REG 0x08
28+
#define PMC_GCR_TELEM_DEEP_S0IX_REG 0x78
29+
#define PMC_GCR_TELEM_SHLW_S0IX_REG 0x80
30+
2631
#if IS_ENABLED(CONFIG_INTEL_PMC_IPC)
2732

2833
int intel_pmc_ipc_simple_command(int cmd, int sub);
@@ -31,6 +36,9 @@ int intel_pmc_ipc_raw_cmd(u32 cmd, u32 sub, u8 *in, u32 inlen,
3136
int intel_pmc_ipc_command(u32 cmd, u32 sub, u8 *in, u32 inlen,
3237
u32 *out, u32 outlen);
3338
int intel_pmc_s0ix_counter_read(u64 *data);
39+
int intel_pmc_gcr_read(u32 offset, u32 *data);
40+
int intel_pmc_gcr_write(u32 offset, u32 data);
41+
int intel_pmc_gcr_update(u32 offset, u32 mask, u32 val);
3442

3543
#else
3644

@@ -56,6 +64,21 @@ static inline int intel_pmc_s0ix_counter_read(u64 *data)
5664
return -EINVAL;
5765
}
5866

67+
static inline int intel_pmc_gcr_read(u32 offset, u32 *data)
68+
{
69+
return -EINVAL;
70+
}
71+
72+
static inline int intel_pmc_gcr_write(u32 offset, u32 data)
73+
{
74+
return -EINVAL;
75+
}
76+
77+
static inline int intel_pmc_gcr_update(u32 offset, u32 mask, u32 val)
78+
{
79+
return -EINVAL;
80+
}
81+
5982
#endif /*CONFIG_INTEL_PMC_IPC*/
6083

6184
#endif

arch/x86/include/asm/intel_scu_ipc.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
#include <linux/notifier.h>
55

6+
#define IPCMSG_INDIRECT_READ 0x02
7+
#define IPCMSG_INDIRECT_WRITE 0x05
8+
69
#define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */
710

811
#define IPCMSG_WARM_RESET 0xF0
@@ -45,7 +48,10 @@ int intel_scu_ipc_update_register(u16 addr, u8 data, u8 mask);
4548
/* Issue commands to the SCU with or without data */
4649
int intel_scu_ipc_simple_command(int cmd, int sub);
4750
int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
48-
u32 *out, int outlen);
51+
u32 *out, int outlen);
52+
int intel_scu_ipc_raw_command(int cmd, int sub, u8 *in, int inlen,
53+
u32 *out, int outlen, u32 dptr, u32 sptr);
54+
4955
/* I2C control api */
5056
int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data);
5157

drivers/platform/x86/Kconfig

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ config FUJITSU_LAPTOP
182182
depends on INPUT
183183
depends on BACKLIGHT_CLASS_DEVICE
184184
depends on ACPI_VIDEO || ACPI_VIDEO = n
185-
depends on LEDS_CLASS || LEDS_CLASS=n
185+
select INPUT_SPARSEKMAP
186+
select LEDS_CLASS
186187
---help---
187188
This is a driver for laptops built by Fujitsu:
188189

@@ -780,6 +781,19 @@ config ACPI_CMPC
780781
keys as input device, backlight device, tablet and accelerometer
781782
devices.
782783

784+
config INTEL_CHT_INT33FE
785+
tristate "Intel Cherry Trail ACPI INT33FE Driver"
786+
depends on X86 && ACPI && I2C
787+
---help---
788+
This driver add support for the INT33FE ACPI device found on
789+
some Intel Cherry Trail devices.
790+
791+
The INT33FE ACPI device has a CRS table with I2cSerialBusV2
792+
resources for 3 devices: Maxim MAX17047 Fuel Gauge Controller,
793+
FUSB302 USB Type-C Controller and PI3USB30532 USB switch.
794+
This driver instantiates i2c-clients for these, so that standard
795+
i2c drivers for these chips can bind to the them.
796+
783797
config INTEL_HID_EVENT
784798
tristate "INTEL HID Event"
785799
depends on ACPI
@@ -1087,7 +1101,7 @@ config INTEL_TURBO_MAX_3
10871101

10881102
config SILEAD_DMI
10891103
bool "Tablets with Silead touchscreens"
1090-
depends on ACPI && DMI && I2C=y && INPUT
1104+
depends on ACPI && DMI && I2C=y && TOUCHSCREEN_SILEAD
10911105
---help---
10921106
Certain ACPI based tablets with Silead touchscreens do not have
10931107
enough data in ACPI tables for the touchscreen driver to handle

drivers/platform/x86/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
4545
obj-$(CONFIG_TOSHIBA_BT_RFKILL) += toshiba_bluetooth.o
4646
obj-$(CONFIG_TOSHIBA_HAPS) += toshiba_haps.o
4747
obj-$(CONFIG_TOSHIBA_WMI) += toshiba-wmi.o
48+
obj-$(CONFIG_INTEL_CHT_INT33FE) += intel_cht_int33fe.o
4849
obj-$(CONFIG_INTEL_HID_EVENT) += intel-hid.o
4950
obj-$(CONFIG_INTEL_VBTN) += intel-vbtn.o
5051
obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o

drivers/platform/x86/acer-wmi.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,7 @@ static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32 level,
18961896
if (!strcmp(ctx, "SENR")) {
18971897
if (acpi_bus_get_device(ah, &dev))
18981898
return AE_OK;
1899-
if (!strcmp(ACER_WMID_ACCEL_HID, acpi_device_hid(dev)))
1899+
if (strcmp(ACER_WMID_ACCEL_HID, acpi_device_hid(dev)))
19001900
return AE_OK;
19011901
} else
19021902
return AE_OK;
@@ -1917,8 +1917,7 @@ static int __init acer_wmi_get_handle(const char *name, const char *prop,
19171917
handle = NULL;
19181918
status = acpi_get_devices(prop, acer_wmi_get_handle_cb,
19191919
(void *)name, &handle);
1920-
1921-
if (ACPI_SUCCESS(status)) {
1920+
if (ACPI_SUCCESS(status) && handle) {
19221921
*ah = handle;
19231922
return 0;
19241923
} else {
@@ -1987,7 +1986,7 @@ static int __init acer_wmi_input_setup(void)
19871986
acer_wmi_notify, NULL);
19881987
if (ACPI_FAILURE(status)) {
19891988
err = -EIO;
1990-
goto err_free_keymap;
1989+
goto err_free_dev;
19911990
}
19921991

19931992
err = input_register_device(acer_wmi_input_dev);
@@ -1998,8 +1997,6 @@ static int __init acer_wmi_input_setup(void)
19981997

19991998
err_uninstall_notifier:
20001999
wmi_remove_notify_handler(ACERWMID_EVENT_GUID);
2001-
err_free_keymap:
2002-
sparse_keymap_free(acer_wmi_input_dev);
20032000
err_free_dev:
20042001
input_free_device(acer_wmi_input_dev);
20052002
return err;
@@ -2008,7 +2005,6 @@ static int __init acer_wmi_input_setup(void)
20082005
static void acer_wmi_input_destroy(void)
20092006
{
20102007
wmi_remove_notify_handler(ACERWMID_EVENT_GUID);
2011-
sparse_keymap_free(acer_wmi_input_dev);
20122008
input_unregister_device(acer_wmi_input_dev);
20132009
}
20142010

@@ -2290,8 +2286,8 @@ static int __init acer_wmi_init(void)
22902286
if (err)
22912287
return err;
22922288
err = acer_wmi_accel_setup();
2293-
if (err)
2294-
return err;
2289+
if (err && err != -ENODEV)
2290+
pr_warn("Cannot enable accelerometer\n");
22952291
}
22962292

22972293
err = platform_driver_register(&acer_platform_driver);

drivers/platform/x86/asus-laptop.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,25 +1516,21 @@ static int asus_input_init(struct asus_laptop *asus)
15161516
error = input_register_device(input);
15171517
if (error) {
15181518
pr_warn("Unable to register input device\n");
1519-
goto err_free_keymap;
1519+
goto err_free_dev;
15201520
}
15211521

15221522
asus->inputdev = input;
15231523
return 0;
15241524

1525-
err_free_keymap:
1526-
sparse_keymap_free(input);
15271525
err_free_dev:
15281526
input_free_device(input);
15291527
return error;
15301528
}
15311529

15321530
static void asus_input_exit(struct asus_laptop *asus)
15331531
{
1534-
if (asus->inputdev) {
1535-
sparse_keymap_free(asus->inputdev);
1532+
if (asus->inputdev)
15361533
input_unregister_device(asus->inputdev);
1537-
}
15381534
asus->inputdev = NULL;
15391535
}
15401536

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ static struct quirk_entry quirk_asus_x550lb = {
111111
.xusb2pr = 0x01D9,
112112
};
113113

114+
static struct quirk_entry quirk_asus_ux330uak = {
115+
.wmi_force_als_set = true,
116+
};
117+
114118
static int dmi_matched(const struct dmi_system_id *dmi)
115119
{
116120
pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -142,6 +146,15 @@ static const struct dmi_system_id asus_quirks[] = {
142146
*/
143147
.driver_data = &quirk_asus_wapf4,
144148
},
149+
{
150+
.callback = dmi_matched,
151+
.ident = "ASUSTeK COMPUTER INC. X302UA",
152+
.matches = {
153+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
154+
DMI_MATCH(DMI_PRODUCT_NAME, "X302UA"),
155+
},
156+
.driver_data = &quirk_asus_wapf4,
157+
},
145158
{
146159
.callback = dmi_matched,
147160
.ident = "ASUSTeK COMPUTER INC. X401U",
@@ -367,6 +380,15 @@ static const struct dmi_system_id asus_quirks[] = {
367380
},
368381
.driver_data = &quirk_asus_ux303ub,
369382
},
383+
{
384+
.callback = dmi_matched,
385+
.ident = "ASUSTeK COMPUTER INC. UX330UAK",
386+
.matches = {
387+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
388+
DMI_MATCH(DMI_PRODUCT_NAME, "UX330UAK"),
389+
},
390+
.driver_data = &quirk_asus_ux330uak,
391+
},
370392
{
371393
.callback = dmi_matched,
372394
.ident = "ASUSTeK COMPUTER INC. X550LB",

drivers/platform/x86/asus-wmi.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,23 +269,19 @@ static int asus_wmi_input_init(struct asus_wmi *asus)
269269

270270
err = input_register_device(asus->inputdev);
271271
if (err)
272-
goto err_free_keymap;
272+
goto err_free_dev;
273273

274274
return 0;
275275

276-
err_free_keymap:
277-
sparse_keymap_free(asus->inputdev);
278276
err_free_dev:
279277
input_free_device(asus->inputdev);
280278
return err;
281279
}
282280

283281
static void asus_wmi_input_exit(struct asus_wmi *asus)
284282
{
285-
if (asus->inputdev) {
286-
sparse_keymap_free(asus->inputdev);
283+
if (asus->inputdev)
287284
input_unregister_device(asus->inputdev);
288-
}
289285

290286
asus->inputdev = NULL;
291287
}
@@ -1108,6 +1104,15 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus)
11081104
orig_ports_available, ports_available);
11091105
}
11101106

1107+
/*
1108+
* Some devices dont support or have borcken get_als method
1109+
* but still support set method.
1110+
*/
1111+
static void asus_wmi_set_als(void)
1112+
{
1113+
asus_wmi_set_devstate(ASUS_WMI_DEVID_ALS_ENABLE, 1, NULL);
1114+
}
1115+
11111116
/*
11121117
* Hwmon device
11131118
*/
@@ -1761,7 +1766,7 @@ ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER);
17611766
ASUS_WMI_CREATE_DEVICE_ATTR(lid_resume, 0644, ASUS_WMI_DEVID_LID_RESUME);
17621767
ASUS_WMI_CREATE_DEVICE_ATTR(als_enable, 0644, ASUS_WMI_DEVID_ALS_ENABLE);
17631768

1764-
static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
1769+
static ssize_t cpufv_store(struct device *dev, struct device_attribute *attr,
17651770
const char *buf, size_t count)
17661771
{
17671772
int value, rv;
@@ -1778,7 +1783,7 @@ static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
17781783
return count;
17791784
}
17801785

1781-
static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
1786+
static DEVICE_ATTR_WO(cpufv);
17821787

17831788
static struct attribute *platform_attributes[] = {
17841789
&dev_attr_cpufv.attr,
@@ -2117,6 +2122,9 @@ static int asus_wmi_add(struct platform_device *pdev)
21172122
goto fail_rfkill;
21182123
}
21192124

2125+
if (asus->driver->quirks->wmi_force_als_set)
2126+
asus_wmi_set_als();
2127+
21202128
/* Some Asus desktop boards export an acpi-video backlight interface,
21212129
stop this from showing up */
21222130
chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);

drivers/platform/x86/asus-wmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct quirk_entry {
4444
bool store_backlight_power;
4545
bool wmi_backlight_power;
4646
bool wmi_backlight_native;
47+
bool wmi_force_als_set;
4748
int wapf;
4849
/*
4950
* For machines with AMD graphic chips, it will send out WMI event

0 commit comments

Comments
 (0)