1 /* 2 * Copyright (c) 2010 Intel Corporation 3 * 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, sublicensen 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: 10 * 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. 14 * 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. 22 * 23 * Authors: 24 * Thomas Eaton <thomas.g.eaton@intel.com> 25 * Scott Rowe <scott.m.rowe@intel.com> 26 */ 27 28 #ifndef MDFLD_OUTPUT_H 29 #define MDFLD_OUTPUT_H 30 31 #include "psb_drv.h" 32 33 #define TPO_PANEL_WIDTH 84 34 #define TPO_PANEL_HEIGHT 46 35 #define TMD_PANEL_WIDTH 39 36 #define TMD_PANEL_HEIGHT 71 37 38 struct mdfld_dsi_config; 39 40 enum panel_type { 41 TPO_VID, 42 TMD_VID, 43 HDMI, 44 TC35876X, 45 }; 46 47 struct panel_info { 48 u32 width_mm; 49 u32 height_mm; 50 /* Other info */ 51 }; 52 53 struct panel_funcs { 54 const struct drm_encoder_funcs *encoder_funcs; 55 const struct drm_encoder_helper_funcs *encoder_helper_funcs; 56 struct drm_display_mode * (*get_config_mode)(struct drm_device *); 57 int (*get_panel_info)(struct drm_device *, int, struct panel_info *); 58 int (*reset)(int pipe); 59 void (*drv_ic_init)(struct mdfld_dsi_config *dsi_config, int pipe); 60 }; 61 62 int mdfld_output_init(struct drm_device *dev); 63 64 struct backlight_device *mdfld_get_backlight_device(void); 65 int mdfld_set_brightness(struct backlight_device *bd); 66 67 int mdfld_get_panel_type(struct drm_device *dev, int pipe); 68 69 extern const struct drm_crtc_helper_funcs mdfld_helper_funcs; 70 71 extern const struct panel_funcs mdfld_tmd_vid_funcs; 72 extern const struct panel_funcs mdfld_tpo_vid_funcs; 73 74 extern void mdfld_disable_crtc(struct drm_device *dev, int pipe); 75 extern void mdfldWaitForPipeEnable(struct drm_device *dev, int pipe); 76 extern void mdfldWaitForPipeDisable(struct drm_device *dev, int pipe); 77 #endif 78