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
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.
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>
34 #include <drm/drm_crtc.h>
35 #include <drm/drm_edid.h>
38 #include "psb_intel_drv.h"
39 #include "psb_intel_reg.h"
41 #include "mdfld_output.h"
46 static inline struct mdfld_dsi_config
*
47 mdfld_dsi_get_config(struct mdfld_dsi_connector
*connector
)
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
;
61 dsi_connector
= config
->connector
;
66 return dsi_connector
->pkg_sender
;
69 static inline struct mdfld_dsi_config
*
70 mdfld_dsi_encoder_get_config(struct mdfld_dsi_encoder
*encoder
)
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
;
85 config
= mdfld_dsi_encoder_get_config(encoder
);
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
);
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
;
111 connector
= mdfld_dsi_encoder_get_connector(encoder
);
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
,
122 extern void mdfld_dsi_brightness_control(struct drm_device
*dev
, int pipe
,
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
,
130 extern int mdfld_dsi_get_power_mode(struct mdfld_dsi_config
*dsi_config
,
133 extern int mdfld_dsi_get_diagnostic_result(struct mdfld_dsi_config
*dsi_config
,
136 extern int mdfld_dsi_panel_reset(int pipe
);
138 #endif /*__MDFLD_DSI_OUTPUT_H__*/