summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* platform/x86: fujitsu-laptop: simplify set_lcd_level()Michał Kępień2017-04-131-8/+5
| | | | | | | | | | | | | | acpi_execute_simple_method() takes a method parameter which tells it to look for the given method underneath the given handle, so calling acpi_get_handle() beforehand is redundant. Replace the call to acpi_get_handle() with a call to acpi_execute_simple_method(), thus eliminating the need for a local variable storing the handle. Update debug message to reflect this change. Also do not assign a default value to status as it has no influence on execution flow. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: merge set_lcd_level_alt() into set_lcd_level()Michał Kępień2017-04-131-38/+16
| | | | | | | | | | | | | Depending on the value of the use_alt_lcd_levels module parameter, one of two functions is used for setting LCD brightness level. These functions are almost identical and only differ in the name of the ACPI method they call. Instead of checking the value of use_alt_lcd_levels at each call site, move that check to set_lcd_level() and get rid of set_lcd_level_alt(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: switch to a managed backlight deviceMichał Kępień2017-04-131-17/+6
| | | | | | | | | | Use a managed backlight device to get rid of acpi_fujitsu_bl_remove(). Change the parent of the backlight device from NULL to the FUJ02B1 ACPI device as the latter is required for the backlight device to work. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: only handle backlight when appropriateMichał Kępień2017-04-131-5/+6
| | | | | | | | | | | | | | | The backlight part of fujitsu-laptop is only used by laptops which are incapable of using the standard ACPI video interface for handling brightness changes. Conversely, on laptops which are capable of using the latter, no vendor-specific ACPI calls should be made unless explicitly requested by the user. Bail out immediately from acpi_fujitsu_bl_add() unless using the vendor-specific interface was either explicitly requested by the user or automatically selected by the kernel. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: update debug message logged by call_fext_func()Michał Kępień2017-04-131-1/+1
| | | | | | | | | | Update debug message logged when the acpi_evaluate_integer() call inside call_fext_func() fails so that it covers a broader set of possible errors. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: intel_scu_ipc: Introduce intel_scu_ipc_raw_command()Andy Shevchenko2017-04-132-1/+70
| | | | | | | A new call to SCU intel_scu_ipc_raw_command() writes SPTR and DPTR registers before sending a command. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: intel_scu_ipc: Introduce SCU_DEVICE() macroAndy Shevchenko2017-04-131-15/+7
| | | | | | | | | For better maintainability and readability introduce a macro for device ID table. No functional change intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: intel_scu_ipc: Remove redundant subarch checkAndy Shevchenko2017-04-131-5/+0
| | | | | | | | The driver is bound to the devices based on their PCI IDs. There is no need to do an additional check. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: intel_scu_ipc: Rearrange init sequenceAndy Shevchenko2017-04-131-6/+8
| | | | | | | | | | | | Device pointer is used as a flag that everything is prepared. Nevertheless the assignment happened quite before and there is a window when a caller can get weird results or even crashes since not all fields are initialized yet. Rearrange initialization sequence in ->probe() to prepare everything before use. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: intel_scu_ipc: Platform data is mandatoryAndy Shevchenko2017-04-131-0/+2
| | | | | | Fail ->probe() if there is no platform data supplied. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: silead_dmi - abort early if DMI does not matchDmitry Torokhov2017-04-131-9/+11
| | | | | | | | | | There is no point in registering I2C bus notifier if DMI data does not match. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> [andy: updated due to previous patch changed] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: silead_dmi - do not treat all devices as i2c_clientsDmitry Torokhov2017-04-131-3/+6
| | | | | | | | | | | | I2C bus has both i2c clients and adapter devices, so we must be careful in notifier code and verify that we are actually dealing with an i2c client before using it as such. Fixes: cef9dd85acd7 ("platform/x86: add support for devices with Silead...") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> [andy: simplified silead_ts_dmi_add_props() change] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* platform/x86: asus-nb-wmi: Add wapf4 quirk for the X302UASanteri Toivonen2017-04-131-0/+9
| | | | | | | | Asus laptop X302UA starts up with Wi-Fi disabled, without a way to enable it. Set wapf=4 to fix the problem. Signed-off-by: Santeri Toivonen <santeri.toivonen@vatsul.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: rename call_fext_func() argumentsMichał Kępień2017-04-131-8/+7
| | | | | | | | | | | | | | | | Rename call_fext_func() arguments so that each argument's name signifies its role: - cmd -> func: sub-function to call (flags, buttons etc.), - arg0 -> op: operation to perform (get, set, get capabilities etc.), - arg1 -> feature: feature to act on (e.g. which LED), if relevant, - arg2 -> state: state to set (e.g. LED on or off), if relevant. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: simplify call_fext_func()Michał Kępień2017-04-131-12/+3
| | | | | | | | | | | | | acpi_evaluate_integer() takes a pathname parameter which contains the name of the entity to evaluate underneath the given handle, so calling acpi_get_handle() beforehand is redundant. Replace the call to acpi_get_handle() with a call to acpi_evaluate_integer(), thus eliminating the need for a local variable storing the handle. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: clean up local variables in call_fext_func()Michał Kępień2017-04-131-12/+7
| | | | | | | | | | | Set values of FUNC call parameters in a designated initializer. Do not initialize status and handle variables as the values these are initialized to have no influence on execution flow. Use an array variable instead of the address of the first element of that array. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: remove keycode fields from struct fujitsu_blMichał Kępień2017-04-131-6/+0
| | | | | | | | | Remove the keycode[1-5] fields from struct fujitsu_bl as they are not needed any more as a result of the sparse keymap migration. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: model-dependent sparse keymap overridesMichał Kępień2017-04-131-56/+55
| | | | | | | | | | | | | | | | | | | Some laptop models need to have different keycodes assigned to hotkey scancodes. Change the sparse keymap upon a DMI match, before the hotkey input device is setup. Instead of using three different callbacks in the DMI match table, simplify code by using the driver_data field of struct dmi_system_id to supply the requested keymap to a common callback. Also merge keymaps for S6410 and S6420 as they are identical. Rename fujitsu_dmi_table to fujitsu_laptop_dmi_table to emphasize it is no longer used by the backlight part of fujitsu-laptop. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: use a sparse keymap for hotkey event generationMichał Kępień2017-04-131-70/+41
| | | | | | | | | | | | | Simplify hotkey event generation by using a sparse keymap. As sparse keymap operates on scancodes instead of keycodes, adjust variable names and debug messages accordingly. This patch only handles the default keymap for clarity. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> [dvhart: correct flag passed to call_fext_func in acpi_fujitsu_laptop_notify] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: switch to a managed hotkey input deviceMichał Kępień2017-04-131-36/+19
| | | | | | | | | | | Use a managed input device for hotkey events in order to simplify two error paths and one cleanup function while also reducing the number of local variables required. Remove double assignment to make checkpatch happy. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: refactor hotkey input device setupMichał Kępień2017-04-131-31/+43
| | | | | | | | | Simplify error handling in acpi_fujitsu_laptop_add() by moving code responsible for setting up the input device to a separate function. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: use a sparse keymap for brightness key eventsMichał Kępień2017-04-132-16/+16
| | | | | | | | Simplify brightness key event generation by using a sparse keymap. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: switch to a managed backlight input deviceMichał Kępień2017-04-131-33/+14
| | | | | | | | | | | Use a managed input device for brightness events in order to simplify two error paths and one cleanup function while also reducing the number of local variables required. Remove double assignment to make checkpatch happy. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* platform/x86: fujitsu-laptop: refactor backlight input device setupMichał Kępień2017-04-131-26/+38
| | | | | | | | | Simplify error handling in acpi_fujitsu_bl_add() by moving code responsible for setting up the input device to a separate function. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* Merge branch 'linux-leds/dell-laptop-changes-for-4.12'Darren Hart2017-04-139-140/+117
|\ | | | | | | | | | | | | | | 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>
| * platform/x86: dell-wmi-led: fix coding style issuesMichał Kępień2017-03-061-40/+26
| | | | | | | | | | | | | | | | Fix coding style issues in dell-wmi-led to make sure the module gets a clean start in the x86 platform driver subsystem. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
| * dell-led: move driver to drivers/platform/x86/dell-wmi-led.cMichał Kępień2017-03-065-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dell-led driver handles a specific WMI GUID present on some Dell laptops and as such it belongs in the x86 platform driver subsystem. Source code is moved along with the relevant Kconfig and Makefile entries, with some minor modifications: - Kconfig option is renamed from CONFIG_LEDS_DELL_NETBOOKS to CONFIG_DELL_WMI_LED, - the X86 Kconfig dependency is removed as the whole drivers/platform/x86 menu depends on it, so there is no need to duplicate it, - the name of the module's source file is removed from the header comment to avoid the need to update it in the future. 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: Pavel Machek <pavel@ucw.cz> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
| * dell-led: remove code related to mic mute LEDMichał Kępień2017-03-062-19/+7
| | | | | | | | | | | | | | | | | | | | | | | | With dell_micmute_led_set() moved to drivers/platform/x86/dell-laptop.c, all remnants of the mic mute LED handling code can be removed from drivers/leds/dell-led.c, restoring it back to the state it was in before commit db6d8cc00773 ("dell-led: add mic mute led interface"). 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> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
| * platform/x86: dell-laptop: import dell_micmute_led_set() from ↵Michał Kępień2017-03-063-32/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/leds/dell-led.c 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>
| * ALSA: hda - rename dell_led_set_func to dell_micmute_led_set_funcMichał Kępień2017-03-061-10/+10
| | | | | | | | | | | | | | | | | | | | | | With dell_app_wmi_led_set() replaced by dell_micmute_led_set(), rename the function pointer to the latter for consistency. 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: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
| * ALSA: hda - use dell_micmute_led_set() instead of dell_app_wmi_led_set()Michał Kępień2017-03-063-29/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dell_app_wmi_led_set() method introduced in commit db6d8cc00773 ("dell-led: add mic mute led interface") was implemented as an easily extensible entry point for other modules to set the state of various LEDs. However, almost three years later it is still only used to control the mic mute LED, so it will be replaced with direct calls to dell_micmute_led_set(). 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: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
| * dell-led: remove GUID check from dell_micmute_led_set()Michał Kępień2017-03-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | As dell_micmute_led_set() no longer uses the dell_wmi_perform_query() method, which was removed in commit 0c41a08e131d ("dell-led: use dell_smbios_send_request() for performing SMBIOS calls"), the DELL_APP_GUID check is redundant and thus can be safely removed. 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> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
| * leds/trigger/cpu: Add LED trigger for all CPUs aggregatedPaulo Costa2017-03-061-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there is one CPU led trigger per cpu ('cpu0', 'cpu1', ...) This patch adds a new trigger, 'cpu', with brightness proportional to the number of active CPUs. If multiple brightness levels aren't supported on the LED, it effectively indicates if there is any CPU active. This is particularly useful on tiny linux boards with more CPU cores than LED pins. Signed-off-by: Paulo Costa <me@paulo.costa.nom.br> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
* | platform/x86: silead_dmi: Add entry for Insyde 7W tabletsHans de Goede2017-04-131-0/+21
| | | | | | | | | | | | | | | | | | | | Add an entry providing the necessary info to make the touchscreen work on various tablets based on the Insyde 7W whitebox tablet. This has been tested on a DEXP Ursus 7W tablet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: silead_dmi: Constify properties arraysHans de Goede2017-04-131-3/+3
| | | | | | | | | | | | | | | | Now that device_add_properties takes a const property_entry * rather then a non-const one we can constify the properties arrays. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: dell-*: Call new led hw_changed API on kbd brightness changeHans de Goede2017-04-132-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | platform/x86: dell-laptop: Protect kbd_state against racesHans de Goede2017-04-131-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>
* | platform/x86: dell-laptop: Refactor kbd_led_triggers_store()Hans de Goede2017-04-131-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>
* | platform/x86: dell-*: Add a generic dell-laptop notifier chainHans de Goede2017-04-132-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several cases where events handled in one of the dell-* drivers need to be propagated to another dell-* driver. This commit adds 3 generic functions: dell_laptop_register_notifier() dell_laptop_unregister_notifier() dell_laptop_call_notifier() It currently only defines 1 action: DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED Which is intended to propagate kbd_backlight_brightness_changed wmi events from dell-wmi to dell-laptop (which contains the actual kbd backlight driver). These functions are put in dell-smbios as both dell-wmi and dell-laptop use smbios functions and I do not want to put the notifier head in either driver, as that will make the 2 drivers depend on each other. 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>
* | platform/x86: fujitsu-laptop: remove pf_device field from struct fujitsu_blMichał Kępień2017-03-231-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both struct fujitsu_bl and struct fujitsu_laptop have a pf_device field. Up until now the latter has been redundant, which is logically incorrect because the primary function of the platform device created by fujitsu-laptop is to provide laptop-related (not brightness-related) attributes to userspace. Remove the pf_device field from struct fujitsu_bl and make all module code use the pf_device field of struct fujitsu_laptop instead. Suggested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Jonathan Woithe <jwoithe@just42.net> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: fujitsu-laptop: only register platform device if FUJ02E3 is ↵Michał Kępień2017-03-231-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | present The platform device registered by fujitsu-laptop is registered unconditionally while sysfs attributes attached to it depend on the FUJ02E3 ACPI device being present. Fix this by moving platform device creation and removal to acpi_fujitsu_laptop_add() and acpi_fujitsu_laptop_remove(), respectively. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Jonathan Woithe <jwoithe@just42.net> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: fujitsu-laptop: add and remove platform device in separate ↵Michał Kępień2017-03-231-26/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | functions Platform device handling adds a lot of complexity to fujitsu_init(), which hinders its readability. Extract code responsible for adding and removing the platform device to separate functions. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Jonathan Woithe <jwoithe@just42.net> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: fujitsu-laptop: simplify platform device attribute definitionsMichał Kępień2017-03-231-19/+9
| | | | | | | | | | | | | | | | | | | | Use the DEVICE_ATTR_RO() macro to get rid of ignore_store() and shorten attribute definitions. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Jonathan Woithe <jwoithe@just42.net> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: fujitsu-laptop: remove backlight-related attributes from the ↵Michał Kępień2017-03-231-87/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platform device Setting backlight level using a vendor-specific interface should only be possible when using the latter is either explicitly requested by the user or automatically selected by the kernel. fujitsu-laptop violates that premise by unconditionally attaching three backlight-related attributes to the platform device it registers. Remove the offending attributes from the platform device. Update module comments to reflect this change. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Tested-by: Jonathan Woithe <jwoithe@just42.net> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: eeepc-laptop: Skip unknown key messages 0x50 0x51Pau Espin Pedrol2017-03-231-0/+2
| | | | | | | | | | | | | | | | | | Otherwise those are printed several times when (un)plugging the AC connector. Signed-off-by: Pau Espin Pedrol <pespin.shar@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
* | platform/x86: intel-hid: do not set parents of input devices explicitlyMichał Kępień2017-03-151-2/+0
| | | | | | | | | | | | | | | | | | | | devm_input_allocate_device() already causes the supplied struct device to be set as the parent of the input device, so doing it again is redundant. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-and-tested-by: Alex Hung <alex.hung@canonical.com>
* | platform/x86: toshiba_acpi: remove sparse_keymap_free() callsMichał Kępień2017-03-151-6/+2
| | | | | | | | | | | | | | | | | | As sparse_keymap_setup() now uses a managed memory allocation for the keymap copy it creates, the latter is freed automatically. Remove all calls to sparse_keymap_free(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* | platform/x86: toshiba-wmi: remove sparse_keymap_free() callsMichał Kępień2017-03-151-4/+1
| | | | | | | | | | | | | | | | | | As sparse_keymap_setup() now uses a managed memory allocation for the keymap copy it creates, the latter is freed automatically. Remove all calls to sparse_keymap_free(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* | platform/x86: topstar-laptop: remove sparse_keymap_free() callsMichał Kępień2017-03-151-4/+1
| | | | | | | | | | | | | | | | | | As sparse_keymap_setup() now uses a managed memory allocation for the keymap copy it creates, the latter is freed automatically. Remove all calls to sparse_keymap_free(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* | platform/x86: panasonic-laptop: remove sparse_keymap_free() callsMichał Kępień2017-03-151-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | As sparse_keymap_setup() now uses a managed memory allocation for the keymap copy it creates, the latter is freed automatically. Remove all calls to sparse_keymap_free(). As this reduces acpi_pcc_destroy_input() to one line, replace all calls to that function with direct calls to input_unregister_device(). Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>