aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index b1a56bf682ae..d4b4b52facba 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -276,7 +276,6 @@ static void acpi_video_device_rebind(struct acpi_video_bus *video);
276static void acpi_video_device_bind(struct acpi_video_bus *video, 276static void acpi_video_device_bind(struct acpi_video_bus *video,
277 struct acpi_video_device *device); 277 struct acpi_video_device *device);
278static int acpi_video_device_enumerate(struct acpi_video_bus *video); 278static int acpi_video_device_enumerate(struct acpi_video_bus *video);
279static int acpi_video_switch_output(struct acpi_video_bus *video, int event);
280static int acpi_video_device_lcd_set_level(struct acpi_video_device *device, 279static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
281 int level); 280 int level);
282static int acpi_video_device_lcd_get_level_current( 281static int acpi_video_device_lcd_get_level_current(
@@ -1583,64 +1582,6 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
1583 return status; 1582 return status;
1584} 1583}
1585 1584
1586/*
1587 * Arg:
1588 * video : video bus device
1589 * event : notify event
1590 *
1591 * Return:
1592 * < 0 : error
1593 *
1594 * 1. Find out the current active output device.
1595 * 2. Identify the next output device to switch to.
1596 * 3. call _DSS to do actual switch.
1597 */
1598
1599static int acpi_video_switch_output(struct acpi_video_bus *video, int event)
1600{
1601 struct list_head *node;
1602 struct acpi_video_device *dev = NULL;
1603 struct acpi_video_device *dev_next = NULL;
1604 struct acpi_video_device *dev_prev = NULL;
1605 unsigned long state;
1606 int status = 0;
1607
1608 mutex_lock(&video->device_list_lock);
1609
1610 list_for_each(node, &video->video_device_list) {
1611 dev = container_of(node, struct acpi_video_device, entry);
1612 status = acpi_video_device_get_state(dev, &state);
1613 if (state & 0x2) {
1614 dev_next = container_of(node->next,
1615 struct acpi_video_device, entry);
1616 dev_prev = container_of(node->prev,
1617 struct acpi_video_device, entry);
1618 goto out;
1619 }
1620 }
1621
1622 dev_next = container_of(node->next, struct acpi_video_device, entry);
1623 dev_prev = container_of(node->prev, struct acpi_video_device, entry);
1624
1625 out:
1626 mutex_unlock(&video->device_list_lock);
1627
1628 switch (event) {
1629 case ACPI_VIDEO_NOTIFY_CYCLE:
1630 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:
1631 acpi_video_device_set_state(dev, 0);
1632 acpi_video_device_set_state(dev_next, 0x80000001);
1633 break;
1634 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:
1635 acpi_video_device_set_state(dev, 0);
1636 acpi_video_device_set_state(dev_prev, 0x80000001);
1637 default:
1638 break;
1639 }
1640
1641 return status;
1642}
1643
1644static int 1585static int
1645acpi_video_get_next_level(struct acpi_video_device *device, 1586acpi_video_get_next_level(struct acpi_video_device *device,
1646 u32 level_current, u32 event) 1587 u32 level_current, u32 event)
@@ -1800,23 +1741,19 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
1800 * connector. */ 1741 * connector. */
1801 acpi_video_device_enumerate(video); 1742 acpi_video_device_enumerate(video);
1802 acpi_video_device_rebind(video); 1743 acpi_video_device_rebind(video);
1803 acpi_video_switch_output(video, event);
1804 acpi_bus_generate_proc_event(device, event, 0); 1744 acpi_bus_generate_proc_event(device, event, 0);
1805 keycode = KEY_SWITCHVIDEOMODE; 1745 keycode = KEY_SWITCHVIDEOMODE;
1806 break; 1746 break;
1807 1747
1808 case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */ 1748 case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */
1809 acpi_video_switch_output(video, event);
1810 acpi_bus_generate_proc_event(device, event, 0); 1749 acpi_bus_generate_proc_event(device, event, 0);
1811 keycode = KEY_SWITCHVIDEOMODE; 1750 keycode = KEY_SWITCHVIDEOMODE;
1812 break; 1751 break;
1813 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */ 1752 case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */
1814 acpi_video_switch_output(video, event);
1815 acpi_bus_generate_proc_event(device, event, 0); 1753 acpi_bus_generate_proc_event(device, event, 0);
1816 keycode = KEY_VIDEO_NEXT; 1754 keycode = KEY_VIDEO_NEXT;
1817 break; 1755 break;
1818 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */ 1756 case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */
1819 acpi_video_switch_output(video, event);
1820 acpi_bus_generate_proc_event(device, event, 0); 1757 acpi_bus_generate_proc_event(device, event, 0);
1821 keycode = KEY_VIDEO_PREV; 1758 keycode = KEY_VIDEO_PREV;
1822 break; 1759 break;