Calling acpi_wmi_init() at the subsys_initcall() level causes ordering
issues to appear on some systems and they are difficult to reproduce,
because there is no guaranteed ordering between subsys_initcall()
calls, so they may occur in different orders on different systems.
In particular, commit 86d9f48534 (mm/slab: fix kmemcg cache
creation delayed issue) exposed one of these issues where genl_init()
and acpi_wmi_init() are both called at the same initcall level, but
the former must run before the latter so as to avoid a NULL pointer
dereference.
For this reason, move the acpi_wmi_init() invocation to the
initcall_sync level which should still be early enough for things
to work correctly in the WMI land.
Link: https://marc.info/?t=151274596700002&r=1&w=2
Reported-by: Jonathan McDowell <[email protected]>
Reported-by: Joonsoo Kim <[email protected]>
Tested-by: Jonathan McDowell <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Lenovo Legion Y720-15IKB is another Lenovo model without a
hw rfkill switch, resulting in wifi always reported as hard
blocked.
Add the model to the list of models without rfkill switch.
Signed-off-by: Olle Liljenzin <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Calling acpi_wmi_init() at the subsys_initcall() level causes ordering
issues to appear on some systems and they are difficult to reproduce,
because there is no guaranteed ordering between subsys_initcall()
calls, so they may occur in different orders on different systems.
In particular, commit 86d9f48534 (mm/slab: fix kmemcg cache
creation delayed issue) exposed one of these issues where genl_init()
and acpi_wmi_init() are both called at the same initcall level, but
the former must run before the latter so as to avoid a NULL pointer
dereference.
For this reason, move the acpi_wmi_init() invocation to the
initcall_sync level which should still be early enough for things
to work correctly in the WMI land.
Link: https://marc.info/?t=151274596700002&r=1&w=2
Reported-by: Jonathan McDowell <[email protected]>
Reported-by: Joonsoo Kim <[email protected]>
Tested-by: Jonathan McDowell <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Add touchscreen platform data for the Teclast X98 Plus II tablet.
Signed-off-by: Paul Cercueil <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Add touchscreen platform data for the Trekstor Primebook C13 laptop.
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Fixes the following sparse warnings:
drivers/platform/x86/dell-laptop.c:289:6: warning:
symbol 'dell_set_arguments' was not declared. Should it be static?
drivers/platform/x86/dell-laptop.c:298:5: warning:
symbol 'dell_send_request' was not declared. Should it be static?
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Pali Rohár <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Add a driver for the GPD pocket device's custom fan controller, which
gets controlled through 2 GPIOs listed in a FAN02501 ACPI device.
Cc: James <[email protected]>
Suggested-by: James <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
On the X1 Yoga 2nd Generation and most likely other notebooks the FLAT
mode is reported. Decode it correctly rather than warning about an
unexpected multi mode status to be reported.
Signed-off-by: Benjamin Berg <[email protected]>
Cc: Peter FP1 Zhang <[email protected]
Cc: Lyude <[email protected]>
Reviewed-by: Lyude Paul <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
This macro deduplicates a lot of similar code in the pmc_atom.c module.
Targeting to be moved to seq_file.h eventually.
Signed-off-by: Andy Shevchenko <[email protected]>
Add touchscreen platform data for the Chuwi Vi8 tablet.
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
pkt_xfer should be used for protocol v3, and cmd_xfer otherwise. We had
one instance of these functions correct, but not the second, fall-back
case. We use the fall-back only when the first command returns an
IN_PROGRESS status, which is only used on some EC firmwares where we
don't want to constantly poll the bus, but instead back off and
sleep/retry for a little while.
Fixes: 2c7589af3c ("mfd: cros_ec: add proto v3 skeleton")
Signed-off-by: Shawn Nematbakhsh <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Benson Leung <[email protected]>
This patch adds device information to the DMI table of the cros_ec_lpc
driver for Google Glimmer devices. Since Google BIOS does not enumerate
devices in the LPC bus, the cros_ec_lpc driver checks for system
compatibility and registers the cros_ec device itself.
Signed-off-by: Thierry Escande <[email protected]>
Reviewed-by: Gwendal Grignou <[email protected]>
Signed-off-by: Benson Leung <[email protected]>
Commit 12278dc7c5 ("platform/chrome: cros_ec_lpc: Add support for
GOOG004 ACPI device") added support when the firmware reports the ACPI
device, there are some firmwares though that doesn't report this device
but have it. In such cases we need to instantiate the driver explicitly
if it is not instantiated through ACPI.
Fixes: 12278dc7c5 ("platform/chrome: cros_ec_lpc: Add support for GOOG004 ACPI device")
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
Signed-off-by: Thierry Escande <[email protected]>
Reviewed-by: Gwendal Grignou <[email protected]>
Signed-off-by: Benson Leung <[email protected]>
Pointer request is being assigned but never used, so remove it. Cleans
up the clang warning:
drivers/platform/chrome/cros_ec_lpc.c:68:2: warning: Value stored to
'request' is never read
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Benson Leung <[email protected]>
As gcc-8 reports, we zero out the wrong byte:
drivers/platform/chrome/cros_ec_sysfs.c: In function 'show_ec_version':
drivers/platform/chrome/cros_ec_sysfs.c:190:12: error: array subscript 4294967295 is above array bounds of 'uint8_t[]' [-Werror=array-bounds]
This changes the code back to what it did before changing to a
zero-length array structure.
Fixes: a841178445 ("mfd: cros_ec: Use a zero-length array for command data")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Benson Leung <[email protected]>
Declare chromeos_laptop structures as const as they are only used during
a copy operation. As their value is never modified during runtime, they
can be made const.
Signed-off-by: Bhumika Goyal <[email protected]>
Signed-off-by: Benson Leung <[email protected]>
The cros_ec_dev module is responsible for registering the MFD devices
attached to the ChromeOS EC. This patch moves this module to drivers/mfd
so calls to mfd_add_devices() are not done from outside the MFD subtree
anymore.
Signed-off-by: Thierry Escande <[email protected]>
Reviewed-by: Gwendal Grignou <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
This patch splits the cros_ec_devs module in two parts with a
cros_ec_dev module responsible for handling MFD devices registration and
a cros_ec_ctl module responsible for handling the various user-space
interfaces.
For consistency purpose, the driver name for the cros_ec_dev module is
now cros-ec-dev instead of cros-ec-ctl.
In the next commit, the new cros_ec_dev module will be moved to the MFD
subtree so mfd_add_devices() calls are not done from outside MFD.
Signed-off-by: Thierry Escande <[email protected]>
Reviewed-by: Gwendal Grignou <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Add touchscreen info for the Trekstor SurfTab twin 10.1 ST10432-8
tablet. Resolution based on output of evemu-record.
Signed-off-by: Bernhard Übelacker <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
This allocation won't fail in the current kernel because it's small but
not checking for kmalloc() failures introduces static checker warnings
so let's fix it.
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Sending the switch state change twice within the same frame is invalid
evdev protocol and only works if the client handles keys immediately as
well. Processing events immediately is incorrect, it forces a fake
order of events that does not exist on the device.
Recent versions of libinput changed to only process the device state and
SYN_REPORT time, so now the key event is lost.
https://bugs.freedesktop.org/show_bug.cgi?id=104041
Signed-off-by: Peter Hutterer <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
This machine reports number of keyboard backlight led levels, instead of
value of the last led level index. Therefore max_brightness properly needs
to be subtracted by 1 to match led max_brightness API.
Signed-off-by: Pali Rohár <[email protected]>
Reported-by: Gabriel M. Elder <[email protected]>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=196913
Signed-off-by: Darren Hart (VMware) <[email protected]>
This allocation won't fail in the current kernel because it's small but
not checking for kmalloc() failures introduces static checker warnings
so let's fix it.
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Sending the switch state change twice within the same frame is invalid
evdev protocol and only works if the client handles keys immediately as
well. Processing events immediately is incorrect, it forces a fake
order of events that does not exist on the device.
Recent versions of libinput changed to only process the device state and
SYN_REPORT time, so now the key event is lost.
https://bugs.freedesktop.org/show_bug.cgi?id=104041
Signed-off-by: Peter Hutterer <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
This model does not have a hardware rfkill switch, add it to the
no_hw_rfkill_list to prevent the radio always being blocked.
Reported-by: Roger Jargoyhen <[email protected]>
Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Address the following checkpatch warning by using __func__ instead:
WARNING: Prefer using '"%s...", __func__' to using 'write_ec_cmd',
this function's name, in a string
Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Address the following checkpatch warning by removing unnecessary else
blocks:
WARNING: else is not generally useful after a break or return
Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
The new notify_handler logic determining if autorelease should be used or
not is a bit awkward, and can result in more than one call to
sparse_keymap_report_event for the same event (scancode). The nesting
and long lines also made it difficult to read.
Simplify the logic by eliminating a level of nesting with a goto and
always calculate autorelease and val so we can make a single call to
sparse_keymap_report_event.
Signed-off-by: Darren Hart (VMware) <[email protected]>
Reviewed-by: Stefan Brüns <[email protected]>
Tested-by: Stefan Brüns <[email protected]>
Cc: AceLan Kao <[email protected]>
The Lenovo Helix 2 and Dell XPS 12 (9Q33) have an extra button on the
front showing a 'Windows' logo, both reporting event codes 0xC2/0xC3
on press/release. On the Dell, both press/release are distinct events
while on the Helix 2 both events are generated on release.
Tested on XPS 12, for info on the Helix 2 see:
https://www.spinics.net/lists/ibm-acpi-devel/msg03982.html
Signed-off-by: Stefan Brüns <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
The Rotate Lock button event is emitted on the XPS 12 (BIOS A8, but not
on BIOS A2).
Signed-off-by: Stefan Brüns <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Currently all key events use autorelease, but this forbids use as a
modifier key.
As all event codes come in even/odd pairs, we can lookup the key type
(KE_KEY/KE_IGNORE) for the key up event corresponding to the currently
handled key down event. If the key up is ignored, we keep setting the
autorelease flag for the key down.
Signed-off-by: Stefan Brüns <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
Event code 0xcc is emitted by several convertibles (Dell XPS 12 9Q33 BIOS
A8, Dell XPS 13 2in1 9365, HP Spectre x360, Lenovo Thinkpad Helix) when
entering tablet mode, and 0xcd on return to laptop mode.
Signed-off-by: Stefan Brüns <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
In struct quirk_entry some boolean fields used int, some u8 type. Change
them all to bool type.
Signed-off-by: Pali Rohár <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
This machine reports number of keyboard backlight led levels, instead of
value of the last led level index. Therefore max_brightness properly needs
to be subtracted by 1 to match led max_brightness API.
Signed-off-by: Pali Rohár <[email protected]>
Reported-by: Gabriel M. Elder <[email protected]>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=196913
Signed-off-by: Darren Hart (VMware) <[email protected]>
This patch removes unnecessary header files and newlines.
It also fixes some alignment issues.
Signed-off-by: Souvik Kumar Chakravarty <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Suspend with shallow wakes is not a useful parameter since the phenomena
does not exist on deployed devices and is only a parameter of use during
device power-on phase. The field always reads zero. Additionally there
are other easier methods to detect it, e.g., if the S0ix counter
increments by more than one during suspend. Hence the field is superfluous
and can be removed.
This patch also slightly renames the S0ix total field for better
viewability.
Signed-off-by: Souvik Kumar Chakravarty <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Suspend stats are not reported consistently due to a limitation in the PMC
firmware. This limitation causes a delay in updating the s0ix counters and
residencies in the telemetry log upon s0ix exit. As a consequence, reading
these counters from the suspend-exit notifier may result in zero read.
This patch fixes this issue by cross-verifying the s0ix residencies from
the GCR TELEM registers in case the counters are not incremented in the
telemetry log after suspend.
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=197833
Reported-and-tested-by: Rajneesh Bhardwaj <[email protected]>
Signed-off-by: Souvik Kumar Chakravarty <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Add intel_pmc_gcr_read64() API for reading from 64-bit GCR registers.
This API will be called from intel_telemetry. Update description of
intel_pmc_gcr_read().
Signed-off-by: Souvik Kumar Chakravarty <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Remove the IRQF_NO_THREAD irq flag, there is no need for it and it breaks
irq-sharing with the "acpi" irq when passing "threadirqs" on the kernel
cmdline, as the acpi/osl.c code does not pass IRQF_NO_THREAD.
Signed-off-by: Hans de Goede <[email protected]>
Reported-by: Oleksandr Natalenko <[email protected]>
Tested-by: Oleksandr Natalenko <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
New Acer laptops in 2018 will have a separate ACPI device for
notifications from the airplane mode hotkey. The device name in
the DSDT is SMKB and its ACPI _HID is 10251229.
For these models, when the airplane mode hotkey (Fn+F3) pressed,
a query 0x02 is started in the Embedded Controller, and all this
query does is a notify SMKB with the value 0x80.
Scope (_SB.PCI0.LPCB.EC0)
{
(...)
Method (_Q02, 0, NotSerialized) // _Qxx: EC Query
{
HKEV (0x2, One)
Notify (SMKB, 0x80) // Status Change
}
}
Based on code from asus-wireless
Signed-off-by: Chris Chiu <[email protected]>
Reviewed-by: João Paulo Rechi Vita <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
This patch adds support for ALS on the Zenbook UX430UQ to the asus_nb_wmi
driver. It also renames "quirk_asus_ux330uak" to "quirk_asus_forceals"
because it is now used for more than one model of computer, and should
thus have a more general name.
Signed-off-by: Kiernan Hager <[email protected]>
[andy: massaged commit message, fixed indentation and commas in the code]
Signed-off-by: Andy Shevchenko <[email protected]>
Inspiron 5675 lightbar compatible with WMI interface on alienware,
the difference lies in the zone number and color control.
Add Inspiron 5675 DMI quirks to detect by dmi_check_system().
Signed-off-by: Chang Liu <[email protected]>
Acked-by: Mario Limonciello <[email protected]>
[andy: massaged commit message]
Signed-off-by: Andy Shevchenko <[email protected]>
Pull timer updates from Thomas Gleixner:
- The final conversion of timer wheel timers to timer_setup().
A few manual conversions and a large coccinelle assisted sweep and
the removal of the old initialization mechanisms and the related
code.
- Remove the now unused VSYSCALL update code
- Fix permissions of /proc/timer_list. I still need to get rid of that
file completely
- Rename a misnomed clocksource function and remove a stale declaration
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
m68k/macboing: Fix missed timer callback assignment
treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts
timer: Remove redundant __setup_timer*() macros
timer: Pass function down to initialization routines
timer: Remove unused data arguments from macros
timer: Switch callback prototype to take struct timer_list * argument
timer: Pass timer_list pointer to callbacks unconditionally
Coccinelle: Remove setup_timer.cocci
timer: Remove setup_*timer() interface
timer: Remove init_timer() interface
treewide: setup_timer() -> timer_setup() (2 field)
treewide: setup_timer() -> timer_setup()
treewide: init_timer() -> setup_timer()
treewide: Switch DEFINE_TIMER callbacks to struct timer_list *
s390: cmm: Convert timers to use timer_setup()
lightnvm: Convert timers to use timer_setup()
drivers/net: cris: Convert timers to use timer_setup()
drm/vc4: Convert timers to use timer_setup()
block/laptop_mode: Convert timers to use timer_setup()
net/atm/mpc: Avoid open-coded assignment of timer callback function
...
Pull x86 platform driver fixes from Darren Hart:
"Fix two issues resulting from the dell-smbios refactoring and
introduction of the dell-smbios-wmi dispatcher.
The first ensures a proper error code is returned when kzalloc fails.
The second avoids an issue in older Dell BIOS implementations which
would fail if the more complex calls were made by limiting those
platforms to the simple calls such as those used by the existing
dell-laptop and dell-wmi drivers, preserving their functionality prior
to the addition of the dell-smbios-wmi dispatcher"
* tag 'platform-drivers-x86-v4.15-2' of git://git.infradead.org/linux-platform-drivers-x86:
platform/x86: dell-laptop: fix error return code in dell_init()
platform/x86: dell-smbios-wmi: Disable userspace interface if missing hotfix