summaryrefslogtreecommitdiffstats
path: root/drivers/platform
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'chrome-platform-for-linus-4.17' of ↵Linus Torvalds2018-04-144-481/+648
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform Pull chrome platform updates from Benson Leung: - a series from Dmitry to remove platform data from chromeos_laptop.c, which was the only user of platform data for the atmel_mxt_ts driver. - a series to clean up sysfs and debugfs for cros_ec - other misc cleanups * tag 'chrome-platform-for-linus-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform: (22 commits) platform/chrome: mfd/cros_ec_dev: Add sysfs entry to set keyboard wake lid angle platform/chrome: cros_ec_debugfs: Add PD port info to debugfs platform/chrome: cros_ec_debugfs: Use octal permissions '0444' platform/chrome: cros_ec_sysfs: use permission-specific DEVICE_ATTR variants platform/chrome: cros_ec_sysfs: introduce to_cros_ec_dev define. platform/chrome: cros_ec_sysfs: Modify error handling platform/chrome: cros_ec_lpc: Add support for Google devices using custom coreboot firmware platform/chrome: cros_ec_lpc: wake up from s2idle on Chrome EC Input: atmel_mxt_ts - remove platform data support platform/chrome: chromeos_laptop - discard data for unneeded boards platform/chrome: chromeos_laptop - use device properties for Pixel platform/chrome: chromeos_laptop - rely on I2C to set up interrupt trigger platform/chrome: chromeos_laptop - use I2C notifier to create devices platform/chrome: chromeos_laptop - parse DMI IRQ data once platform/chrome: chromeos_laptop - rework i2c peripherals initialization platform/chrome: chromeos_laptop - factor out getting IRQ from DMI platform/chrome: chromeos_laptop - introduce pr_fmt() platform/chrome: chromeos_laptop - stop setting suspend mode for Atmel devices platform/chrome: chromeos_laptop - add SPDX identifier Input: atmel_mxt_ts - switch ChromeOS ACPI devices to generic props ...
| * Merge remote-tracking branch ↵Benson Leung2018-04-112-41/+176
| |\ | | | | | | | | | | | | | | | | | | | | | 'origin/ib-chrome-platform-cros-ec-sysfs-debugfs-for-v4.17' into working-branch-for-4.17 Merging Enric's cros-ec sysfs and debugfs fixes from immutable branch. Signed-off-by: Benson Leung <bleung@chromium.org>
| | * platform/chrome: mfd/cros_ec_dev: Add sysfs entry to set keyboard wake lid angleGwendal Grignou2018-04-111-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a sysfs attribute (/sys/class/chromeos/cros_ec/kb_wake_angle) used to set and get the keyboard wake lid angle. This attribute is present only if 2 accelerometers are controlled by the EC. This patch also moves the cros_ec features check before the device is added so the features map obtained from the EC is ready on time. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * platform/chrome: cros_ec_debugfs: Add PD port info to debugfsShawn Nematbakhsh2018-04-111-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add info useful for debugging USB-PD port state. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * platform/chrome: cros_ec_debugfs: Use octal permissions '0444'Enric Balletbo i Serra2018-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the following checkpatch warning: WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * platform/chrome: cros_ec_sysfs: use permission-specific DEVICE_ATTR variantsEnric Balletbo i Serra2018-04-111-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use DEVICE_ATTR variants for read/write attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * platform/chrome: cros_ec_sysfs: introduce to_cros_ec_dev define.Enric Balletbo i Serra2018-04-111-6/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a define to get the cros_ec_dev from device and use it. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * platform/chrome: cros_ec_sysfs: Modify error handlingGwendal Grignou2018-04-111-21/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When accessing a sysfs attribute, if the EC command fails, -EPROTO is now returned instead of an error message as it is unlikely an app is parsing the error message to do something meaningful. Also, this patch makes use of cros_ec_cmd_xfer_status() instead of cros_ec_cmd_xfer() so an error message is printed in the syslog. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| * | Merge remote-tracking branch ↵Benson Leung2018-04-101-440/+456
| |\ \ | | | | | | | | | | | | 'chrome-platform-stop-being-a-platform-driver-plus-atmel_mxt_ts-for-v4.17' into working-branch-for-4.17
| | * | platform/chrome: chromeos_laptop - discard data for unneeded boardsDmitry Torokhov2018-04-101-212/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark board data as __intconst/__initdata and make a copy of appropriate entry once we identified the board we are running on. The rest of the data will be discarded once the kernel finished booting (or module finished loading). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - use device properties for PixelDmitry Torokhov2018-04-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that Atmel driver uses generic device properties we can use them instead of platform data when setting up touchpad on the original Google Pixel. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - rely on I2C to set up interrupt triggerDmitry Torokhov2018-04-101-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing interrupt flags via platform data to drivers, or hoping that drivers will do the right thing and set it up the way we need, let's set up IRQ resource and attach it to the I2C board info, and let I2C core set it up for us. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - use I2C notifier to create devicesDmitry Torokhov2018-04-101-145/+102Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using platform device and deferrals to handle the case when i2C adapters appear late in the game, and not handling device unbinding all that well, let's switch to using I2C bus notifier to get told when a new I2C adapter appears in the system, and attempt to add appropriate devices at that time. In case when we have 2 Designware adapters in the system (Acer C720), instead of counting and hoping they get enumerate din the right order, let's switch to using their PCI devids (slot/function) that should be stable. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - parse DMI IRQ data onceDmitry Torokhov2018-04-101-56/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of trying to parse DMI IRQ data every time we try to instantiate a device, let's do it once, when we identify the device we are working with. This allows us to mark chromeos_laptop_get_irq_from_dmi() as __init and discard it once module is initialized. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - rework i2c peripherals initializationDmitry Torokhov2018-04-101-232/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having separate setup() functions responsible for instantiating i2c client for each peripheral, let's generalize the behavior and use common code for instantiating all i2c peripherals. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - factor out getting IRQ from DMIDmitry Torokhov2018-04-101-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make code instantiating I2C device a bit clearer. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - introduce pr_fmt()Dmitry Torokhov2018-04-101-17/+14Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Define pr_fmt() to standardize driver messages. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - stop setting suspend mode for Atmel devicesDmitry Torokhov2018-04-101-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Atmel touch controller driver no longer respects suspend mode specified in platform data, so let's stop setting it. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| | * | platform/chrome: chromeos_laptop - add SPDX identifierDmitry Torokhov2018-04-101-22/+5Star
| | |/ | | | | | | | | | | | | | | | | | | | | | Replace the original license statement with the SPDX identifier. Add also one line of description as recommended by the COPYING file. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Benson Leung <bleung@chromium.org>
| * | platform/chrome: cros_ec_lpc: Add support for Google devices using custom ↵Salvatore Bellizzi2018-04-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | coreboot firmware This patch adds generic device information to the DMI table of the cros_ec_lpc driver, needed for Chromebooks/boxes using a custom coreboot firmware. The DMI info would not contain "Google_*" as BIOS version string, instead the system vendor string would still be "GOOGLE", so this seems to be a reasonable match for every Chromebook/box running a custom firmware. Signed-off-by: Salvatore Bellizzi <lkml@seppia.net> Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net> Signed-off-by: Benson Leung <bleung@chromium.org>
| * | platform/chrome: cros_ec_lpc: wake up from s2idle on Chrome ECWenkai Du2018-04-101-0/+4
| |/ | | | | | | | | | | | | | | | | | | Chrome platform installed a Chrome EC notify handler which prevents default EC GPE handler getting called. Add pm_system_wakeup to the Chrome EC notify handler so wake up from s2idle can happen. Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Wenkai Du <wenkai.du@intel.com> Signed-off-by: Benson Leung <bleung@chromium.org>
* | Merge tag 'platform-drivers-x86-v4.17-1' of ↵Linus Torvalds2018-04-1012-212/+525
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform driver updates from Andy Shevchenko: - Dell SMBIOS driver fixed against memory leaks. - The fujitsu-laptop driver is cleaned up and now supports hotkeys for Lifebook U7x7 models. Besides that the typo introduced by one of previous clean up series has been fixed. - Specific to x86-based laptops HID device now supports KEY_ROTATE_LOCK_TOGGLE event which is emitted, for example, by Wacom MobileStudio Pro 13. - Turbo MAX 3 technology is enabled for the rest of platforms that support Hardware-P-States feature which have core priority described by ACPI CPPC table. - Mellanox on x86 gets better support of I2C bus in use including support of hotpluggable ones. - Silead touchscreen is enabled on two tablet models, i.e Yours Y8W81 and I.T.Works TW701. - From now on the second fan on Thinkpad P50 is supported. - The topstar-laptop driver is reworked to support new models, in particular Topstar U931. * tag 'platform-drivers-x86-v4.17-1' of git://git.infradead.org/linux-platform-drivers-x86: (41 commits) platform/x86: thinkpad_acpi: Add 2nd Fan Support for Thinkpad P50 platform/x86: dell-smbios: Fix memory leaks in build_tokens_sysfs() intel-hid: support KEY_ROTATE_LOCK_TOGGLE intel-hid: clean up and sort header files platform/x86: silead_dmi: Add entry for the Yours Y8W81 tablet platform/x86: fujitsu-laptop: Support Lifebook U7x7 hotkeys platform/x86: mlx-platform: Add physical bus number auto detection platform/mellanox: mlxreg-hotplug: Change input for device create routine platform/x86: mlx-platform: Add deffered bus functionality platform/x86: mlx-platform: Use define for the channel numbers platform/x86: fujitsu-laptop: Revert UNSUPPORTED_CMD back to an int platform/x86: Fix dell driver init order platform/x86: dell-smbios: Resolve dependency error on ACPI_WMI platform/x86: dell-smbios: Resolve dependency error on DCDBAS platform/x86: Allow for SMBIOS backend defaults platform/x86: dell-smbios: Link all dell-smbios-* modules together platform/x86: dell-smbios: Rename dell-smbios source to dell-smbios-base platform/x86: dell-smbios: Correct some style warnings platform/x86: wmi: Fix misuse of vsprintf extension %pULL platform/x86: intel-hid: Reset wakeup capable flag on removal ...
| * | platform/x86: thinkpad_acpi: Add 2nd Fan Support for Thinkpad P50Alexander Kappner2018-04-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Thinkpad P50 has 2 fans. Add the 2FAN quirk so the tpacpi driver properly reports both fan speeds. Because the P50 doesn't report the version of its EC controller, we need to identify it by BIOS version (N1). Signed-off-by: Alexander Kappner <agk@godking.net> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> [andy: renamed macro, massaged changelog] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | platform/x86: dell-smbios: Fix memory leaks in build_tokens_sysfs()Dan Carpenter2018-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're freeing "value_name" which is NULL, so that's a no-op, but we intended to free "location_name" instead. And then we don't free the names in token_location_attrs[0] and token_value_attrs[0]. Fixes: 33b9ca1e53b4 ("platform/x86: dell-smbios: Add a sysfs interface for SMBIOS tokens") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | intel-hid: support KEY_ROTATE_LOCK_TOGGLEAlex Hung2018-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KEY_ROTATE_LOCK_TOGGLE is introduced in 4.16 rc1 and this key event is emitted on Wacom MobileStudio Pro 13. Signed-off-by: Alex Hung <alex.hung@canonical.com> Co-developed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | intel-hid: clean up and sort header filesAlex Hung2018-04-021-6/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | Removed unused header files and sorted them alphabetically. No functional changes are made. Signed-off-by: Alex Hung <alex.hung@canonical.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | platform/x86: silead_dmi: Add entry for the Yours Y8W81 tabletHans de Goede2018-04-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an entry with touchscreen info for the Yours Y8W81 8" tablet. This tablet has the same case and mostly the same internals as the Chuwi Vi8. Both seem to be from an ODM called inet-tek. Both are labelled: "INET-I86M-REVxx" on the PCB, with the Chuwi Vi8 being REV03 (and having an ALC5640 audio codec) and the Yours Y8W81 being REV21 (and having an ALC5651 audio codec). The wifi, accelerometer and touchscreen are identical on both. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | platform/x86: fujitsu-laptop: Support Lifebook U7x7 hotkeysJan-Marek Glogowski2018-03-241-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate input events for hotkeys present in Fujitsu Lifebook U727 and U757 laptops: - Fn+F1 (KEY_MICMUTE) - Fn+F5 (KEY_RFKILL) Signed-off-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: mlx-platform: Add physical bus number auto detectionVadim Pasternak2018-03-243-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mlx-platform does not provide a bus number to i2c-mlxcpld, assuming it is always one. On some x86 systems, other i2c drivers may probe before i2c-mlxcpld, causing bus one to be busy. Make mlx-platform determine which adapter number is free prior to activating i2c-mlxpld, adjusting the mux base numbers accordingly. Update the mlxreg-hotplug pdata similarly. This adds an explicit mlx-platform build dependency on I2C, update the Kconfig accordingly. Add the missing REGMAP dependency while we're at it. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> [dvhart: Rewrite commit message more concisely] [dvhart: Add build dependencies] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/mellanox: mlxreg-hotplug: Change input for device create routineVadim Pasternak2018-03-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the first input parameter in mlxreg_hotplug_device_create to the pointer to mlxreg_hotplug private data in order to use the fields from the private data structure. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> [dvhart: Cleaned up commit message] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: mlx-platform: Add deffered bus functionalityVadim Pasternak2018-03-242-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mlx-platform activates i2c-mux-reg, which creates buses needed by mlxreg-hotplug. If the mlxreg-hotplug probe runs before the i2c-mux-reg probe completes, it may attempt to connect a device to an adapter number that has not been created yet, and fail. Make mlx-platform driver record the highest bus number in mlxreg-hotplug platform data and defer mlxreg-hotplug probe until all the buses are created. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> [dvhart: rewrite commit message more concisely] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: mlx-platform: Use define for the channel numbersVadim Pasternak2018-03-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add define for the channels number for mux device, instead of using hardcoded value inside the code in order to improve code readability. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: fujitsu-laptop: Revert UNSUPPORTED_CMD back to an intMichał Kępień2018-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UNSUPPORTED_CMD was previously 0x80000000 (int), but commit 819cddae7cfa ("platform/x86: fujitsu-laptop: Clean up constants") changed it into an unsigned long due to BIT() being used to define it. As call_fext_func() returns an int, 0x80000000 would get type promoted when compared to an unsigned long, which on a 64-bit system would cause it to become 0xffffffff80000000 due to sign extension. This causes one logical condition in fujitsu-laptop to always be true and another one to always be false on 64-bit systems. Fix this by reverting UNSUPPORTED_CMD back to an int. This patch fixes the following smatch warnings: drivers/platform/x86/fujitsu-laptop.c:763 acpi_fujitsu_laptop_leds_register() warn: always true condition '(call_fext_func(device, ((1 << (12)) | (1 << (0))), 2, (1 << (16)), 0) != (1 << (31))) => (s32min-s32max != 2147483648)' drivers/platform/x86/fujitsu-laptop.c:816 acpi_fujitsu_laptop_add() warn: impossible condition '(priv->flags_supported == (1 << (31))) => (0-2147483647,18446744071562067968-u64max == 2147483648)' Fixes: 819cddae7cfa ("platform/x86: fujitsu-laptop: Clean up constants") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 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: Fix dell driver init orderDarren Hart (VMware)2018-03-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the initcall ordering to satisfy the following dependency ordering: 1. DCDBAS, ACPI_WMI 2. DELL_SMBIOS, DELL_RBTN 3. DELL_LAPTOP, DELL_WMI By assigning them to the following initcall levels: subsys_initcall: DCDBAS, ACPI_WMI module_init: DELL_SMBIOS, DELL_RBTN late_initcall: DELL_LAPTOP, DELL_WMI Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Mario.Limonciello@dell.com Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: dell-smbios: Resolve dependency error on ACPI_WMIDarren Hart2018-03-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similarly to DCDBAS for DELL_SMBIOS_SMM, if DELL_SMBIOS_WMI is enabled, DELL_SMBIOS becomes dependent on ACPI_WMI. Update the depends lines to prevent a configuration where DELL_SMBIOS=y and either backend dependency =m. Update the comment accordingly. Cc: Mario Limonciello <mario.limonciello@dell.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: dell-smbios: Resolve dependency error on DCDBASDarren Hart (VMware)2018-03-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the DELL_SMBIOS_SMM backend is enabled, the DELL_SMBIOS symbol depends on DELL_DCDBAS, and we must avoid the situation where DELL_SMBIOS=y and DCDBAS=m. Adding the conditional dependency to DELL_SMBIOS such as: depends !DELL_SMBIOS_SMM || (DCDBAS || DCDBAS=n) results in the Kconfig tooling complaining about a circular dependency, although it appears to work in practice. Avoid the errors by simplifying the dependency and forcing DELL_SMBIOS to be <= DCDBAS if DCDBAS is enabled (thanks to Greg KH for the suggestion). Cc: Mario.Limonciello@dell.com Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: Allow for SMBIOS backend defaultsDarren Hart (VMware)2018-03-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid accidental configurations by setting default y for DELL_SMBIOS backends. Avoid this impacting the default build size, by making them dependent on DELL_SMBIOS, so they only appear when DELL_SMBIOS is manually selected, or by DELL_LAPTOP or DELL_WMI. While DELL_SMBIOS does have a prompt, it does not have any dependencies. Keeping DELL_SMBIOS visible, despite being "select"ed by DELL_LAPTOP and DELL_WMI, is a deliberate choice to provide context for the WMI and SMM backends, which would otherwise appear to float without context within the menu. Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: dell-smbios: Link all dell-smbios-* modules togetherMario Limonciello2018-03-036-33/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some race conditions were raised due to dell-smbios and its backends not being ready by the time that a consumer would call one of the exported methods. To avoid this problem, guarantee that all initialization has been done by linking them all together and running init for them all. As part of this change the Kconfig needs to be adjusted so that CONFIG_DELL_SMBIOS_SMM and CONFIG_DELL_SMBIOS_WMI are boolean rather than modules. CONFIG_DELL_SMBIOS is a visually selectable option again and both CONFIG_DELL_SMBIOS_WMI and CONFIG_DELL_SMBIOS_SMM are optional. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> [dvhart: Update prompt and help text for DELL_SMBIOS_* backends] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: dell-smbios: Rename dell-smbios source to dell-smbios-baseMario Limonciello2018-03-032-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is being done to faciliate a later change to link all the dell-smbios drivers together. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: dell-smbios: Correct some style warningsMario Limonciello2018-03-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WARNING: function definition argument 'struct calling_interface_buffer *' should also have an identifier name + int (*call_fn)(struct calling_interface_buffer *); WARNING: Block comments use * on subsequent lines + /* 4 bytes of table header, plus 7 bytes of Dell header, plus at least + 6 bytes of entry */ WARNING: Block comments use a trailing */ on a separate line + 6 bytes of entry */ Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: wmi: Fix misuse of vsprintf extension %pULLJoe Perches2018-03-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | %pULL doesn't officially exist but %pUL does. Miscellanea: o Add missing newlines to a couple logging messages Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: intel-hid: Reset wakeup capable flag on removalRafael J. Wysocki2018-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intel-hid device will not be able to wake up the system any more after removing the notify handler provided by its driver, so make its sysfs attributes reflect that. Fixes: ef884112e55c (platform: x86: intel-hid: Wake up the system from suspend-to-idle) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | platform/x86: intel-vbtn: Reset wakeup capable flag on removalRafael J. Wysocki2018-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intel-vbtn device will not be able to wake up the system any more after removing the notify handler provided by its driver, so make its sysfs attributes reflect that. Fixes: 91f9e850d465 (platform: x86: intel-vbtn: Wake up the system from suspend-to-idle) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1'sMario Limonciello2018-02-241-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some laptops such as the XPS 9360 support the intel-vbtn INT33D6 interface but don't initialize the bit that intel-vbtn uses to represent switching tablet mode. By running this only on real 2-in-1's it shouldn't cause false positives. Fixes: 30323fb6d5 ("Support tablet mode switch") Reported-by: Jeremy Cline <jeremy@jcline.org> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Tested-by: Jeremy Cline <jeremy@jcline.org> Tested-by: Darren Hart (VMware) <dvhart@infradead.org> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
| * | platform/x86: fujitsu-laptop: Clean up constantsMichał Kępień2018-02-241-32/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Align all constant values defined in the module to a common indentation. Rename ACPI_FUJITSU_NOTIFY_CODE1 to ACPI_FUJITSU_NOTIFY_CODE as there is only one ACPI notification code used throughout the driver. Define all bitmasks using the BIT() macro. Clean up comments. 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: Define constants for backlight power controlMichał Kępień2018-02-241-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use named constants instead of integers in call_fext_func() invocations related to backlight power control in order to more clearly convey the intent of each call. 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: Do not include linux/slab.hMichał Kępień2018-02-241-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Do not include linux/slab.h as all module code now uses managed memory allocations and thus neither k*alloc() nor kfree() is used. 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: Clearly distinguish module parametersMichał Kępień2018-02-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to improve code clarity, move declarations of variables that are module parameters higher up and add a comment. 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 error pathsMichał Kępień2018-02-241-10/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the last few lines of acpi_fujitsu_bl_add() with a simple return in order to improve code readability without changing the logic. As acpi_fujitsu_laptop_add() uses a managed memory allocation for device-specific data, it is fine to just return immediately upon kfifo allocation failure. Do that instead of jumping to the end of the function to improve code readability. Running out of memory while allocating the kfifo does not seem probable enough to warrant logging an error message, so do not do it. 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: Defer input device registrationMichał Kępień2018-02-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Only register input devices after the device-specific data structures they access are fully initialized. 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>