blob: 5ca2f2c1645811f4893a7c15758da1bccf05bfe7 [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 Goede382d1162016-01-14 09:41:47 +010035/*
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 Goede90b066b2015-12-22 19:09:48 +010039extern bool acpi_video_handles_brightness_key_presses(void);
Matthew Garrett74a365b2009-03-19 21:35:39 +000040#else
41static inline int acpi_video_register(void) { return 0; }
Zhao Yakui86e437f2009-06-16 11:23:13 +080042static inline void acpi_video_unregister(void) { return; }
Matthew Garrette92a7162010-01-12 14:17:03 -050043static 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 Goede87521e12015-06-16 16:27:48 +020048static inline enum acpi_backlight_type acpi_video_get_backlight_type(void)
49{
50 return acpi_backlight_vendor;
51}
Borislav Petkoveddda192015-06-24 12:01:49 +020052static inline void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type)
Hans de Goede87521e12015-06-16 16:27:48 +020053{
54}
Hans de Goede90b066b2015-12-22 19:09:48 +010055static inline bool acpi_video_handles_brightness_key_presses(void)
56{
57 return false;
58}
Matthew Garrett74a365b2009-03-19 21:35:39 +000059#endif
60
61#endif