Subject: [PATCH] [acpi video] Add helper to return description of attached device - Add video_dev_string() - Call from video_add() to report the type of device Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/video/dev-device.c | 28 ++++++++++++++++++++++++++++ drivers/acpi/drivers/video/dev-driver.c | 4 ++-- drivers/acpi/drivers/video/video.h | 1 + 3 files changed, 31 insertions(+), 2 deletions(-) applies-to: f479e3b877961b1475c52d324ce719a587c67e19 d2b9b22719ec61e0a38fb8ff02dcb4700a707439 diff --git a/drivers/acpi/drivers/video/dev-device.c b/drivers/acpi/drivers/video/dev-device.c index 4e47d72..05b47b2 100644 --- a/drivers/acpi/drivers/video/dev-device.c +++ b/drivers/acpi/drivers/video/dev-device.c @@ -155,3 +155,31 @@ int video_dev_init(struct acpi_video_dev return ret; return 0; } + + +const char * video_dev_string(struct acpi_video_dev * vd) +{ + const char * str; + + switch (vd->v_id & VIDEO_DEV_TYPE_MASK) { + case 0x0000: + str = "Other"; + break; + case 0x0100: + str = "VGA"; + break; + case 0x0200: + str = "TV/Analog"; + break; + case 0x0300: + str = "External Digital"; + break; + case 0x0400: + str = "Integrated LCD"; + break; + default: + str = "Other"; + break; + } + return str; +} diff --git a/drivers/acpi/drivers/video/dev-driver.c b/drivers/acpi/drivers/video/dev-driver.c index efbd859..2061291 100644 --- a/drivers/acpi/drivers/video/dev-driver.c +++ b/drivers/acpi/drivers/video/dev-driver.c @@ -54,8 +54,8 @@ static int video_add(struct acpi_dev * a dev_set_drvdata(&ad->dev, vd); - printk(KERN_INFO PREFIX "video device [%s]\n", - acpi_dev_bid(ad)); + printk(KERN_INFO PREFIX "video device [%s]: %s\n", + acpi_dev_bid(ad), video_dev_string(vd)); return 0; } diff --git a/drivers/acpi/drivers/video/video.h b/drivers/acpi/drivers/video/video.h index 06ccd06..0e14668 100644 --- a/drivers/acpi/drivers/video/video.h +++ b/drivers/acpi/drivers/video/video.h @@ -49,6 +49,7 @@ struct acpi_video_dev { extern int video_dev_test(struct acpi_dev * ad); extern int video_dev_init(struct acpi_video_dev * vd); +extern const char * video_dev_string(struct acpi_video_dev * vd); struct acpi_video_enum { --- 0.99.9.GIT