Commit graph

2422 commits

Author SHA1 Message Date
Mario Limonciello 980f481d63 platform/x86: dell-smbios: only run if proper oem string is detected
The proper way to indicate that a system is a 'supported' Dell System
is by the presence of this string in OEM strings.

Allowing the driver to load on non-Dell systems will have undefined
results.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:58 -07:00
Mario Limonciello f97e058cfe platform/x86: wmi: Don't allow drivers to get each other's GUIDs
The only driver using this was dell-wmi, and it really was a hack.
The driver was getting a data attribute from another driver and this
type of action should not be encouraged.

Rather drivers that need to interact with one another should pass
data back and forth via exported functions.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:58 -07:00
Mario Limonciello 92b8c540bc platform/x86: dell-wmi-descriptor: split WMI descriptor into it's own driver
All communication on individual GUIDs should occur in separate drivers.
Allowing a driver to communicate with the bus to another GUID is just
a hack that discourages drivers to adopt the bus model.

The information found from the WMI descriptor driver is now exported
for use by other drivers.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:58 -07:00
Mario Limonciello fa9f924c7f platform/x86: dell-wmi: don't check length returned
This is intended to be variable and provided by the platform.
Some platforms this year will be adopting a 32k WMI buffer, so don't
complain when encountering those platforms or any other future changes.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:58 -07:00
Mario Limonciello 7e6dcbebcb platform/x86: dell-wmi: clean up wmi descriptor check
Some cases the wrong type was used for errors and checks can be
done more cleanly.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:57 -07:00
Mario Limonciello d0bf42d83e platform/x86: dell-wmi: increase severity of some failures
There is a lot of error checking in place for the format of the WMI
descriptor buffer, but some of the potentially raised issues should
be considered critical failures.

If the buffer size or header don't match, this is a good indication
that the buffer format changed in a way that the rest of the data
should not be relied upon.

For the remaining data set vectors, continue to notate a warning
in undefined results, but as those are fields that the descriptor
intended to refer to other applications, don't fail if they're new
values.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:57 -07:00
Mario Limonciello 722c856d46 platform/x86: wmi: Add new method wmidev_evaluate_method
Drivers properly using the wmibus can pass their wmi_device
pointer rather than the GUID back to the WMI bus to evaluate
the proper methods.

Any "new" drivers added that use the WMI bus should use this
rather than the old wmi_evaluate_method that would take the
GUID.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:57 -07:00
Mario Limonciello f35a8efe2c platform/x86: dell-smbios: Prefix class/select with cmd_
Later on these structures will be brought up to userspace.
the word "class" is a reserved word in c++ and this will prevent
uapi headers from being included directly in c++ programs.

To make life easier on these applications, prepare the change now.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03 16:33:57 -07:00
Hans de Goede 455e027f33 platform/x86: intel_cht_int33fe: Update fusb302 type string, add properties
The fusb302 driver as merged in staging uses "typec_fusb302" as i2c-id
rather then just "fusb302" and needs us to set a number of device-
properties, adjust the intel_cht_int33fe driver accordingly.

One of the properties set is max-snk-mv which makes the fusb302 driver
negotiate up to 12V charging voltage, which is a bad idea on boards
which are not setup to handle this, so this commit also adds 2 extra
sanity checks to make sure that the expected Whiskey Cove PMIC +
TI bq24292i charger combo, which can handle 12V, is present.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-03 13:52:28 +02:00
Sergey Tshovrebov 3fcf2b2a25 platform/x86: silead_dmi: Add entry for the Digma e200 tablet
Add touchscreen platform data for the Digma e200 tablet.

Signed-off-by: Sergey Tshovrebov <sinxwal@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-03 13:32:09 +02:00
Hans de Goede 5c24c05efa platform/x86: silead_dmi: Fix GP-electronic T701 entry
The GP-electronic T701 has its LCD panel mounted upside-down, initially
my plan was to fix this by transparently rotating the image in the i915
driver (my "drm/i915: Deal with upside-down mounted LCD" patch), but
that approach has been rejected instead the kernel will now export
a "panel orientation" property on the drm-connector for the panel and
let userspace deal with it.

