2009-03-20 00:35:39 +03:00
|
|
|
#ifndef __ACPI_VIDEO_H
|
|
|
|
#define __ACPI_VIDEO_H
|
|
|
|
|
2010-09-05 17:51:49 +04:00
|
|
|
#include <linux/errno.h> /* for ENODEV */
|
2015-12-22 21:09:48 +03:00
|
|
|
#include <linux/types.h> /* for bool */
|
2010-09-05 17:51:49 +04:00
|
|
|
|
2016-04-27 15:45:04 +03:00
|
|
|
struct acpi_video_brightness_flags {
|
|
|
|
u8 _BCL_no_ac_battery_levels:1; /* no AC/Battery levels in _BCL */
|
|
|
|
u8 _BCL_reversed:1; /* _BCL package is in a reversed order */
|
|
|
|
u8 _BQC_use_index:1; /* _BQC returns an index value */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct acpi_video_device_brightness {
|
|
|
|
int curr;
|
|
|
|
int count;
|
|
|
|
int *levels;
|
|
|
|
struct acpi_video_brightness_flags flags;
|
|
|
|
};
|
|
|
|
|
2010-09-05 17:51:49 +04:00
|
|
|
struct acpi_device;
|
|
|
|
|
2011-07-13 02:30:52 +04:00
|
|
|
#define ACPI_VIDEO_CLASS "video"
|
|
|
|
|
2010-01-12 22:17:03 +03:00
|
|
|
#define ACPI_VIDEO_DISPLAY_CRT 1
|
|
|
|
#define ACPI_VIDEO_DISPLAY_TV 2
|
|
|
|
#define ACPI_VIDEO_DISPLAY_DVI 3
|
|
|
|
#define ACPI_VIDEO_DISPLAY_LCD 4
|
|
|
|
|
|
|
|
#define ACPI_VIDEO_DISPLAY_LEGACY_MONITOR 0x0100
|
|
|
|
#define ACPI_VIDEO_DISPLAY_LEGACY_PANEL 0x0110
|
|
|
|
#define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200
|
|
|
|
|
2015-06-16 17:27:48 +03:00
|
|
|
enum acpi_backlight_type {
|
|
|
|
acpi_backlight_undef = -1,
|
|
|
|
acpi_backlight_none = 0,
|
|
|
|
acpi_backlight_video,
|
|
|
|
acpi_backlight_vendor,
|
|
|
|
acpi_backlight_native,
|
|
|
|
};
|
|
|
|
|
2015-09-14 18:01:55 +03:00
|
|
|
#if IS_ENABLED(CONFIG_ACPI_VIDEO)
|
2013-07-25 23:43:39 +04:00
|
|
|
extern int acpi_video_register(void);
|
2009-06-16 07:23:13 +04:00
|
|
|
extern void acpi_video_unregister(void);
|
2010-01-12 22:17:03 +03:00
|
|
|
extern int acpi_video_get_edid(struct acpi_device *device, int type,
|
|
|
|
int device_id, void **edid);
|
2015-06-16 17:27:48 +03:00
|
|
|
extern enum acpi_backlight_type acpi_video_get_backlight_type(void);
|
|
|
|
extern void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type);
|
2016-01-14 11:41:47 +03:00
|
|
|
/*
|
|
|
|
* Note: The value returned by acpi_video_handles_brightness_key_presses()
|
|
|
|
* may change over time and should not be cached.
|
|
|
|
*/
|
2015-12-22 21:09:48 +03:00
|
|
|
extern bool acpi_video_handles_brightness_key_presses(void);
|
2016-04-27 15:45:04 +03:00
|
|
|
extern int acpi_video_get_levels(struct acpi_device *device,
|
2016-05-21 10:30:46 +03:00
|
|
|
struct acpi_video_device_brightness **dev_br,
|
|
|
|
int *pmax_level);
|
2009-03-20 00:35:39 +03:00
|
|
|
#else
|
2016-06-22 21:56:01 +03:00
|
|
|
static inline int acpi_video_register(void) { return -ENODEV; }
|
2009-06-16 07:23:13 +04:00
|
|
|
static inline void acpi_video_unregister(void) { return; }
|
2010-01-12 22:17:03 +03:00
|
|
|
static inline int acpi_video_get_edid(struct acpi_device *device, int type,
|
|
|
|
int device_id, void **edid)
|
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
2015-06-16 17:27:48 +03:00
|
|
|
static inline enum acpi_backlight_type acpi_video_get_backlight_type(void)
|
|
|
|
{
|
|
|
|
return acpi_backlight_vendor;
|
|
|
|
}
|
2015-06-24 13:01:49 +03:00
|
|
|
static inline void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type)
|
2015-06-16 17:27:48 +03:00
|
|
|
{
|
|
|
|
}
|
2015-12-22 21:09:48 +03:00
|
|
|
static inline bool acpi_video_handles_brightness_key_presses(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2016-05-13 00:00:12 +03:00
|
|
|
static inline int acpi_video_get_levels(struct acpi_device *device,
|
2016-05-21 10:30:46 +03:00
|
|
|
struct acpi_video_device_brightness **dev_br,
|
|
|
|
int *pmax_level)
|
2016-04-27 15:45:04 +03:00
|
|
|
{
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
2009-03-20 00:35:39 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|