Subject: [PATCH] [acpi video] Move helpers that get/set device state into bus module - This way the bus driver can use them on events - Export them to the device driver module.. Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/video/bus-device.c | 44 +++++++++++++++++++++++++++++++ drivers/acpi/drivers/video/dev-device.c | 38 --------------------------- 2 files changed, 44 insertions(+), 38 deletions(-) applies-to: bea9227d9a108faaa1d8c30c04e8b11fd8187a93 27d38ee2eb9956deb70f3567b01b398edf351499 diff --git a/drivers/acpi/drivers/video/bus-device.c b/drivers/acpi/drivers/video/bus-device.c index 10936b9..c1f5172 100644 --- a/drivers/acpi/drivers/video/bus-device.c +++ b/drivers/acpi/drivers/video/bus-device.c @@ -431,3 +431,47 @@ int video_bus_disable(struct acpi_video_ { return run_dos(vb, VIDEO_DOS_BIOS_NO_AUTO, VIDEO_DOS_LCD_NO_AUTO); } + + +/** + * video_dev_get_state - Get the device state via _DCS + * @vd: The ACPI video device + * @output: The returned state of the output device (montior) + * @graphics: The returned state of the graphics device (card) + */ + +int video_dev_get_state(struct acpi_video_dev * vd, u32 * output, u32 * graphics) +{ + unsigned long s; + int ret = 0; + + if (vd->v_hotkey) { + ret = get_int(vd->v_ad, "_DCS", &s); + if (!ret) + *output = s; + else + return ret; + + ret = get_int(vd->v_ad, "_DGS", &s); + if (!ret) + *graphics = s; + } + return ret; +} + +EXPORT_SYMBOL_GPL(video_dev_get_state); + + +/** + * video_dev_set_state - Set the device state via _DCS + * @vd: The ACPI video device + * @state: The state we're setting + */ + +int video_dev_set_state(struct acpi_video_dev * vd, u32 state) +{ + return vd->v_hotkey ? set_int(vd->v_ad, "_DSS", state) : -EIO; +} + +EXPORT_SYMBOL_GPL(video_dev_set_state); + diff --git a/drivers/acpi/drivers/video/dev-device.c b/drivers/acpi/drivers/video/dev-device.c index 4fe943e..3ecd2e5 100644 --- a/drivers/acpi/drivers/video/dev-device.c +++ b/drivers/acpi/drivers/video/dev-device.c @@ -329,41 +329,3 @@ int video_dev_edid(struct acpi_video_dev return ret; } -/** - * video_dev_get_state - Get the device state via _DCS - * @vd: The ACPI video device - * @output: The returned state of the output device (montior) - * @graphics: The returned state of the graphics device (card) - */ - -int video_dev_get_state(struct acpi_video_dev * vd, u32 * output, u32 * graphics) -{ - unsigned long s; - int ret = 0; - - if (vd->v_hotkey) { - ret = get_int(vd->v_ad, "_DCS", &s); - if (!ret) - *output = s; - else - return ret; - - ret = get_int(vd->v_ad, "_DGS", &s); - if (!ret) - *graphics = s; - } - return ret; -} - - -/** - * video_dev_set_state - Set the device state via _DCS - * @vd: The ACPI video device - * @state: The state we're setting - */ - -int video_dev_set_state(struct acpi_video_dev * vd, u32 state) -{ - return vd->v_hotkey ? set_int(vd->v_ad, "_DSS", state) : -EIO; -} - --- 0.99.9.GIT