| Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 1 | /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __HDMI_MSM_H__ |
| 14 | #define __HDMI_MSM_H__ |
| 15 | |
| 16 | #include <mach/msm_iomap.h> |
| 17 | #include "external_common.h" |
| 18 | /* #define PORT_DEBUG */ |
| 19 | |
| 20 | #ifdef PORT_DEBUG |
| 21 | const char *hdmi_msm_name(uint32 offset); |
| 22 | void hdmi_outp(uint32 offset, uint32 value); |
| 23 | uint32 hdmi_inp(uint32 offset); |
| 24 | |
| 25 | #define HDMI_OUTP_ND(offset, value) outpdw(MSM_HDMI_BASE+(offset), (value)) |
| 26 | #define HDMI_OUTP(offset, value) hdmi_outp((offset), (value)) |
| 27 | #define HDMI_INP_ND(offset) inpdw(MSM_HDMI_BASE+(offset)) |
| 28 | #define HDMI_INP(offset) hdmi_inp((offset)) |
| 29 | #else |
| 30 | #define HDMI_OUTP_ND(offset, value) outpdw(MSM_HDMI_BASE+(offset), (value)) |
| 31 | #define HDMI_OUTP(offset, value) outpdw(MSM_HDMI_BASE+(offset), (value)) |
| 32 | #define HDMI_INP_ND(offset) inpdw(MSM_HDMI_BASE+(offset)) |
| 33 | #define HDMI_INP(offset) inpdw(MSM_HDMI_BASE+(offset)) |
| 34 | #endif |
| 35 | |
| 36 | #define QFPROM_BASE ((uint32)hdmi_msm_state->qfprom_io) |
| 37 | |
| 38 | struct hdmi_msm_state_type { |
| 39 | boolean panel_power_on; |
| 40 | boolean hpd_initialized; |
| 41 | #ifdef CONFIG_SUSPEND |
| 42 | boolean pm_suspended; |
| 43 | #endif |
| 44 | int hpd_stable; |
| 45 | boolean hpd_prev_state; |
| 46 | boolean hpd_cable_chg_detected; |
| 47 | boolean full_auth_done; |
| 48 | boolean hpd_during_auth; |
| 49 | struct work_struct hpd_state_work, hpd_read_work; |
| 50 | struct timer_list hpd_state_timer; |
| 51 | struct completion ddc_sw_done; |
| 52 | |
| 53 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL_HDCP_SUPPORT |
| 54 | boolean hdcp_activating; |
| 55 | boolean reauth ; |
| 56 | struct work_struct hdcp_reauth_work, hdcp_work; |
| 57 | struct completion hdcp_success_done; |
| 58 | struct timer_list hdcp_timer; |
| 59 | #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL_HDCP_SUPPORT */ |
| 60 | |
| 61 | int irq; |
| 62 | struct msm_hdmi_platform_data *pd; |
| 63 | struct clk *hdmi_app_clk; |
| 64 | struct clk *hdmi_m_pclk; |
| 65 | struct clk *hdmi_s_pclk; |
| 66 | void __iomem *qfprom_io; |
| 67 | void __iomem *hdmi_io; |
| 68 | |
| 69 | struct external_common_state_type common; |
| 70 | }; |
| 71 | |
| 72 | extern struct hdmi_msm_state_type *hdmi_msm_state; |
| 73 | |
| 74 | uint32 hdmi_msm_get_io_base(void); |
| 75 | |
| 76 | #ifdef CONFIG_FB_MSM_HDMI_COMMON |
| 77 | void hdmi_phy_reset(void); |
| 78 | void hdmi_msm_init_phy(int video_format); |
| 79 | void hdmi_msm_powerdown_phy(void); |
| 80 | void hdmi_frame_ctrl_cfg(const struct hdmi_disp_mode_timing_type *timing); |
| 81 | void hdmi_msm_phy_status_poll(void); |
| 82 | #endif |
| 83 | |
| 84 | #endif /* __HDMI_MSM_H__ */ |