Matthew Garrett | 74a365b | 2009-03-19 21:35:39 +0000 | [diff] [blame] | 1 | #ifndef __ACPI_VIDEO_H |
| 2 | #define __ACPI_VIDEO_H |
| 3 | |
Chris Wilson | b72512e | 2010-09-05 14:51:49 +0100 | [diff] [blame] | 4 | #include <linux/errno.h> /* for ENODEV */ |
Hans de Goede | 90b066b | 2015-12-22 19:09:48 +0100 | [diff] [blame] | 5 | #include <linux/types.h> /* for bool */ |
Chris Wilson | b72512e | 2010-09-05 14:51:49 +0100 | [diff] [blame] | 6 | |
| 7 | struct acpi_device; |
| 8 | |
Matthew Garrett | f5a3d0c | 2011-07-12 18:30:52 -0400 | [diff] [blame] | 9 | #define ACPI_VIDEO_CLASS "video" |
| 10 | |
Matthew Garrett | e92a716 | 2010-01-12 14:17:03 -0500 | [diff] [blame] | 11 | #define ACPI_VIDEO_DISPLAY_CRT 1 |
| 12 | #define ACPI_VIDEO_DISPLAY_TV 2 |
| 13 | #define ACPI_VIDEO_DISPLAY_DVI 3 |
| 14 | #define ACPI_VIDEO_DISPLAY_LCD 4 |
| 15 | |
| 16 | #define ACPI_VIDEO_DISPLAY_LEGACY_MONITOR 0x0100 |
| 17 | #define ACPI_VIDEO_DISPLAY_LEGACY_PANEL 0x0110 |
| 18 | #define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200 |
| 19 | |
Hans de Goede | 87521e1 | 2015-06-16 16:27:48 +0200 | [diff] [blame] | 20 | enum acpi_backlight_type { |
| 21 | acpi_backlight_undef = -1, |
| 22 | acpi_backlight_none = 0, |
| 23 | acpi_backlight_video, |
| 24 | acpi_backlight_vendor, |
| 25 | acpi_backlight_native, |
| 26 | }; |
| 27 | |
Sudeep Holla | bcb2b0b | 2015-09-14 16:01:55 +0100 | [diff] [blame] | 28 | #if IS_ENABLED(CONFIG_ACPI_VIDEO) |
Rafael J. Wysocki | 8e5c2b7 | 2013-07-25 21:43:39 +0200 | [diff] [blame] | 29 | extern int acpi_video_register(void); |
Zhao Yakui | 86e437f | 2009-06-16 11:23:13 +0800 | [diff] [blame] | 30 | extern void acpi_video_unregister(void); |
Matthew Garrett | e92a716 | 2010-01-12 14:17:03 -0500 | [diff] [blame] | 31 | extern int acpi_video_get_edid(struct acpi_device *device, int type, |
| 32 | int device_id, void **edid); |
Hans de Goede | 87521e1 | 2015-06-16 16:27:48 +0200 | [diff] [blame] | 33 | extern enum acpi_backlight_type acpi_video_get_backlight_type(void); |
| 34 | extern void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type); |
Hans de Goede | 382d116 | 2016-01-14 09:41:47 +0100 | [diff] [blame] | 35 | /* |
| 36 | * Note: The value returned by acpi_video_handles_brightness_key_presses() |
| 37 | * may change over time and should not be cached. |
| 38 | */ |
Hans de Goede | 90b066b | 2015-12-22 19:09:48 +0100 | [diff] [blame] | 39 | extern bool acpi_video_handles_brightness_key_presses(void); |
Matthew Garrett | 74a365b | 2009-03-19 21:35:39 +0000 | [diff] [blame] | 40 | #else |
| 41 | static inline int acpi_video_register(void) { return 0; } |
Zhao Yakui | 86e437f | 2009-06-16 11:23:13 +0800 | [diff] [blame] | 42 | static inline void acpi_video_unregister(void) { return; } |
Matthew Garrett | e92a716 | 2010-01-12 14:17:03 -0500 | [diff] [blame] | 43 | static inline int acpi_video_get_edid(struct acpi_device *device, int type, |
| 44 | int device_id, void **edid) |
| 45 | { |
| 46 | return -ENODEV; |
| 47 | } |
Hans de Goede | 87521e1 | 2015-06-16 16:27:48 +0200 | [diff] [blame] | 48 | static inline enum acpi_backlight_type acpi_video_get_backlight_type(void) |
| 49 | { |
| 50 | return acpi_backlight_vendor; |
| 51 | } |
Borislav Petkov | eddda19 | 2015-06-24 12:01:49 +0200 | [diff] [blame] | 52 | static inline void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type) |
Hans de Goede | 87521e1 | 2015-06-16 16:27:48 +0200 | [diff] [blame] | 53 | { |
| 54 | } |
Hans de Goede | 90b066b | 2015-12-22 19:09:48 +0100 | [diff] [blame] | 55 | static inline bool acpi_video_handles_brightness_key_presses(void) |
| 56 | { |
| 57 | return false; |
| 58 | } |
Matthew Garrett | 74a365b | 2009-03-19 21:35:39 +0000 | [diff] [blame] | 59 | #endif |
| 60 | |
| 61 | #endif |