1 /*
2  * Allwinner SoCs display driver.
3  *
4  * Copyright (C) 2016 Allwinner.
5  *
6  * This file is licensed under the terms of the GNU General Public
7  * License version 2.  This program is licensed "as is" without any
8  * warranty of any kind, whether express or implied.
9  */
10 
11 /*****************************************************************************
12  *  All Winner Tech, All Right Reserved. 2014-2015 Copyright (c)
13  *
14  *  File name   :   de_ase_type.h
15  *
16  *  Description :   display engine 2.0 ase struct declaration
17  *
18  *  History     :   2014/04/01  vito cheng  v0.1  Initial version
19  *
20 ******************************************************************************/
21 
22 #ifndef __DE_ASE_TYPE_H__
23 #define __DE_ASE_TYPE_H__
24 
25 #include "de_rtmx.h"
26 
27 #define ASE_PARA_NUM  1
28 #define ASE_MODE_NUM  4
29 union ASE_CTRL_REG {
30     unsigned int dwval;
31     struct {
32         unsigned int en:1;
33         unsigned int win_en:1;
34         unsigned int res0:30;
35     } bits;
36 };
37 
38 union ASE_SIZE_REG {
39     unsigned int dwval;
40     struct {
41         unsigned int width:12;
42         unsigned int res0:4;
43         unsigned int height:12;
44         unsigned int res1:4;
45     } bits;
46 };
47 
48 union ASE_WIN0_REG {
49     unsigned int dwval;
50     struct {
51         unsigned int left:12;
52         unsigned int res0:4;
53         unsigned int top:12;
54         unsigned int res1:4;
55     } bits;
56 };
57 
58 union ASE_WIN1_REG {
59     unsigned int dwval;
60     struct {
61         unsigned int right:12;
62         unsigned int res0:4;
63         unsigned int bot:12;
64         unsigned int res1:4;
65     } bits;
66 };
67 
68 union ASE_GAIN_REG {
69     unsigned int dwval;
70     struct {
71         unsigned int gain:5;
72         unsigned int res0:27;
73     } bits;
74 };
75 
76 struct __ase_reg_t {
77     union ASE_CTRL_REG ctrl;
78     union ASE_SIZE_REG size;
79     union ASE_WIN0_REG win0;
80     union ASE_WIN1_REG win1;
81     union ASE_GAIN_REG gain;
82 };
83 
84 struct __ase_config_data {
85     /* ase */
86     unsigned int ase_en;
87     unsigned int gain;
88 
89     /* window */
90     unsigned int win_en;
91     struct de_rect win;
92 };
93 #endif
94