video_detect.c (a87878bafa1f82c20eddaf2d23780b194c35ccf5) video_detect.c (14ca7a47d0ab2a7a35faab130e6d9682f8ff1a46)
1/*
2 * Copyright (C) 2008 SuSE Linux Products GmbH
3 * Thomas Renninger <trenn@suse.de>
4 *
5 * May be copied or modified under the terms of the GNU General Public License
6 *
7 * video_detect.c:
8 * After PCI devices are glued with ACPI devices

--- 18 unchanged lines hidden (view full) ---

27 * acpi_video_backlight_support() will always return 0 and vendor specific
28 * drivers always can handle backlight.
29 *
30 */
31
32#include <linux/export.h>
33#include <linux/acpi.h>
34#include <linux/dmi.h>
1/*
2 * Copyright (C) 2008 SuSE Linux Products GmbH
3 * Thomas Renninger <trenn@suse.de>
4 *
5 * May be copied or modified under the terms of the GNU General Public License
6 *
7 * video_detect.c:
8 * After PCI devices are glued with ACPI devices

--- 18 unchanged lines hidden (view full) ---

27 * acpi_video_backlight_support() will always return 0 and vendor specific
28 * drivers always can handle backlight.
29 *
30 */
31
32#include <linux/export.h>
33#include <linux/acpi.h>
34#include <linux/dmi.h>
35#include <linux/module.h>
35#include <linux/pci.h>
36
36#include <linux/pci.h>
37
37#include "internal.h"
38
39ACPI_MODULE_NAME("video");
40#define _COMPONENT ACPI_VIDEO_COMPONENT
41
42static long acpi_video_support;
43static bool acpi_video_caps_checked;
44
38ACPI_MODULE_NAME("video");
39#define _COMPONENT ACPI_VIDEO_COMPONENT
40
41static long acpi_video_support;
42static bool acpi_video_caps_checked;
43
44static void acpi_video_parse_cmdline(void)
45{
46 if (!strcmp("vendor", acpi_video_backlight_string))
47 acpi_video_support |= ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR;
48 if (!strcmp("video", acpi_video_backlight_string))
49 acpi_video_support |= ACPI_VIDEO_BACKLIGHT_FORCE_VIDEO;
50}
51
45static acpi_status
46find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
47{
48 long *cap = context;
49 struct pci_dev *dev;
50 struct acpi_device *acpi_dev;
51
52 static const struct acpi_device_id video_ids[] = {

--- 116 unchanged lines hidden (view full) ---

169}
170
171static void acpi_video_caps_check(void)
172{
173 /*
174 * We must check whether the ACPI graphics device is physically plugged
175 * in. Therefore this must be called after binding PCI and ACPI devices
176 */
52static acpi_status
53find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
54{
55 long *cap = context;
56 struct pci_dev *dev;
57 struct acpi_device *acpi_dev;
58
59 static const struct acpi_device_id video_ids[] = {

--- 116 unchanged lines hidden (view full) ---

176}
177
178static void acpi_video_caps_check(void)
179{
180 /*
181 * We must check whether the ACPI graphics device is physically plugged
182 * in. Therefore this must be called after binding PCI and ACPI devices
183 */
177 if (!acpi_video_caps_checked)
184 if (!acpi_video_caps_checked) {
185 acpi_video_parse_cmdline();
178 acpi_video_get_capabilities(NULL);
186 acpi_video_get_capabilities(NULL);
187 }
179}
180
181/* Promote the vendor interface instead of the generic video module.
182 * This function allow DMI blacklists to be implemented by externals
183 * platform drivers instead of putting a big blacklist in video_detect.c
184 * After calling this function you will probably want to call
185 * acpi_video_unregister() to make sure the video module is not loaded
186 */

--- 20 unchanged lines hidden (view full) ---

207 return 0;
208 else if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_DMI_VIDEO)
209 return 1;
210
211 /* Then go the default way */
212 return acpi_video_support & ACPI_VIDEO_BACKLIGHT;
213}
214EXPORT_SYMBOL(acpi_video_backlight_support);
188}
189
190/* Promote the vendor interface instead of the generic video module.
191 * This function allow DMI blacklists to be implemented by externals
192 * platform drivers instead of putting a big blacklist in video_detect.c
193 * After calling this function you will probably want to call
194 * acpi_video_unregister() to make sure the video module is not loaded
195 */

--- 20 unchanged lines hidden (view full) ---

216 return 0;
217 else if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_DMI_VIDEO)
218 return 1;
219
220 /* Then go the default way */
221 return acpi_video_support & ACPI_VIDEO_BACKLIGHT;
222}
223EXPORT_SYMBOL(acpi_video_backlight_support);
215
216/*
217 * Use acpi_backlight=vendor/video to force that backlight switching
218 * is processed by vendor specific acpi drivers or video.ko driver.
219 */
220static int __init acpi_backlight(char *str)
221{
222 if (str == NULL || *str == '\0')
223 return 1;
224 else {
225 if (!strcmp("vendor", str))
226 acpi_video_support |=
227 ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR;
228 if (!strcmp("video", str))
229 acpi_video_support |=
230 ACPI_VIDEO_BACKLIGHT_FORCE_VIDEO;
231 }
232 return 1;
233}
234__setup("acpi_backlight=", acpi_backlight);