mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
Merge branch 'acpi-video'
Merge updates related to the ACPI video bus driver for 7.3-rc1: - Introduce helper function acpi_dev_is_video_device() and use it in the core ACPI device enumeration code, in the ACPI video bus driver, in the ACPI support code for I2C, in the PCI VGA driver, and in the x86 platform thinkpad_acpi driver (Andy Shevchenko) - Add a quirk to use the native backlight on Acer Nitro AN515-46 to the ACPI video bus driver (Marcos Paulo Medeiros) - Release PCI device reference after lookup in video_detect_portege_r100() in the ACPI video bus driver (Yuho Choi) * acpi-video: ACPI: video: Release PCI device reference after lookup ACPI: video: force native backlight on Acer Nitro AN515-46 platform/x86: thinkpad_acpi: Convert to use acpi_dev_is_video_device() helper PCI/VGA: Convert to use acpi_dev_is_video_device() helper i2c: acpi: Convert to use acpi_dev_is_video_device() helper ACPI: video: Convert to use acpi_dev_is_video_device() helper ACPI: scan: Convert to use acpi_dev_is_video_device() helper ACPI: utils: Introduce acpi_dev_is_video_device() helper
This commit is contained in:
commit
79ba234b39
|
|
@ -1765,7 +1765,6 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
|
|||
* Some ACPI devs contain SerialBus resources even though they are not
|
||||
* attached to a serial bus at all.
|
||||
*/
|
||||
{ACPI_VIDEO_HID, },
|
||||
{"MSHW0028", },
|
||||
/*
|
||||
* HIDs of device with an UartSerialBusV2 resource for which userspace
|
||||
|
|
@ -1788,6 +1787,9 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
|
|||
fwnode_property_present(&device->fwnode, "baud")))
|
||||
return true;
|
||||
|
||||
if (acpi_dev_is_video_device(device))
|
||||
return false;
|
||||
|
||||
if (!acpi_match_device_ids(device, ignore_serial_bus_ids))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -1047,6 +1047,23 @@ static int __init acpi_backlight(char *str)
|
|||
}
|
||||
__setup("acpi_backlight=", acpi_backlight);
|
||||
|
||||
/**
|
||||
* acpi_dev_is_video_device - test if device matches against ACPI video device IDs
|
||||
* @adev: ACPI device to test
|
||||
*
|
||||
* Return: true when matches, otherwise false.
|
||||
*/
|
||||
bool acpi_dev_is_video_device(struct acpi_device *adev)
|
||||
{
|
||||
static const struct acpi_device_id video_device_ids[] = {
|
||||
{ .id = ACPI_VIDEO_HID },
|
||||
{ }
|
||||
};
|
||||
|
||||
return adev && !acpi_match_device_ids(adev, video_device_ids);
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_dev_is_video_device);
|
||||
|
||||
/**
|
||||
* acpi_match_platform_list - Check if the system matches with a given list
|
||||
* @plat: pointer to acpi_platform_list table terminated by a NULL entry
|
||||
|
|
|
|||
|
|
@ -67,12 +67,7 @@ find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
|
|||
long *cap = context;
|
||||
struct pci_dev *dev;
|
||||
|
||||
static const struct acpi_device_id video_ids[] = {
|
||||
{ACPI_VIDEO_HID, 0},
|
||||
{"", 0},
|
||||
};
|
||||
|
||||
if (acpi_dev && !acpi_match_device_ids(acpi_dev, video_ids)) {
|
||||
if (acpi_dev_is_video_device(acpi_dev)) {
|
||||
dev = acpi_dev_get_pci_dev(acpi_dev);
|
||||
if (!dev)
|
||||
return AE_OK;
|
||||
|
|
@ -137,8 +132,10 @@ static int video_detect_portege_r100(const struct dmi_system_id *d)
|
|||
struct pci_dev *dev;
|
||||
/* Search for Trident CyberBlade XP4m32 to confirm Portégé R100 */
|
||||
dev = pci_get_device(PCI_VENDOR_ID_TRIDENT, 0x2100, NULL);
|
||||
if (dev)
|
||||
if (dev) {
|
||||
acpi_backlight_dmi = acpi_backlight_vendor;
|
||||
pci_dev_put(dev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -924,6 +921,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-n0xxx"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = video_detect_force_native,
|
||||
/* Acer Nitro AN515-46 */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN515-46"),
|
||||
},
|
||||
},
|
||||
|
||||
/*
|
||||
* x86 android tablets which directly control the backlight through
|
||||
|
|
|
|||
|
|
@ -131,15 +131,6 @@ static int i2c_acpi_fill_info(struct acpi_resource *ares, void *data)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id i2c_acpi_ignored_device_ids[] = {
|
||||
/*
|
||||
* ACPI video acpi_devices, which are handled by the acpi-video driver
|
||||
* sometimes contain a SERIAL_TYPE_I2C ACPI resource, ignore these.
|
||||
*/
|
||||
{ ACPI_VIDEO_HID, 0 },
|
||||
{}
|
||||
};
|
||||
|
||||
struct i2c_acpi_irq_context {
|
||||
int irq;
|
||||
bool wake_capable;
|
||||
|
|
@ -158,7 +149,11 @@ static int i2c_acpi_do_lookup(struct acpi_device *adev,
|
|||
if (!acpi_dev_ready_for_enumeration(adev))
|
||||
return -ENODEV;
|
||||
|
||||
if (acpi_match_device_ids(adev, i2c_acpi_ignored_device_ids) == 0)
|
||||
/*
|
||||
* ACPI video devices, which are handled by the acpi-video driver,
|
||||
* sometimes contain a SERIAL_TYPE_I2C ACPI resource, ignore these.
|
||||
*/
|
||||
if (acpi_dev_is_video_device(adev))
|
||||
return -ENODEV;
|
||||
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
|
|
|||
|
|
@ -575,9 +575,7 @@ static bool vga_is_firmware_default(struct pci_dev *pdev)
|
|||
static bool vga_arb_integrated_gpu(struct device *dev)
|
||||
{
|
||||
#if defined(CONFIG_ACPI)
|
||||
struct acpi_device *adev = ACPI_COMPANION(dev);
|
||||
|
||||
return adev && !strcmp(acpi_device_hid(adev), ACPI_VIDEO_HID);
|
||||
return acpi_dev_is_video_device(ACPI_COMPANION(dev));
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -768,7 +768,7 @@ static acpi_status __init tpacpi_acpi_handle_locate_callback(acpi_handle handle,
|
|||
if (!strcmp(context, "video")) {
|
||||
struct acpi_device *dev = acpi_fetch_acpi_dev(handle);
|
||||
|
||||
if (!dev || strcmp(ACPI_VIDEO_HID, acpi_device_hid(dev)))
|
||||
if (!acpi_dev_is_video_device(dev))
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ extern char *wmi_get_acpi_device_uid(const char *guid);
|
|||
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800
|
||||
|
||||
extern char acpi_video_backlight_string[];
|
||||
extern bool acpi_dev_is_video_device(struct acpi_device *adev);
|
||||
extern long acpi_is_video_device(acpi_handle handle);
|
||||
|
||||
extern void acpi_osi_setup(char *str);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user