Subject: [PATCH] [acpi video] Get POST ID info along with post options - Get _GPD in video_bus_post_options() and cache the value in ->v_post_id. - NOTE that we may not want to always cache this value, so it may move to its own helper and called from proc/sysfs interfaces. Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/video/bus-device.c | 16 +++++++++++++--- drivers/acpi/drivers/video/video.h | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) applies-to: f009a001edf40c30d9c8bc12c17bef37ad9bc0b7 6981a577be5eaf1d73c8baf0b61cb2d06ee3ce1c diff --git a/drivers/acpi/drivers/video/bus-device.c b/drivers/acpi/drivers/video/bus-device.c index 10f125e..232c138 100644 --- a/drivers/acpi/drivers/video/bus-device.c +++ b/drivers/acpi/drivers/video/bus-device.c @@ -129,12 +129,13 @@ void video_bus_check(struct acpi_video_b /** - * video_bus_post_options - Query the POST options of the bus + * video_bus_post_options - Query the POST info on the bus * @vb: The ACPI video bus * * If the device is capable of POSTing, then get the integer mask * stored at _VPO, which will tell us what devices it is capable of - * executing the POST on. + * executing the POST on, and get the integer at _GPD, which will + * tell us which device has been POSTed. * * The device should always be capable of posting the on-board video, * but apparently the BIOS may incorrectly tell us that it cannot. @@ -145,6 +146,10 @@ void video_bus_check(struct acpi_video_b * later checked e.g. * if (options & 4) ... * Assuming that we want to keep that bit, the mask has changed to 0x7. + * + * + * Q: Should we really cache _GPD, or should we call it every time + * we're asked for it? */ int video_bus_post_options(struct acpi_video_bus * vb) @@ -169,7 +174,12 @@ int video_bus_post_options(struct acpi_v err("Please contact the manufacturer."); err("options = %#01lx", o); } - } + } else + return ret; + + ret = get_int(vb->v_ad, "_GPD", &o); + if (!ret) + vb->v_post_id = o & 0x7; } return ret; } diff --git a/drivers/acpi/drivers/video/video.h b/drivers/acpi/drivers/video/video.h index ff2eac8..f4635a1 100644 --- a/drivers/acpi/drivers/video/video.h +++ b/drivers/acpi/drivers/video/video.h @@ -22,6 +22,7 @@ struct acpi_video_bus { int v_can_post; int v_post_options; + int v_post_id; struct acpi_dev * v_ad; }; @@ -29,4 +30,4 @@ struct acpi_video_bus { extern int video_bus_test(struct acpi_dev * ad); extern void video_bus_check(struct acpi_video_bus * vb); -int video_bus_post_options(struct acpi_video_bus * vb); +extern int video_bus_post_options(struct acpi_video_bus * vb); --- 0.99.9.GIT