Lynx framebuffers multidomain implementation.
[linux/elbrus.git] / drivers / video / lynxfb / ddk750_power.h
blob87a8fa55f5ea8663687fb00e052c361f21ec20aa
1 /*******************************************************************
2 *Copyright (c) 2012 by Silicon Motion, Inc. (SMI)
3 *Permission is hereby granted, free of charge, to any person obtaining a copy
4 *of this software and associated documentation files (the "Software"), to deal
5 *in the Software without restriction, including without limitation the rights to
6 *use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 *of the Software, and to permit persons to whom the Software is furnished to
8 *do so, subject to the following conditions:
10 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
12 *OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 *NONINFRINGEMENT. IN NO EVENT SHALL Mill.Chen and Monk.Liu OR COPYRIGHT
14 *HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
15 *WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16 *FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
17 *OTHER DEALINGS IN THE SOFTWARE.
18 *******************************************************************/
19 #ifndef DDK750_POWER_H__
20 #define DDK750_POWER_H__
22 typedef enum _DPMS_t {
23 crtDPMS_ON = 0x0,
24 crtDPMS_STANDBY = 0x1,
25 crtDPMS_SUSPEND = 0x2,
26 crtDPMS_OFF = 0x3,
27 } DPMS_t;
30 #ifdef CONFIG_FB_LYNXFB_DOMAINS
31 #define setDAC(off, domain) \
32 { \
33 POKE32(MISC_CTRL, PEEK32(MISC_CTRL, domain)|(off << MISC_CTRL_DAC_POWER_LSB), domain); \
35 #else
36 #define setDAC(off) \
37 { \
38 POKE32(MISC_CTRL, PEEK32(MISC_CTRL)|(off << MISC_CTRL_DAC_POWER_LSB)); \
40 #endif /* CONFIG_FB_LYNXFB_DOMAINS */
42 #ifdef CONFIG_FB_LYNXFB_DOMAINS
44 void ddk750_setDPMS(DPMS_t, int);
46 unsigned int getPowerMode(int);
49 * This function sets the current power mode
51 void setPowerMode(unsigned int powerMode, int domain);
54 * This function sets current gate
56 void setCurrentGate(unsigned int gate, int domain);
59 * This function enable/disable the 2D engine.
61 void enable2DEngine(unsigned int enable, int domain);
64 * This function enable/disable the ZV Port
66 void enableZVPort(unsigned int enable, int domain);
69 * This function enable/disable the DMA Engine
71 void enableDMA(unsigned int enable, int domain);
74 * This function enable/disable the GPIO Engine
76 void enableGPIO(unsigned int enable, int domain);
79 * This function enable/disable the PWM Engine
81 void enablePWM(unsigned int enable, int domain);
84 * This function enable/disable the I2C Engine
86 void enableI2C(unsigned int enable, int domain);
89 * This function enable/disable the SSP.
91 void enableSSP(unsigned int enable, int domain);
93 #else /* !CONFIG_FB_LYNXFB_DOMAINS: */
95 void ddk750_setDPMS(DPMS_t);
97 unsigned int getPowerMode(void);
100 * This function sets the current power mode
102 void setPowerMode(unsigned int powerMode);
105 * This function sets current gate
107 void setCurrentGate(unsigned int gate);
110 * This function enable/disable the 2D engine.
112 void enable2DEngine(unsigned int enable);
115 * This function enable/disable the ZV Port
117 void enableZVPort(unsigned int enable);
120 * This function enable/disable the DMA Engine
122 void enableDMA(unsigned int enable);
125 * This function enable/disable the GPIO Engine
127 void enableGPIO(unsigned int enable);
130 * This function enable/disable the PWM Engine
132 void enablePWM(unsigned int enable);
135 * This function enable/disable the I2C Engine
137 void enableI2C(unsigned int enable);
140 * This function enable/disable the SSP.
142 void enableSSP(unsigned int enable);
144 #endif /* !CONFIG_FB_LYNXFB_DOMAINS */
146 #endif