summaryrefslogtreecommitdiff
path: root/drivers/platform
AgeCommit message (Collapse)AuthorFilesLines
2021-02-25Merge tag 'acpi-5.12-rc1-3' of ↵Linus Torvalds1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These make additional changes to the platform profile interface merged recently and add support for the FPDT ACPI table. Specifics: - Rearrange Kconfig handling of ACPI_PLATFORM_PROFILE, add "balanced-performance" to the list of supported platform profiles and fix up some file references in a comment (Maximilian Luz). - Add support for parsing the ACPI Firmware Performance Data Table (FPDT) and exposing the data from there via sysfs (Zhang Rui)" * tag 'acpi-5.12-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: platform: Add balanced-performance platform profile ACPI: platform: Fix file references in comment ACPI: platform: Hide ACPI_PLATFORM_PROFILE option ACPI: tables: introduce support for FPDT table
2021-02-24Merge tag 'sfi-removal-5.12-rc1' of ↵Linus Torvalds1-18/+4
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull Simple Firmware Interface (SFI) support removal from Rafael Wysocki: "Drop support for depercated platforms using SFI, drop the entire support for SFI that has been long deprecated too and make some janitorial changes on top of that (Andy Shevchenko)" * tag 'sfi-removal-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: x86/platform/intel-mid: Update Copyright year and drop file names x86/platform/intel-mid: Remove unused header inclusion in intel-mid.h x86/platform/intel-mid: Drop unused __intel_mid_cpu_chip and Co. x86/platform/intel-mid: Get rid of intel_scu_ipc_legacy.h x86/PCI: Describe @reg for type1_access_ok() x86/PCI: Get rid of custom x86 model comparison sfi: Remove framework for deprecated firmware cpufreq: sfi-cpufreq: Remove driver for deprecated firmware media: atomisp: Remove unused header mfd: intel_msic: Remove driver for deprecated platform x86/apb_timer: Remove driver for deprecated platform x86/platform/intel-mid: Remove unused leftovers (vRTC) x86/platform/intel-mid: Remove unused leftovers (msic) x86/platform/intel-mid: Remove unused leftovers (msic_thermal) x86/platform/intel-mid: Remove unused leftovers (msic_power_btn) x86/platform/intel-mid: Remove unused leftovers (msic_gpio) x86/platform/intel-mid: Remove unused leftovers (msic_battery) x86/platform/intel-mid: Remove unused leftovers (msic_ocd) x86/platform/intel-mid: Remove unused leftovers (msic_audio) platform/x86: intel_scu_wdt: Drop mistakenly added const
2021-02-24Merge tag 'char-misc-5.12-rc1' of ↵Linus Torvalds1-17/+11
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver updates from Greg KH: "Here is the large set of char/misc/whatever driver subsystem updates for 5.12-rc1. Over time it seems like this tree is collecting more and more tiny driver subsystems in one place, making it easier for those maintainers, which is why this is getting larger. Included in here are: - coresight driver updates - habannalabs driver updates - virtual acrn driver addition (proper acks from the x86 maintainers) - broadcom misc driver addition - speakup driver updates - soundwire driver updates - fpga driver updates - amba driver updates - mei driver updates - vfio driver updates - greybus driver updates - nvmeem driver updates - phy driver updates - mhi driver updates - interconnect driver udpates - fsl-mc bus driver updates - random driver fix - some small misc driver updates (rtsx, pvpanic, etc.) All of these have been in linux-next for a while, with the only reported issue being a merge conflict due to the dfl_device_id addition from the fpga subsystem in here" * tag 'char-misc-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (311 commits) spmi: spmi-pmic-arb: Fix hw_irq overflow Documentation: coresight: Add PID tracing description coresight: etm-perf: Support PID tracing for kernel at EL2 coresight: etm-perf: Clarify comment on perf options ACRN: update MAINTAINERS: mailing list is subscribers-only regmap: sdw-mbq: use MODULE_LICENSE("GPL") regmap: sdw: use no_pm routines for SoundWire 1.2 MBQ regmap: sdw: use _no_pm functions in regmap_read/write soundwire: intel: fix possible crash when no device is detected MAINTAINERS: replace my with email with replacements mhi: Fix double dma free uapi: map_to_7segment: Update example in documentation uio: uio_pci_generic: don't fail probe if pdev->irq equals to IRQ_NOTCONNECTED drivers/misc/vmw_vmci: restrict too big queue size in qp_host_alloc_queue firewire: replace tricky statement by two simple ones vme: make remove callback return void firmware: google: make coreboot driver's remove callback return void firmware: xilinx: Use explicit values for all enum values sample/acrn: Introduce a sample of HSM ioctl interface usage virt: acrn: Introduce an interface for Service VM to control vCPU ...
2021-02-24ACPI: platform: Hide ACPI_PLATFORM_PROFILE optionMaximilian Luz1-2/+2
The ACPI_PLATFORM_PROFILE option essentially provides a library and not really an independent module. Thus it seems to be more user-friendly to hide this option and simply make drivers depending on it select it. Suggested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-02-22Merge tag 'thermal-v5.12-rc1' of ↵Linus Torvalds1-1/+2
git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal updates from Daniel Lezcano: - Use the newly introduced 'hot' and 'critical' ops for the acpi thermal driver (Daniel Lezcano) - Remove the notify ops as it is no longer used (Daniel Lezcano) - Remove the 'forced passive' option and the unused bind/unbind functions (Daniel Lezcano) - Remove the THERMAL_TRIPS_NONE and the code cleanup around this macro (Daniel Lezcano) - Rework the delays to make them pre-computed instead of computing them again and again at each polling interval (Daniel Lezcano) - Remove the pointless 'thermal_zone_device_reset' function (Daniel Lezcano) - Use the critical and hot ops to prevent an unexpected system shutdown on int340x (Kai-Heng Feng) - Make the cooling device state private to the thermal subsystem (Daniel Lezcano) - Prevent to use not-power-aware actor devices with the power allocator governor (Lukasz Luba) - Remove 'zx' and 'tango' support along with the corresponding platforms (Arnd Bergman) - Fix several issues on the Omap thermal driver (Tony Lindgren) - Add support for adc-tm5 PMIC thermal monitor for Qcom platforms (Dmitry Baryshkov) - Fix an initialization loop in the adc-tm5 (Colin Ian King) - Fix a return error check in the cpufreq cooling device (Viresh Kumar) * tag 'thermal-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (26 commits) thermal: cpufreq_cooling: freq_qos_update_request() returns < 0 on error thermal: qcom: Fix comparison with uninitialized variable channels_available thermal: qcom: add support for adc-tm5 PMIC thermal monitor dt-bindings: thermal: qcom: add adc-thermal monitor bindings thermal: ti-soc-thermal: Use non-inverted define for omap4 thermal: ti-soc-thermal: Simplify polling with iopoll thermal: ti-soc-thermal: Fix stuck sensor with continuous mode for 4430 thermal: ti-soc-thermal: Skip pointless register access for dra7 thermal/drivers/zx: Remove zx driver thermal/drivers/tango: Remove tango driver thermal: power allocator: fail binding for non-power actor devices thermal/core: Make cooling device state change private thermal: intel: pch: Fix unexpected shutdown at critical temperature thermal: int340x: Fix unexpected shutdown at critical temperature thermal/core: Remove pointless thermal_zone_device_reset() function thermal/core: Remove ms based delay fields thermal/core: Use precomputed jiffies for the polling thermal/core: Precompute the delays from msecs to jiffies thermal/core: Remove unused macro THERMAL_TRIPS_NONE thermal/core: Remove THERMAL_TRIPS_NONE test ...
2021-02-22Merge tag 'tag-chrome-platform-for-v5.12' of ↵Linus Torvalds10-39/+66
git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Benson Leung: "Lots of changes to the cros_ec_typec driver for 5.12. A portion of this this set of cros_ec_typec driver's changes was merged through GregKH's USB tree in order to satisfy cros_ec_typec driver and typec connector class subsystem dependencies of subsequent changes. Summary: cros_ec_typec: - Registration of cable plug information - Support for SOP' plug registration and altmodes - Support for reporting number of altmodes supported by partners and plugs - Send mux configuration ack to EC via a new host command - Support mux control with no port partner present - Decouple cable removal from partner removal cros_ec misc: - Fix some event masking in cros_ec_proto. - Gwendal reworked cros_ec's top and bottom half for consistency in ishtp and rpmsg - Constify static attribute_group structs" * tag 'tag-chrome-platform-for-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_typec: Flush pending work platform/chrome: cros_ec_types: Support disconnect events without partners platform/chrome: cros_ec_typec: Skip port partner check in configure_mux() platform/chrome: cros_ec_typec: Decouple partner removal platform/chrome: cros_ec: Call interrupt bottom half at probe time platform/chrome: cros_ec: Call interrupt bottom half in ISH or RPMSG mode platform/chrome: cros_ec_sysfs: Add cold-ap-off to sysfs reboot. platform/chrome: cros_ec_commands: Add host command to keep AP off after EC reset. platform/chrome: Constify static attribute_group structs platform/chrome: cros_ec_proto: Add LID and BATTERY to default mask platform/chrome: cros_ec_proto: Use EC_HOST_EVENT_MASK not BIT
2021-02-22Merge tag 'platform-drivers-x86-v5.12-1' of ↵Linus Torvalds64-1528/+12615
git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: "Highlights: - Microsoft Surface devices System Aggregator Module support - SW_TABLET_MODE reporting improvements - thinkpad_acpi keyboard language setting support - platform / DPTF profile settings support: - Base / userspace API parts merged from Rafael's acpi-platform branch - thinkpad_acpi and ideapad-laptop support through pdx86 - Remove support for some obsolete Intel MID platforms through merging of the shared intel-mid-removal branch - Big cleanup of the ideapad-laptop driver - Misc other fixes / new hw support / quirks" * tag 'platform-drivers-x86-v5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (99 commits) platform/x86: intel_scu_ipc: Increase virtual timeout from 3 to 5 seconds platform/surface: aggregator: Fix access of unaligned value tools/power/x86/intel-speed-select: Update version to 1.8 tools/power/x86/intel-speed-select: Add new command to get/set TRL tools/power/x86/intel-speed-select: Add new command turbo-mode Platform: OLPC: Constify static struct regulator_ops platform/surface: Add Surface Hot-Plug driver platform/x86: intel_scu_wdt: Drop mistakenly added const platform/x86: Kconfig: add missing selects for ideapad-laptop platform/x86: acer-wmi: Don't use ACPI_EXCEPTION() platform/x86: thinkpad_acpi: Replace ifdef CONFIG_ACPI_PLATFORM_PROFILE with depends on platform/x86: thinkpad_acpi: Fix 'warning: no previous prototype for' warnings platform/x86: msi-wmi: Fix variable 'status' set but not used compiler warning platform/surface: surface3-wmi: Fix variable 'status' set but not used compiler warning platform/x86: Move all dell drivers to their own subdirectory Documentation/ABI: sysfs-platform-ideapad-laptop: conservation_mode attribute Documentation/ABI: sysfs-platform-ideapad-laptop: update device attribute paths platform/x86: ideapad-laptop: add "always on USB charging" control support platform/x86: ideapad-laptop: add keyboard backlight control support platform/x86: ideapad-laptop: send notification about touchpad state change to sysfs ...
2021-02-21Merge tag 'acpi-5.12-rc1' of ↵Linus Torvalds1-3/+3
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These update the ACPICA code in the kernel to upstream revision 20210105, fix and clean up the handling of device properties, add support for setting global profile of the platform, clean up device enumeration, the CPPC library, the APEI support and more, update the documentation, consolidate the printing of messages in several places and make assorted janitorial changes. Specifics: - Update ACPICA code in the kernel to upstream revision 20201113 with changes as follows: * Remove the MTMR (Mid-Timer) table (Al Stone). * Remove the VRTC table (Al Stone). * Add type casts for string functions (Bob Moore). * Update all copyrights to 2021 (Bob Moore). * Fix exception code class checks (Maximilian Luz). * Clean up exception code class checks (Maximilian Luz). * Fix -Wfallthrough (Nick Desaulniers). - Add support for setting and reading global profile of the platform along with documentation (Mark Pearson, Hans de Goede, Jiaxun Yang). - Fix fwnode properties matching and clean up the code handling device properties and its documentation (Rafael Wysocki, Andy Shevchenko). - Clean up ACPI-based device enumeration code (Rafael Wysocki). - Clean up the CPPC support library code (Ionela Voinescu). - Clean up the APEI support code (Yang Li, Yazen Ghannam). - Update GPIO-related properties documentation (Flavio Suligoi). - Consolidate and clean up the printing of messages in several places (Rafael Wysocki). - Fix error code path in configfs handling code (Qinglang Miao). - Use DEVICE_ATTR_<RW|RO|WO> macros where applicable (Dwaipayan Ray). - Replace tests for !ACPI_FAILURE with tests for ACPI_SUCCESS in multiple places (Bjorn Helgaas)" * tag 'acpi-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (44 commits) ACPI: property: Satisfy kernel doc validator (part 2) ACPI: property: Satisfy kernel doc validator (part 1) ACPI: property: Make acpi_node_prop_read() static ACPI: property: Remove dead code ACPI: property: Fix fwnode string properties matching ACPI: OSL: Clean up printing messages ACPI: OSL: Rework acpi_check_resource_conflict() ACPI: APEI: ERST: remove unneeded semicolon ACPI: thermal: Clean up printing messages ACPI: video: Clean up printing messages ACPI: button: Clean up printing messages ACPI: battery: Clean up printing messages ACPI: AC: Clean up printing messages ACPI: bus: Drop ACPI_BUS_COMPONENT which is not used any more ACPI: utils: Clean up printing messages ACPI: scan: Clean up printing messages ACPI: bus: Clean up printing messages ACPI: PM: Clean up printing messages ACPI: power: Clean up printing messages ACPI: APEI: Add is_generic_error() to identify GHES sources ...
2021-02-15sfi: Remove framework for deprecated firmwareAndy Shevchenko1-18/+4
SFI-based platforms are gone. So does this framework. This removes mention of SFI through the drivers and other code as well. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-02-15Merge branches 'acpi-misc', 'acpi-cppc', 'acpi-docs', 'acpi-config' and ↵Rafael J. Wysocki1-3/+3
'acpi-apei' * acpi-misc: ACPI: Test for ACPI_SUCCESS rather than !ACPI_FAILURE ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros * acpi-cppc: ACPI: CPPC: initialise vaddr pointers to NULL ACPI: CPPC: add __iomem annotation to generic_comm_base pointer ACPI: CPPC: remove __iomem annotation for cpc_reg's address * acpi-docs: Documentation: ACPI: add new rule for gpio-line-names * acpi-config: ACPI: configfs: add missing check after configfs_register_default_group() * acpi-apei: ACPI: APEI: ERST: remove unneeded semicolon ACPI: APEI: Add is_generic_error() to identify GHES sources
2021-02-12platform/chrome: cros_ec_typec: Flush pending workPrashant Malani1-0/+1
When a PD notifier event arrives, a new work event won't be enqueued if the current one hasn't completed. This could lead to dropped events. So, flush any pending work before scheduling the new instance. Signed-off-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20210211193221.610867-1-pmalani@chromium.org Signed-off-by: Benson Leung <bleung@chromium.org>
2021-02-11platform/x86: intel_scu_ipc: Increase virtual timeout from 3 to 5 secondsCasey Bowman1-1/+1
Increasing the virtual timeout time to account for scenarios that may require more time, like DisplayPort Multi-Stream Transport (DP MST), where the disconnect time can be extended longer than usual. The recommended timeout range is 5-10 seconds, of which we will take the lower bound. Signed-off-by: Casey Bowman <casey.g.bowman@intel.com> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210210192041.17022-1-casey.g.bowman@intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-11platform/surface: aggregator: Fix access of unaligned valueMaximilian Luz1-1/+1
The raw message frame length is unaligned and explicitly marked as little endian. It should not be accessed without the appropriate accessor functions. Fix this. Note that payload.len already contains the correct length after parsing via sshp_parse_frame(), so we can simply use that instead. Reported-by: kernel-test-robot <lkp@intel.com> Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Acked-by: Mark Gross <mgross@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210211124149.2439007-1-luzmaximilian@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-09Merge tag 'ib-drm-gpio-pdx86-rtc-wdt-v5.12-2' of ↵Rafael J. Wysocki5-810/+84
git://git.infradead.org/linux-platform-drivers-x86 Pull the first part of Intel MID outdated platforms removal from Andy Shevchenko: "The following is an automated git shortlog grouped by driver: drm/gma500: - Get rid of duplicate NULL checks - Convert to use new SCU IPC API gpio: - msic: Remove driver for deprecated platform - intel-mid: Remove driver for deprecated platform intel_mid_powerbtn: - Remove driver for deprecated platform intel_mid_thermal: - Remove driver for deprecated platform intel_scu_wdt: - Drop mistakenly added const - Get rid of custom x86 model comparison - Drop SCU notification - Move driver from arch/x86 rtc: - mrst: Remove driver for deprecated platform watchdog: - intel-mid_wdt: Postpone IRQ handler registration till SCU is ready - intel_scu_watchdog: Remove driver for deprecated platform" * tag 'ib-drm-gpio-pdx86-rtc-wdt-v5.12-2' of git://git.infradead.org/linux-platform-drivers-x86: platform/x86: intel_scu_wdt: Drop mistakenly added const platform/x86: intel_scu_wdt: Get rid of custom x86 model comparison platform/x86: intel_scu_wdt: Drop SCU notification platform/x86: intel_scu_wdt: Move driver from arch/x86 watchdog: intel-mid_wdt: Postpone IRQ handler registration till SCU is ready watchdog: intel_scu_watchdog: Remove driver for deprecated platform rtc: mrst: Remove driver for deprecated platform platform/x86: intel_mid_powerbtn: Remove driver for deprecated platform platform/x86: intel_mid_thermal: Remove driver for deprecated platform gpio: msic: Remove driver for deprecated platform gpio: intel-mid: Remove driver for deprecated platform drm/gma500: Get rid of duplicate NULL checks drm/gma500: Convert to use new SCU IPC API
2021-02-08Platform: OLPC: Constify static struct regulator_opsRikard Falkeborn1-1/+1
The only usage of it is to assign its address to the ops field in the regulator_desc struct, which is a pointer to const struct regulator_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20210206232152.58046-1-rikard.falkeborn@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-08platform/surface: Add Surface Hot-Plug driverMaximilian Luz3-0/+302
Some Surface Book 2 and 3 models have a discrete GPU (dGPU) that is hot-pluggable. On those devices, the dGPU is contained in the base, which can be separated from the tablet part (containing CPU and touchscreen) while the device is running. It (in general) is presented as/behaves like a standard PCIe hot-plug capable device, however, this device can also be put into D3cold. In D3cold, the device itself is turned off and can thus not submit any standard PCIe hot-plug events. To properly detect hot-(un)plugging while the dGPU is in D3cold, out-of-band signaling is required. Without this, the device state will only get updated during the next bus-check, eg. via a manually issued lspci call. This commit adds a driver to handle out-of-band PCIe hot-(un)plug events on Microsoft Surface devices. On those devices, said events can be detected via GPIO interrupts, which are then forwarded to the corresponding ACPI DSM calls by this driver. The DSM then takes care of issuing the appropriate bus-/device-check, causing the PCI core to properly pick up the device change. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20210205012657.1951753-1-luzmaximilian@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-08Merge 5.11-rc7 into usb-nextGreg Kroah-Hartman2-5/+15
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-06platform/chrome: cros_ec_types: Support disconnect events without partnersRajmohan Mani1-7/+19
There are certain scenarios, where a disconnect event might occur on a Type-C port with no port partners. This is required to enable communication to Burnside Bridge USB4 retimers. Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com> Reviewed-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20210205195113.20277-3-rajmohan.mani@intel.com Signed-off-by: Benson Leung <bleung@chromium.org>
2021-02-06platform/chrome: cros_ec_typec: Skip port partner check in configure_mux()Rajmohan Mani1-3/+0
For certain needs like updating the USB4 retimer firmware when no device are connected, the Type-C ports require mux configuration, to be able to communicate with the retimer. So removed the above check to allow for mux configuration of Type-C ports, to enable retimer communication. Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com> Reviewed-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20210205195113.20277-2-rajmohan.mani@intel.com Signed-off-by: Benson Leung <bleung@chromium.org>
2021-02-05platform/x86: intel_scu_wdt: Drop mistakenly added constAndy Shevchenko1-1/+1
Neither original structure nor platform_data is declared with const. Drop mistakenly added const when assing platform_data. Fixes: a507e5d90f3d ("platform/x86: intel_scu_wdt: Get rid of custom x86 model comparison") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210204150508.62659-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/chrome: cros_ec_typec: Clear Type C disc eventsPrashant Malani1-3/+26
Clear USB Type C discovery events from the Chrome EC once they've been successfully handled. Signed-off-by: Prashant Malani <pmalani@chromium.org> Reported-by: Benson Leung <bleung@chromium.org> Tested-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20210203021539.745239-2-pmalani@chromium.org Signed-off-by: Benson Leung <bleung@chromium.org>
2021-02-04platform/x86: intel_scu_wdt: Drop mistakenly added constAndy Shevchenko1-1/+1
Neither original structure nor platform_data is declared with const. Drop mistakenly added const when assing platform_data. Fixes: a507e5d90f3d ("platform/x86: intel_scu_wdt: Get rid of custom x86 model comparison") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210204150508.62659-1-andriy.shevchenko@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: Kconfig: add missing selects for ideapad-laptopBarnabás Pőcze1-0/+2
LED class support is needed by the ideapad-laptop module to compile after the referenced commit. Add missing NEW_LEDS and LEDS_CLASS to Kconfig. Fixes: 503325f84bc0 ("platform/x86: ideapad-laptop: add keyboard backlight control support") Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210204142010.356675-1-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: acer-wmi: Don't use ACPI_EXCEPTION()Hans de Goede1-2/+2
ACPI_EXCEPTION is only intended for internal use by the ACPICA code. ACPI_EXCEPTION was being used here to change the apci_status code into something human-readable, use acpi_format_exception() for this instead, which is the proper way to do this outside of ACPICA. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210204140205.268344-1-hdegoede@redhat.com
2021-02-04platform/x86: thinkpad_acpi: Replace ifdef CONFIG_ACPI_PLATFORM_PROFILE with ↵Hans de Goede2-7/+1
depends on With the #if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE), we get the following errors when thinkpad_acpi is builtin while CONFIG_ACPI_PLATFORM_PROFILE=m : drivers/platform/x86/thinkpad_acpi.c:10186: undefined reference to `platform_profile_notify' drivers/platform/x86/thinkpad_acpi.c:10226: undefined reference to `platform_profile_register' drivers/platform/x86/thinkpad_acpi.c:10246: undefined reference to `platform_profile_remove' This could be fixed by changing the IS_ENABLED to IS_REACHABLE, but I believe that it is better to just switch to using depends on. Using depends on ensures that platform-profile support is always available when thinkpad_acpi is build, hopefully leading to less confusing bug-reports about it sometimes not working. Cc: Mark Pearson <markpearson@lenovo.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210204140158.268289-2-hdegoede@redhat.com
2021-02-04platform/x86: thinkpad_acpi: Fix 'warning: no previous prototype for' warningsHans de Goede1-5/+5
Some of the new dytc handling functions are not marked static, even though they are only used internally. Mark these static, fixing the following compiler warnings: drivers/platform/x86/thinkpad_acpi.c:10081:5: warning: no previous prototype for 'dytc_profile_get' [-Wmissing-prototypes] drivers/platform/x86/thinkpad_acpi.c:10095:5: warning: no previous prototype for 'dytc_cql_command' [-Wmissing-prototypes] drivers/platform/x86/thinkpad_acpi.c:10133:5: warning: no previous prototype for 'dytc_profile_set' [-Wmissing-prototypes] Cc: Mark Pearson <markpearson@lenovo.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210204140158.268289-1-hdegoede@redhat.com
2021-02-04platform/x86: msi-wmi: Fix variable 'status' set but not used compiler warningHans de Goede1-0/+2
Explicitly check the status rather then relying on output.pointer staying NULL on an error. Reported-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210204121931.131617-1-hdegoede@redhat.com
2021-02-04platform/surface: surface3-wmi: Fix variable 'status' set but not used ↵Hans de Goede1-1/+5
compiler warning Explicitly check the status rather then relying on output.pointer staying NULL on an error. This silences the following compiler warning: drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used [-Wunused-but-set-variable] Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210204113848.105994-1-hdegoede@redhat.com
2021-02-04platform/x86: Move all dell drivers to their own subdirectoryMario Limonciello30-190/+230
A user without a Dell system doesn't need to pick any of these drivers. Users with a Dell system can enable this submenu and all drivers behind it will be enabled. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com> Link: https://lore.kernel.org/r/20210203195832.2950605-1-mario.limonciello@dell.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: add "always on USB charging" control supportBarnabás Pőcze1-9/+56
Certain models have a so-called "always on USB charging" feature, which enables USB charging even when the computer is turned off or suspended, and which may be controlled/queried using the SALS/HALS ACPI methods. Expose this functionality via a new device attribute (usb_charging). Tested on: Lenovo YOGA 520-14IKB 80X8 Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-28-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: add keyboard backlight control supportBarnabás Pőcze1-1/+132
On certain models it is possible to control/query the keyboard backlight via the SALS/HALS ACPI methods. Add support for that, and register an LED class device to expose this functionality. Tested on: Lenovo YOGA 520-14IKB 80X8 Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-27-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: send notification about touchpad state change ↵Barnabás Pőcze1-0/+1
to sysfs Consumers can determine if the value of an attribute changed much more easily if changes are broadcast using sysfs_notify(), so utilize it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-26-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: fix checkpatch warnings, more consistent styleBarnabás Pőcze1-198/+256
Fix all checkpatch warnings. Reorder variable definitions from longest to shortest. Add more whitespaces for better readability. Rename variables named `ret` to `err` where appropriate. Reorder sysfs attributes show/store callbacks and the `ideapad_attributes` array in lexicographic order. And other minor formatting changes. No significant functional changes are intended. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-25-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04Revert "platform/x86: ideapad-laptop: Switch touchpad attribute to be RO"Barnabás Pőcze1-5/+4
The touchpad can be enabled/disabled via this attribute on a Lenovo Yoga 520-14IKB. Allow writing as it provides legitimate functionality. This reverts commit 7f363145992cebf4ea760447f1cfdf6f81459683. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-24-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: change 'cfg' debugfs file formatBarnabás Pőcze1-15/+18
Minor formatting changes. Use seq_puts() where possible. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-23-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: change 'status' debugfs file formatBarnabás Pőcze1-22/+15
Remove conservation mode reporting since it is already reported via the appropriate device attribute, and its state can be deduced from the value of GBMD. Add the return value of the GBMD and HALS ACPI methods to the output. Use seq_puts() where possible. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-22-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: check for touchpad support in _CFGBarnabás Pőcze1-5/+9
Bit 30 of _CFG is set if the device has a touchpad, check that in is_visible() for the touchpad attribute. Show 'touchpad', if supported, in the list of capabilities in the 'cfg' debugfs file. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-21-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: check for Fn-lock support in HALSBarnabás Pőcze1-3/+9
Bit 9 in the return value of the HALS ACPI method is set if Fn-lock is supported. Change ideapad_check_features() to check it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-20-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: rework is_visible() logicBarnabás Pőcze1-25/+55
Store the supported features in the driver private data, and modify the is_visible() callback to use it, and create ideapad_check_features() to populate it. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-19-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: rework and create new ACPI helpersBarnabás Pőcze1-95/+77
Create dedicated helper functions for accessing the main ACPI methods: GBMD, SMBC, HALS, SALS; and utilize them. Use `unsigned long` consistently in every ACPI helper wherever possible. Change names to better express purpose. Do not assign values to output parameters in case of failure. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-18-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: group and separate (un)related constants into ↵Barnabás Pőcze1-27/+37
enums Group and rename constants depending on which ACPI interface they pertain to, and rename CFG_X constants to CFG_CAP_X. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-17-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: misc. device attribute changesBarnabás Pőcze1-15/+15
Do not handle zero length buffer separately. Use kstrtouint() instead of sscanf(). Use kstrtobool() in store_ideapad_cam(). These introduce minor ABI changes, but it is expected that no users rely on the previous behavior. Thus the change is deemed justifed. Additionally, use `!!` to convert to `int` and use the "%d" format specifier in sysfs_emit() for boolean-like attributes. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-16-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: always propagate error codes from device ↵Barnabás Pőcze1-9/+17
attributes' show() callback Consumers can differentiate an error from a successful read much more easily if the read() call fails with an appropriate errno instead of returning a magic string like "-1". This introduces an ABI change, but not many users are expected to be relying on the previous behavior, and this change makes this module conforming to the standard behavior that sysfs attribute show/store callbacks return an appropriate errno in case of failure. Thus the ABI breakage is deemed justified. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-15-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: convert ACPI helpers to return -EIO in case of ↵Barnabás Pőcze1-46/+62
failure ACPI helpers returned -1 in case of failure. Convert these functions to return appropriate error codes, and convert their users to propagate these error codes accordingly. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-14-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: use dev_{err,warn} or appropriate variant to ↵Barnabás Pőcze1-9/+17
display log messages Having the device name in the log message makes it easier to determine in the context of which device the message was printed, so utilize the appropriate variants of dev_{err,warn,...} when printing log messages. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-12-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: use msecs_to_jiffies() helper instead of ↵Barnabás Pőcze1-4/+7
hand-crafted formula The current code used a hand-crafted formula to convert milliseconds to jiffies, replace it with the msecs_to_jiffies() function. Furthermore, use a while loop instead of for loop for shorter lines and simplicity. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-11-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: use for_each_set_bit() helper to simplify ↵Barnabás Pőcze1-55/+53
event processing The current code used the combination of a for loop + test_bit, which can be simplified using for_each_set_bit(), so utilize that. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-10-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: use kobj_to_dev()Barnabás Pőcze1-1/+1
Use kobj_to_dev() instead of open-coding the container_of() macro. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-9-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: use device_{add,remove}_groupBarnabás Pőcze1-4/+4
Use device_{add,remove}_group instead of sysfs_{add,remove}_group. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-8-pobrn@protonmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-02-04platform/x86: ideapad-laptop: use sysfs_emit()Barnabás Pőcze1-10/+11
sysfs_emit() has been introduced to make it less ambiguous which function is preferred when writing to the output buffer in a device attribute's show() callback. Convert the ideapad-laptop module to utilize this new helper function. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-7-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>