aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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 <[email protected]> Acked-by: Pali Rohár <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2017-04-28platform/x86: hp-wireless: reuse module_acpi_driverAndy Shevchenko1-18/+1
There is a macro to register and unregister modules in simple cases, Let's use it and clean up the driver. Cc: Alex Hung <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Darren Hart (VMware) <[email protected]>
2017-04-25platform/x86: intel-vbtn: add volume up and downMaarten Maathuis1-0/+4
Tested on HP Elite X2 1012 G1. Matches event report of Lenovo Helix 2 (https://www.spinics.net/lists/ibm-acpi-devel/msg03982.html). Signed-off-by: Maarten Maathuis <[email protected]> [andy: fixed indentation of comments and massaged title of the change] Signed-off-by: Andy Shevchenko <[email protected]>
2017-04-21platform/x86: INT33FE: add i2c dependencyTobias Regnery1-1/+1
With CONFIG_I2C=m and CONFIG_INTEL_CHT_INT33FE=y we see the following link errors: drivers/built-in.o: In function 'cht_int33fe_remove': intel_cht_int33fe.c:(.text+0x391f6e): undefined reference to 'i2c_unregister_device' intel_cht_int33fe.c:(.text+0x391f76): undefined reference to 'i2c_unregister_device' intel_cht_int33fe.c:(.text+0x391f7d): undefined reference to 'i2c_unregister_device' drivers/built-in.o: In function 'cht_int33fe_probe': intel_cht_int33fe.c:(.text+0x392147): undefined reference to 'i2c_acpi_new_device' intel_cht_int33fe.c:(.text+0x392185): undefined reference to 'i2c_acpi_new_device' intel_cht_int33fe.c:(.text+0x3921bd): undefined reference to 'i2c_acpi_new_device' intel_cht_int33fe.c:(.text+0x3921d9): undefined reference to 'i2c_unregister_device' intel_cht_int33fe.c:(.text+0x3921e8): undefined reference to 'i2c_unregister_device' drivers/built-in.o: In function 'cht_int33fe_driver_init': intel_cht_int33fe.c:(.init.text+0x2386d): undefined reference to 'i2c_register_driver' drivers/built-in.o: In function 'cht_int33fe_driver_exit': intel_cht_int33fe.c:(.exit.text+0x206e): undefined reference to 'i2c_del_driver' Fix this by adding a kconfig dependency on the I2C subsystem. Fixes: 1cd706df8a9c ("platform/x86: Add Intel Cherry Trail ACPI INT33FE device driver") Signed-off-by: Tobias Regnery <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-20platform/x86: hp-wmi: Cleanup exit pathsDarren Hart (VMware)1-30/+33
Several exit paths were more complex than they needed to be. Remove superfluous conditionals, use labels common cleanup, do not shadow negative error codes. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-20platform/x86: hp-wmi: Do not shadow errors in sysfs show functionsDarren Hart (VMware)1-6/+6
The new hp_wmi_read_int function returns a negative value in case of error, pass this on directly rather than always replacing it with -EINVAL. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-20platform/x86: hp-wmi: Use DEVICE_ATTR_(RO|RW) helper macrosDarren Hart (VMware)1-18/+18
Use the DEVICE_ATTR_(RO|RW) macros, ranaming the show and store functions accordingly. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-20platform/x86: hp-wmi: Refactor dock and tablet state fetchersDarren Hart (VMware)1-19/+14
Both dock and tablet use the HPWMI_HARDWARE_QUERY, but require different masks. Rather than using two functions with magic masks, define the masks, and use a common accessor. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-20platform/x86: hp-wmi: Cleanup wireless get_(hw|sw)state functionsDarren Hart (VMware)1-16/+8
Use the new hp_wmi_read_int() function and add a WARN_ONCE() to the TBD regarding passing the error through. These are used in a null return function unfortunately. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-20platform/x86: hp-wmi: Refactor redundant HPWMI_READ functionsDarren Hart (VMware)1-58/+24
Several functions perform the same WMI read int with different query arguments. Refactor this into a single hp_wmi_read_int function. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-20platform/x86: hp-wmi: Standardize enum usage for constantsDarren Hart (VMware)1-58/+74
Use enums consistently throughout the hp-wmi driver for groups of related constants. Use hex and align the assignment within groups. Move the *QUERY constants into an enum, create a new enum defining the READ, WRITE, and ODM constants and use them instead of 0 and 1 at the call sites. Set the command directly instead of using the ternary operator since both 1 and 3 as previously documented would result in the command being set to 0x2. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-20platform/x86: hp-wmi: Cleanup local variable declarationsDarren Hart (VMware)1-16/+13
Declare like types on one line. Order declarations in decreasing length where possible. Signed-off-by: Darren Hart (VMware) <[email protected]> Tested-by: Carlo Caione <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2017-04-19platform/x86: hp-wmi: Do not shadow error valuesCarlo Caione1-10/+10
All the helper functions (i.e. hp_wmi_dock_state, hp_wmi_tablet_state, ...) using hp_wmi_perform_query to perform an HP WMI query shadow the returned value in case of error. We return -EINVAL only when the HP WMI query returns a positive value (the specific error code) to not mix this up with the actual value returned by the helper function. Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Carlo Caione <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-19platform/x86: fujitsu-laptop: simplify error handling in ↵Michał Kępień1-5/+3
acpi_fujitsu_laptop_add() As LED class devices registered by fujitsu-laptop no longer depend on the platform device, two function calls inside acpi_fujitsu_laptop_add() can be rearranged in order to simplify error handling. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-19platform/x86: fujitsu-laptop: do not log LED registration failuresMichał Kępień1-10/+6
If acpi_fujitsu_laptop_leds_register() returns an error, the latter will become the return value of acpi_fujitsu_laptop_add(), which in turn will be reported by driver core. Simplify code by replacing pr_err() calls with return statements. Return 0 instead of result when no errors occur in order to make the code easier to read. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-19platform/x86: fujitsu-laptop: switch to managed LED class devicesMichał Kępień1-44/+11
Use devm_led_classdev_register() for registering LED class devices in order to simplify cleanup and remove LED-related fields with the "_registered" suffix from struct fujitsu_laptop. This also fixes a cleanup bug: with non-managed LED class devices, if e.g. two supported LEDs are detected, the first one gets registered successfully but the second one does not, acpi_fujitsu_laptop_add() will return an error, but the successfully registered LED will never get unregistered. Change the parent device for LED class devices to the FUJ02E3 ACPI device due to this being the logically correct relationship as LED class devices do not depend on any facility provided by the platform device registered by fujitsu-laptop, which was their parent until now. Each managed LED class device is automatically unregistered when the last reference to its parent device is dropped. Taking the parent change described above into account, LED class devices registered by fujitsu-laptop will be unregistered after acpi_fujitsu_laptop_remove() is called. During unregistration, LED brightness is reset to LED_OFF by LED core, so do not set the acpi_handle field of struct fujitsu_laptop to NULL inside acpi_fujitsu_laptop_remove() to prevent call_fext_func() from generating errors upon module removal. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-19platform/x86: fujitsu-laptop: reorganize LED-related codeMichał Kępień1-137/+124
Move around LED definitions and callbacks to eliminate the need for forward declarations and ensure code is organized LED-wise, not action-wise. Reorder assignments inside designated initializers so that they are in the same order as struct led_classdev fields in include/linux/leds.h. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-19platform/x86: fujitsu-laptop: refactor LED registrationMichał Kępień1-58/+70
Move a long section of code responsible for registering LEDs out of acpi_fujitsu_laptop_add() to improve readability and ensure proper cleanup of platform device and kfifo e.g. when two supported LEDs are detected, the first one gets registered successfully but the second one does not. This makes the result variable in acpi_fujitsu_laptop_add() redundant, so remove it. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-19platform/x86: fujitsu-laptop: select LEDS_CLASSMichał Kępień2-14/+2
Follow common subsystem practice of selecting LEDS_CLASS instead of riddling module code with #ifdefs. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-18platform/x86: intel-hid: Add missing ->thaw callbackRafael J. Wysocki1-0/+1
The intel-hid driver is missing a PM ->thaw callback allowing the device to go back to the operational state after creating a hibernation image or when there is an image restoration error during resume. The lack of the ->thaw callback basically means that all events signaled by the device are discarded after a hibernation image has been created which may be problematic, for example, if the image cannot be saved (eg. due to an I/O issue with storage). Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-17platform/x86: Add Intel Cherry Trail ACPI INT33FE device driverHans de Goede3-0/+157
The INT33FE ACPI device has a CRS table with I2cSerialBusV2 resources for 3 devices: Maxim MAX17047 Fuel Gauge Controller, FUSB302 USB Type-C Controller and PI3USB30532 USB switch. This commit adds a driver for this ACPI device which instantiates i2c-clients for these, so that the standard i2c drivers for these chips can bind to the them. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-17Merge branch 'i2c/for-INT33FE'Darren Hart (VMware)204-1758/+3561
Merge branch 'i2c/for-INT33FE' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git to prepare for an incoming INT33FE driver. Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-16i2c: core: Allow drivers to disable i2c-core irq mappingHans de Goede2-3/+6
By default the i2c-core will try to get an irq with index 0 on ACPI / of instantiated devices. This is troublesome on some ACPI systems where the irq info at index 0 in the CRS table may contain nonsense and/or point to an irqchip for which there is no Linux driver. If this happens then before this commit the driver's probe method would never get called because i2c_device_probe will try to get an irq by calling acpi_dev_gpio_irq_get which will always return -EPROBE in this case, as it waits for a matching irqchip driver to load. Thus causing the driver to not get a chance to bind. This commit adds a new disable_i2c_core_irq_mapping flag to struct i2c_driver which a driver can set to tell the core to skip irq mapping. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2017-04-16i2c: core: Add new i2c_acpi_new_device helper functionHans de Goede2-0/+56
By default the i2c subsys creates an i2c-client for the first I2cSerialBus resource of an acpi_device, but some acpi_devices have multiple I2cSerialBus resources and we may want to instantiate i2c-clients for the others. This commit adds a new i2c_acpi_new_device function which can be used to create an i2c-client for any I2cSerialBus resource of an acpi_device. Note that the other resources may even be on a different i2c bus, so just retrieving the client address is not enough. Here is an example DSDT excerpt from such a device: Device (WIDR) { Name (_HID, "INT33FE" /* XPOWER Battery Device */) Name (_CID, "INT33FE" /* XPOWER Battery Device */) Name (_DDN, "WC PMIC Battery Device") <snip> Name (RBUF, ResourceTemplate () { I2cSerialBusV2 (0x005E, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.I2C7", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x0036, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x0022, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x0054, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) GpioInt (Level, ActiveLow, Exclusive, PullNone, 0x0000, "\\_SB.PCI0.I2C7.PMI5", 0x00, ResourceConsumer, , ) { // Pin list 0x0012 } GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone, 0x0000, "\\_SB.GPO1", 0x00, ResourceConsumer, , ) { // Pin list 0x0005 } GpioInt (Level, ActiveLow, Exclusive, PullNone, 0x0000, "\\_SB.PCI0.I2C7.PMI5", 0x00, ResourceConsumer, , ) { // Pin list 0x0013 } }) Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Return (RBUF) /* \_SB_.PCI0.I2C7.WIDR.RBUF */ } <snip> } Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2017-04-16i2c: core: Allow getting ACPI info by indexHans de Goede1-0/+7
Modify struct i2c_acpi_lookup and i2c_acpi_fill_info() to allow using them to get the info from a certain index in the ACPI-resource list rather then taking the first I2cSerialBus resource. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2017-04-14platform/x86: hp-wmi: Fix detection for dock and tablet modeCarlo Caione1-13/+27
The current driver code is not checking for the error values returned by 'hp_wmi_dock_state()' and 'hp_wmi_tablet_state()' before passing the returned values down to 'input_report_switch()'. This error code is being translated to '1' in the input subsystem, reporting the wrong status. The biggest problem caused by this issue is that several laptops are wrongly reported by the driver as docked, preventing them to be put to sleep using the LID (and in most cases they are not even dockable). With this patch we create the report switches only if we are able to read the dock and tablet mode status correctly from ACPI. Signed-off-by: Carlo Caione <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-14platform/x86: hp-wmi: Fix error value for hp_wmi_tablet_stateCarlo Caione1-1/+1
hp_wmi_tablet_state() fails to return the correct error code when hp_wmi_perform_query() returns the HP WMI query specific error code that is a positive value. Signed-off-by: Carlo Caione <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: hp-wireless: add Xiaomi's hardware id to the supported listAlex Hung1-4/+4
The airplane mode button on Xiaomi's new laptops are the same as HP laptops. This is tested on Xiaomi Notebook Air 13. Signed-off-by: Alex Hung <[email protected]> [dvhart: Dropped module init/exit info messages] Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: silead_dmi: Add touchscreen info for Surftab Wintron 7.0Hans de Goede1-0/+24
Add touchscreen info for the Trekstor Surftab Wintron 7.0 ST70416-6 tablet. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: remove redundant fields from struct fujitsu_blMichał Kępień1-13/+2
The dev field of struct fujitsu_bl is assigned in acpi_fujitsu_bl_add(), but never used afterwards. brightness_changed is set in get_lcd_level() and then its value is only printed in a debug message, so it does not influence execution flow. Remove both fields as they are redundant. Update the aforementioned debug message. Adjust whitespace to make checkpatch happy. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: account for backlight power when determining ↵Michał Kępień1-1/+1
brightness The comment for the get_brightness backlight device callback in include/linux/backlight.h states that it should "return the current backlight brightness (accounting for power, fb_blank etc.)". fujitsu-laptop violates that premise by simply returning the value to which ACPI function GBLL evaluates to. Make sure 0 is returned when backlight power is turned off. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: do not log set_lcd_level() failures in ↵Michał Kępień1-7/+1
bl_update_status() Any set_lcd_level() call can fail for one of two reasons: either requested brightness is outside the allowed range or the ACPI method used for setting brightness level is not available. For bl_update_status(), the first case is handled by backlight core, which means bl_update_status() will not even be called if requested brightness is outside the allowed range. The second case will be logged anyway by set_lcd_level() itself, so there is no point in generating another message in bl_update_status(). Remove the superfluous debug message along with a local variable that is now redundant. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: ignore errors when setting backlight powerMichał Kępień1-6/+2
Not all Fujitsu laptops support controlling backlight power through the FUJ02E3 ACPI device. Remove the debug message informing about a failed attempt to set backlight power as it may be confusing and the return value of call_fext_func() is logged anyway. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: make disable_brightness_adjust a booleanMichał Kępień1-9/+4
Due to the way the disable_brightness_adjust module parameter is currently handled in acpi_fujitsu_bl_add(), it can only be set to either 0 or 1, which effectively makes it a boolean. Emphasize that by changing module parameter type to bool. Do not announce parameter value in a debug message as it can be dynamically changed via sysfs and its current value can also be read from there. Clean up module parameter description. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: clean up use_alt_lcd_levels handlingMichał Kępień1-16/+10
The value of each module parameter can be changed on the fly via sysfs. However, the current way of handling use_alt_lcd_levels prevents the user from dynamically switching from a value of 0 or 1 back to autodetection as the latter is only performed upon ACPI device instantiation. Fix this by moving autodetection (in a simplified form) to set_lcd_level() and changing module parameter type to int. Do not announce autodetection results in a debug message as current value of use_alt_lcd_levels can simply be read from sysfs. Clarify module parameter description. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: sync brightness in set_lcd_level()Michał Kępień1-0/+2
When using brightness keys and backlight device's sysfs interface alternately, an incorrect input event might be generated for a brightness key press. Consider the following sequence of events: 1. Set backlight brightness to 6 using brightness keys. 2. Write 4 to /sys/class/backlight/fujitsu-laptop/brightness. 3. Press the "brightness up" key. The input event generated in this scenario would be KEY_BRIGHTNESSDOWN, because before step 3 brightness_level would still be at 6. As the new brightness level is established using GBLL, it would evaluate to 5 (SBLL/SBL2 sets it to 4 in step 2 and pressing the "brightness up" key increases it by 1). This in turn would cause acpi_fujitsu_bl_notify() to observe a 6 -> 5 change, i.e. a decrease in brightness, while screen brightness would in fact be increased. Fix this by updating brightness_level in set_lcd_level. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: simplify set_lcd_level()Michał Kępień1-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ń <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: merge set_lcd_level_alt() into set_lcd_level()Michał Kępień1-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ń <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: switch to a managed backlight deviceMichał Kępień1-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ń <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: only handle backlight when appropriateMichał Kępień1-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ń <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: update debug message logged by call_fext_func()Michał Kępień1-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ń <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: intel_scu_ipc: Introduce intel_scu_ipc_raw_command()Andy Shevchenko2-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 <[email protected]>
2017-04-13platform/x86: intel_scu_ipc: Introduce SCU_DEVICE() macroAndy Shevchenko1-15/+7
For better maintainability and readability introduce a macro for device ID table. No functional change intended. Signed-off-by: Andy Shevchenko <[email protected]>
2017-04-13platform/x86: intel_scu_ipc: Remove redundant subarch checkAndy Shevchenko1-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 <[email protected]>
2017-04-13platform/x86: intel_scu_ipc: Rearrange init sequenceAndy Shevchenko1-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 <[email protected]>
2017-04-13platform/x86: intel_scu_ipc: Platform data is mandatoryAndy Shevchenko1-0/+2
Fail ->probe() if there is no platform data supplied. Signed-off-by: Andy Shevchenko <[email protected]>
2017-04-13platform/x86: silead_dmi - abort early if DMI does not matchDmitry Torokhov1-9/+11
There is no point in registering I2C bus notifier if DMI data does not match. Signed-off-by: Dmitry Torokhov <[email protected]> Reviewed-by: Hans de Goede <[email protected]> [andy: updated due to previous patch changed] Signed-off-by: Andy Shevchenko <[email protected]>
2017-04-13platform/x86: silead_dmi - do not treat all devices as i2c_clientsDmitry Torokhov1-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 <[email protected]> Reviewed-by: Hans de Goede <[email protected]> [andy: simplified silead_ts_dmi_add_props() change] Signed-off-by: Andy Shevchenko <[email protected]>
2017-04-13platform/x86: asus-nb-wmi: Add wapf4 quirk for the X302UASanteri Toivonen1-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 <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
2017-04-13platform/x86: fujitsu-laptop: rename call_fext_func() argumentsMichał Kępień1-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ń <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>