But userspace expects the touchscreen coordinates to match the panel
coordinates *before* applying any rotation, so now that we no longer hide
the upside-down-ness of the LCD panel from userspace the coordinates being
generated are wrong and we need to apply a rotation of 180 degrees to the
coordinates to fix this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-03 13:32:09 +02:00
Hans de Goede f6c7b8031d platform/x86: peaq-wmi: Remove unnecessary checks from peaq_wmi_exit
peaq_wmi_exit will only ever get called if peaq_wmi_init succeeds, so
there is no need to repeat the checks from peaq_wmi_init.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-03 13:32:09 +02:00
Hans de Goede d6fa71f1c0 platform/x86: peaq_wmi: Fix missing terminating entry for peaq_dmi_table
Add missing terminating entry to peaq_dmi_table.

Fixes: 3b95206110 ("platform/x86: peaq-wmi: Add DMI check before ...")
Cc: stable@vger.kernel.org
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-03 13:32:09 +02:00
Philipp Hug b231669ca3 platform/x86: ideapad-laptop: Add Lenovo Yoga 920-13IKB to no_hw_rfkill dmi list
The Lenovo Yoga 920-13IKB does not have a hw rfkill switch, and trying
to read the hw rfkill switch through the ideapad module causes it to
always report as blocked.

This commit adds the Lenovo Yoga 920-13IKB to the no_hw_rfkill dmi list,
fixing the WiFI breakage.

Signed-off-by: Philipp Hug <philipp@hug.cx>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-10-31 14:33:47 -07:00
Michał Kępień c7b3e98e4d platform/x86: fujitsu-laptop: Fix radio LED detection
Radio LED detection method implemented in commit 4f62568c1f
("fujitsu-laptop: Support radio LED") turned out to be incorrect as it
causes a radio LED to be erroneously detected on a Fujitsu Lifebook E751
which has a slide switch (and thus no radio LED).  Use bit 17 of
flags_supported (the value returned by method S000 of ACPI device
FUJ02E3) to determine whether a radio LED is present as it seems to be a
more reliable indicator, based on comparing DSDT tables of four Fujitsu
Lifebook models (E744, E751, S7110, S8420).

Fixes: 4f62568c1f ("fujitsu-laptop: Support radio LED")
Reported-by: Heinrich Siebmanns <harv@gmx.de>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Heinrich Siebmanns <harv@gmx.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-30 13:20:11 +02:00
Osama Khan 163ca80013 platform/x86: hp_accel: Add quirk for HP ProBook 440 G4
Added support for HP ProBook 440 G4 laptops by including the accelerometer
orientation quirk for that device. Testing was performed based on the
axis orientation guidelines here:
https://www.kernel.org/doc/Documentation/misc-devices/lis3lv02d
which states "If the left side is elevated, X increases (becomes positive)".

When tested, on lifting the left edge, x values became increasingly negative
thus indicating an inverted x-axis on the installed lis3lv02d chip.
This was compensated by adding an entry for this device in hp_accel.c
specifying the quirk as x_inverted. The patch was tested on a
ProBook 440 G4 device and x-axis as well as y and z-axis values are now
generated as per spec.

Signed-off-by: Osama Khan <osama.khan@ericsson.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-27 20:54:01 +03:00
Srinivas Pandruvada 5520437beb platform/x86: intel_turbo_max_3: Add Skylake platform
Ev Kontsevoy reported that he can't see the presence of
"/proc/sys/kernel/sched_itmt_enabled" on i9-7900x with Asrock x299
Taichi system even if he enabled "Turbo 3.0" in the BIOS.

The problem is that even if one core max is 200MHz more than others, the
current implementation couldn't enumerate that with the way the system
is configured.

The system by default configured for legacy mode (no HWP or speed shift
technology), in this mode only way we can enumerate via the mail box
interface as implemented in this driver. We were planing to only use
this driver for Broadwell, but we need to extend this because some
Skylake system has same issue as Braodwell systems.

On this system BIOS allows to change to HWP mode, where we expect that
we can enumerate favored core with ACPI-CPPC. But on this system the
core priority is 0xff for all cores in CPPC object. So this is not an
option.

Hence this change allows Skylake systems to be enumerate favored core
similar to Broadwell in legacy mode.

