summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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-141-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-141-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-141-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-141-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-141-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>
* | platform/x86: msi-wmi: remove sparse_keymap_free() callsMichał Kępień2017-03-141-7/+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: msi-laptop: remove sparse_keymap_free() callsMichał Kępień2017-03-141-11/+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 msi_laptop_input_destroy() 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>
* | platform/x86: ideapad-laptop: remove sparse_keymap_free() callsMichał Kępień2017-03-141-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: hp-wmi: remove sparse_keymap_free() callsMichał Kępień2017-03-141-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: eeepc-laptop: remove sparse_keymap_free() callsMichał Kępień2017-03-141-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: dell-wmi: remove sparse_keymap_free() callsMichał Kępień2017-03-141-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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 dell_wmi_input_destroy() 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>
* | platform/x86: dell-wmi-aio: remove sparse_keymap_free() callsMichał Kępień2017-03-141-5/+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: asus-wmi: remove sparse_keymap_free() callsMichał Kępień2017-03-141-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: asus-laptop: remove sparse_keymap_free() callsMichał Kępień2017-03-141-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: acer-wmi: remove sparse_keymap_free() callsMichał Kępień2017-03-141-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>
* | Merge branch 'ib/4.10-sparse-keymap-managed' of ↵Darren Hart2017-03-141-30/+9
|\ \ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input into testing
| * | Input: sparse-keymap - use a managed allocation for keymap copyMichał Kępień2017-03-081-30/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some platform drivers use devm_input_allocate_device() together with sparse_keymap_setup() in their .probe callbacks. While using the former simplifies error handling, using the latter necessitates calling sparse_keymap_free() in the error path and upon module unloading to avoid leaking the copy of the keymap allocated by sparse_keymap_setup(). To help prevent such leaks and enable simpler error handling, make sparse_keymap_setup() use devm_kmemdup() to create the keymap copy so that it gets automatically freed. This works for both managed and non-managed input devices as the keymap is freed after the last reference to the input device is dropped. Note that actions previously taken by sparse_keymap_free(), i.e. taking the input device's mutex and zeroing its keycode and keycodemax fields, are now redundant because the managed keymap will always be freed after the input device is unregistered. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* | | platform/x86: fujitsu-laptop: cleanup error labels in fujitsu_init()Michał Kępień2017-03-141-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error labels currently used in fujitsu_init() are really hard to follow: some (fail_laptop) indicate which operation has failed, others (fail_sysfs_group) indicate where unrolling should start and the rest (fail_platform_driver) is simply confusing. Change them to follow the pattern used throughout the rest of the module, i.e. make every label indicate the first unrolling operation it leads to. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-and-tested-by: Jonathan Woithe <jwoithe@just42.net>
* | | platform/x86: fujitsu-laptop: only register backlight device if FUJ02B1 is ↵Michał Kępień2017-03-141-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | present As the backlight device registered by fujitsu-laptop relies on the FUJ02B1 ACPI device being present, only register the backlight device once that ACPI device is detected. Suggested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-and-tested-by: Jonathan Woithe <jwoithe@just42.net>
* | | platform/x86: fujitsu-laptop: sync backlight power status in ↵Michał Kępień2017-03-141-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_fujitsu_laptop_add() Registering an ACPI driver does not mean the device it handles has to exist. As the code which syncs backlight power status uses call_fext_func(), it needs the FUJ02E3 ACPI device to be present, so ensure that code is only run once the FUJ02E3 device is detected. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-and-tested-by: Jonathan Woithe <jwoithe@just42.net>
* | | platform/x86: fujitsu-laptop: register backlight device in a separate functionMichał Kępień2017-03-141-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move code responsible for backlight device registration to a separate function in order to simplify error handling and decrease indentation. Simplify initialization of struct backlight_properties. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-and-tested-by: Jonathan Woithe <jwoithe@just42.net>