Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319663
b: refs/heads/master
c: f838eb5
h: refs/heads/master
i:
  319661: f9bd55a
  319659: 859f4f9
  319655: cd9f4aa
  319647: 5174e71
v: v3
  • Loading branch information
Corentin Chary authored and Matthew Garrett committed Jul 28, 2012
1 parent 35a2494 commit 1fc2e68
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1eb3fe1d3b6b9bf6045eb12f0c3ac12569169870
refs/heads/master: f838eb5bd257e8a666aa8c451058fa198df7e299
31 changes: 29 additions & 2 deletions trunk/drivers/acpi/video_detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,42 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
}
EXPORT_SYMBOL(acpi_video_get_capabilities);

/* Returns true if video.ko can do backlight switching */
int acpi_video_backlight_support(void)
static void acpi_video_caps_check(void)
{
/*
* We must check whether the ACPI graphics device is physically plugged
* in. Therefore this must be called after binding PCI and ACPI devices
*/
if (!acpi_video_caps_checked)
acpi_video_get_capabilities(NULL);
}

/* Promote the vendor interface instead of the generic video module.
* This function allow DMI blacklists to be implemented by externals
* platform drivers instead of putting a big blacklist in video_detect.c
* After calling this function you will probably want to call
* acpi_video_unregister() to make sure the video module is not loaded
*/
void acpi_video_dmi_promote_vendor(void)
{
acpi_video_caps_check();
acpi_video_support |= ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
}
EXPORT_SYMBOL(acpi_video_dmi_promote_vendor);

/* To be called when a driver who previously promoted the vendor
* interface */
void acpi_video_dmi_demote_vendor(void)
{
acpi_video_caps_check();
acpi_video_support &= ~ACPI_VIDEO_BACKLIGHT_DMI_VENDOR;
}
EXPORT_SYMBOL(acpi_video_dmi_demote_vendor);

/* Returns true if video.ko can do backlight switching */
int acpi_video_backlight_support(void)
{
acpi_video_caps_check();

/* First check for boot param -> highest prio */
if (acpi_video_support & ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR)
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ extern bool wmi_has_guid(const char *guid);

extern long acpi_video_get_capabilities(acpi_handle graphics_dev_handle);
extern long acpi_is_video_device(struct acpi_device *device);
extern void acpi_video_dmi_promote_vendor(void);
extern void acpi_video_dmi_demote_vendor(void);
extern int acpi_video_backlight_support(void);
extern int acpi_video_display_switch_support(void);

Expand All @@ -205,6 +207,14 @@ static inline long acpi_is_video_device(struct acpi_device *device)
return 0;
}

static inline void acpi_video_dmi_promote_vendor(void)
{
}

static inline void acpi_video_dmi_demote_vendor(void)
{
}

static inline int acpi_video_backlight_support(void)
{
return 0;
Expand Down

0 comments on commit 1fc2e68

Please sign in to comment.