Reported-and-tested-by: Ev Kontsevoy <ev@kontsevoy.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-27 20:54:01 +03:00
Andy Shevchenko 026930bc06 platform/x86: intel_telemetry: Remove useless default in Kconfig
'default n' is a default behaviour of Kconfig options. So, remove
explicit line from Kconfig.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-27 19:18:43 +03:00
Andy Shevchenko cfab22c012 platform/x86: intel_telemetry: Add needed inclusion
linux/io.h defines readq() and ioremap_nocache() / iounmap() functions.

If not included, the build fails:

intel_telemetry_pltdrv.c:1165:31: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
intel_telemetry_pltdrv.c:1165:33: error: implicit declaration of function 'ioremap_nocache' [-Werror=implicit-function-declaration]
intel_telemetry_pltdrv.c:1202:3: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
intel_telemetry_pltdrv.c:900:20: error: implicit declaration of function 'readq' [-Werror=implicit-function-declaration]

Fix this by including linux/io.h.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-27 19:18:43 +03:00
Kuppuswamy Sathyanarayanan e3075fd6f8 platform/x86: intel_pmc_ipc: Use spin_lock to protect GCR updates
Currently, update_no_reboot_bit() function implemented in this driver
uses mutex_lock() to protect its register updates. But this function is
called with in atomic context in iTCO_wdt_start() and iTCO_wdt_stop()
functions in iTCO_wdt.c driver, which in turn causes "sleeping into
atomic context" issue. This patch fixes this issue by replacing the
mutex_lock() with spin_lock() to protect the GCR read/write/update APIs.

Fixes: 9d855d4 ("platform/x86: intel_pmc_ipc: Fix iTCO_wdt GCS memory mapping failure")
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kupuswamy@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-23 20:17:49 +03:00
Rajneesh Bhardwaj a5e50220ed platform/x86: intel_telemetry: cleanup redundant headers
Removes unnecessary header files included in the driver and sorts the
remaining ones in the alphabetical order.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-23 20:01:52 +03:00
Rajneesh Bhardwaj 999c8397df platform/x86: intel_telemetry: Fix typos
Telemetry word is misspelled several times in this file as Telemtry. This
fixes the spelling mistake and folds in another minor typo.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-23 20:01:52 +03:00
Rajneesh Bhardwaj 2cb81ac078 platform/x86: intel_telemetry: Fix load failure info
Intel Telemetry driver depends on IPC1 interface. If IPC1 interface is
disabled on a given platform by the system firmware, the driver does not
load but prints misleading information in the dmesg logs.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-23 20:01:52 +03:00
Colin Ian King f0d962392a platform/x86: intel_cht_int33fe: make a couple of local functions static
The functions cht_int33fe_check_for_max17047 and cht_int33fe_find_max17047
are local to the source and do not need to be in global scope, so make
them static.

Cleans up sparse warnings:
symbol 'cht_int33fe_check_for_max17047' was not declared. Should it be
static?
symbol 'cht_int33fe_find_max17047' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-23 20:01:52 +03:00
Colin Ian King 36c282b31f platform/x86: mlx-platform: make a couple of structures static
The structures mlxplat_dev and mlxplat_hotplug are local to the source
and do not need to be in global scope, so make them static.

Cleans up sparse warnings:
symbol 'mlxplat_dev' was not declared. Should it be static?
symbol 'mlxplat_hotplug' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-10-16 13:45:07 -07:00
Hans de Goede 485f2a5811 platform/x86: silead_dmi: Add entry for the Chuwi Hi8 Pro tablet
Add touchscreen platform data for the Chuwi Hi8 Pro tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-10-16 13:12:23 -07:00
Andy Shevchenko 8f21b74e7c platform/x86: intel_ips: Remove FSF address from GPL notice
This patch removes the FSF address from the GPL notice to fix a
checkpatch.pl CHECK message.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:07:15 +03:00
Andy Shevchenko b8cc799ddc platform/x86: intel_ips: Remove unneeded fields and label
There are fields in the struct ips_mcp_limits which are not used
anywhere and a label which we may get rid of.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:07:14 +03:00
Andy Shevchenko d2fa170a25 platform/x86: intel_ips: Keep pointer to struct device
...instead of keeping pointer to struct pci_dev.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:07:14 +03:00
Andy Shevchenko 512f4665d8 platform/x86: intel_ips: Use PCI_VDEVICE() macro
Intel vendor ID is defined globally, thus we may use PCI_VDEVICE().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:07:14 +03:00
Andy Shevchenko 8b8bd6d255 platform/x86: intel_ips: Switch to new PCI IRQ allocation API
This makes code cleaner.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:07:13 +03:00
Andy Shevchenko f5b33d94c1 platform/x86: intel_ips: Simplify error handling via devres API
Use devm_ and pcim_ functions to make error handling
simpler and code smaller and tidier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:07:13 +03:00
Hans de Goede 3b95206110 platform/x86: peaq-wmi: Add DMI check before binding to the WMI interface
It seems that the WMI GUID used by the PEAQ 2-in-1 WMI hotkeys is not
as unique as a GUID should be and is used on some other devices too.

