audit: complex interfield comparison helper
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / gma500 / mdfld_dsi_output.h
blob4699267efd6059c6098a47e0f98ffb722a4ec9f4
1 /*
2 * Copyright © 2010 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
23 * Authors:
24 * jim liu <jim.liu@intel.com>
25 * Jackie Li<yaodong.li@intel.com>
28 #ifndef __MDFLD_DSI_OUTPUT_H__
29 #define __MDFLD_DSI_OUTPUT_H__
31 #include <linux/backlight.h>
32 #include <drm/drmP.h>
33 #include <drm/drm.h>
34 #include <drm/drm_crtc.h>
35 #include <drm/drm_edid.h>
37 #include "psb_drv.h"
38 #include "psb_intel_drv.h"
39 #include "psb_intel_reg.h"
40 #include "power.h"
41 #include "mdfld_output.h"
43 #include <asm/mrst.h>
46 static inline struct mdfld_dsi_config *
47 mdfld_dsi_get_config(struct mdfld_dsi_connector *connector)
49 if (!connector)
50 return NULL;
51 return (struct mdfld_dsi_config *)connector->private;
54 static inline void *mdfld_dsi_get_pkg_sender(struct mdfld_dsi_config *config)
56 struct mdfld_dsi_connector *dsi_connector;
58 if (!config)
59 return NULL;
61 dsi_connector = config->connector;
63 if (!dsi_connector)
64 return NULL;
66 return dsi_connector->pkg_sender;
69 static inline struct mdfld_dsi_config *
70 mdfld_dsi_encoder_get_config(struct mdfld_dsi_encoder *encoder)
72 if (!encoder)
73 return NULL;
74 return (struct mdfld_dsi_config *)encoder->private;
77 static inline struct mdfld_dsi_connector *
78 mdfld_dsi_encoder_get_connector(struct mdfld_dsi_encoder *encoder)
80 struct mdfld_dsi_config *config;
82 if (!encoder)
83 return NULL;
85 config = mdfld_dsi_encoder_get_config(encoder);
86 if (!config)
87 return NULL;
89 return config->connector;
92 static inline void *mdfld_dsi_encoder_get_pkg_sender(
93 struct mdfld_dsi_encoder *encoder)
95 struct mdfld_dsi_config *dsi_config;
97 dsi_config = mdfld_dsi_encoder_get_config(encoder);
98 if (!dsi_config)
99 return NULL;
101 return mdfld_dsi_get_pkg_sender(dsi_config);
104 static inline int mdfld_dsi_encoder_get_pipe(struct mdfld_dsi_encoder *encoder)
106 struct mdfld_dsi_connector *connector;
108 if (!encoder)
109 return -1;
111 connector = mdfld_dsi_encoder_get_connector(encoder);
112 if (!connector)
113 return -1;
115 return connector->pipe;
118 extern void mdfld_dsi_gen_fifo_ready(struct drm_device *dev,
119 u32 gen_fifo_stat_reg, u32 fifo_stat);
120 extern void mdfld_dsi_brightness_init(struct mdfld_dsi_config *dsi_config,
121 int pipe);
122 extern void mdfld_dsi_brightness_control(struct drm_device *dev, int pipe,
123 int level);
124 extern void mdfld_dsi_output_init(struct drm_device *dev, int pipe,
125 struct mdfld_dsi_config *config,
126 struct panel_funcs *p_cmd_funcs,
127 struct panel_funcs *p_vid_funcs);
128 extern void mdfld_dsi_controller_init(struct mdfld_dsi_config *dsi_config,
129 int pipe);
130 extern int mdfld_dsi_get_power_mode(struct mdfld_dsi_config *dsi_config,
131 u32 *mode,
132 u8 transmission);
133 extern int mdfld_dsi_get_diagnostic_result(struct mdfld_dsi_config *dsi_config,
134 u32 *result,
135 u8 transmission);
136 extern int mdfld_dsi_panel_reset(int pipe);
138 #endif /*__MDFLD_DSI_OUTPUT_H__*/