blob: f11d342b45670f1137d695557388935df7f4cf18 [file] [log] [blame]
Matthew Garrett74a365b2009-03-19 21:35:39 +00001#ifndef __ACPI_VIDEO_H
2#define __ACPI_VIDEO_H
3
Chris Wilsonb72512e2010-09-05 14:51:49 +01004#include <linux/errno.h> /* for ENODEV */
Hans de Goede90b066b2015-12-22 19:09:48 +01005#include <linux/types.h> /* for bool */
Chris Wilsonb72512e2010-09-05 14:51:49 +01006
7struct acpi_device;
8
Matthew Garrettf5a3d0c2011-07-12 18:30:52 -04009#define ACPI_VIDEO_CLASS "video"
10
Matthew Garrette92a7162010-01-12 14:17:03 -050011#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 Goede87521e12015-06-16 16:27:48 +020020enum 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 Hollabcb2b0b2015-09-14 16:01:55 +010028#if IS_ENABLED(CONFIG_ACPI_VIDEO)
Rafael J. Wysocki8e5c2b72013-07-25 21:43:39 +020029extern int acpi_video_register(void);
Zhao Yakui86e437f2009-06-16 11:23:13 +080030extern void acpi_video_unregister(void);
Matthew Garrette92a7162010-01-12 14:17:03 -050031extern int acpi_video_get_edid(struct acpi_device *device, int type,
32 int device_id, void **edid);
Hans de Goede87521e12015-06-16 16:27:48 +020033extern enum acpi_backlight_type acpi_video_get_backlight_type(void);
34extern void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type);
Hans de Goede90b066b2015-12-22 19:09:48 +010035extern bool acpi_video_handles_brightness_key_presses(void);
Matthew Garrett74a365b2009-03-19 21:35:39 +000036#else
37static inline int acpi_video_register(void) { return 0; }
Zhao Yakui86e437f2009-06-16 11:23:13 +080038static inline void acpi_video_unregister(void) { return; }
Matthew Garrette92a7162010-01-12 14:17:03 -050039static inline int acpi_video_get_edid(struct acpi_device *device, int type,
40 int device_id, void **edid)
41{
42 return -ENODEV;
43}
Hans de Goede87521e12015-06-16 16:27:48 +020044static inline enum acpi_backlight_type acpi_video_get_backlight_type(void)
45{
46 return acpi_backlight_vendor;
47}
Borislav Petkoveddda192015-06-24 12:01:49 +020048static inline void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type)
Hans de Goede87521e12015-06-16 16:27:48 +020049{
50}
Hans de Goede90b066b2015-12-22 19:09:48 +010051static inline bool acpi_video_handles_brightness_key_presses(void)
52{
53 return false;
54}
Matthew Garrett74a365b2009-03-19 21:35:39 +000055#endif
56
57#endif