This is causing spurious key-press reports on these other devices.

This commits adds a DMI check to the PEAQ 2-in-1 WMI hotkeys driver to
ensure that it is actually running on a PEAQ 2-in-1, fixing the
spurious key-presses on these other devices.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1497861
BugLink: https://bugzilla.suse.com/attachment.cgi?id=743182
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:07:12 +03:00
Andy Shevchenko dfea7e1827 platform/x86: peaq-wmi: Revert Blacklist Lenovo ideapad 700-15ISK
In favour of new approach this reverts commit
ff74972e96.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-08 21:06:43 +03:00
Kai Heng Feng ff74972e96 platform/x86: peaq-wmi: Blacklist Lenovo ideapad 700-15ISK
peaq-wmi on Lenovo ideapad 700-15ISK keeps sending KEY_SOUND,
which makes user's repeated keys gets interrupted.

The system does not have Dolby button, let's blacklist it.

BugLink: https://bugs.launchpad.net/bugs/1720219
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-04 15:28:06 +03:00
Kuppuswamy Sathyanarayanan d7ca5ebf24 platform/x86: intel_pmc_ipc: Use devm_* calls in driver probe function
This patch cleans up unnecessary free/alloc calls in ipc_plat_probe(),
ipc_pci_probe() and ipc_plat_get_res() functions by using devm_*
calls.

This patch also adds proper error handling for failure cases in
ipc_pci_probe() function.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
[andy: fixed style issues, missed devm_free_irq(), removed unnecessary log message]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-01 17:33:56 +03:00
Benjamin Berg dda3ec0aa6 platform/x86: thinkpad_acpi: Implement tablet mode using GMMS method
Many thinkpad laptops and convertibles provide the GMMS method to
resolve how far the laptop has been opened and whether it has been
converted into tablet mode. This allows reporting a more precise tablet
mode state to userspace.

The current implementation only reports a summarized tablet mode state
which is triggered as soon as the input devices become unusable as they
are folded away from the display.

This will work on all models where the CMMD method was used previously and
it may also work in other cases.

Thanks to Peter Zhang of Lenovo for providing information on how to use the
GMMS method to query the tablet mode.

Signed-off-by: Benjamin Berg <bberg@redhat.com>
Cc: Peter FP1 Zhang <zhangfp1@lenovo.com>
Cc: Lyude Paul <lyude@redhat.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-10-01 17:33:13 +03:00
Ville Syrjälä cd6bf7741c platform/x86: fujitsu-laptop: Don't oops when FUJ02E3 is not presnt
My Fujitsu-Siemens Lifebook S6120 doesn't have the FUJ02E3 device,
but it does have FUJ02B1. That means we do register the backlight
device (and it even seems to work), but the code will oops as soon
as we try to set the backlight brightness because it's trying to
call call_fext_func() with a NULL device. Let's just skip those
function calls when the FUJ02E3 device is not present.

Cc: Jonathan Woithe <jwoithe@just42.net>
Cc: Andy Shevchenko <andy@infradead.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: <stable@vger.kernel.org> # 4.13.x
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-29 16:44:00 -07:00
Mario Limonciello 7b11e89896 platform/x86: wmi: Destroy on cleanup rather than unregister
device_create documentation says to cleanup using device_destroy

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-27 14:57:45 -07:00
Mario Limonciello 303d1fcc0b platform/x86: wmi: Cleanup exit routine in reverse order of init
The initialize routine is:
* class -> bus -> platform

The exit routine is:
* platform -> class -> bus

