aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2010-12-06 02:04:21 -0500
committerLen Brown <len.brown@intel.com>2010-12-14 00:04:52 -0500
commit677bd810eedce61edf15452491781ff046b92edc (patch)
tree3ed50023d311d598a4928c79ae575f02248a185a /drivers/acpi/video.c
parentcf7d7e5a1980d1116ee152d25dac382b112b9c17 (diff)
ACPI video: remove output switching control
Remove the ACPI video output switching control as it never works. With the patch applied, ACPI video driver still catches the video output notification, but it does nothing but raises the notification to userspace. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 5cd0228d2daa..81766ebec843 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -33,7 +33,6 @@
33#include <linux/input.h> 33#include <linux/input.h>
34#include <linux/backlight.h> 34#include <linux/backlight.h>
35#include <linux/thermal.h> 35#include <linux/thermal.h>
36#include <linux/video_output.h>
37#include <linux/sort.h> 36#include <linux/sort.h>
38#include <linux/pci.h> 37#include <linux/pci.h>
39#include <linux/pci_ids.h> 38#include <linux/pci_ids.h>
@@ -172,9 +171,6 @@ struct acpi_video_device_cap {
172 u8 _BQC:1; /* Get current brightness level */ 171 u8 _BQC:1; /* Get current brightness level */
173 u8 _BCQ:1; /* Some buggy BIOS uses _BCQ instead of _BQC */ 172 u8 _BCQ:1; /* Some buggy BIOS uses _BCQ instead of _BQC */
174 u8 _DDC:1; /*Return the EDID for this device */ 173 u8 _DDC:1; /*Return the EDID for this device */
175 u8 _DCS:1; /*Return status of output device */
176 u8 _DGS:1; /*Query graphics state */
177 u8 _DSS:1; /*Device state set */
178}; 174};
179 175
180struct acpi_video_brightness_flags { 176struct acpi_video_brightness_flags {
@@ -202,7 +198,6 @@ struct acpi_video_device {
202 struct acpi_video_device_brightness *brightness; 198 struct acpi_video_device_brightness *brightness;
203 struct backlight_device *backlight; 199 struct backlight_device *backlight;
204 struct thermal_cooling_device *cooling_dev; 200 struct thermal_cooling_device *cooling_dev;
205 struct output_device *output_dev;
206}; 201};
207 202
208static const char device_decode[][30] = { 203static const char device_decode[][30] = {
@@ -226,10 +221,6 @@ static int acpi_video_get_next_level(struct acpi_video_device *device,
226 u32 level_current, u32 event); 221 u32 level_current, u32 event);
227static int acpi_video_switch_brightness(struct acpi_video_device *device, 222static int acpi_video_switch_brightness(struct acpi_video_device *device,
228 int event); 223 int event);
229static int acpi_video_device_get_state(struct acpi_video_device *device,
230 unsigned long long *state);
231static int acpi_video_output_get(struct output_device *od);
232static int acpi_video_device_set_state(struct acpi_video_device *device, int state);
233 224
234/*backlight device sysfs support*/ 225/*backlight device sysfs support*/
235static int acpi_video_get_brightness(struct backlight_device *bd) 226static int acpi_video_get_brightness(struct backlight_device *bd)
@@ -265,30 +256,6 @@ static struct backlight_ops acpi_backlight_ops = {
265 .update_status = acpi_video_set_brightness, 256 .update_status = acpi_video_set_brightness,
266}; 257};
267 258
268/*video output device sysfs support*/
269static int acpi_video_output_get(struct output_device *od)
270{
271 unsigned long long state;
272 struct acpi_video_device *vd =
273 (struct acpi_video_device *)dev_get_drvdata(&od->dev);
274 acpi_video_device_get_state(vd, &state);
275 return (int)state;
276}
277
278static int acpi_video_output_set(struct output_device *od)
279{
280 unsigned long state = od->request_state;
281 struct acpi_video_device *vd=
282 (struct acpi_video_device *)dev_get_drvdata(&od->dev);
283 return acpi_video_device_set_state(vd, state);
284}
285
286static struct output_properties acpi_output_properties = {
287 .set_state = acpi_video_output_set,
288 .get_status = acpi_video_output_get,
289};
290
291
292/* thermal cooling device callbacks */ 259/* thermal cooling device callbacks */
293static int video_get_max_state(struct thermal_cooling_device *cooling_dev, unsigned 260static int video_get_max_state(struct thermal_cooling_device *cooling_dev, unsigned
294 long *state) 261 long *state)
@@ -344,34 +311,6 @@ static struct thermal_cooling_device_ops video_cooling_ops = {
344 Video Management 311 Video Management
345 -------------------------------------------------------------------------- */ 312 -------------------------------------------------------------------------- */
346 313
347/* device */
348
349static int
350acpi_video_device_get_state(struct acpi_video_device *device,
351 unsigned long long *state)
352{
353 int status;
354
355 status = acpi_evaluate_integer(device->dev->handle, "_DCS", NULL, state);
356
357 return status;
358}
359
360static int
361acpi_video_device_set_state(struct acpi_video_device *device, int state)
362{
363 int status;
364 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
365 struct acpi_object_list args = { 1, &arg0 };
366 unsigned long long ret;
367
368
369 arg0.integer.value = state;
370 status = acpi_evaluate_integer(device->dev->handle, "_DSS", &args, &ret);
371
372 return status;
373}
374
375static int 314static int
376acpi_video_device_lcd_query_levels(struct acpi_video_device *device, 315acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
377 union acpi_object **levels) 316 union acpi_object **levels)
@@ -831,15 +770,6 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
831 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) { 770 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) {
832 device->cap._DDC = 1; 771 device->cap._DDC = 1;
833 } 772 }
834 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DCS", &h_dummy1))) {
835 device->cap._DCS = 1;
836 }
837 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DGS", &h_dummy1))) {
838 device->cap._DGS = 1;
839 }
840 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DSS", &h_dummy1))) {
841 device->cap._DSS = 1;
842 }
843 773
844 if (acpi_video_backlight_support()) { 774 if (acpi_video_backlight_support()) {
845 struct backlight_properties props; 775 struct backlight_properties props;
@@ -904,21 +834,6 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
904 printk(KERN_ERR PREFIX "Create sysfs link\n"); 834 printk(KERN_ERR PREFIX "Create sysfs link\n");
905 835
906 } 836 }
907
908 if (acpi_video_display_switch_support()) {
909
910 if (device->cap._DCS && device->cap._DSS) {
911 static int count;
912 char *name;
913 name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
914 if (!name)
915 return;
916 count++;
917 device->output_dev = video_output_register(name,
918 NULL, device, &acpi_output_properties);
919 kfree(name);
920 }
921 }
922} 837}
923 838
924/* 839/*
@@ -1452,7 +1367,6 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
1452 thermal_cooling_device_unregister(device->cooling_dev); 1367 thermal_cooling_device_unregister(device->cooling_dev);
1453 device->cooling_dev = NULL; 1368 device->cooling_dev = NULL;
1454 } 1369 }
1455 video_output_unregister(device->output_dev);
1456 1370
1457 return 0; 1371 return 0;
1458} 1372}