Subject: [PATCH] [acpi video] Change names of source files to have "bus-" prefix Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/video/Makefile | 7 ++- drivers/acpi/drivers/video/bus-device.c | 70 +++++++++++++++++++++++++++++++ drivers/acpi/drivers/video/bus-driver.c | 57 +++++++++++++++++++++++++ drivers/acpi/drivers/video/bus-event.c | 15 +++++++ drivers/acpi/drivers/video/bus-proc.c | 15 +++++++ drivers/acpi/drivers/video/bus-sysfs.c | 11 +++++ drivers/acpi/drivers/video/device.c | 70 ------------------------------- drivers/acpi/drivers/video/driver.c | 57 ------------------------- drivers/acpi/drivers/video/event.c | 15 ------- drivers/acpi/drivers/video/proc.c | 15 ------- drivers/acpi/drivers/video/sysfs.c | 11 ----- 11 files changed, 172 insertions(+), 171 deletions(-) create mode 100644 drivers/acpi/drivers/video/bus-device.c create mode 100644 drivers/acpi/drivers/video/bus-driver.c create mode 100644 drivers/acpi/drivers/video/bus-event.c create mode 100644 drivers/acpi/drivers/video/bus-proc.c create mode 100644 drivers/acpi/drivers/video/bus-sysfs.c delete mode 100644 drivers/acpi/drivers/video/device.c delete mode 100644 drivers/acpi/drivers/video/driver.c delete mode 100644 drivers/acpi/drivers/video/event.c delete mode 100644 drivers/acpi/drivers/video/proc.c delete mode 100644 drivers/acpi/drivers/video/sysfs.c applies-to: 2d59971a25a8e6e756e79417e31a4f9501c120ba b501d3b71d6d8f8e79e62551f7162923ae9b997d diff --git a/drivers/acpi/drivers/video/Makefile b/drivers/acpi/drivers/video/Makefile index 12c32af..9c424a1 100644 --- a/drivers/acpi/drivers/video/Makefile +++ b/drivers/acpi/drivers/video/Makefile @@ -1,7 +1,8 @@ obj-$(CONFIG_ACPI_VIDEO) += video-bus.o -video-bus-y := driver.o device.o event.o +video-bus-y := bus-driver.o bus-device.o +video-bus-y += bus-event.o -video-bus-$(CONFIG_ACPI_DM_PROC) += proc.o -video-bus-$(CONFIG_ACPI_DM_SYSFS) += sysfs.o +video-bus-$(CONFIG_ACPI_DM_PROC) += bus-proc.o +video-bus-$(CONFIG_ACPI_DM_SYSFS) += bus-sysfs.o diff --git a/drivers/acpi/drivers/video/bus-device.c b/drivers/acpi/drivers/video/bus-device.c new file mode 100644 index 0000000..7a11dda --- /dev/null +++ b/drivers/acpi/drivers/video/bus-device.c @@ -0,0 +1,70 @@ +/** + * drivers/acpi/drivers/video/device.c - Low-level video access + * + * Copyright (C) 2006 Patrick Mochel + * + * Based on drivers/acpi/video.c, which was: + * Copyright (C) 2004 Luming Yu + * Copyright (C) 2004 Bruno Ducrot + * + * This file is released under the GPLv2. + */ + +#include "video.h" + + +/** + * is_handle - Check if a named object exists in the namespace + * @ad: The ACPI device whose namespace we're checking + * @obj: The name of the handle to check for + * + */ + +static int is_handle(struct acpi_dev * ad, char * obj) +{ + acpi_handle h; + acpi_status status; + + status = acpi_get_handle(ad->acpi_device->handle, obj, &h); + return ACPI_SUCCESS(status) ? 1 : 0; +} + + +/** + * video_bus_test - Check device to see if it's a video bus + * @ad: The ACPI device that we're checking + * + * Since there is no HID or CID for ACPI Video devices, we have + * to check well known required nodes for each feature we support. + * + * We bind to a device if it supports one of the following: + * - Video switching (via _DOD or _DOS) + * - Retrieving video ROM (via _ROM) + * - Ability to configure head to be POSTed (via _VPD, _GPD and _SPD) + * + * Returns %1 if the device is a video device; %0 otherwise. + */ + +int video_bus_test(struct acpi_dev * ad) +{ + /* + * Video switching + */ + if (is_handle(ad, "_DOD") && is_handle(ad, "_DOS")) + return 1; + + /* + * ROM retrieval + */ + if (is_handle(ad, "_ROM")) + return 1; + + /* + * POST configuration + */ + if (is_handle(ad, "_VPD") && + is_handle(ad, "_GPD") && + is_handle(ad, "_SPD")) + return 1; + return 0; +} diff --git a/drivers/acpi/drivers/video/bus-driver.c b/drivers/acpi/drivers/video/bus-driver.c new file mode 100644 index 0000000..2e0202a --- /dev/null +++ b/drivers/acpi/drivers/video/bus-driver.c @@ -0,0 +1,57 @@ +/*** + * drivers/acpi/drivers/video/driver.c - New school ACPI video driver + * + * Copyright (C) 2006 Patrick Mochel + * + * Based on drivers/acpi/video.c, which was + * Copyright (C) 2004 Luming Yu + * Copyright (C) 2004 Bruno Ducrot + * + * This file is released under the GPLv2. + */ + +#include "video.h" + +static int video_bus_probe(struct acpi_dev * ad) +{ + return video_bus_test(ad); +} + +static int video_bus_add(struct acpi_dev * ad) +{ + struct acpi_video_bus * av; + + av = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); + if (!av) + return -ENOMEM; + + av->v_ad = ad; + + dev_set_drvdata(&ad->dev, av); + + printk(KERN_INFO PREFIX "video bus [%s]\n", + acpi_dev_bid(ad)); + return 0; +} + +static int video_bus_remove(struct acpi_dev * ad) +{ + struct acpi_video_bus * av = dev_get_drvdata(&ad->dev); + + dev_set_drvdata(&ad->dev, NULL); + kfree(av); + return 0; +} + + +acpi_no_start(video_bus); +acpi_no_stop(video_bus); +acpi_no_shutdown(video_bus); +acpi_no_suspend(video_bus); +acpi_no_resume(video_bus); + +declare_acpi_driver(video_bus); + +MODULE_AUTHOR("Patrick Mochel"); +MODULE_DESCRIPTION("ACPI Video Bus Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/acpi/drivers/video/bus-event.c b/drivers/acpi/drivers/video/bus-event.c new file mode 100644 index 0000000..84702b6 --- /dev/null +++ b/drivers/acpi/drivers/video/bus-event.c @@ -0,0 +1,15 @@ +/** + * drivers/acpi/drivers/video/event.c - ACPI Event notification for video + * + * Copyright (C) 2006 Patrick Mochel + * + * Based on drivers/acpi/video.c, which was + * Copyright (C) 2004 Luming Yu + * Copyright (C) 2004 Bruno Ducrot + * + * This file is released under the GPLv2. + */ + +#include "video.h" + +acpi_device_event_none(video_bus); diff --git a/drivers/acpi/drivers/video/bus-proc.c b/drivers/acpi/drivers/video/bus-proc.c new file mode 100644 index 0000000..8297c84 --- /dev/null +++ b/drivers/acpi/drivers/video/bus-proc.c @@ -0,0 +1,15 @@ +/** + * drivers/acpi/drivers/video/proc.c - procfs interface for video driver + * + * Copyright (C) 2006 Patrick Mochel + * + * Based on drivers/acpi/video.c, which was: + * Copyright (C) 2004 Luming Yu + * Copyright (C) 2004 Bruno Ducrot + * + * This file is released under the GPLv2. + */ + +#include "video.h" + +acpi_driver_proc_none(video_bus); diff --git a/drivers/acpi/drivers/video/bus-sysfs.c b/drivers/acpi/drivers/video/bus-sysfs.c new file mode 100644 index 0000000..b2d1eaf --- /dev/null +++ b/drivers/acpi/drivers/video/bus-sysfs.c @@ -0,0 +1,11 @@ +/** + * drivers/acpi/drivers/video/sysfs.c - sysfs interface for video driver. + * + * Copyright (C) 2006 Patrick Mochel + * + * This file is released under the GPLv2. + */ + +#include "video.h" + +acpi_driver_sysfs_none(video_bus); diff --git a/drivers/acpi/drivers/video/device.c b/drivers/acpi/drivers/video/device.c deleted file mode 100644 index 7a11dda..0000000 --- a/drivers/acpi/drivers/video/device.c +++ /dev/null @@ -1,70 +0,0 @@ -/** - * drivers/acpi/drivers/video/device.c - Low-level video access - * - * Copyright (C) 2006 Patrick Mochel - * - * Based on drivers/acpi/video.c, which was: - * Copyright (C) 2004 Luming Yu - * Copyright (C) 2004 Bruno Ducrot - * - * This file is released under the GPLv2. - */ - -#include "video.h" - - -/** - * is_handle - Check if a named object exists in the namespace - * @ad: The ACPI device whose namespace we're checking - * @obj: The name of the handle to check for - * - */ - -static int is_handle(struct acpi_dev * ad, char * obj) -{ - acpi_handle h; - acpi_status status; - - status = acpi_get_handle(ad->acpi_device->handle, obj, &h); - return ACPI_SUCCESS(status) ? 1 : 0; -} - - -/** - * video_bus_test - Check device to see if it's a video bus - * @ad: The ACPI device that we're checking - * - * Since there is no HID or CID for ACPI Video devices, we have - * to check well known required nodes for each feature we support. - * - * We bind to a device if it supports one of the following: - * - Video switching (via _DOD or _DOS) - * - Retrieving video ROM (via _ROM) - * - Ability to configure head to be POSTed (via _VPD, _GPD and _SPD) - * - * Returns %1 if the device is a video device; %0 otherwise. - */ - -int video_bus_test(struct acpi_dev * ad) -{ - /* - * Video switching - */ - if (is_handle(ad, "_DOD") && is_handle(ad, "_DOS")) - return 1; - - /* - * ROM retrieval - */ - if (is_handle(ad, "_ROM")) - return 1; - - /* - * POST configuration - */ - if (is_handle(ad, "_VPD") && - is_handle(ad, "_GPD") && - is_handle(ad, "_SPD")) - return 1; - return 0; -} diff --git a/drivers/acpi/drivers/video/driver.c b/drivers/acpi/drivers/video/driver.c deleted file mode 100644 index 2e0202a..0000000 --- a/drivers/acpi/drivers/video/driver.c +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * drivers/acpi/drivers/video/driver.c - New school ACPI video driver - * - * Copyright (C) 2006 Patrick Mochel - * - * Based on drivers/acpi/video.c, which was - * Copyright (C) 2004 Luming Yu - * Copyright (C) 2004 Bruno Ducrot - * - * This file is released under the GPLv2. - */ - -#include "video.h" - -static int video_bus_probe(struct acpi_dev * ad) -{ - return video_bus_test(ad); -} - -static int video_bus_add(struct acpi_dev * ad) -{ - struct acpi_video_bus * av; - - av = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); - if (!av) - return -ENOMEM; - - av->v_ad = ad; - - dev_set_drvdata(&ad->dev, av); - - printk(KERN_INFO PREFIX "video bus [%s]\n", - acpi_dev_bid(ad)); - return 0; -} - -static int video_bus_remove(struct acpi_dev * ad) -{ - struct acpi_video_bus * av = dev_get_drvdata(&ad->dev); - - dev_set_drvdata(&ad->dev, NULL); - kfree(av); - return 0; -} - - -acpi_no_start(video_bus); -acpi_no_stop(video_bus); -acpi_no_shutdown(video_bus); -acpi_no_suspend(video_bus); -acpi_no_resume(video_bus); - -declare_acpi_driver(video_bus); - -MODULE_AUTHOR("Patrick Mochel"); -MODULE_DESCRIPTION("ACPI Video Bus Driver"); -MODULE_LICENSE("GPL"); diff --git a/drivers/acpi/drivers/video/event.c b/drivers/acpi/drivers/video/event.c deleted file mode 100644 index 84702b6..0000000 --- a/drivers/acpi/drivers/video/event.c +++ /dev/null @@ -1,15 +0,0 @@ -/** - * drivers/acpi/drivers/video/event.c - ACPI Event notification for video - * - * Copyright (C) 2006 Patrick Mochel - * - * Based on drivers/acpi/video.c, which was - * Copyright (C) 2004 Luming Yu - * Copyright (C) 2004 Bruno Ducrot - * - * This file is released under the GPLv2. - */ - -#include "video.h" - -acpi_device_event_none(video_bus); diff --git a/drivers/acpi/drivers/video/proc.c b/drivers/acpi/drivers/video/proc.c deleted file mode 100644 index 8297c84..0000000 --- a/drivers/acpi/drivers/video/proc.c +++ /dev/null @@ -1,15 +0,0 @@ -/** - * drivers/acpi/drivers/video/proc.c - procfs interface for video driver - * - * Copyright (C) 2006 Patrick Mochel - * - * Based on drivers/acpi/video.c, which was: - * Copyright (C) 2004 Luming Yu - * Copyright (C) 2004 Bruno Ducrot - * - * This file is released under the GPLv2. - */ - -#include "video.h" - -acpi_driver_proc_none(video_bus); diff --git a/drivers/acpi/drivers/video/sysfs.c b/drivers/acpi/drivers/video/sysfs.c deleted file mode 100644 index b2d1eaf..0000000 --- a/drivers/acpi/drivers/video/sysfs.c +++ /dev/null @@ -1,11 +0,0 @@ -/** - * drivers/acpi/drivers/video/sysfs.c - sysfs interface for video driver. - * - * Copyright (C) 2006 Patrick Mochel - * - * This file is released under the GPLv2. - */ - -#include "video.h" - -acpi_driver_sysfs_none(video_bus); --- 0.99.9.GIT