Fix the exit routine to be:
* platform -> bus -> class

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-27 14:57:45 -07:00
Mario Limonciello b60ee4e091 platform/x86: wmi: Sort include list
The include list is randomly assembled right now.  Sort in alphabetical
order.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-27 14:57:44 -07:00
Mario Limonciello 7b4dd21630 platform/x86: dell-smbios: Add pr_fmt definition to driver
pr_fmt provides formatting to be used by the driver when
displaying errors and messages.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Pali Pohar <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-27 14:57:43 -07:00
Mario Limonciello 9808f3628c platform/x86: dell-wmi: Do not match on descriptor GUID modalias
The descriptor GUID is not used to indicate that WMI notifications
in the dell-wmi driver work properly.  As such a modalias should
not be present that causes this driver to load on systems with this
GUID.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Pali Pohar <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-27 14:57:42 -07:00
Mario Limonciello 72e83204b7 platform/x86: dell-wmi: Label driver as handling notifications
This driver serves the purpose of responding to WMI based notifications
from the DELL_EVENT_GUID (9DBB5994-A997-11DA-B012-B622A1EF5492).
Other GUIDs will be handled by separate drivers.

Update the language used by this driver to avoid future confusion.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-27 10:30:25 -07:00
Maxime Bellengé 4c05984459 platform/x86: asus-wmi: Add lightbar led support
Some Asus laptops (ROG series for example) are provided with a lightbar
behind the monitor. This patch make possible to switch it on and off.
This lightbar works exactly like any other led.

Signed-off-by: Maxime Bellengé <maxime.bellenge@gmail.com>
[dvhart: fix commit message format and variable declaration order]
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-27 00:26:54 -07:00
Jérôme de Bretagne 821b853662 platform/x86: intel-hid: Power button suspend on Dell Latitude 7275
On Dell Latitude 7275 the 5-button array is not exposed in the ACPI
tables, but notififies are still sent to the Intel HID device object
(device ID INT33D5) in response to power button actions.  They were
ignored as the intel-hid driver was not prepared to take care of them
until recently.

Power button wakeup from suspend-to-idle was added in:

commit 635173a17b ("intel-hid: Wake up Dell Latitude 7275 from suspend-to-idle")

However power button suspend doesn't work yet on this platform so it
would be good to add it also.

On the affected platform (for which priv->array is NULL), add a new
upfront check against the power button press notification (0xCE) to
notify_handler(), outside the wakeup mode this time, which allows
reporting the power button press event and triggers the suspend. Also
catch and ignore the corresponding power button release notification
(0xCF) to stop it from being reported as an "unknown event" in the logs.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=196115
Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
Acked-By: Mario Limonciello <mario.limonciello@dell.com>
[dvhart: minor coding style and commit message format fix]
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>

Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-22 16:49:47 -07:00
Mario Limonciello 12933ea2b8 platform/x86: intel-wmi-thunderbolt: Silence error cases
These were raised by Lukas Wunner as potential DOS attacks against
the system log by passing bad data to sysfs.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-22 15:08:19 -07:00
Allen Pais ae11c5b2c2 platform/x86: intel_telemetry_debugfs: Use standard ARRAY_SIZE() macro
Use the standard ARRAY_SIZE() macro instead of the custom
TELEM_EVT_LEN().

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-09-22 14:57:42 -07:00
Hans de Goede 5c003458db platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices
At least one BIOS enumerates the max17047 both through the INT33FE ACPI
device (it is right there in the resources table) as well as through a
separate MAX17047 device.

This commit checks for the max17047 already being enumerated through
a separate MAX17047 ACPI device and if so it uses the i2c-client
instantiated for this and attaches the device-props for the max17047 to
that i2c-client.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-09-20 16:09:36 +03:00
Mario Limonciello ce6a90027c platform/x86: Add driver to force WMI Thunderbolt controller power status
Current implementations of Intel Thunderbolt controllers will go
into a low power mode when not in use.

Many machines containing these controllers also have a GPIO wired up
that can force the controller awake.  This is offered via a ACPI-WMI
interface intended to be manipulated by a userspace utility.

This mechanism is provided by Intel to OEMs to include in BIOS.
It uses an industry wide GUID that is populated in a separate _WDG
entry with no binary MOF.

This interface allows software such as fwupd to wake up thunderbolt
controllers to query the firmware version or flash new firmware.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
[andy fixed merge conflicts and bump kernel version for ABI]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-09-20 16:07:22 +03:00