Re: [PATCH] ACPI: video: Fix Apple GMUX backlight detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 15, 2022 at 10:41:38AM +0100, Hans de Goede wrote:
> The apple-gmux driver only binds to old GMUX devices which have an
> IORESOURCE_IO resource (using inb()/outb()) rather then memory-mapped
> IO (IORESOURCE_MEM).
> 
> T2 MacBooks use the new style GMUX devices (with IORESOURCE_MEM access),
> so these are not supported by the apple-gmux driver. This is not a problem
> since they have working ACPI video backlight support.

Interesting.


> +static bool apple_gmux_backlight_present(void)
> +{
> +	struct acpi_device *adev;
> +	struct device *dev;
> +
> +	adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1);
> +	if (!adev)
> +		return false;
> +
> +	dev = acpi_get_first_physical_node(adev);
> +	if (!dev)
> +		return false;
> +
> +	/*
> +	 * drivers/platform/x86/apple-gmux.c only supports old style
> +	 * Apple GMUX with an IO-resource.
> +	 */
> +	return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL;
> +}

The T2 is represented by a PCI device with ID 106B:1802.

Instead of the above, how about amending apple_gmux_present()
with a simple check like this:

	/* T2 Macs drive GMUX via MMIO, which is unsupported for now */
	if (pci_dev_present({{PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x1802)}, {}}))
		return false;

Thanks,

Lukas



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux