aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform
AgeCommit message (Collapse)AuthorFilesLines
2022-02-24surface: surface3_power: Fix battery readings on batteries without a serial ↵Gravatar Hans de Goede 1-3/+10
number The battery on the 2nd hand Surface 3 which I recently bought appears to not have a serial number programmed in. This results in any I2C reads from the registers containing the serial number failing with an I2C NACK. This was causing mshw0011_bix() to fail causing the battery readings to not work at all. Ignore EREMOTEIO (I2C NACK) errors when retrieving the serial number and continue with an empty serial number to fix this. Fixes: b1f81b496b0d ("platform/x86: surface3_power: MSHW0011 rev-eng implementation") BugLink: https://github.com/linux-surface/linux-surface/issues/608 Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220224101848.7219-1-hdegoede@redhat.com
2022-02-24platform/x86: amd-pmc: Set QOS during suspend on CZN w/ timer wakeupGravatar Mario Limonciello 1-9/+33
commit 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup") adds support for using another platform timer in lieu of the RTC which doesn't work properly on some systems. This path was validated and worked well before submission. During the 5.16-rc1 merge window other patches were merged that caused this to stop working properly. When this feature was used with 5.16-rc1 or later some OEM laptops with the matching firmware requirements from that commit would shutdown instead of program a timer based wakeup. This was bisected to commit 8d89835b0467 ("PM: suspend: Do not pause cpuidle in the suspend-to-idle path"). This wasn't supposed to cause any negative impacts and also tested well on both Intel and ARM platforms. However this changed the semantics of when CPUs are allowed to be in the deepest state. For the AMD systems in question it appears this causes a firmware crash for timer based wakeup. It's hypothesized to be caused by the `amd-pmc` driver sending `OS_HINT` and all the CPUs going into a deep state while the timer is still being programmed. It's likely a firmware bug, but to avoid it don't allow setting CPUs into the deepest state while using CZN timer wakeup path. If later it's discovered that this also occurs from "regular" suspends without a timer as well or on other silicon, this may be later expanded to run in the suspend path for more scenarios. Cc: stable@vger.kernel.org # 5.16+ Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/linux-acpi/BL1PR12MB51570F5BD05980A0DCA1F3F4E23A9@BL1PR12MB5157.namprd12.prod.outlook.com/T/#mee35f39c41a04b624700ab2621c795367f19c90e Fixes: 8d89835b0467 ("PM: suspend: Do not pause cpuidle in the suspend-to-idle path") Fixes: 23f62d7ab25b ("PM: sleep: Pause cpuidle later and resume it earlier during system transitions") Fixes: 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup" Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20220223175237.6209-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-02-21platform/x86: int3472: Add terminator to gpiod_lookup_tableGravatar Daniel Scally 1-1/+2
Without the terminator, if a con_id is passed to gpio_find() that does not exist in the lookup table the function will not stop looping correctly, and eventually cause an oops. Fixes: 19d8d6e36b4b ("platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell") Signed-off-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/20220216225304.53911-5-djrscally@gmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-02-05platform/x86: asus-wmi: Fix regression when probing for fan curve controlGravatar Hans de Goede 1-1/+1
The fan curve control patches introduced a regression for at least the TUF FX506 and possibly other TUF series laptops that do not have support for fan curve control. As part of the probing process, asus_wmi_evaluate_method_buf is called to get the factory default fan curve . The WMI management function returns 0 on certain laptops to indicate lack of fan curve control instead of ASUS_WMI_UNSUPPORTED_METHOD. This 0 is transformed to -ENODATA which results in failure when probing. Fixes: 0f0ac158d28f ("platform/x86: asus-wmi: Add support for custom fan curves") Reported-and-tested-by: Abhijeet V <abhijeetviswa@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220205112840.33095-1-hdegoede@redhat.com
2022-02-03platform/x86: thinkpad_acpi: Add dual-fan quirk for T15g (2nd gen)Gravatar Hans de Goede 1-0/+1
The ThinkPad T15g Gen 2 has 2 fan, add a TPACPI_FAN_2CTL quirk entry for it to the fan_quirk_table[] so that both fans can be controllerd. Reported-and-tested-by: David Dreschner <david@dreschner.net> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220203103302.49401-1-hdegoede@redhat.com
2022-02-01platform/x86: thinkpad_acpi: Fix incorrect use of platform profile on AMD ↵Gravatar Mark Pearson 1-0/+12
platforms Lenovo AMD based platforms have been offering platform_profiles but they are not working correctly. This is because the mode we are using on the Intel platforms (MMC) is not available on the AMD platforms. This commit adds checking of the functional capabilities returned by the BIOS to confirm if MMC is supported or not. Profiles will not be available if the platform is not MMC capable. I'm investigating and working on an alternative for AMD platforms but that is still work-in-progress. Signed-off-by: Mark Pearson <markpearson@lenovo.com> Link: https://lore.kernel.org/r/20220127190358.4078-1-markpearson@lenovo.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/x86: amd-pmc: Correct usage of SMU versionGravatar Mario Limonciello 1-5/+8
Yellow carp has been outputting versions like `1093.24.0`, but this is supposed to be 69.24.0. That is the MSB is being interpreted incorrectly. The MSB is not part of the major version, but has generally been treated that way thus far. It's actually the program, and used to distinguish between two programs from a similar family but different codebase. Link: https://patchwork.freedesktop.org/patch/469993/ Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20220120174439.12770-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/x86: asus-tf103c-dock: Make 2 global structs staticGravatar Hans de Goede 1-2/+2
tf103c_dock_hid_ll_driver and tf103c_dock_pm_ops are not used outside of the driver, make them both static. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220117112644.260168-2-hdegoede@redhat.com
2022-01-24platform/x86: amd-pmc: Make amd_pmc_stb_debugfs_fops staticGravatar Hans de Goede 1-1/+1
amd_pmc_stb_debugfs_fops is not used outside of amd-pmc.c, make it static. Cc: Sanket Goswami <Sanket.Goswami@amd.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220117112644.260168-1-hdegoede@redhat.com
2022-01-24platform/x86: ISST: Fix possible circular locking dependency detectedGravatar Srinivas Pandruvada 1-34/+63
As reported: [ 256.104522] ====================================================== [ 256.113783] WARNING: possible circular locking dependency detected [ 256.120093] 5.16.0-rc6-yocto-standard+ #99 Not tainted [ 256.125362] ------------------------------------------------------ [ 256.131673] intel-speed-sel/844 is trying to acquire lock: [ 256.137290] ffffffffc036f0d0 (punit_misc_dev_lock){+.+.}-{3:3}, at: isst_if_open+0x18/0x90 [isst_if_common] [ 256.147171] [ 256.147171] but task is already holding lock: [ 256.153135] ffffffff8ee7cb50 (misc_mtx){+.+.}-{3:3}, at: misc_open+0x2a/0x170 [ 256.160407] [ 256.160407] which lock already depends on the new lock. [ 256.160407] [ 256.168712] [ 256.168712] the existing dependency chain (in reverse order) is: [ 256.176327] [ 256.176327] -> #1 (misc_mtx){+.+.}-{3:3}: [ 256.181946] lock_acquire+0x1e6/0x330 [ 256.186265] __mutex_lock+0x9b/0x9b0 [ 256.190497] mutex_lock_nested+0x1b/0x20 [ 256.195075] misc_register+0x32/0x1a0 [ 256.199390] isst_if_cdev_register+0x65/0x180 [isst_if_common] [ 256.205878] isst_if_probe+0x144/0x16e [isst_if_mmio] ... [ 256.241976] [ 256.241976] -> #0 (punit_misc_dev_lock){+.+.}-{3:3}: [ 256.248552] validate_chain+0xbc6/0x1750 [ 256.253131] __lock_acquire+0x88c/0xc10 [ 256.257618] lock_acquire+0x1e6/0x330 [ 256.261933] __mutex_lock+0x9b/0x9b0 [ 256.266165] mutex_lock_nested+0x1b/0x20 [ 256.270739] isst_if_open+0x18/0x90 [isst_if_common] [ 256.276356] misc_open+0x100/0x170 [ 256.280409] chrdev_open+0xa5/0x1e0 ... The call sequence suggested that misc_device /dev file can be opened before misc device is yet to be registered, which is done only once. Here punit_misc_dev_lock was used as common lock, to protect the registration by multiple ISST HW drivers, one time setup, prevent duplicate registry of misc device and prevent load/unload when device is open. We can split into locks: - One which just prevent duplicate call to misc_register() and one time setup. Also never call again if the misc_register() failed or required one time setup is failed. This lock is not shared with any misc device callbacks. - The other lock protects registry, load and unload of HW drivers. Sequence in isst_if_cdev_register() - Register callbacks under punit_misc_dev_open_lock - Call isst_misc_reg() which registers misc_device on the first registry which is under punit_misc_dev_reg_lock, which is not shared with callbacks. Sequence in isst_if_cdev_unregister Just opposite of isst_if_cdev_register Reported-and-tested-by: Liwei Song <liwei.song@windriver.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20220112022521.54669-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/x86: intel_crystal_cove_charger: Fix IRQ masking / unmaskingGravatar Hans de Goede 1-13/+13
The driver as originally submitted accidentally relied on Android having run before and Android having unmasked the 2nd level IRQ-mask for the charger IRQ. This worked since these are PMIC registers which are only reset when the battery is fully drained or disconnected. Fix the charger IRQ no longer working after loss of battery power by properly setting the 2nd level IRQ-mask for the charger IRQ. Note this removes the need to enable/disable our parent IRQ which just sets the mask bit in the 1st level IRQ-mask register, setting one of the 2 level masks is enough to stop the IRQ from getting reported. Fixes: 761db353d9e2 ("platform/x86: Add intel_crystal_cove_charger driver") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220111232309.377642-1-hdegoede@redhat.com
2022-01-24platform/x86: thinkpad_acpi: Add quirk for ThinkPads without a fanGravatar Alexander Kobel 1-3/+10
Some ThinkPad models, like the X1 Tablet 1st and 2nd Gen, are passively cooled without any fan. Currently, an entry in /proc/acpi/ibm/fan is nevertheless created, and misleadingly shows status: enabled speed: 65535 level: auto This patch adds a TPACPI_FAN_NOFAN quirk definition and corresponding handling to not initialize a fan interface at all. For the time being, the quirk is only applied for X1 Tablet 2nd Gen (types 20JB, 20JC; EC N1O...); further models (such as Gen1, types 20GG and 20GH) can be added easily once tested. Tested on a 20JCS00C00, BIOS N1OET58W (1.43), EC N1OHT34W. Signed-off-by: Alexander Kobel <a-kobel@a-kobel.de> Link: https://lore.kernel.org/r/12d4b825-a2b9-8cb7-6ed3-db4d66f46a60@a-kobel.de Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/x86: touchscreen_dmi: Add info for the RWC NANOTE P8 AY07J 2-in-1Gravatar Yuka Kawajiri 1-0/+24
Add touchscreen info for RWC NANOTE P8 (AY07J) 2-in-1. Signed-off-by: Yuka Kawajiri <yukx00@gmail.com> Link: https://lore.kernel.org/r/20220111154019.4599-1-yukx00@gmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/surface: Reinstate platform dependencyGravatar Geert Uytterhoeven 1-0/+1
Microsoft Surface platform-specific devices are only present on Microsoft Surface platforms, which are currently limited to arm64 and x86. Hence add a dependency on ARM64 || X86, to prevent asking the user about drivers for these devices when configuring a kernel for an architecture that does not support Microsoft Surface platforms. Fixes: 272479928172edf0 ("platform: surface: Propagate ACPI Dependency") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20220115140849.269479-1-geert@linux-m68k.org Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/x86: x86-android-tablets: Trivial typo fix for MODULE_AUTHORGravatar Lubomir Rintel 1-1/+1
Bring balance to the quoting of Hans' e-mail address. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20220110063629.273364-1-lkundrak@v3.sk Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/x86: x86-android-tablets: Fix the buttons on CZC P10T tabletGravatar Lubomir Rintel 1-0/+51
This switches the P10T tablet to "Android" mode, where the Home button sends a single sancode instead of a Windows-specific key combination and the other button doesn't disable the Wi-Fi. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lore.kernel.org/r/20220110063512.273252-1-lkundrak@v3.sk Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-24platform/x86: x86-android-tablets: Constify the gpiod_lookup_tables arraysGravatar Hans de Goede 1-5/+5
The individual gpiod_lookup_table structs cannot be const because they contain a list-head which gets used when registering them. But the array of pointers to the gpiod_lookup_table-s used by a board can be const, constify these. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-By: Lubomir Rintel <lkundrak@V3.sk> Link: https://lore.kernel.org/r/20220110103952.48760-3-hdegoede@redhat.com
2022-01-24platform/x86: x86-android-tablets: Add an init() callback to struct x86_dev_infoGravatar Hans de Goede 1-0/+15
Add an init() callback to struct x86_dev_info, board descriptions can use this to do some custom setup before registering the i2c_clients, platform- devices and servdevs. Also add an exit() callback to also allow for cleanup of the custom setup. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-By: Lubomir Rintel <lkundrak@V3.sk> Link: https://lore.kernel.org/r/20220110103952.48760-2-hdegoede@redhat.com
2022-01-24platform/x86: x86-android-tablets: Add support for disabling ACPI _AEI handlersGravatar Hans de Goede 1-2/+21
Some of the broken DSDTs on these devices often also include broken / wrong _AEI (ACPI Event Interrupt) handlers, which can cause e.g. interrupt storms by listening to a floating GPIO pin. Add support for disabling these and disable them on the Asus ME176C and TF103C tablets. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-By: Lubomir Rintel <lkundrak@V3.sk> Link: https://lore.kernel.org/r/20220110103952.48760-1-hdegoede@redhat.com
2022-01-24platform/x86: x86-android-tablets: Correct crystal_cove_charger module nameGravatar Hans de Goede 1-2/+2
The module was renamed to intel_crystal_cove_charger before it was merged, updated bq24190_modules to match. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220111100708.38585-1-hdegoede@redhat.com
2022-01-22proc: remove PDE_DATA() completelyGravatar Muchun Song 2-10/+10
Remove PDE_DATA() completely and replace it with pde_data(). [akpm@linux-foundation.org: fix naming clash in drivers/nubus/proc.c] [akpm@linux-foundation.org: now fix it properly] Link: https://lkml.kernel.org/r/20211124081956.87711-2-songmuchun@bytedance.com Signed-off-by: Muchun Song <songmuchun@bytedance.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Alexey Gladkov <gladkov.alexey@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-01-14Merge tag 'mips_5.17' of ↵Gravatar Linus Torvalds 3-0/+60
git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - add support for more BCM47XX based devices - add MIPS support for brcmstb PCIe controller - add Loongson 2K1000 reset driver - remove board support for rbtx4938/rbtx4939 - remove support for TX4939 SoCs - fixes and cleanups * tag 'mips_5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (59 commits) MIPS: ath79: drop _machine_restart again PCI: brcmstb: Augment driver for MIPs SOCs MIPS: bmips: Remove obsolete DMA mapping support MIPS: bmips: Add support PCIe controller device nodes dt-bindings: PCI: Add compatible string for Brcmstb 74[23]5 MIPs SOCs MIPS: compressed: Fix build with ZSTD compression MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2 MIPS: BCM47XX: Add support for Netgear R6300 v1 MIPS: BCM47XX: Add LEDs and buttons for Asus RTN-10U MIPS: BCM47XX: Add board entry for Linksys WRT320N v1 MIPS: BCM47XX: Define Linksys WRT310N V2 buttons MIPS: Remove duplicated include in local.h MIPS: retire "asm/llsc.h" MIPS: rework local_t operation on MIPS64 MIPS: fix local_{add,sub}_return on MIPS64 mips/pci: remove redundant ret variable MIPS: Loongson64: Add missing of_node_put() in ls2k_reset_init() MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS MIPS: enable both vmlinux.gz.itb and vmlinuz for generic MIPS: signal: Return immediately if call fails ...
2022-01-12Merge tag 'driver-core-5.17-rc1' of ↵Gravatar Linus Torvalds 9-59/+528
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the set of changes for the driver core for 5.17-rc1. Lots of little things here, including: - kobj_type cleanups - auxiliary_bus documentation updates - auxiliary_device conversions for some drivers (relevant subsystems all have provided acks for these) - kernfs lock contention reduction for some workloads - other tiny cleanups and changes. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (43 commits) kobject documentation: remove default_attrs information drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb debugfs: lockdown: Allow reading debugfs files that are not world readable driver core: Make bus notifiers in right order in really_probe() driver core: Move driver_sysfs_remove() after driver_sysfs_add() firmware: edd: remove empty default_attrs array firmware: dmi-sysfs: use default_groups in kobj_type qemu_fw_cfg: use default_groups in kobj_type firmware: memmap: use default_groups in kobj_type sh: sq: use default_groups in kobj_type headers/uninline: Uninline single-use function: kobject_has_children() devtmpfs: mount with noexec and nosuid driver core: Simplify async probe test code by using ktime_ms_delta() nilfs2: use default_groups in kobj_type kobject: remove kset from struct kset_uevent_ops callbacks driver core: make kobj_type constant. driver core: platform: document registration-failure requirement vdpa/mlx5: Use auxiliary_device driver data helpers net/mlx5e: Use auxiliary_device driver data helpers soundwire: intel: Use auxiliary_device driver data helpers ...
2022-01-11Merge tag 'platform-drivers-x86-v5.17-1' of ↵Gravatar Linus Torvalds 26-661/+4318
git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: "Highlights: New drivers: - asus-tf103c-dock - intel_crystal_cove_charger - lenovo-yogabook-wmi - simatic-ipc platform-code + led driver + watchdog driver - x86-android-tablets (kernel module to workaround DSDT bugs on these) amd-pmc: - bug-fixes - smar trace buffer support asus-wmi: - support for custom fan curves int3472 (camera info ACPI object for Intel IPU3/SkyCam cameras): - ACPI core + int3472 changes to delay enumeration of camera sensor I2C clients until the PMIC for the sensor has been fully probed - Add support for board data (DSDT info is incomplete) for setting up the tps68470 PMIC used on some boards with these cameras - Add board data for the Microsoft Surface Go (original, v2 and v3) thinkpad_acpi: - various cleanups - support for forced battery discharging (for battery calibration) - support to inhibit battery charging - this includes power_supply core changes to add new APIs for this think_lmi: - enhanced BIOS password support various other small fixes and hardware-id additions" * tag 'platform-drivers-x86-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (78 commits) power: supply: Provide stubs for charge_behaviour helpers platform/x86: x86-android-tablets: Fix GPIO lookup leak on error-exit platform/x86: int3472: Add board data for Surface Go 3 platform/x86: Add Asus TF103C dock driver platform/x86: x86-android-tablets: Add TM800A550L data platform/x86: x86-android-tablets: Add Asus MeMO Pad 7 ME176C data platform/x86: x86-android-tablets: Add Asus TF103C data platform/x86: x86-android-tablets: Add support for preloading modules platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables platform/x86: x86-android-tablets: Add support for instantiating serdevs platform/x86: x86-android-tablets: Add support for instantiating platform-devs platform/x86: x86-android-tablets: Add support for PMIC interrupts platform/x86: x86-android-tablets: Don't return -EPROBE_DEFER from a non probe() function platform/x86: touchscreen_dmi: Remove the Glavey TM800A550L entry platform/x86: touchscreen_dmi: Enable pen support on the Chuwi Hi10 Plus and Pro platform/x86: touchscreen_dmi: Correct min/max values for Chuwi Hi10 Pro (CWI529) tablet platform/x86: Add intel_crystal_cove_charger driver power: supply: fix charge_behaviour attribute initialization platform/x86: intel-uncore-frequency: use default_groups in kobj_type x86/platform/uv: use default_groups in kobj_type ...
2022-01-10Merge tag 'media/v5.17-1' of ↵Gravatar Linus Torvalds 9-145/+373
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - New sensor driver: ov5693 - A new driver for STM32 Chrom-ART Accelerator - Added V4L2 core helper functions for VP9 codec - Hantro driver has gained support for VP9 codecs - Added support for Maxim MAX96712 Quad GMSL2 Deserializer - The staging atomisp driver has gained lots of improvements, fixes and cleanups. It now works with userptr - Lots of random driver improvements as usual * tag 'media/v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (397 commits) media: ipu3-cio2: Add support for instantiating i2c-clients for VCMs media: ipu3-cio2: Call cio2_bridge_init() before anything else media: ipu3-cio2: Defer probing until the PMIC is fully setup media: hantro: Add support for Allwinner H6 media: dt-bindings: allwinner: document H6 Hantro G2 binding media: hantro: Convert imx8m_vpu_g2_irq to helper media: hantro: move postproc enablement for old cores media: hantro: vp9: add support for legacy register set media: hantro: vp9: use double buffering if needed media: hantro: add support for reset lines media: hantro: Fix probe func error path media: i2c: hi846: use pm_runtime_force_suspend/resume for system suspend media: i2c: hi846: check return value of regulator_bulk_disable() media: hi556: Support device probe in non-zero ACPI D state media: ov5675: Support device probe in non-zero ACPI D state media: imx208: Support device probe in non-zero ACPI D state media: ov2740: support device probe in non-zero ACPI D state media: ov5670: Support device probe in non-zero ACPI D state media: ov8856: support device probe in non-zero ACPI D state media: ov8865: Disable only enabled regulators on error path ...
2022-01-10Merge tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drmGravatar Linus Torvalds 2-42/+97
Pull drm updates from Dave Airlie: "Highlights are support for privacy screens found in new laptops, a bunch of nomodeset refactoring, and i915 enables ADL-P systems by default, while starting to add RPL-S support. vmwgfx adds GEM and support for OpenGL 4.3 features in userspace. Lots of internal refactorings around dma reservations, and lots of driver refactoring as well. Summary: core: - add privacy screen support - move nomodeset option into drm subsystem - clean up nomodeset handling in drivers - make drm_irq.c legacy - fix stack_depot name conflicts - remove DMA_BUF_SET_NAME ioctl restrictions - sysfs: send hotplug event - replace several DRM_* logging macros with drm_* - move hashtable to legacy code - add error return from gem_create_object - cma-helper: improve interfaces, drop CONFIG_DRM_KMS_CMA_HELPER - kernel.h related include cleanups - support XRGB2101010 source buffers ttm: - don't include drm hashtable - stop pruning fences after wait - documentation updates dma-buf: - add dma_resv selftest - add debugfs helpers - remove dma_resv_get_excl_unlocked - documentation - make fences mandatory in dma_resv_add_excl_fence dp: - add link training delay helpers gem: - link shmem/cma helpers into separate modules - use dma_resv iteratior - import dma-buf namespace into gem helper modules scheduler: - fence grab fix - lockdep fixes bridge: - switch to managed MIPI DSI helpers - register and attach during probe fixes - convert to YAML in several places. panel: - add bunch of new panesl simpledrm: - support FB_DAMAGE_CLIPS - support virtual screen sizes - add Apple M1 support amdgpu: - enable seamless boot for DCN 3.01 - runtime PM fixes - use drm_kms_helper_connector_hotplug_event - get all fences at once - use generic drm fb helpers - PSR/DPCD/LTTPR/DSC/PM/RAS/OLED/SRIOV fixes - add smart trace buffer (STB) for supported GPUs - display debugfs entries - new SMU debug option - Documentation update amdkfd: - IP discovery enumeration refactor - interface between driver fixes - SVM fixes - kfd uapi header to define some sysfs bitfields. i915: - support VESA panel backlights - enable ADL-P by default - add eDP privacy screen support - add Raptor Lake S (RPL-S) support - DG2 page table support - lots of GuC/HuC fw refactoring - refactored i915->gt interfaces - CD clock squashing support - enable 10-bit gamma support - update ADL-P DMC fw to v2.14 - enable runtime PM autosuspend by default - ADL-P DSI support - per-lane DP drive settings for ICL+ - add support for pipe C/D DMC firmware - Atomic gamma LUT updates - remove CCS FB stride restrictions on ADL-P - VRR platform support for display 11 - add support for display audio codec keepalive - lots of display refactoring - fix runtime PM handling during PXP suspend - improved eviction performance with async TTM moves - async VMA unbinding improvements - VMA locking refactoring - improved error capture robustness - use per device iommu checks - drop bits stealing from i915_sw_fence function ptr - remove dma_resv_prune - add IC cache invalidation on DG2 nouveau: - crc fixes - validate LUTs in atomic check - set HDMI AVI RGB quant to full tegra: - buffer objects reworks for dma-buf compat - NVDEC driver uAPI support - power management improvements etnaviv: - IOMMU enabled system support - fix > 4GB command buffer mapping - close a DoS vector - fix spurious GPU resets ast: - fix i2c initialization rcar-du: - DSI output support exynos: - replace legacy gpio interface - implement generic GEM object mmap msm: - dpu plane state cleanup in prep for multirect - dpu debugfs cleanups - dp support for sc7280 - a506 support - removal of struct_mutex - remove old eDP sub-driver anx7625: - support MIPI DSI input - support HDMI audio - fix reading EDID lvds: - fix bridge DT bindings megachips: - probe both bridges before registering dw-hdmi: - allow interlace on bridge ps8640: - enable runtime PM - support aux-bus tx358768: - enable reference clock - add pulse mode support ti-sn65dsi86: - use regmap bulk write - add PWM support etnaviv: - get all fences at once gma500: - gem object cleanups kmb: - enable fb console radeon: - use dma_resv_wait_timeout rockchip: - add DSP hold timeout - suspend/resume fixes - PLL clock fixes - implement mmap in GEM object functions - use generic fbdev emulation sun4i: - use CMA helpers without vmap support vc4: - fix HDMI-CEC hang with display is off - power on HDMI controller while disabling - support 4K@60Hz modes - support 10-bit YUV 4:2:0 output vmwgfx: - fix leak on probe errors - fail probing on broken hosts - new placement for MOB page tables - hide internal BOs from userspace - implement GEM support - implement GL 4.3 support virtio: - overflow fixes xen: - implement mmap as GEM object function omapdrm: - fix scatterlist export - support virtual planes mediatek: - MT8192 support - CMDQ refinement" * tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drm: (1241 commits) drm/amdgpu: no DC support for headless chips drm/amd/display: fix dereference before NULL check drm/amdgpu: always reset the asic in suspend (v2) drm/amdgpu: put SMU into proper state on runpm suspending for BOCO capable platform drm/amd/display: Fix the uninitialized variable in enable_stream_features() drm/amdgpu: fix runpm documentation amdgpu/pm: Make sysfs pm attributes as read-only for VFs drm/amdgpu: save error count in RAS poison handler drm/amdgpu: drop redundant semicolon drm/amd/display: get and restore link res map drm/amd/display: support dynamic HPO DP link encoder allocation drm/amd/display: access hpo dp link encoder only through link resource drm/amd/display: populate link res in both detection and validation drm/amd/display: define link res and make it accessible to all link interfaces drm/amd/display: 3.2.167 drm/amd/display: [FW Promotion] Release 0.0.98 drm/amd/display: Undo ODM combine drm/amd/display: Add reg defs for DCN303 drm/amd/display: Changed pipe split policy to allow for multi-display pipe split drm/amd/display: Set optimize_pwr_state for DCN31 ...
2022-01-08platform/x86: x86-android-tablets: Fix GPIO lookup leak on error-exitGravatar Hans de Goede 1-1/+3
Fix leaking the registered gpiod_lookup tables when the kcalloc() for the i2c_clients array fails. Fixes: ef2ac11493e2 ("platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220108154947.136593-1-hdegoede@redhat.com
2022-01-08platform/x86: int3472: Add board data for Surface Go 3Gravatar Daniel Scally 1-0/+13
The Surface Go 3 needs some board data in order to configure the TPS68470 PMIC - add entries to the tables in tps68470_board_data.c that define the configuration that's needed. Signed-off-by: Daniel Scally <djrscally@gmail.com> Link: https://lore.kernel.org/r/20220106232045.41291-1-djrscally@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2022-01-05platform/x86: Add Asus TF103C dock driverGravatar Hans de Goede 3-0/+965
Add a driver for the keyboard, touchpad and USB port of the keyboard dock for the Asus TF103C 2-in-1 tablet. This keyboard dock has its own I2C attached embedded controller and the keyboard and touchpad are also connected over I2C, instead of using the usual USB connection. This means that the keyboard dock requires this special driver to function. Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> Cc: Ion Agorria <ion@agorria.com> Cc: Svyatoslav Ryhel <clamor95@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211226141849.156407-1-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add TM800A550L dataGravatar Hans de Goede 1-1/+92
The whitelabel (sold as various brands) TM800A550L tablets's DSDT contains a whole bunch of bogus ACPI I2C devices and the ACPI node describing the touchscreen is bad (the IRQ is missing). Enumeration of these is skipped through the acpi_quirk_skip_i2c_client_enumeration(). Add support for manually instantiating the (now) missing I2C devices by adding the necessary device info to the x86-android-tablets module, including instantiating an actually working i2c-client for the touchscreen. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-13-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add Asus MeMO Pad 7 ME176C dataGravatar Hans de Goede 1-0/+118
Asus MeMO Pad 7 ME176C tablets have an Android factory img with everything hardcoded in the kernel instead of properly described in the DSDT. Add support for manually instantiating all the missing I2C devices by adding the necessary device info to the x86-android-tablets module. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-12-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add Asus TF103C dataGravatar Hans de Goede 1-0/+165
Asus TF103C tablets have an Android factory img with everything hardcoded in the kernel instead of properly described in the DSDT. Add support for manually instantiating all the missing I2C devices by adding the necessary device info to the x86-android-tablets module. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-11-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add support for preloading modulesGravatar Hans de Goede 1-0/+8
Since the x86-android-tablets code does all it work from module_init() it cannot use -EPROBE_DEFER to wait for e.g. interrupt providing GPIO-chips or PMIC-cells to show up. To make sure things will still work when some necessary resource providers are build as module allow the per board info to specify a list of modules to pre-load before instantiating the I2C clients. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-10-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add support for registering GPIO lookup ↵Gravatar Hans de Goede 1-0/+9
tables Add support for registering GPIO lookup tables. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-9-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add support for instantiating serdevsGravatar Hans de Goede 2-1/+102
Add support for instantiating serdevs, this is necessary on some boards where the serdev info in the DSDT has issues. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-8-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add support for instantiating platform-devsGravatar Hans de Goede 1-6/+30
Add support for instantiating platform-devs, note this also makes some small changes to the i2c_client instantiating code to make the 2 flows identical. Specifically for the pdevs flow pdev_count must only be set after allocating the pdevs array, to avoid a NULL ptr deref in x86_android_tablet_cleanup() and the i2c_clients flow is updated to work the same way. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-7-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Add support for PMIC interruptsGravatar Hans de Goede 1-1/+30
The Crystal Cove PMIC has a pin which can be used to connect the IRQ of an external charger IC. On some boards this is used so we need a way to look this up. Note that the Intel PMICs have 2 levels of interrupts and thus 2 levels of IRQ domains all tied to a single fwnode. Level 1 is the irqchip which demultiplexes the actual PMIC interrupt into interrupts for the various MFD cells. Level 2 are the irqchips used in the cell drivers which themselves export IRQs, such as the crystal_cove_gpio driver, which de-multiplexes the level 2 interrupts for the GPIOs into individual per GPIO IRQs. The crystal_cove_charger driver registers an irqchip with a single IRQ for the charger driver to consume. Note the MFD cell IRQ cannot be consumed directly because the level 2 interrupts must be explicitly acked. To allow finding the right IRQ domain when looking up the IRQ for the charger, the crystal_cove_charger driver sets a DOMAIN_BUS_WIRED token on its IRQ domain. Add support for looking up the IRQ from the crystal_cove_charger driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-6-hdegoede@redhat.com
2022-01-05platform/x86: x86-android-tablets: Don't return -EPROBE_DEFER from a non ↵Gravatar Hans de Goede 1-2/+4
probe() function The x86-android-tablets code all runs from module_init, so returning -EPROBE_DEFER is not appropriate. Instead log an error and bail. This path should never get hit since PINCTRL_BAYTRAIL is a bool. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-5-hdegoede@redhat.com
2022-01-05platform/x86: touchscreen_dmi: Remove the Glavey TM800A550L entryGravatar Hans de Goede 1-21/+0
The Glavey TM800A550L tablet is a tablet which ships with Android as factory OS. As such it has the typical broken DSDT which x86 Android tablets tend to have. Specifically the touchscreen ACPI device node is missing the IRQ for the touchscreen. So far users were expected to fix this with a DSDT overlay, but support for the TM800A550L has been added to the new x86-android-modules kernel-module and that will now automatically instantiate a proper i2c-client with the IRQ set for the touchscreen, including the necessary device-properties for the firmware loading. This means that the touchscreen_dmi entry for the TM800A550L is no longer necessary (and it no longer matches either since the touchscreen is no longer enumerated through ACPI), remove it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220103112700.111414-1-hdegoede@redhat.com
2022-01-05platform/x86: touchscreen_dmi: Enable pen support on the Chuwi Hi10 Plus and ProGravatar Hans de Goede 1-0/+6
Both the Chuwi Hi10 Plus (CWI527) and the Chuwi Hi10 Pro (CWI529) tablets support being used together with the Hi H2 pen. Add the necessary properties to enable the new support for this in the silead touchscreen driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211225120247.95380-2-hdegoede@redhat.com
2022-01-05platform/x86: touchscreen_dmi: Correct min/max values for Chuwi Hi10 Pro ↵Gravatar Hans de Goede 1-4/+7
(CWI529) tablet The firmware distributed as part of the Windows and Android drivers uses significantly different min and max values for the x- and y-axis, compared to the EFI's embedded touchscreen firmware. The difference is large enough that e.g. typing on an onscreen keyboard results in the wrong "keys" getting pressed. Adjust the values to match those of the firmware distributed with the Windows and Android drivers (which is necessary for pen support) and put the EFI-fw version's min/max values in the new "silead,efi-fw-min-max" property. The silead driver will use these when it is using the EFI embedded firmware, so as to not regress functionality in that case. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211225120247.95380-1-hdegoede@redhat.com
2022-01-05platform/x86: Add intel_crystal_cove_charger driverGravatar Hans de Goede 2-0/+155
Driver for the external-charger IRQ pass-through function of the Intel Bay Trail Crystal Cove PMIC. Note this is NOT a power_supply class driver, it just deals with IRQ pass-through, this requires this separate driver because the PMIC's level 2 interrupt for this must be explicitly acked. This new driver gets enabled by the existing X86_ANDROID_TABLETS Kconfig option because the x86-android-tablets module is the only consumer of the exported external-charger IRQ. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211225115509.94891-5-hdegoede@redhat.com
2022-01-05MIPS: Loongson64: Add missing of_node_put() in ls2k_reset_init()Gravatar Yang Yingliang 1-1/+1
This node pointer is returned by of_find_compatible_node() with refcount incremented in ls2k_reset_init(). Calling of_node_put() to aovid the refcount leak. Fixes: 7eb7819a2e12 ("MIPS: Loongson64: Add Loongson-2K1000 reset platform driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2022-01-02MIPS: Loongson64: Add Loongson-2K1000 reset platform driverGravatar Qing Zhang 3-0/+60
Add power management register operations to support reboot and poweroff. Signed-off-by: Qing Zhang <zhangqing@loongson.cn> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-12-30platform/x86: intel-uncore-frequency: use default_groups in kobj_typeGravatar Greg Kroah-Hartman 1-1/+2
There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the uncore-frequency sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mark Gross <markgross@kernel.org> Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20211229141454.2552950-1-gregkh@linuxfoundation.org Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-12-30x86/platform/uv: use default_groups in kobj_typeGravatar Greg Kroah-Hartman 1-2/+4
There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the uv sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Justin Ernst <justin.ernst@hpe.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mark Gross <markgross@kernel.org> Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20211229141332.2552428-1-gregkh@linuxfoundation.org Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-12-25platform/x86: x86-android-tablets: New driver for x86 Android tabletsGravatar Hans de Goede 3-0/+339
x86 tablets which ship with Android as (part of) the factory image typically have various problems with their DSDTs. The factory kernels shipped on these devices typically have device addresses and GPIOs hardcoded in the kernel, rather then specified in their DSDT. With the DSDT containing a random collection of devices which may or may not actually be present as well as missing devices which are actually present. This driver, which loads only on affected models based on DMI matching, adds DMI based instantiating of kernel devices for devices which are missing from the DSDT, fixing e.g. battery monitoring, touchpads and/or accelerometers not working. Note the Kconfig help text also refers to "various fixes" ATM there are no such fixes, but there are also known cases where entries are present in the DSDT but they contain bugs, such as missing/wrong GPIOs. The plan is to also add fixes for things like this here in the future. This is the least ugly option to get these devices to fully work and to do so without adding any extra code to the main kernel image (vmlinuz) when built as a module. Link: https://lore.kernel.org/platform-driver-x86/20211031162428.22368-1-hdegoede@redhat.com/ Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211223190750.397487-1-hdegoede@redhat.com
2021-12-24Merge tag 'platform-drivers-x86-v5.16-4' of ↵Gravatar Linus Torvalds 7-49/+37
git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Various bug-fixes" * tag 'platform-drivers-x86-v5.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: intel_pmc_core: fix memleak on registration failure platform/x86/intel: Remove X86_PLATFORM_DRIVERS_INTEL platform/x86: system76_acpi: Guard System76 EC specific functionality platform/x86: apple-gmux: use resource_size() with res platform/x86: amd-pmc: only use callbacks for suspend platform/mellanox: mlxbf-pmc: Fix an IS_ERR() vs NULL bug in mlxbf_pmc_map_counters
2021-12-23platform/x86: intel_pmc_core: fix memleak on registration failureGravatar Johan Hovold 1-1/+1
In case device registration fails during module initialisation, the platform device structure needs to be freed using platform_device_put() to properly free all resources (e.g. the device name). Fixes: 938835aa903a ("platform/x86: intel_pmc_core: do not create a static struct device") Cc: stable@vger.kernel.org # 5.9 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20211222105023.6205-1-johan@kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-12-23platform/x86: intel_pmc_core: fix memleak on registration failureGravatar Johan Hovold 1-1/+1
In case device registration fails during module initialisation, the platform device structure needs to be freed using platform_device_put() to properly free all resources (e.g. the device name). Fixes: 938835aa903a ("platform/x86: intel_pmc_core: do not create a static struct device") Cc: stable@vger.kernel.org # 5.9 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20211222105023.6205-1-johan@kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com>