summaryrefslogtreecommitdiff
path: root/hw/display.h
blob: dcea233fa8c1a47ea865f06759833b9ace0f9401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
 * libdevice-node
 *
 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


#ifndef __HW_DISPLAY_H__
#define __HW_DISPLAY_H__

#include <hw/common.h>

/**
 * The id of this device
 */
#define DISPLAY_HARDWARE_DEVICE_ID	"display"

/**
 * The version of this device
 */
#define DISPLAY_HARDWARE_DEVICE_VERSION	MAKE_VERSION(0,2)

enum display_state {
	DISPLAY_ON,       /* In use */
	DISPLAY_STANDBY,  /* Blanked, low power */
	DISPLAY_SUSPEND,  /* Blanked, lower power */
	DISPLAY_OFF,      /* Shut off, awaiting activity */
};

enum display_image_effect {
	DISPLAY_IMAGE_EFFECT_STANDARD,     /* No effect */
	DISPLAY_IMAGE_EFFECT_NEGATIVE,         /* Negative effect */
	DISPLAY_IMAGE_EFFECT_GREY,             /* Grey effect */
	DISPLAY_IMAGE_EFFECT_GREY_NEGATIVE,    /* Grey Negative effect */
	DISPLAY_IMAGE_EFFECT_MAX,
};

enum display_panel_mode {
	DISPLAY_PANEL_MODE_STANDARD,      /* Standard mode */
	DISPLAY_PANEL_MODE_OUTDOOR,       /* Outdoor mode */
	DISPLAY_PANEL_MODE_CONTENTS,      /* Contents adaptive brightness control mode */
	DISPLAY_PANEL_MODE_LOWPOWER,      /* Low power mode */
};

enum display_aod_mode {
	DISPLAY_AOD_MODE_OFF,
	DISPLAY_AOD_MODE_ON,
};

struct display_device {
	struct hw_common common;

	/* Control display brightness */
	int (*get_max_brightness)(int *brightness);
	int (*get_brightness)(int *brightness);
	int (*set_brightness)(int brightness);
	int (*set_multi_brightness)(int brightness, int step, int delay);

	/* Control display brightness by sensor */
	int (*get_auto_brightness)(float lmax, float lmin, float light, int *brightness);

	/* Control display state */
	int (*get_state)(enum display_state *state);
	int (*set_state)(enum display_state state);

	/* Control image effect */
	int (*get_image_effect)(enum display_image_effect *effect);
	int (*set_image_effect)(enum display_image_effect effect);

	/* Control panel mode */
	int (*get_panel_mode)(enum display_panel_mode *mode);
	int (*set_panel_mode)(enum display_panel_mode mode);

	/* Control AOD mode */
	int (*get_aod_mode)(enum display_aod_mode *mode);

	/* Control AOD brightness */
	int (*get_aod_brightness)(int *max, int *normal, int *min);

	/* Control display frame rate */
	int (*get_max_frame_rate)(int *rate);
	int (*get_min_frame_rate)(int *rate);
	int (*get_frame_rate)(int *rate);
	int (*set_frame_rate)(int rate);
};

#endif