aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/dell-laptop.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-11-28platform/x86: dell-laptop: Mark expected switch fall-throughsGustavo A. R. Silva1-0/+2
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2018-07-20platform/x86: dell-laptop: Fix backlight detectionDamien Thébault1-1/+1
Fix return code check for "max brightness" ACPI call. The Dell laptop ACPI video brightness control is not present on dell laptops anymore, but was present in older kernel versions. The code that checks the return value is incorrect since the SMM refactoring. The old code was: if (buffer->output[0] == 0) Which was changed to: ret = dell_send_request(...) if (ret) However, dell_send_request() will return 0 if buffer->output[0] == 0, so we must change the check to: if (ret == 0) This issue was found on a Dell M4800 laptop, and the fix tested on it as well. Fixes: 549b4930f057 ("dell-smbios: Introduce dispatcher for SMM calls") Signed-off-by: Damien Thébault <damien@dtbo.net> Tested-by: Damien Thébault <damien@dtbo.net> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-06-04platform/x86: dell-laptop: Fix keyboard backlight timeout on XPS 13 9370Timur Kristóf1-1/+16
The XPS 13 9370 doesn't expose the necessary KBD_LED_AC_TOKEN in the BIOS, so the driver thinks it cannot adjust the AC keyboard backlight timeout. This patch adds a quirk to fix this until Dell adds the missing token to the BIOS. For further discussion, see: https://github.com/dell/libsmbios/issues/48 Signed-off-by: Timur Kristóf <venemo@fedoraproject.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-15platform/x86: dell-laptop: Removed duplicates in DMI whitelistAlexander Abrosimov1-18/+0
Fixed a mistake in which several entries were duplicated in the DMI list from the below commit fe486138 platform/x86: dell-laptop: Add 2-in-1 devices to the DMI whitelist Signed-off-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-15platform/x86: dell-laptop: fix kbd_get_state's request valueLaszlo Toth1-1/+1
Commit 9862b43624a5 ("platform/x86: dell-laptop: Allocate buffer on heap rather than globally") broke one request, changed it back to the original value. Tested on a Dell E6540, backlight came back. Fixes: 9862b43624a5 ("platform/x86: dell-laptop: Allocate buffer on heap rather than globally") Signed-off-by: Laszlo Toth <laszlth@gmail.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-07platform/x86: dell-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macroAndy Shevchenko1-13/+1
...instead of open coding file operations followed by custom ->open() callbacks per each attribute. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-02-01platform/x86: dell-laptop: Allocate buffer on heap rather than globallyMario Limonciello1-85/+103
There is no longer a need for the buffer to be defined in first 4GB physical address space. Furthermore there may be race conditions with multiple different functions working on a module wide buffer causing incorrect results. Fixes: 549b4930f057658dc50d8010e66219233119a4d8 Suggested-by: Pali Rohar <pali.rohar@gmail.com> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2018-01-26platform/x86: dell-laptop: Add 2-in-1 devices to the DMI whitelistAlexander Abrosimov1-0/+36
SMBIOS 3.0.0 Specification introduced new Chassis Types field values for 2-in-1 devices like tablets, convertibles and detachables. Dell's Inspiron 2-in-1 and XPS 2-in-1 fall into this category and they have to be added to the DMI whitelist, so rfkill and backlight can be controlled for them as for other laptops. Signed-off-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2018-01-16platform/x86: dell-laptop: Filter out spurious keyboard backlight change eventsHans de Goede1-2/+22
On some Dell XPS models WMI events of type 0x0000 reporting a keycode of 0xe00c get reported when the brightness of the LCD panel changes. This leads to us reporting false-positive kbd_led change events to userspace which in turn leads to the kbd backlight OSD showing when it should not. We already read the current keyboard backlight brightness value when reporting events because the led_classdev_notify_brightness_hw_changed API requires this. Compare this value to the last known value and filter out duplicate events, fixing this. Note the fixed issue is esp. a problem on XPS models with an ambient light sensor and automatic brightness adjustments turned on, this causes the kbd backlight OSD to show all the time there. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514969 Fixes: 9c656b0799 ("platform/x86: dell-*: Call new led hw_changed API ...") Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-12-28platform/x86: dell-laptop: make some local functions staticweiyongjun (A)1-2/+2
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 <weiyongjun1@huawei.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-12-08platform/x86: dell-laptop: Use bool in struct quirk_entry for true/false fieldsPali Rohár1-6/+6
In struct quirk_entry some boolean fields used int, some u8 type. Change them all to bool type. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-12-08platform/x86: dell-laptop: Fix keyboard max lighting for Dell Latitude E6410Pali Rohár1-0/+17
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 <pali.rohar@gmail.com> Reported-by: Gabriel M. Elder <gabriel@tekgnowsys.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=196913 Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-21platform/x86: dell-laptop: fix error return code in dell_init()weiyongjun (A)1-1/+3
Fix to return error code -ENOMEM from the kzalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: 549b4930f057 ("platform/x86: dell-smbios: Introduce dispatcher for SMM calls") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-11-16platform/x86: dell-laptop: Allocate buffer before rfkill useMario Limonciello1-4/+5
On machines using rfkill interface the buffer needs to have been allocated before the initial use (memset) of it. Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-11-03platform/x86: dell-smbios: Introduce dispatcher for SMM callsMario Limonciello1-178/+105
This splits up the dell-smbios driver into two drivers: * dell-smbios * dell-smbios-smm dell-smbios can operate with multiple different dispatcher drivers to perform SMBIOS operations. Also modify the interface that dell-laptop and dell-wmi use align to this model more closely. Rather than a single global buffer being allocated for all drivers, each driver will allocate and be responsible for it's own buffer. The pointer will be passed to the calling function and each dispatcher driver will then internally copy it to the proper location to perform it's call. Add defines for calls used by these methods in the dell-smbios.h header for tracking purposes. 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-06-20platform/x86: dell-laptop: Fix bogus keyboard backlight sysfs interfaceKai Heng Feng1-1/+5
Dell Latitude 3160 does not have keyboard backlight, but there is a sysfs interface for it, which does nothing at all. KBD_LED_ON_TOKEN is the only token can be found. Since it doesn't have KBD_LED_OFF_TOKEN or KBD_LED_AUTO_*_TOKEN, it should be safe to assume at least two tokens should be present to support keyboard backlight. Not all models have ON token - they may have multiple AUTO tokens instead. Models which do not use SMBIOS token to control keyboard backlight, also have this issue. Brightness level is 0 on these models. Verified on Dell Inspiron 3565. Reports keyboard backlight is supported only when at least two modes are present. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-04-28platform/x86: dell-laptop: Add keyboard backlight timeout AC settingsPali Rohár1-6/+53
When changing keyboard backlight state on new Dell laptops, firmware expects a new timeout AC value filled in Set New State SMBIOS call. Without it any change of keyboard backlight state on new Dell laptops fails. And user can see following error message in dmesg: dell_laptop: Setting old previous keyboard state failed leds dell::kbd_backlight: Setting an LED's brightness failed (-6) This patch adds support for retrieving current timeout AC values and also updating them. Current timeout value in sysfs is displayed based on current AC status, like current display brightness value. Detection if Dell laptop supports or not new timeout AC settings is done by checking existence of Keyboard Backlight with AC SMBIOS token (0x0451). Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Mario Limonciello <mario.limonciello@dell.com> Tested-by: Arcadiy Ivanov <arcadiy@ivanov.biz> [andy: fixed merge conflict with defined constants] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-04-28platform/x86: dell-laptop: Handle return error form dell_get_intensity.Arvind Yadav1-0/+6
Here, This patch is to handle a return error from dell_get_intensity. This change is done using Coccinelle. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-04-13Merge branch 'linux-leds/dell-laptop-changes-for-4.12'Darren Hart1-0/+28
Merge branch 'dell-laptop-changes-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git to avoid linux-next merge conflict with dell-laptop.c. Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-13platform/x86: dell-*: Call new led hw_changed API on kbd brightness changeHans de Goede1-1/+31
Make dell-wmi notify on hotkey kbd brightness changes, listen for this in dell-laptop and call led_classdev_notify_brightness_hw_changed. This will allow userspace to monitor (poll) for brightness changes on these LEDs caused by the hotkey. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-13platform/x86: dell-laptop: Protect kbd_state against racesHans de Goede1-36/+76
The kbd led code has multiple entry points each of which modifies the kbd_state by reading it, modifying a copy, writing the copy and on error setting the modified copy writing back the original state. This is racy, so add a mutex protection the read-modify-write cycle on each of the entry points. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-04-13platform/x86: dell-laptop: Refactor kbd_led_triggers_store()Hans de Goede1-31/+32
Return -EINVAL immediately on invalid input, rather then doing the straight path in an if block and returning -EINVAL at the end of the function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2017-03-06platform/x86: dell-laptop: import dell_micmute_led_set() from drivers/leds/dell-led.cMichał Kępień1-0/+28
To ensure all users of dell-smbios are in drivers/platform/x86, move the dell_micmute_led_set() method from drivers/leds/dell-led.c to drivers/platform/x86/dell-laptop.c. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Alex Hung <alex.hung@canonical.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2017-02-24platform/x86: dell-laptop: Add Latitude 7480 and others to the DMI whitelistAlex Hung1-0/+6
This is to support Latitude 7480 and many other newer Dell laptops. Signed-off-by: Alex Hung <alex.hung@canonical.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-12-13platform/x86: dell-laptop: Use brightness_set_blocking for kbd_led_level_setHans de Goede1-12/+14
kbd_led_level_set uses dell_smbios call which blocks, so the kbd_led classdev should use the brightness_set_blocking callback. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-smbios: rename dell_smi_error() to dell_smbios_error()Michał Kępień1-8/+8
As dell_smi_error() is exported by dell-smbios, its prefix should be consistent with other exported symbols, so change function name to dell_smbios_error(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-laptop: move dell_smi_error() to dell-smbiosMichał Kępień1-14/+0
The dell_smi_error() method could be used by modules other than dell-laptop for convenient translation of SMBIOS request errors into errno values. Thus, move it to dell-smbios. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-laptop: use dell_smbios_find_token() instead of find_token_location()Michał Kępień1-12/+12
Replace all uses of find_token_location() with dell_smbios_find_token() to avoid directly accessing the da_tokens table. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-laptop: use dell_smbios_find_token() instead of find_token_id()Michał Kępień1-11/+11
Replace all uses of find_token_id() with dell_smbios_find_token() to avoid directly accessing the da_tokens table. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-smbios: return the SMBIOS buffer from dell_smbios_get_buffer()Michał Kępień1-17/+32
Ultimately, the SMBIOS buffer should not be exported from dell-smbios. Currently, dell-laptop accesses it directly using a global variable, so make dell_smbios_get_buffer() return a pointer to the SMBIOS buffer and replace all uses of the global variable with local variables. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-smbios: don't pass an SMBIOS buffer to dell_smbios_send_request()Michał Kępień1-21/+21
Passing an SMBIOS buffer pointer to dell_smbios_send_request() is redundant as it should always operate on the SMBIOS buffer exported from the module. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-smbios: rename dell_send_request() to dell_smbios_send_request()Michał Kępień1-21/+21
As dell_send_request() is exported from the module, its prefix should be consistent with other exported symbols, so change function name to dell_smbios_send_request(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-smbios: rename release_buffer() to dell_smbios_release_buffer()Michał Kępień1-14/+14
As release_buffer() is exported from the module, it has to be renamed to something less generic, so add a "dell_smbios_" prefix to the function name. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-smbios: rename clear_buffer() to dell_smbios_clear_buffer()Michał Kępień1-6/+6
As clear_buffer() is exported from the module, it has to be renamed to something less generic, so add a "dell_smbios_" prefix to the function name. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-smbios: rename get_buffer() to dell_smbios_get_buffer()Michał Kępień1-13/+13
As get_buffer() is exported from the module, it has to be renamed to something less generic, so add a "dell_smbios_" prefix to the function name. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-03-23dell-laptop: extract SMBIOS-related code to a separate moduleMichał Kępień1-162/+1
Extract SMBIOS-related code from dell-laptop to a new kernel module, dell-smbios. The static specifier is removed from exported symbols, otherwise code is just moved around. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> [dvhart: Include linux/io.h in dell-smbios.c as caught by lkp] Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-07-06dell-laptop: Do not cache hwswitch statePali Rohár1-24/+61
The hwswitch state can be changed at runtime, so make sure dell-laptop always knows the current state. It can be modified by the userspace utility smbios-wireless-ctl. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-07-06dell-laptop: Check return value of each SMBIOS callPali Rohár1-25/+58
Make sure that return value of each SMBIOS call is properly checked and do not continue processing output if the call failed. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-07-06dell-laptop: Clear buffer before each SMBIOS callPali Rohár1-1/+10
Make sure that before initializing SMBIOS call, the input buffer does not contain any garbage (e.g. values from previous SMBIOS call). This fixes problems with passing undefined/random parameters to SMBIOS functions. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-07-05Merge tag 'platform-drivers-x86-v4.2-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86Linus Torvalds1-44/+139
Pull late x86 platform driver updates from Darren Hart: "The following came in a bit later and I wanted them to bake in next a few more days before submitting, thus the second pull. A new intel_pmc_ipc driver, a symmetrical allocation and free fix in dell-laptop, a couple minor fixes, and some updated documentation in the dell-laptop comments. intel_pmc_ipc: - Add Intel Apollo Lake PMC IPC driver tc1100-wmi: - Delete an unnecessary check before the function call "kfree" dell-laptop: - Fix allocating & freeing SMI buffer page - Show info about WiGig and UWB in debugfs - Update information about wireless control" * tag 'platform-drivers-x86-v4.2-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: intel_pmc_ipc: Add Intel Apollo Lake PMC IPC driver tc1100-wmi: Delete an unnecessary check before the function call "kfree" dell-laptop: Fix allocating & freeing SMI buffer page dell-laptop: Show info about WiGig and UWB in debugfs dell-laptop: Update information about wireless control
2015-07-01Merge tag 'platform-drivers-x86-v4.2-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86Linus Torvalds1-8/+86
Pull x86 platform driver updates from Darren Hart: "Fairly routine update for platform-drivers-x86. Mostly fixes and cleanups, with a significant refactoring of toshiba* drivers. Includes the addition of the dell-rbtn driver. Details: asus-wmi: - fan control dell*: - add Dell airplane mode switch driver ideapad-laptop: - platform rfkill fixes, and regression fix pvpanic: - handle missing _STA correctly toshiba*: - rafactor bluetooth support - haps documentation - driver cleanup other: - Use acpi_video_unregister_backlight instead of acpi_video_unregister in serveral drivers. - Orphan msi-wmi. * tag 'platform-drivers-x86-v4.2-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (24 commits) MAINTAINERS: Orphan x86 driver msi-wmi ideapad: fix software rfkill setting dell-laptop: Use dell-rbtn instead i8042 filter when possible dell-rbtn: Export notifier for other kernel modules dell-rbtn: Dell Airplane Mode Switch driver samsung-laptop: Use acpi_video_unregister_backlight instead of acpi_video_unregister asus-wmi: Use acpi_video_unregister_backlight instead of acpi_video_unregister apple_gmux: Use acpi_video_unregister_backlight instead of acpi_video_unregister pvpanic: handle missing _STA correctly ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked asus-wmi: add fan control Documentation/ABI: Add file describing the sysfs entries for toshiba_haps toshiba_haps: Make use of DEVICE_ATTR_{RW, WO} macros toshiba_haps: Replace sscanf with kstrtoint toshiba_acpi: Bump driver version to 0.22 toshiba_acpi: Remove TOS_FAILURE check from some functions toshiba_acpi: Comments cleanup toshiba_acpi: Rename hci_{read, write}1 functions toshiba_acpi: Remove no longer needed hci_{read, write}2 functions toshiba_bluetooth: Change BT status message to debug ...
2015-06-24dell-laptop: Fix allocating & freeing SMI buffer pagePali Rohár1-5/+3
This commit fix kernel crash when probing for rfkill devices in dell-laptop driver failed. Function free_page() was incorrectly used on struct page * instead of virtual address of SMI buffer. This commit also simplify allocating page for SMI buffer by using __get_free_page() function instead of sequential call of functions alloc_page() and page_address(). Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: stable@vger.kernel.org Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-06-22dell-laptop: Show info about WiGig and UWB in debugfsPali Rohár1-0/+17
This commit show additional information about rfkill state in debugfs based on newly released documentation by Dell. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-06-22dell-laptop: Update information about wireless controlPali Rohár1-39/+119
Make sure that all existing SMBIOS calls for wireless control are properly documented. This commit also add new documentation released by Dell. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-06-19dell-laptop: Port to new backlight interface selection APIHans de Goede1-6/+2
Port the backlight selection logic to the new backlight interface selection API. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-06-10dell-laptop: Use dell-rbtn instead i8042 filter when possiblePali Rohár1-8/+86
Until now module dell-laptop registered rfkill device which used i8042 filter function for receiving HW switch rfkill events (handling special keycode). But for some dell laptops there is native ACPI driver dell-rbtn which can receive rfkill events (without i8042 hooks). So this patch will combine best from both sides. It will use native ACPI driver dell-rbtn for receiving events and dell-laptop SMBIOS interface for enabling or disabling radio devices. If ACPI driver or device will not be available fallback to i8042 filter function will be used. Patch also changes module_init() to late_initcall() to ensure that init function will be called after initializing dell-rbtn.c driver. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-04-07platform: x86: dell-laptop: Add support for keyboard backlightGabriele Mazzotta1-6/+1083
This patch adds the support for the configuration of the keyboard backlight on supported Dell laptops. With this patch it is possible to set: * keyboard backlight level * timeout after which the backlight will be automatically turned off * input activity triggers (keyboard, touchpad, mouse) that enable the backlight * ambient light settings The settings are exposed via /sys/class/leds/dell::kbd_backlight/ The code is based on the newly released documentation by Dell in the libsmbios project. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2015-01-23Revert "platform: x86: dell-laptop: Add support for keyboard backlight"Darren Hart1-1049/+6
This reverts commit 02b2aaaa57ab41504e8d03a3b2ceeb9440a2c188. This interface was determined to be flawed and required too invasive a fix for the RC cycle. This will be revisited in 3.20. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-12-18Merge tag 'platform-drivers-x86-v3.19-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86Linus Torvalds1-7/+1050
Pull x86 platform driver update from Darren Hart: - thinkpad-acpi: Switch to software mute, cleanups - acerhdf: Bang-bang thermal governor, new models, cleanups - dell-laptop: New keyboard backlight support and documentation - toshiba_acpi: Keyboard backlight updates, hotkey handling - dell-wmi: Keypress filtering, WMI event processing - eeepc-laptop: Multiple cleanups, improved error handling, documentation - hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails - misc: Code cleanups, quirks, various new IDs * tag 'platform-drivers-x86-v3.19-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (33 commits) platform/x86/acerhdf: Still depends on THERMAL Documentation: Add entry for dell-laptop sysfs interface acpi: Remove _OSI(Linux) for ThinkPads thinkpad-acpi: Try to use full software mute control acerhdf: minor clean up acerhdf: added critical trip point acerhdf: Use bang-bang thermal governor acerhdf: Adding support for new models acerhdf: Adding support for "manual mode" dell-smo8800: Add more ACPI ids and change description of driver platform: x86: dell-laptop: Add support for keyboard backlight toshiba_acpi: Add keyboard backlight mode change event toshiba_acpi: Change notify funtion to handle more events toshiba_acpi: Move hotkey enabling code to its own function dell-wmi: Don't report keypresses on keybord illumination change dell-wmi: Don't report keypresses for radio state changes hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails toshiba-acpi: Add missing ID (TOS6207) Sony-laptop: Deletion of an unnecessary check before the function call "pci_dev_put" platform: x86: Deletion of checks before backlight_device_unregister() ...
2014-12-03platform: x86: dell-laptop: Add support for keyboard backlightPali Rohár1-6/+1049
This patch adds support for configuring keyboard backlight settings on supported Dell laptops. It exports kernel leds interface and uses Dell SMBIOS tokens or keyboard class interface. With this patch it is possible to set: * keyboard backlight level * timeout after which will be backlight automatically turned off * input activity triggers (keyboard, touchpad, mouse) which enable backlight * ambient light settings Settings are exported via sysfs: /sys/class/leds/dell::kbd_backlight/ Code is based on newly released documentation by Dell in libsmbios project. Thanks to Dan Carpenter who reported bug about unpredictable results in quirks->kbd_timeouts for loop. His fix adds needs_kbd_timeouts flag to quirk structure to indicate if kbd_timeouts array is empty or not. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Minor English corrections to comments. Signed-off-by: Darren Hart <dvhart@linux.intel.com>