linux-stable/drivers/platform/x86
Hans de Goede d143908f80 platform/x86: apple-gmux: Add apple_gmux_detect() helper
Add a new (static inline) apple_gmux_detect() helper to apple-gmux.h
which can be used for gmux detection instead of apple_gmux_present().

The latter is not really reliable since an ACPI device with a HID
of APP000B is present on some devices without a gmux at all, as well
as on devices with a newer (unsupported) MMIO based gmux model.

This causes apple_gmux_present() to return false-positives on
a number of different Apple laptop models.

This new helper uses the same probing as the actual apple-gmux
driver, so that it does not return false positives.

To avoid code duplication the gmux_probe() function of the actual
driver is also moved over to using the new apple_gmux_detect() helper.

This avoids false positives (vs _HID + IO region detection) on:

MacBookPro5,4
https://pastebin.com/8Xjq7RhS

MacBookPro8,1
https://linux-hardware.org/?probe=e513cfbadb&log=dmesg

MacBookPro9,2
https://bugzilla.kernel.org/attachment.cgi?id=278961

MacBookPro10,2
https://lkml.org/lkml/2014/9/22/657

MacBookPro11,2
https://forums.fedora-fr.org/viewtopic.php?id=70142

MacBookPro11,4
https://raw.githubusercontent.com/im-0/investigate-card-reader-suspend-problem-on-mbp11.4/master/test-16/dmesg

Fixes: 21245df307 ("ACPI: video: Add Apple GMUX brightness control detection")
Link: https://lore.kernel.org/platform-driver-x86/20230123113750.462144-1-hdegoede@redhat.com/
Reported-by: Emmanouil Kouroupakis <kartebi@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230124105754.62167-3-hdegoede@redhat.com
2023-01-24 13:41:57 +01:00
..
amd platform/x86/amd: pmc: Add a module parameter to disable workarounds 2023-01-24 13:41:13 +01:00
dell platform/x86: dell-wmi: Add a keymap for KEY_MUTE in type 0x0010 table 2023-01-24 13:41:13 +01:00
hp platform/x86: hp-wmi: Fix cast to smaller integer type warning 2023-01-24 13:41:13 +01:00
intel platform/x86: int3472/discrete: Ensure the clk/power enable pins are in output mode 2023-01-12 20:10:31 +01:00
acer-wireless.c
acer-wmi.c platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017) 2022-11-15 17:16:40 +01:00
acerhdf.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
adv_swbutton.c
amilo-rfkill.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
apple-gmux.c platform/x86: apple-gmux: Add apple_gmux_detect() helper 2023-01-24 13:41:57 +01:00
asus-laptop.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
asus-nb-wmi.c platform/x86: asus-wmi: Ignore fan on E410MA 2023-01-12 19:36:03 +01:00
asus-tf103c-dock.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
asus-wireless.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
asus-wmi.c platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting 2023-01-24 13:41:13 +01:00
asus-wmi.h platform/x86: asus-wmi: Add quirk wmi_ignore_fan 2023-01-12 19:35:51 +01:00
barco-p50-gpio.c platform/x86: barco-p50-gpio: Add check for platform_driver_register 2022-06-10 21:59:08 +02:00
classmate-laptop.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
compal-laptop.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
dual_accel_detect.h
eeepc-laptop.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
eeepc-wmi.c platform/x86: asus-wmi: Move acpi_backlight=vendor quirks to ACPI video_detect.c 2022-09-03 12:17:27 +02:00
firmware_attributes_class.c
firmware_attributes_class.h
fujitsu-laptop.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
fujitsu-tablet.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
gigabyte-wmi.c platform/x86: gigabyte-wmi: add support for B450M DS3H WIFI-CF 2023-01-24 13:41:13 +01:00
gpd-pocket-fan.c
hdaps.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
huawei-wmi.c platform/x86: huawei-wmi: remove unnecessary member 2022-11-16 08:48:19 +01:00
ibm_rtl.c
ideapad-laptop.c platform/x86: ideapad-laptop: Add Legion 5 15ARH05 DMI id to set_fn_lock_led_list[] 2022-12-27 12:24:48 +01:00
intel_ips.c
intel_ips.h
intel_scu_ipc.c platform/x86: intel_scu_ipc: fix possible name leak in __intel_scu_ipc_register() 2022-12-08 17:35:49 +01:00
intel_scu_ipcutil.c
intel_scu_pcidrv.c
intel_scu_pltdrv.c
intel_scu_wdt.c
Kconfig platform/x86: Move existing HP drivers to a new hp subdir 2022-11-16 08:48:19 +01:00
lenovo-yogabook-wmi.c platform/x86: lenovo-yogabook-wmi: Add support for hall sensor on the back 2021-12-07 12:21:01 +01:00
lg-laptop.c ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
Makefile platform/x86: Move existing HP drivers to a new hp subdir 2022-11-16 08:48:19 +01:00
meraki-mx100.c
mlx-platform.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
msi-laptop.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
msi-wmi.c
mxm-wmi.c platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]() 2022-12-08 16:32:12 +01:00
nvidia-wmi-ec-backlight.c platform/x86: nvidia-wmi-ec-backlight: Use acpi_video_get_backlight_type() 2022-09-03 12:17:26 +02:00
p2sb.c platform/x86: p2sb: Don't fail if unknown CPU is found 2022-11-07 12:33:49 +01:00
panasonic-laptop.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
pcengines-apuv2.c
peaq-wmi.c
pmc_atom.c platform/x86: pmc_atom: Amend comment style and grammar 2022-08-25 16:23:52 +02:00
samsung-laptop.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
samsung-q10.c
serial-multi-instantiate.c sound fixes for 6.0-rc2 2022-08-19 09:46:11 -07:00
simatic-ipc.c platform/x86: simatic-ipc: add another model 2023-01-12 19:42:53 +01:00
sony-laptop.c platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe 2022-12-27 12:23:11 +01:00
system76_acpi.c ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
think-lmi.c platform/x86: think-lmi: certificate support clean ups 2022-04-04 15:20:53 +02:00
think-lmi.h platform/x86: think-lmi: certificate support clean ups 2022-04-04 15:20:53 +02:00
thinkpad_acpi.c platform/x86: thinkpad_acpi: Fix profile mode display in AMT mode 2023-01-13 11:40:30 +01:00
topstar-laptop.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
toshiba-wmi.c
toshiba_acpi.c ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
toshiba_bluetooth.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
toshiba_haps.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
touchscreen_dmi.c platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD 2023-01-12 17:45:04 +01:00
uv_sysfs.c platform/x86: uv_sysfs: Use sysfs_emit() instead of scnprintf() 2022-12-08 17:07:01 +01:00
winmate-fm07-keys.c platform/x86: use PLATFORM_DEVID_NONE instead of -1 2022-10-03 09:40:04 +02:00
wireless-hotkey.c ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
wmi-bmof.c
wmi.c platform/x86: dell: Add new dell-wmi-ddv driver 2022-11-16 08:48:18 +01:00
x86-android-tablets.c platform/x86: x86-android-tablets: Add Advantech MICA-071 extra button 2022-12-08 16:10:54 +01:00
xiaomi-wmi.c
xo1-rfkill.c
xo15-ebook.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00