| Duy Truong | e833aca | 2013-02-12 13:35:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 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 |  | 
|  | 14 | #include <linux/init.h> | 
|  | 15 | #include <linux/ioport.h> | 
| Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | #include <linux/gpio.h> | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 17 | #include <linux/platform_device.h> | 
|  | 18 | #include <linux/bootmem.h> | 
| Mitchel Humpherys | 00a8b8e | 2012-09-06 11:32:35 -0700 | [diff] [blame] | 19 | #include <linux/msm_ion.h> | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 20 | #include <asm/mach-types.h> | 
|  | 21 | #include <mach/msm_memtypes.h> | 
|  | 22 | #include <mach/board.h> | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 23 | #include <mach/gpiomux.h> | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 24 | #include <mach/ion.h> | 
| Ravishangar Kalyanam | 59a67b1 | 2012-02-13 14:29:56 -0800 | [diff] [blame] | 25 | #include <mach/msm_bus_board.h> | 
| Huaibin Yang | 02f981c | 2012-02-27 16:58:41 -0800 | [diff] [blame] | 26 | #include <mach/socinfo.h> | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 27 |  | 
|  | 28 | #include "devices.h" | 
|  | 29 | #include "board-8064.h" | 
|  | 30 |  | 
|  | 31 | #ifdef CONFIG_FB_MSM_TRIPLE_BUFFER | 
|  | 32 | /* prim = 1366 x 768 x 3(bpp) x 3(pages) */ | 
| Huaibin Yang | c8946d4 | 2012-05-04 17:22:02 -0700 | [diff] [blame] | 33 | #define MSM_FB_PRIM_BUF_SIZE roundup(1920 * 1088 * 4 * 3, 0x10000) | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 34 | #else | 
|  | 35 | /* prim = 1366 x 768 x 3(bpp) x 2(pages) */ | 
| Huaibin Yang | c8946d4 | 2012-05-04 17:22:02 -0700 | [diff] [blame] | 36 | #define MSM_FB_PRIM_BUF_SIZE roundup(1920 * 1088 * 4 * 2, 0x10000) | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 37 | #endif | 
|  | 38 |  | 
| Huaibin Yang | c8946d4 | 2012-05-04 17:22:02 -0700 | [diff] [blame] | 39 | #define MSM_FB_SIZE roundup(MSM_FB_PRIM_BUF_SIZE, 4096) | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 40 |  | 
|  | 41 | #ifdef CONFIG_FB_MSM_OVERLAY0_WRITEBACK | 
|  | 42 | #define MSM_FB_OVERLAY0_WRITEBACK_SIZE roundup((1376 * 768 * 3 * 2), 4096) | 
|  | 43 | #else | 
|  | 44 | #define MSM_FB_OVERLAY0_WRITEBACK_SIZE (0) | 
|  | 45 | #endif  /* CONFIG_FB_MSM_OVERLAY0_WRITEBACK */ | 
|  | 46 |  | 
|  | 47 | #ifdef CONFIG_FB_MSM_OVERLAY1_WRITEBACK | 
|  | 48 | #define MSM_FB_OVERLAY1_WRITEBACK_SIZE roundup((1920 * 1088 * 3 * 2), 4096) | 
|  | 49 | #else | 
|  | 50 | #define MSM_FB_OVERLAY1_WRITEBACK_SIZE (0) | 
|  | 51 | #endif  /* CONFIG_FB_MSM_OVERLAY1_WRITEBACK */ | 
|  | 52 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 53 |  | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 54 | static struct resource msm_fb_resources[] = { | 
|  | 55 | { | 
|  | 56 | .flags = IORESOURCE_DMA, | 
|  | 57 | } | 
|  | 58 | }; | 
|  | 59 |  | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 60 | #define LVDS_CHIMEI_PANEL_NAME "lvds_chimei_wxga" | 
| Zhang Chang Ken | 4a07fcb | 2012-06-03 11:24:51 -0400 | [diff] [blame] | 61 | #define LVDS_FRC_PANEL_NAME "lvds_frc_fhd" | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 62 | #define MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME "mipi_video_toshiba_wsvga" | 
|  | 63 | #define MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME "mipi_video_chimei_wxga" | 
|  | 64 | #define HDMI_PANEL_NAME "hdmi_msm" | 
| Aravind Venkateswaran | 7f934ae | 2012-08-20 14:43:23 -0700 | [diff] [blame] | 65 | #define MHL_PANEL_NAME "hdmi_msm,mhl_8334" | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 66 | #define TVOUT_PANEL_NAME "tvout_msm" | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 67 |  | 
| Zhang Chang Ken | 4a07fcb | 2012-06-03 11:24:51 -0400 | [diff] [blame] | 68 | #define LVDS_PIXEL_MAP_PATTERN_1	1 | 
|  | 69 | #define LVDS_PIXEL_MAP_PATTERN_2	2 | 
|  | 70 |  | 
| Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 71 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY | 
|  | 72 | static unsigned char hdmi_is_primary = 1; | 
|  | 73 | #else | 
|  | 74 | static unsigned char hdmi_is_primary; | 
|  | 75 | #endif | 
|  | 76 |  | 
| Aravind Venkateswaran | 7f934ae | 2012-08-20 14:43:23 -0700 | [diff] [blame] | 77 | static unsigned char mhl_display_enabled; | 
|  | 78 |  | 
| Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 79 | unsigned char apq8064_hdmi_as_primary_selected(void) | 
|  | 80 | { | 
|  | 81 | return hdmi_is_primary; | 
|  | 82 | } | 
|  | 83 |  | 
| Aravind Venkateswaran | 7f934ae | 2012-08-20 14:43:23 -0700 | [diff] [blame] | 84 | unsigned char apq8064_mhl_display_enabled(void) | 
|  | 85 | { | 
|  | 86 | return mhl_display_enabled; | 
|  | 87 | } | 
|  | 88 |  | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 89 | static void set_mdp_clocks_for_wuxga(void); | 
|  | 90 |  | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 91 | static int msm_fb_detect_panel(const char *name) | 
|  | 92 | { | 
| Ravishangar Kalyanam | ed3593c | 2012-03-08 10:15:04 -0800 | [diff] [blame] | 93 | u32 version; | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 94 | if (machine_is_apq8064_liquid()) { | 
| Ravishangar Kalyanam | ed3593c | 2012-03-08 10:15:04 -0800 | [diff] [blame] | 95 | version = socinfo_get_platform_version(); | 
|  | 96 | if ((SOCINFO_VERSION_MAJOR(version) == 1) && | 
|  | 97 | (SOCINFO_VERSION_MINOR(version) == 1)) { | 
|  | 98 | if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME, | 
|  | 99 | strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME, | 
|  | 100 | PANEL_NAME_MAX_LEN))) | 
|  | 101 | return 0; | 
|  | 102 | } else { | 
|  | 103 | if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME, | 
|  | 104 | strnlen(LVDS_CHIMEI_PANEL_NAME, | 
|  | 105 | PANEL_NAME_MAX_LEN))) | 
|  | 106 | return 0; | 
|  | 107 | } | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 108 | } else if (machine_is_apq8064_mtp()) { | 
|  | 109 | if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME, | 
|  | 110 | strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME, | 
|  | 111 | PANEL_NAME_MAX_LEN))) | 
|  | 112 | return 0; | 
| Zhang Chang Ken | 4a07fcb | 2012-06-03 11:24:51 -0400 | [diff] [blame] | 113 | } else if (machine_is_apq8064_cdp()) { | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 114 | if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME, | 
|  | 115 | strnlen(LVDS_CHIMEI_PANEL_NAME, | 
|  | 116 | PANEL_NAME_MAX_LEN))) | 
|  | 117 | return 0; | 
| Zhang Chang Ken | 4a07fcb | 2012-06-03 11:24:51 -0400 | [diff] [blame] | 118 | } else if (machine_is_mpq8064_dtv()) { | 
|  | 119 | if (!strncmp(name, LVDS_FRC_PANEL_NAME, | 
|  | 120 | strnlen(LVDS_FRC_PANEL_NAME, | 
|  | 121 | PANEL_NAME_MAX_LEN))) { | 
|  | 122 | set_mdp_clocks_for_wuxga(); | 
|  | 123 | return 0; | 
|  | 124 | } | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 125 | } | 
|  | 126 |  | 
|  | 127 | if (!strncmp(name, HDMI_PANEL_NAME, | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 128 | strnlen(HDMI_PANEL_NAME, | 
|  | 129 | PANEL_NAME_MAX_LEN))) { | 
| Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 130 | if (apq8064_hdmi_as_primary_selected()) | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 131 | set_mdp_clocks_for_wuxga(); | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 132 | return 0; | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 133 | } | 
|  | 134 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 135 |  | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 136 | return -ENODEV; | 
|  | 137 | } | 
|  | 138 |  | 
|  | 139 | static struct msm_fb_platform_data msm_fb_pdata = { | 
|  | 140 | .detect_client = msm_fb_detect_panel, | 
|  | 141 | }; | 
|  | 142 |  | 
|  | 143 | static struct platform_device msm_fb_device = { | 
|  | 144 | .name              = "msm_fb", | 
|  | 145 | .id                = 0, | 
|  | 146 | .num_resources     = ARRAY_SIZE(msm_fb_resources), | 
|  | 147 | .resource          = msm_fb_resources, | 
|  | 148 | .dev.platform_data = &msm_fb_pdata, | 
|  | 149 | }; | 
|  | 150 |  | 
|  | 151 | void __init apq8064_allocate_fb_region(void) | 
|  | 152 | { | 
|  | 153 | void *addr; | 
|  | 154 | unsigned long size; | 
|  | 155 |  | 
|  | 156 | size = MSM_FB_SIZE; | 
|  | 157 | addr = alloc_bootmem_align(size, 0x1000); | 
|  | 158 | msm_fb_resources[0].start = __pa(addr); | 
|  | 159 | msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1; | 
|  | 160 | pr_info("allocating %lu bytes at %p (%lx physical) for fb\n", | 
|  | 161 | size, addr, __pa(addr)); | 
|  | 162 | } | 
|  | 163 |  | 
|  | 164 | #define MDP_VSYNC_GPIO 0 | 
|  | 165 |  | 
| Ravishangar Kalyanam | 59a67b1 | 2012-02-13 14:29:56 -0800 | [diff] [blame] | 166 | static struct msm_bus_vectors mdp_init_vectors[] = { | 
|  | 167 | { | 
|  | 168 | .src = MSM_BUS_MASTER_MDP_PORT0, | 
|  | 169 | .dst = MSM_BUS_SLAVE_EBI_CH0, | 
|  | 170 | .ab = 0, | 
|  | 171 | .ib = 0, | 
|  | 172 | }, | 
|  | 173 | }; | 
|  | 174 |  | 
|  | 175 | static struct msm_bus_vectors mdp_ui_vectors[] = { | 
|  | 176 | { | 
|  | 177 | .src = MSM_BUS_MASTER_MDP_PORT0, | 
|  | 178 | .dst = MSM_BUS_SLAVE_EBI_CH0, | 
|  | 179 | .ab = 216000000 * 2, | 
|  | 180 | .ib = 270000000 * 2, | 
|  | 181 | }, | 
|  | 182 | }; | 
|  | 183 |  | 
|  | 184 | static struct msm_bus_vectors mdp_vga_vectors[] = { | 
|  | 185 | /* VGA and less video */ | 
|  | 186 | { | 
|  | 187 | .src = MSM_BUS_MASTER_MDP_PORT0, | 
|  | 188 | .dst = MSM_BUS_SLAVE_EBI_CH0, | 
|  | 189 | .ab = 216000000 * 2, | 
|  | 190 | .ib = 270000000 * 2, | 
|  | 191 | }, | 
|  | 192 | }; | 
|  | 193 |  | 
|  | 194 | static struct msm_bus_vectors mdp_720p_vectors[] = { | 
|  | 195 | /* 720p and less video */ | 
|  | 196 | { | 
|  | 197 | .src = MSM_BUS_MASTER_MDP_PORT0, | 
|  | 198 | .dst = MSM_BUS_SLAVE_EBI_CH0, | 
|  | 199 | .ab = 230400000 * 2, | 
|  | 200 | .ib = 288000000 * 2, | 
|  | 201 | }, | 
|  | 202 | }; | 
|  | 203 |  | 
|  | 204 | static struct msm_bus_vectors mdp_1080p_vectors[] = { | 
|  | 205 | /* 1080p and less video */ | 
|  | 206 | { | 
|  | 207 | .src = MSM_BUS_MASTER_MDP_PORT0, | 
|  | 208 | .dst = MSM_BUS_SLAVE_EBI_CH0, | 
|  | 209 | .ab = 334080000 * 2, | 
|  | 210 | .ib = 417600000 * 2, | 
|  | 211 | }, | 
|  | 212 | }; | 
|  | 213 |  | 
|  | 214 | static struct msm_bus_paths mdp_bus_scale_usecases[] = { | 
|  | 215 | { | 
|  | 216 | ARRAY_SIZE(mdp_init_vectors), | 
|  | 217 | mdp_init_vectors, | 
|  | 218 | }, | 
|  | 219 | { | 
|  | 220 | ARRAY_SIZE(mdp_ui_vectors), | 
|  | 221 | mdp_ui_vectors, | 
|  | 222 | }, | 
|  | 223 | { | 
|  | 224 | ARRAY_SIZE(mdp_ui_vectors), | 
|  | 225 | mdp_ui_vectors, | 
|  | 226 | }, | 
|  | 227 | { | 
|  | 228 | ARRAY_SIZE(mdp_vga_vectors), | 
|  | 229 | mdp_vga_vectors, | 
|  | 230 | }, | 
|  | 231 | { | 
|  | 232 | ARRAY_SIZE(mdp_720p_vectors), | 
|  | 233 | mdp_720p_vectors, | 
|  | 234 | }, | 
|  | 235 | { | 
|  | 236 | ARRAY_SIZE(mdp_1080p_vectors), | 
|  | 237 | mdp_1080p_vectors, | 
|  | 238 | }, | 
|  | 239 | }; | 
|  | 240 |  | 
|  | 241 | static struct msm_bus_scale_pdata mdp_bus_scale_pdata = { | 
|  | 242 | mdp_bus_scale_usecases, | 
|  | 243 | ARRAY_SIZE(mdp_bus_scale_usecases), | 
|  | 244 | .name = "mdp", | 
|  | 245 | }; | 
|  | 246 |  | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 247 | static struct msm_panel_common_pdata mdp_pdata = { | 
|  | 248 | .gpio = MDP_VSYNC_GPIO, | 
| Huaibin Yang | 23441d8 | 2012-10-15 15:39:21 -0700 | [diff] [blame] | 249 | .mdp_max_clk = 266667000, | 
| Huaibin Yang | 42f7371 | 2013-03-21 17:27:45 -0700 | [diff] [blame] | 250 | .mdp_max_bw = 2000000000, | 
|  | 251 | .mdp_bw_ab_factor = 115, | 
|  | 252 | .mdp_bw_ib_factor = 125, | 
| Ravishangar Kalyanam | 59a67b1 | 2012-02-13 14:29:56 -0800 | [diff] [blame] | 253 | .mdp_bus_scale_table = &mdp_bus_scale_pdata, | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 254 | .mdp_rev = MDP_REV_44, | 
|  | 255 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION | 
| Ravishangar Kalyanam | a3b168b | 2012-03-26 11:13:11 -0700 | [diff] [blame] | 256 | .mem_hid = BIT(ION_CP_MM_HEAP_ID), | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 257 | #else | 
|  | 258 | .mem_hid = MEMTYPE_EBI1, | 
|  | 259 | #endif | 
| Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 260 | .mdp_iommu_split_domain = 1, | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 261 | }; | 
|  | 262 |  | 
|  | 263 | void __init apq8064_mdp_writeback(struct memtype_reserve* reserve_table) | 
|  | 264 | { | 
|  | 265 | mdp_pdata.ov0_wb_size = MSM_FB_OVERLAY0_WRITEBACK_SIZE; | 
|  | 266 | mdp_pdata.ov1_wb_size = MSM_FB_OVERLAY1_WRITEBACK_SIZE; | 
|  | 267 | #if defined(CONFIG_ANDROID_PMEM) && !defined(CONFIG_MSM_MULTIMEDIA_USE_ION) | 
|  | 268 | reserve_table[mdp_pdata.mem_hid].size += | 
|  | 269 | mdp_pdata.ov0_wb_size; | 
|  | 270 | reserve_table[mdp_pdata.mem_hid].size += | 
|  | 271 | mdp_pdata.ov1_wb_size; | 
|  | 272 | #endif | 
|  | 273 | } | 
|  | 274 |  | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 275 | static struct resource hdmi_msm_resources[] = { | 
|  | 276 | { | 
|  | 277 | .name  = "hdmi_msm_qfprom_addr", | 
|  | 278 | .start = 0x00700000, | 
|  | 279 | .end   = 0x007060FF, | 
|  | 280 | .flags = IORESOURCE_MEM, | 
|  | 281 | }, | 
|  | 282 | { | 
|  | 283 | .name  = "hdmi_msm_hdmi_addr", | 
|  | 284 | .start = 0x04A00000, | 
|  | 285 | .end   = 0x04A00FFF, | 
|  | 286 | .flags = IORESOURCE_MEM, | 
|  | 287 | }, | 
|  | 288 | { | 
|  | 289 | .name  = "hdmi_msm_irq", | 
|  | 290 | .start = HDMI_IRQ, | 
|  | 291 | .end   = HDMI_IRQ, | 
|  | 292 | .flags = IORESOURCE_IRQ, | 
|  | 293 | }, | 
|  | 294 | }; | 
|  | 295 |  | 
|  | 296 | static int hdmi_enable_5v(int on); | 
|  | 297 | static int hdmi_core_power(int on, int show); | 
|  | 298 | static int hdmi_cec_power(int on); | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 299 | static int hdmi_gpio_config(int on); | 
|  | 300 | static int hdmi_panel_power(int on); | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 301 |  | 
|  | 302 | static struct msm_hdmi_platform_data hdmi_msm_data = { | 
|  | 303 | .irq = HDMI_IRQ, | 
|  | 304 | .enable_5v = hdmi_enable_5v, | 
|  | 305 | .core_power = hdmi_core_power, | 
|  | 306 | .cec_power = hdmi_cec_power, | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 307 | .panel_power = hdmi_panel_power, | 
|  | 308 | .gpio_config = hdmi_gpio_config, | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 309 | }; | 
|  | 310 |  | 
|  | 311 | static struct platform_device hdmi_msm_device = { | 
|  | 312 | .name = "hdmi_msm", | 
|  | 313 | .id = 0, | 
|  | 314 | .num_resources = ARRAY_SIZE(hdmi_msm_resources), | 
|  | 315 | .resource = hdmi_msm_resources, | 
|  | 316 | .dev.platform_data = &hdmi_msm_data, | 
|  | 317 | }; | 
|  | 318 |  | 
| Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 319 | static char wfd_check_mdp_iommu_split_domain(void) | 
|  | 320 | { | 
|  | 321 | return mdp_pdata.mdp_iommu_split_domain; | 
|  | 322 | } | 
|  | 323 |  | 
| Mohan Kumar Gubbihalli Lachma Naik | cb7d4e7 | 2012-03-23 18:17:30 -0700 | [diff] [blame] | 324 | #ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL | 
| Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 325 | static struct msm_wfd_platform_data wfd_pdata = { | 
|  | 326 | .wfd_check_mdp_iommu_split = wfd_check_mdp_iommu_split_domain, | 
|  | 327 | }; | 
|  | 328 |  | 
| Mohan Kumar Gubbihalli Lachma Naik | cb7d4e7 | 2012-03-23 18:17:30 -0700 | [diff] [blame] | 329 | static struct platform_device wfd_panel_device = { | 
|  | 330 | .name = "wfd_panel", | 
|  | 331 | .id = 0, | 
|  | 332 | .dev.platform_data = NULL, | 
|  | 333 | }; | 
|  | 334 |  | 
|  | 335 | static struct platform_device wfd_device = { | 
|  | 336 | .name          = "msm_wfd", | 
|  | 337 | .id            = -1, | 
| Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 338 | .dev.platform_data = &wfd_pdata, | 
| Mohan Kumar Gubbihalli Lachma Naik | cb7d4e7 | 2012-03-23 18:17:30 -0700 | [diff] [blame] | 339 | }; | 
|  | 340 | #endif | 
|  | 341 |  | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 342 | /* HDMI related GPIOs */ | 
|  | 343 | #define HDMI_CEC_VAR_GPIO	69 | 
|  | 344 | #define HDMI_DDC_CLK_GPIO	70 | 
|  | 345 | #define HDMI_DDC_DATA_GPIO	71 | 
|  | 346 | #define HDMI_HPD_GPIO		72 | 
|  | 347 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 348 | static bool dsi_power_on; | 
|  | 349 | static int mipi_dsi_panel_power(int on) | 
|  | 350 | { | 
|  | 351 | static struct regulator *reg_lvs7, *reg_l2, *reg_l11, *reg_ext_3p3v; | 
|  | 352 | static int gpio36, gpio25, gpio26, mpp3; | 
|  | 353 | int rc; | 
|  | 354 |  | 
|  | 355 | pr_debug("%s: on=%d\n", __func__, on); | 
|  | 356 |  | 
|  | 357 | if (!dsi_power_on) { | 
|  | 358 | reg_lvs7 = regulator_get(&msm_mipi_dsi1_device.dev, | 
|  | 359 | "dsi1_vddio"); | 
|  | 360 | if (IS_ERR_OR_NULL(reg_lvs7)) { | 
|  | 361 | pr_err("could not get 8921_lvs7, rc = %ld\n", | 
|  | 362 | PTR_ERR(reg_lvs7)); | 
|  | 363 | return -ENODEV; | 
|  | 364 | } | 
|  | 365 |  | 
|  | 366 | reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev, | 
|  | 367 | "dsi1_pll_vdda"); | 
|  | 368 | if (IS_ERR_OR_NULL(reg_l2)) { | 
|  | 369 | pr_err("could not get 8921_l2, rc = %ld\n", | 
|  | 370 | PTR_ERR(reg_l2)); | 
|  | 371 | return -ENODEV; | 
|  | 372 | } | 
|  | 373 |  | 
|  | 374 | rc = regulator_set_voltage(reg_l2, 1200000, 1200000); | 
|  | 375 | if (rc) { | 
|  | 376 | pr_err("set_voltage l2 failed, rc=%d\n", rc); | 
|  | 377 | return -EINVAL; | 
|  | 378 | } | 
|  | 379 | reg_l11 = regulator_get(&msm_mipi_dsi1_device.dev, | 
|  | 380 | "dsi1_avdd"); | 
|  | 381 | if (IS_ERR(reg_l11)) { | 
|  | 382 | pr_err("could not get 8921_l11, rc = %ld\n", | 
|  | 383 | PTR_ERR(reg_l11)); | 
|  | 384 | return -ENODEV; | 
|  | 385 | } | 
|  | 386 | rc = regulator_set_voltage(reg_l11, 3000000, 3000000); | 
|  | 387 | if (rc) { | 
|  | 388 | pr_err("set_voltage l11 failed, rc=%d\n", rc); | 
|  | 389 | return -EINVAL; | 
|  | 390 | } | 
|  | 391 |  | 
|  | 392 | if (machine_is_apq8064_liquid()) { | 
|  | 393 | reg_ext_3p3v = regulator_get(&msm_mipi_dsi1_device.dev, | 
|  | 394 | "dsi1_vccs_3p3v"); | 
|  | 395 | if (IS_ERR_OR_NULL(reg_ext_3p3v)) { | 
|  | 396 | pr_err("could not get reg_ext_3p3v, rc = %ld\n", | 
|  | 397 | PTR_ERR(reg_ext_3p3v)); | 
|  | 398 | reg_ext_3p3v = NULL; | 
|  | 399 | return -ENODEV; | 
|  | 400 | } | 
|  | 401 | mpp3 = PM8921_MPP_PM_TO_SYS(3); | 
|  | 402 | rc = gpio_request(mpp3, "backlight_en"); | 
|  | 403 | if (rc) { | 
|  | 404 | pr_err("request mpp3 failed, rc=%d\n", rc); | 
|  | 405 | return -ENODEV; | 
|  | 406 | } | 
|  | 407 | } | 
|  | 408 |  | 
|  | 409 | gpio25 = PM8921_GPIO_PM_TO_SYS(25); | 
|  | 410 | rc = gpio_request(gpio25, "disp_rst_n"); | 
|  | 411 | if (rc) { | 
|  | 412 | pr_err("request gpio 25 failed, rc=%d\n", rc); | 
|  | 413 | return -ENODEV; | 
|  | 414 | } | 
|  | 415 |  | 
|  | 416 | gpio26 = PM8921_GPIO_PM_TO_SYS(26); | 
|  | 417 | rc = gpio_request(gpio26, "pwm_backlight_ctrl"); | 
|  | 418 | if (rc) { | 
|  | 419 | pr_err("request gpio 26 failed, rc=%d\n", rc); | 
|  | 420 | return -ENODEV; | 
|  | 421 | } | 
|  | 422 |  | 
|  | 423 | gpio36 = PM8921_GPIO_PM_TO_SYS(36); /* lcd1_pwr_en_n */ | 
|  | 424 | rc = gpio_request(gpio36, "lcd1_pwr_en_n"); | 
|  | 425 | if (rc) { | 
|  | 426 | pr_err("request gpio 36 failed, rc=%d\n", rc); | 
|  | 427 | return -ENODEV; | 
|  | 428 | } | 
|  | 429 |  | 
|  | 430 | dsi_power_on = true; | 
|  | 431 | } | 
|  | 432 |  | 
|  | 433 | if (on) { | 
|  | 434 | rc = regulator_enable(reg_lvs7); | 
|  | 435 | if (rc) { | 
|  | 436 | pr_err("enable lvs7 failed, rc=%d\n", rc); | 
|  | 437 | return -ENODEV; | 
|  | 438 | } | 
|  | 439 |  | 
|  | 440 | rc = regulator_set_optimum_mode(reg_l11, 110000); | 
|  | 441 | if (rc < 0) { | 
|  | 442 | pr_err("set_optimum_mode l11 failed, rc=%d\n", rc); | 
|  | 443 | return -EINVAL; | 
|  | 444 | } | 
|  | 445 | rc = regulator_enable(reg_l11); | 
|  | 446 | if (rc) { | 
|  | 447 | pr_err("enable l11 failed, rc=%d\n", rc); | 
|  | 448 | return -ENODEV; | 
|  | 449 | } | 
|  | 450 |  | 
|  | 451 | rc = regulator_set_optimum_mode(reg_l2, 100000); | 
|  | 452 | if (rc < 0) { | 
|  | 453 | pr_err("set_optimum_mode l2 failed, rc=%d\n", rc); | 
|  | 454 | return -EINVAL; | 
|  | 455 | } | 
|  | 456 | rc = regulator_enable(reg_l2); | 
|  | 457 | if (rc) { | 
|  | 458 | pr_err("enable l2 failed, rc=%d\n", rc); | 
|  | 459 | return -ENODEV; | 
|  | 460 | } | 
|  | 461 |  | 
|  | 462 | if (machine_is_apq8064_liquid()) { | 
|  | 463 | rc = regulator_enable(reg_ext_3p3v); | 
|  | 464 | if (rc) { | 
|  | 465 | pr_err("enable reg_ext_3p3v failed, rc=%d\n", | 
|  | 466 | rc); | 
|  | 467 | return -ENODEV; | 
|  | 468 | } | 
|  | 469 | gpio_set_value_cansleep(mpp3, 1); | 
|  | 470 | } | 
|  | 471 |  | 
|  | 472 | gpio_set_value_cansleep(gpio36, 0); | 
|  | 473 | gpio_set_value_cansleep(gpio25, 1); | 
| David Collins | 1b85957 | 2012-08-22 13:59:23 -0700 | [diff] [blame] | 474 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) | 
|  | 475 | gpio_set_value_cansleep(gpio26, 1); | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 476 | } else { | 
| David Collins | 1b85957 | 2012-08-22 13:59:23 -0700 | [diff] [blame] | 477 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) | 
|  | 478 | gpio_set_value_cansleep(gpio26, 0); | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 479 | gpio_set_value_cansleep(gpio25, 0); | 
|  | 480 | gpio_set_value_cansleep(gpio36, 1); | 
|  | 481 |  | 
|  | 482 | if (machine_is_apq8064_liquid()) { | 
|  | 483 | gpio_set_value_cansleep(mpp3, 0); | 
|  | 484 |  | 
|  | 485 | rc = regulator_disable(reg_ext_3p3v); | 
|  | 486 | if (rc) { | 
|  | 487 | pr_err("disable reg_ext_3p3v failed, rc=%d\n", | 
|  | 488 | rc); | 
|  | 489 | return -ENODEV; | 
|  | 490 | } | 
|  | 491 | } | 
|  | 492 |  | 
| Nagamalleswararao Ganji | 15ad5ac | 2012-06-20 20:50:01 -0700 | [diff] [blame] | 493 | rc = regulator_disable(reg_l11); | 
|  | 494 | if (rc) { | 
|  | 495 | pr_err("disable reg_l1 failed, rc=%d\n", rc); | 
|  | 496 | return -ENODEV; | 
|  | 497 | } | 
|  | 498 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 499 | rc = regulator_disable(reg_lvs7); | 
|  | 500 | if (rc) { | 
|  | 501 | pr_err("disable reg_lvs7 failed, rc=%d\n", rc); | 
|  | 502 | return -ENODEV; | 
|  | 503 | } | 
| Nagamalleswararao Ganji | 15ad5ac | 2012-06-20 20:50:01 -0700 | [diff] [blame] | 504 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 505 | rc = regulator_disable(reg_l2); | 
|  | 506 | if (rc) { | 
|  | 507 | pr_err("disable reg_l2 failed, rc=%d\n", rc); | 
|  | 508 | return -ENODEV; | 
|  | 509 | } | 
|  | 510 | } | 
|  | 511 |  | 
|  | 512 | return 0; | 
|  | 513 | } | 
|  | 514 |  | 
|  | 515 | static struct mipi_dsi_platform_data mipi_dsi_pdata = { | 
|  | 516 | .dsi_power_save = mipi_dsi_panel_power, | 
|  | 517 | }; | 
|  | 518 |  | 
|  | 519 | static bool lvds_power_on; | 
|  | 520 | static int lvds_panel_power(int on) | 
|  | 521 | { | 
|  | 522 | static struct regulator *reg_lvs7, *reg_l2, *reg_ext_3p3v; | 
|  | 523 | static int gpio36, gpio26, mpp3; | 
|  | 524 | int rc; | 
|  | 525 |  | 
|  | 526 | pr_debug("%s: on=%d\n", __func__, on); | 
|  | 527 |  | 
|  | 528 | if (!lvds_power_on) { | 
|  | 529 | reg_lvs7 = regulator_get(&msm_lvds_device.dev, | 
|  | 530 | "lvds_vdda"); | 
|  | 531 | if (IS_ERR_OR_NULL(reg_lvs7)) { | 
|  | 532 | pr_err("could not get 8921_lvs7, rc = %ld\n", | 
|  | 533 | PTR_ERR(reg_lvs7)); | 
|  | 534 | return -ENODEV; | 
|  | 535 | } | 
|  | 536 |  | 
|  | 537 | reg_l2 = regulator_get(&msm_lvds_device.dev, | 
|  | 538 | "lvds_pll_vdda"); | 
|  | 539 | if (IS_ERR_OR_NULL(reg_l2)) { | 
|  | 540 | pr_err("could not get 8921_l2, rc = %ld\n", | 
|  | 541 | PTR_ERR(reg_l2)); | 
|  | 542 | return -ENODEV; | 
|  | 543 | } | 
|  | 544 |  | 
|  | 545 | rc = regulator_set_voltage(reg_l2, 1200000, 1200000); | 
|  | 546 | if (rc) { | 
|  | 547 | pr_err("set_voltage l2 failed, rc=%d\n", rc); | 
|  | 548 | return -EINVAL; | 
|  | 549 | } | 
|  | 550 |  | 
|  | 551 | reg_ext_3p3v = regulator_get(&msm_lvds_device.dev, | 
|  | 552 | "lvds_vccs_3p3v"); | 
|  | 553 | if (IS_ERR_OR_NULL(reg_ext_3p3v)) { | 
|  | 554 | pr_err("could not get reg_ext_3p3v, rc = %ld\n", | 
|  | 555 | PTR_ERR(reg_ext_3p3v)); | 
|  | 556 | return -ENODEV; | 
|  | 557 | } | 
|  | 558 |  | 
|  | 559 | gpio26 = PM8921_GPIO_PM_TO_SYS(26); | 
|  | 560 | rc = gpio_request(gpio26, "pwm_backlight_ctrl"); | 
|  | 561 | if (rc) { | 
|  | 562 | pr_err("request gpio 26 failed, rc=%d\n", rc); | 
|  | 563 | return -ENODEV; | 
|  | 564 | } | 
|  | 565 |  | 
|  | 566 | gpio36 = PM8921_GPIO_PM_TO_SYS(36); /* lcd1_pwr_en_n */ | 
|  | 567 | rc = gpio_request(gpio36, "lcd1_pwr_en_n"); | 
|  | 568 | if (rc) { | 
|  | 569 | pr_err("request gpio 36 failed, rc=%d\n", rc); | 
|  | 570 | return -ENODEV; | 
|  | 571 | } | 
|  | 572 |  | 
|  | 573 | mpp3 = PM8921_MPP_PM_TO_SYS(3); | 
|  | 574 | rc = gpio_request(mpp3, "backlight_en"); | 
|  | 575 | if (rc) { | 
|  | 576 | pr_err("request mpp3 failed, rc=%d\n", rc); | 
|  | 577 | return -ENODEV; | 
|  | 578 | } | 
|  | 579 |  | 
|  | 580 | lvds_power_on = true; | 
|  | 581 | } | 
|  | 582 |  | 
|  | 583 | if (on) { | 
|  | 584 | rc = regulator_enable(reg_lvs7); | 
|  | 585 | if (rc) { | 
|  | 586 | pr_err("enable lvs7 failed, rc=%d\n", rc); | 
|  | 587 | return -ENODEV; | 
|  | 588 | } | 
|  | 589 |  | 
|  | 590 | rc = regulator_set_optimum_mode(reg_l2, 100000); | 
|  | 591 | if (rc < 0) { | 
|  | 592 | pr_err("set_optimum_mode l2 failed, rc=%d\n", rc); | 
|  | 593 | return -EINVAL; | 
|  | 594 | } | 
|  | 595 | rc = regulator_enable(reg_l2); | 
|  | 596 | if (rc) { | 
|  | 597 | pr_err("enable l2 failed, rc=%d\n", rc); | 
|  | 598 | return -ENODEV; | 
|  | 599 | } | 
|  | 600 |  | 
|  | 601 | rc = regulator_enable(reg_ext_3p3v); | 
|  | 602 | if (rc) { | 
|  | 603 | pr_err("enable reg_ext_3p3v failed, rc=%d\n", rc); | 
|  | 604 | return -ENODEV; | 
|  | 605 | } | 
|  | 606 |  | 
|  | 607 | gpio_set_value_cansleep(gpio36, 0); | 
|  | 608 | gpio_set_value_cansleep(mpp3, 1); | 
| David Collins | 1b85957 | 2012-08-22 13:59:23 -0700 | [diff] [blame] | 609 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) | 
|  | 610 | gpio_set_value_cansleep(gpio26, 1); | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 611 | } else { | 
| David Collins | 1b85957 | 2012-08-22 13:59:23 -0700 | [diff] [blame] | 612 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) | 
|  | 613 | gpio_set_value_cansleep(gpio26, 0); | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 614 | gpio_set_value_cansleep(mpp3, 0); | 
|  | 615 | gpio_set_value_cansleep(gpio36, 1); | 
|  | 616 |  | 
|  | 617 | rc = regulator_disable(reg_lvs7); | 
|  | 618 | if (rc) { | 
|  | 619 | pr_err("disable reg_lvs7 failed, rc=%d\n", rc); | 
|  | 620 | return -ENODEV; | 
|  | 621 | } | 
|  | 622 | rc = regulator_disable(reg_l2); | 
|  | 623 | if (rc) { | 
|  | 624 | pr_err("disable reg_l2 failed, rc=%d\n", rc); | 
|  | 625 | return -ENODEV; | 
|  | 626 | } | 
|  | 627 | rc = regulator_disable(reg_ext_3p3v); | 
|  | 628 | if (rc) { | 
|  | 629 | pr_err("disable reg_ext_3p3v failed, rc=%d\n", rc); | 
|  | 630 | return -ENODEV; | 
|  | 631 | } | 
|  | 632 | } | 
|  | 633 |  | 
|  | 634 | return 0; | 
|  | 635 | } | 
|  | 636 |  | 
| Huaibin Yang | 02f981c | 2012-02-27 16:58:41 -0800 | [diff] [blame] | 637 | static int lvds_pixel_remap(void) | 
|  | 638 | { | 
| Lei Zhou | 34e216d | 2012-07-25 12:52:13 -0400 | [diff] [blame] | 639 | u32 ver = socinfo_get_version(); | 
|  | 640 |  | 
| Huaibin Yang | 02f981c | 2012-02-27 16:58:41 -0800 | [diff] [blame] | 641 | if (machine_is_apq8064_cdp() || | 
|  | 642 | machine_is_apq8064_liquid()) { | 
| Huaibin Yang | 02f981c | 2012-02-27 16:58:41 -0800 | [diff] [blame] | 643 | if ((SOCINFO_VERSION_MAJOR(ver) == 1) && | 
|  | 644 | (SOCINFO_VERSION_MINOR(ver) == 0)) | 
| Zhang Chang Ken | 4a07fcb | 2012-06-03 11:24:51 -0400 | [diff] [blame] | 645 | return LVDS_PIXEL_MAP_PATTERN_1; | 
|  | 646 | } else if (machine_is_mpq8064_dtv()) { | 
| Lei Zhou | 34e216d | 2012-07-25 12:52:13 -0400 | [diff] [blame] | 647 | if ((SOCINFO_VERSION_MAJOR(ver) == 1) && | 
|  | 648 | (SOCINFO_VERSION_MINOR(ver) == 0)) | 
|  | 649 | return LVDS_PIXEL_MAP_PATTERN_2; | 
| Huaibin Yang | 02f981c | 2012-02-27 16:58:41 -0800 | [diff] [blame] | 650 | } | 
|  | 651 | return 0; | 
|  | 652 | } | 
|  | 653 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 654 | static struct lcdc_platform_data lvds_pdata = { | 
|  | 655 | .lcdc_power_save = lvds_panel_power, | 
| Huaibin Yang | 02f981c | 2012-02-27 16:58:41 -0800 | [diff] [blame] | 656 | .lvds_pixel_remap = lvds_pixel_remap | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 657 | }; | 
|  | 658 |  | 
|  | 659 | #define LPM_CHANNEL 2 | 
|  | 660 | static int lvds_chimei_gpio[] = {LPM_CHANNEL}; | 
|  | 661 |  | 
|  | 662 | static struct lvds_panel_platform_data lvds_chimei_pdata = { | 
|  | 663 | .gpio = lvds_chimei_gpio, | 
|  | 664 | }; | 
|  | 665 |  | 
|  | 666 | static struct platform_device lvds_chimei_panel_device = { | 
|  | 667 | .name = "lvds_chimei_wxga", | 
|  | 668 | .id = 0, | 
|  | 669 | .dev = { | 
|  | 670 | .platform_data = &lvds_chimei_pdata, | 
|  | 671 | } | 
|  | 672 | }; | 
|  | 673 |  | 
| Zhang Chang Ken | 4a07fcb | 2012-06-03 11:24:51 -0400 | [diff] [blame] | 674 | #define FRC_GPIO_UPDATE	(SX150X_EXP4_GPIO_BASE + 8) | 
|  | 675 | #define FRC_GPIO_RESET	(SX150X_EXP4_GPIO_BASE + 9) | 
|  | 676 | #define FRC_GPIO_PWR	(SX150X_EXP4_GPIO_BASE + 10) | 
|  | 677 |  | 
|  | 678 | static int lvds_frc_gpio[] = {FRC_GPIO_UPDATE, FRC_GPIO_RESET, FRC_GPIO_PWR}; | 
|  | 679 | static struct lvds_panel_platform_data lvds_frc_pdata = { | 
|  | 680 | .gpio = lvds_frc_gpio, | 
|  | 681 | }; | 
|  | 682 |  | 
|  | 683 | static struct platform_device lvds_frc_panel_device = { | 
|  | 684 | .name = "lvds_frc_fhd", | 
|  | 685 | .id = 0, | 
|  | 686 | .dev = { | 
|  | 687 | .platform_data = &lvds_frc_pdata, | 
|  | 688 | } | 
|  | 689 | }; | 
|  | 690 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 691 | static int dsi2lvds_gpio[2] = { | 
|  | 692 | LPM_CHANNEL,/* Backlight PWM-ID=0 for PMIC-GPIO#24 */ | 
|  | 693 | 0x1F08 /* DSI2LVDS Bridge GPIO Output, mask=0x1f, out=0x08 */ | 
|  | 694 | }; | 
|  | 695 | static struct msm_panel_common_pdata mipi_dsi2lvds_pdata = { | 
|  | 696 | .gpio_num = dsi2lvds_gpio, | 
|  | 697 | }; | 
|  | 698 |  | 
|  | 699 | static struct platform_device mipi_dsi2lvds_bridge_device = { | 
|  | 700 | .name = "mipi_tc358764", | 
|  | 701 | .id = 0, | 
|  | 702 | .dev.platform_data = &mipi_dsi2lvds_pdata, | 
|  | 703 | }; | 
|  | 704 |  | 
|  | 705 | static int toshiba_gpio[] = {LPM_CHANNEL}; | 
|  | 706 | static struct mipi_dsi_panel_platform_data toshiba_pdata = { | 
|  | 707 | .gpio = toshiba_gpio, | 
|  | 708 | }; | 
|  | 709 |  | 
|  | 710 | static struct platform_device mipi_dsi_toshiba_panel_device = { | 
|  | 711 | .name = "mipi_toshiba", | 
|  | 712 | .id = 0, | 
|  | 713 | .dev = { | 
|  | 714 | .platform_data = &toshiba_pdata, | 
|  | 715 | } | 
|  | 716 | }; | 
|  | 717 |  | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 718 | static struct msm_bus_vectors dtv_bus_init_vectors[] = { | 
|  | 719 | { | 
|  | 720 | .src = MSM_BUS_MASTER_MDP_PORT0, | 
|  | 721 | .dst = MSM_BUS_SLAVE_EBI_CH0, | 
|  | 722 | .ab = 0, | 
|  | 723 | .ib = 0, | 
|  | 724 | }, | 
|  | 725 | }; | 
|  | 726 |  | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 727 | static struct msm_bus_vectors dtv_bus_def_vectors[] = { | 
|  | 728 | { | 
|  | 729 | .src = MSM_BUS_MASTER_MDP_PORT0, | 
|  | 730 | .dst = MSM_BUS_SLAVE_EBI_CH0, | 
|  | 731 | .ab = 566092800 * 2, | 
|  | 732 | .ib = 707616000 * 2, | 
|  | 733 | }, | 
|  | 734 | }; | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 735 |  | 
|  | 736 | static struct msm_bus_paths dtv_bus_scale_usecases[] = { | 
|  | 737 | { | 
|  | 738 | ARRAY_SIZE(dtv_bus_init_vectors), | 
|  | 739 | dtv_bus_init_vectors, | 
|  | 740 | }, | 
|  | 741 | { | 
|  | 742 | ARRAY_SIZE(dtv_bus_def_vectors), | 
|  | 743 | dtv_bus_def_vectors, | 
|  | 744 | }, | 
|  | 745 | }; | 
|  | 746 | static struct msm_bus_scale_pdata dtv_bus_scale_pdata = { | 
|  | 747 | dtv_bus_scale_usecases, | 
|  | 748 | ARRAY_SIZE(dtv_bus_scale_usecases), | 
|  | 749 | .name = "dtv", | 
|  | 750 | }; | 
|  | 751 |  | 
|  | 752 | static struct lcdc_platform_data dtv_pdata = { | 
|  | 753 | .bus_scale_table = &dtv_bus_scale_pdata, | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 754 | .lcdc_power_save = hdmi_panel_power, | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 755 | }; | 
|  | 756 |  | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 757 | static int hdmi_panel_power(int on) | 
|  | 758 | { | 
|  | 759 | int rc; | 
|  | 760 |  | 
|  | 761 | pr_debug("%s: HDMI Core: %s\n", __func__, (on ? "ON" : "OFF")); | 
|  | 762 | rc = hdmi_core_power(on, 1); | 
|  | 763 | if (rc) | 
|  | 764 | rc = hdmi_cec_power(on); | 
|  | 765 |  | 
|  | 766 | pr_debug("%s: HDMI Core: %s Success\n", __func__, (on ? "ON" : "OFF")); | 
|  | 767 | return rc; | 
|  | 768 | } | 
|  | 769 |  | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 770 | static int hdmi_enable_5v(int on) | 
|  | 771 | { | 
|  | 772 | /* TBD: PM8921 regulator instead of 8901 */ | 
|  | 773 | static struct regulator *reg_8921_hdmi_mvs;	/* HDMI_5V */ | 
|  | 774 | static int prev_on; | 
|  | 775 | int rc; | 
|  | 776 |  | 
|  | 777 | if (on == prev_on) | 
|  | 778 | return 0; | 
|  | 779 |  | 
|  | 780 | if (!reg_8921_hdmi_mvs) { | 
|  | 781 | reg_8921_hdmi_mvs = regulator_get(&hdmi_msm_device.dev, | 
|  | 782 | "hdmi_mvs"); | 
|  | 783 | if (IS_ERR(reg_8921_hdmi_mvs)) { | 
|  | 784 | pr_err("could not get reg_8921_hdmi_mvs, rc = %ld\n", | 
|  | 785 | PTR_ERR(reg_8921_hdmi_mvs)); | 
|  | 786 | reg_8921_hdmi_mvs = NULL; | 
|  | 787 | return -ENODEV; | 
|  | 788 | } | 
|  | 789 | } | 
|  | 790 |  | 
|  | 791 | if (on) { | 
|  | 792 | rc = regulator_enable(reg_8921_hdmi_mvs); | 
|  | 793 | if (rc) { | 
|  | 794 | pr_err("'%s' regulator enable failed, rc=%d\n", | 
|  | 795 | "8921_hdmi_mvs", rc); | 
|  | 796 | return rc; | 
|  | 797 | } | 
|  | 798 | pr_debug("%s(on): success\n", __func__); | 
|  | 799 | } else { | 
|  | 800 | rc = regulator_disable(reg_8921_hdmi_mvs); | 
|  | 801 | if (rc) | 
|  | 802 | pr_warning("'%s' regulator disable failed, rc=%d\n", | 
|  | 803 | "8921_hdmi_mvs", rc); | 
|  | 804 | pr_debug("%s(off): success\n", __func__); | 
|  | 805 | } | 
|  | 806 |  | 
|  | 807 | prev_on = on; | 
|  | 808 |  | 
|  | 809 | return 0; | 
|  | 810 | } | 
|  | 811 |  | 
|  | 812 | static int hdmi_core_power(int on, int show) | 
|  | 813 | { | 
|  | 814 | static struct regulator *reg_8921_lvs7, *reg_8921_s4, *reg_ext_3p3v; | 
|  | 815 | static int prev_on; | 
|  | 816 | int rc; | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 817 |  | 
|  | 818 | if (on == prev_on) | 
|  | 819 | return 0; | 
|  | 820 |  | 
|  | 821 | /* TBD: PM8921 regulator instead of 8901 */ | 
|  | 822 | if (!reg_ext_3p3v) { | 
|  | 823 | reg_ext_3p3v = regulator_get(&hdmi_msm_device.dev, | 
|  | 824 | "hdmi_mux_vdd"); | 
|  | 825 | if (IS_ERR_OR_NULL(reg_ext_3p3v)) { | 
|  | 826 | pr_err("could not get reg_ext_3p3v, rc = %ld\n", | 
|  | 827 | PTR_ERR(reg_ext_3p3v)); | 
|  | 828 | reg_ext_3p3v = NULL; | 
|  | 829 | return -ENODEV; | 
|  | 830 | } | 
|  | 831 | } | 
|  | 832 |  | 
|  | 833 | if (!reg_8921_lvs7) { | 
|  | 834 | reg_8921_lvs7 = regulator_get(&hdmi_msm_device.dev, | 
|  | 835 | "hdmi_vdda"); | 
|  | 836 | if (IS_ERR(reg_8921_lvs7)) { | 
|  | 837 | pr_err("could not get reg_8921_lvs7, rc = %ld\n", | 
|  | 838 | PTR_ERR(reg_8921_lvs7)); | 
|  | 839 | reg_8921_lvs7 = NULL; | 
|  | 840 | return -ENODEV; | 
|  | 841 | } | 
|  | 842 | } | 
|  | 843 | if (!reg_8921_s4) { | 
|  | 844 | reg_8921_s4 = regulator_get(&hdmi_msm_device.dev, | 
|  | 845 | "hdmi_lvl_tsl"); | 
|  | 846 | if (IS_ERR(reg_8921_s4)) { | 
|  | 847 | pr_err("could not get reg_8921_s4, rc = %ld\n", | 
|  | 848 | PTR_ERR(reg_8921_s4)); | 
|  | 849 | reg_8921_s4 = NULL; | 
|  | 850 | return -ENODEV; | 
|  | 851 | } | 
|  | 852 | rc = regulator_set_voltage(reg_8921_s4, 1800000, 1800000); | 
|  | 853 | if (rc) { | 
|  | 854 | pr_err("set_voltage failed for 8921_s4, rc=%d\n", rc); | 
|  | 855 | return -EINVAL; | 
|  | 856 | } | 
|  | 857 | } | 
|  | 858 |  | 
|  | 859 | if (on) { | 
|  | 860 | /* | 
|  | 861 | * Configure 3P3V_BOOST_EN as GPIO, 8mA drive strength, | 
|  | 862 | * pull none, out-high | 
|  | 863 | */ | 
|  | 864 | rc = regulator_set_optimum_mode(reg_ext_3p3v, 290000); | 
|  | 865 | if (rc < 0) { | 
|  | 866 | pr_err("set_optimum_mode ext_3p3v failed, rc=%d\n", rc); | 
|  | 867 | return -EINVAL; | 
|  | 868 | } | 
|  | 869 |  | 
|  | 870 | rc = regulator_enable(reg_ext_3p3v); | 
|  | 871 | if (rc) { | 
|  | 872 | pr_err("enable reg_ext_3p3v failed, rc=%d\n", rc); | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 873 | return rc; | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 874 | } | 
|  | 875 | rc = regulator_enable(reg_8921_lvs7); | 
|  | 876 | if (rc) { | 
|  | 877 | pr_err("'%s' regulator enable failed, rc=%d\n", | 
|  | 878 | "hdmi_vdda", rc); | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 879 | goto error1; | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 880 | } | 
|  | 881 | rc = regulator_enable(reg_8921_s4); | 
|  | 882 | if (rc) { | 
|  | 883 | pr_err("'%s' regulator enable failed, rc=%d\n", | 
|  | 884 | "hdmi_lvl_tsl", rc); | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 885 | goto error2; | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 886 | } | 
| Ajay Singh Parmar | 7d11c27 | 2012-06-07 12:25:31 +0530 | [diff] [blame] | 887 | pr_debug("%s(on): success\n", __func__); | 
|  | 888 | } else { | 
|  | 889 | rc = regulator_disable(reg_ext_3p3v); | 
|  | 890 | if (rc) { | 
|  | 891 | pr_err("disable reg_ext_3p3v failed, rc=%d\n", rc); | 
|  | 892 | return -ENODEV; | 
|  | 893 | } | 
|  | 894 | rc = regulator_disable(reg_8921_lvs7); | 
|  | 895 | if (rc) { | 
|  | 896 | pr_err("disable reg_8921_l23 failed, rc=%d\n", rc); | 
|  | 897 | return -ENODEV; | 
|  | 898 | } | 
|  | 899 | rc = regulator_disable(reg_8921_s4); | 
|  | 900 | if (rc) { | 
|  | 901 | pr_err("disable reg_8921_s4 failed, rc=%d\n", rc); | 
|  | 902 | return -ENODEV; | 
|  | 903 | } | 
|  | 904 | pr_debug("%s(off): success\n", __func__); | 
|  | 905 | } | 
|  | 906 |  | 
|  | 907 | prev_on = on; | 
|  | 908 |  | 
|  | 909 | return 0; | 
|  | 910 |  | 
|  | 911 | error2: | 
|  | 912 | regulator_disable(reg_8921_lvs7); | 
|  | 913 | error1: | 
|  | 914 | regulator_disable(reg_ext_3p3v); | 
|  | 915 | return rc; | 
|  | 916 | } | 
|  | 917 |  | 
|  | 918 | static int hdmi_gpio_config(int on) | 
|  | 919 | { | 
|  | 920 | int rc = 0; | 
|  | 921 | static int prev_on; | 
|  | 922 | int pmic_gpio14 = PM8921_GPIO_PM_TO_SYS(14); | 
|  | 923 |  | 
|  | 924 | if (on == prev_on) | 
|  | 925 | return 0; | 
|  | 926 |  | 
|  | 927 | if (on) { | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 928 | rc = gpio_request(HDMI_DDC_CLK_GPIO, "HDMI_DDC_CLK"); | 
|  | 929 | if (rc) { | 
|  | 930 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", | 
|  | 931 | "HDMI_DDC_CLK", HDMI_DDC_CLK_GPIO, rc); | 
|  | 932 | goto error1; | 
|  | 933 | } | 
|  | 934 | rc = gpio_request(HDMI_DDC_DATA_GPIO, "HDMI_DDC_DATA"); | 
|  | 935 | if (rc) { | 
|  | 936 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", | 
|  | 937 | "HDMI_DDC_DATA", HDMI_DDC_DATA_GPIO, rc); | 
|  | 938 | goto error2; | 
|  | 939 | } | 
|  | 940 | rc = gpio_request(HDMI_HPD_GPIO, "HDMI_HPD"); | 
|  | 941 | if (rc) { | 
|  | 942 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", | 
|  | 943 | "HDMI_HPD", HDMI_HPD_GPIO, rc); | 
|  | 944 | goto error3; | 
|  | 945 | } | 
|  | 946 | if (machine_is_apq8064_liquid()) { | 
|  | 947 | rc = gpio_request(pmic_gpio14, "PMIC_HDMI_MUX_SEL"); | 
|  | 948 | if (rc) { | 
|  | 949 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", | 
|  | 950 | "PMIC_HDMI_MUX_SEL", 14, rc); | 
|  | 951 | goto error4; | 
|  | 952 | } | 
|  | 953 | gpio_set_value_cansleep(pmic_gpio14, 0); | 
|  | 954 | } | 
|  | 955 | pr_debug("%s(on): success\n", __func__); | 
|  | 956 | } else { | 
|  | 957 | gpio_free(HDMI_DDC_CLK_GPIO); | 
|  | 958 | gpio_free(HDMI_DDC_DATA_GPIO); | 
|  | 959 | gpio_free(HDMI_HPD_GPIO); | 
|  | 960 |  | 
|  | 961 | if (machine_is_apq8064_liquid()) { | 
|  | 962 | gpio_set_value_cansleep(pmic_gpio14, 1); | 
|  | 963 | gpio_free(pmic_gpio14); | 
|  | 964 | } | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 965 | pr_debug("%s(off): success\n", __func__); | 
|  | 966 | } | 
|  | 967 |  | 
|  | 968 | prev_on = on; | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 969 | return 0; | 
|  | 970 |  | 
|  | 971 | error4: | 
|  | 972 | gpio_free(HDMI_HPD_GPIO); | 
|  | 973 | error3: | 
|  | 974 | gpio_free(HDMI_DDC_DATA_GPIO); | 
|  | 975 | error2: | 
|  | 976 | gpio_free(HDMI_DDC_CLK_GPIO); | 
|  | 977 | error1: | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 978 | return rc; | 
|  | 979 | } | 
|  | 980 |  | 
|  | 981 | static int hdmi_cec_power(int on) | 
|  | 982 | { | 
|  | 983 | static int prev_on; | 
|  | 984 | int rc; | 
|  | 985 |  | 
|  | 986 | if (on == prev_on) | 
|  | 987 | return 0; | 
|  | 988 |  | 
|  | 989 | if (on) { | 
|  | 990 | rc = gpio_request(HDMI_CEC_VAR_GPIO, "HDMI_CEC_VAR"); | 
|  | 991 | if (rc) { | 
|  | 992 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", | 
|  | 993 | "HDMI_CEC_VAR", HDMI_CEC_VAR_GPIO, rc); | 
|  | 994 | goto error; | 
|  | 995 | } | 
|  | 996 | pr_debug("%s(on): success\n", __func__); | 
|  | 997 | } else { | 
|  | 998 | gpio_free(HDMI_CEC_VAR_GPIO); | 
|  | 999 | pr_debug("%s(off): success\n", __func__); | 
|  | 1000 | } | 
|  | 1001 |  | 
|  | 1002 | prev_on = on; | 
|  | 1003 |  | 
|  | 1004 | return 0; | 
|  | 1005 | error: | 
|  | 1006 | return rc; | 
|  | 1007 | } | 
|  | 1008 |  | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 1009 | void __init apq8064_init_fb(void) | 
|  | 1010 | { | 
|  | 1011 | platform_device_register(&msm_fb_device); | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 1012 | platform_device_register(&lvds_chimei_panel_device); | 
|  | 1013 |  | 
| Mohan Kumar Gubbihalli Lachma Naik | cb7d4e7 | 2012-03-23 18:17:30 -0700 | [diff] [blame] | 1014 | #ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL | 
|  | 1015 | platform_device_register(&wfd_panel_device); | 
|  | 1016 | platform_device_register(&wfd_device); | 
|  | 1017 | #endif | 
|  | 1018 |  | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 1019 | if (machine_is_apq8064_liquid()) | 
|  | 1020 | platform_device_register(&mipi_dsi2lvds_bridge_device); | 
|  | 1021 | if (machine_is_apq8064_mtp()) | 
|  | 1022 | platform_device_register(&mipi_dsi_toshiba_panel_device); | 
| Zhang Chang Ken | 4a07fcb | 2012-06-03 11:24:51 -0400 | [diff] [blame] | 1023 | if (machine_is_mpq8064_dtv()) | 
|  | 1024 | platform_device_register(&lvds_frc_panel_device); | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 1025 |  | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 1026 | msm_fb_register_device("mdp", &mdp_pdata); | 
| Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 1027 | msm_fb_register_device("lvds", &lvds_pdata); | 
|  | 1028 | msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata); | 
| Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 1029 | platform_device_register(&hdmi_msm_device); | 
|  | 1030 | msm_fb_register_device("dtv", &dtv_pdata); | 
| Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 1031 | } | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 1032 |  | 
|  | 1033 | /** | 
|  | 1034 | * Set MDP clocks to high frequency to avoid DSI underflow | 
|  | 1035 | * when using high resolution 1200x1920 WUXGA panels | 
|  | 1036 | */ | 
|  | 1037 | static void set_mdp_clocks_for_wuxga(void) | 
|  | 1038 | { | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 1039 | mdp_ui_vectors[0].ab = 2000000000; | 
|  | 1040 | mdp_ui_vectors[0].ib = 2000000000; | 
|  | 1041 | mdp_vga_vectors[0].ab = 2000000000; | 
|  | 1042 | mdp_vga_vectors[0].ib = 2000000000; | 
|  | 1043 | mdp_720p_vectors[0].ab = 2000000000; | 
|  | 1044 | mdp_720p_vectors[0].ib = 2000000000; | 
|  | 1045 | mdp_1080p_vectors[0].ab = 2000000000; | 
|  | 1046 | mdp_1080p_vectors[0].ib = 2000000000; | 
|  | 1047 |  | 
| Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 1048 | if (apq8064_hdmi_as_primary_selected()) { | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 1049 | dtv_bus_def_vectors[0].ab = 2000000000; | 
|  | 1050 | dtv_bus_def_vectors[0].ib = 2000000000; | 
|  | 1051 | } | 
|  | 1052 | } | 
|  | 1053 |  | 
| Ajay Singh Parmar | 6b82d2b | 2012-07-19 17:23:26 +0530 | [diff] [blame] | 1054 | void __init apq8064_set_display_params(char *prim_panel, char *ext_panel, | 
|  | 1055 | unsigned char resolution) | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 1056 | { | 
| Aravind Venkateswaran | d98bc43 | 2012-04-04 16:19:06 -0700 | [diff] [blame] | 1057 | /* | 
|  | 1058 | * For certain MPQ boards, HDMI should be set as primary display | 
|  | 1059 | * by default, with the flexibility to specify any other panel | 
|  | 1060 | * as a primary panel through boot parameters. | 
|  | 1061 | */ | 
|  | 1062 | if (machine_is_mpq8064_hrd() || machine_is_mpq8064_cdp()) { | 
|  | 1063 | pr_debug("HDMI is the primary display by default for MPQ\n"); | 
|  | 1064 | if (!strnlen(prim_panel, PANEL_NAME_MAX_LEN)) | 
|  | 1065 | strlcpy(msm_fb_pdata.prim_panel_name, HDMI_PANEL_NAME, | 
|  | 1066 | PANEL_NAME_MAX_LEN); | 
|  | 1067 | } | 
|  | 1068 |  | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 1069 | if (strnlen(prim_panel, PANEL_NAME_MAX_LEN)) { | 
|  | 1070 | strlcpy(msm_fb_pdata.prim_panel_name, prim_panel, | 
|  | 1071 | PANEL_NAME_MAX_LEN); | 
|  | 1072 | pr_debug("msm_fb_pdata.prim_panel_name %s\n", | 
|  | 1073 | msm_fb_pdata.prim_panel_name); | 
|  | 1074 |  | 
|  | 1075 | if (!strncmp((char *)msm_fb_pdata.prim_panel_name, | 
|  | 1076 | HDMI_PANEL_NAME, strnlen(HDMI_PANEL_NAME, | 
|  | 1077 | PANEL_NAME_MAX_LEN))) { | 
|  | 1078 | pr_debug("HDMI is the primary display by" | 
|  | 1079 | " boot parameter\n"); | 
|  | 1080 | hdmi_is_primary = 1; | 
|  | 1081 | set_mdp_clocks_for_wuxga(); | 
|  | 1082 | } | 
|  | 1083 | } | 
|  | 1084 | if (strnlen(ext_panel, PANEL_NAME_MAX_LEN)) { | 
|  | 1085 | strlcpy(msm_fb_pdata.ext_panel_name, ext_panel, | 
|  | 1086 | PANEL_NAME_MAX_LEN); | 
|  | 1087 | pr_debug("msm_fb_pdata.ext_panel_name %s\n", | 
|  | 1088 | msm_fb_pdata.ext_panel_name); | 
| Aravind Venkateswaran | 7f934ae | 2012-08-20 14:43:23 -0700 | [diff] [blame] | 1089 |  | 
|  | 1090 | if (!strncmp((char *)msm_fb_pdata.ext_panel_name, | 
|  | 1091 | MHL_PANEL_NAME, strnlen(MHL_PANEL_NAME, | 
|  | 1092 | PANEL_NAME_MAX_LEN))) { | 
|  | 1093 | pr_debug("MHL is external display by boot parameter\n"); | 
|  | 1094 | mhl_display_enabled = 1; | 
|  | 1095 | } | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 1096 | } | 
| Ajay Singh Parmar | 6b82d2b | 2012-07-19 17:23:26 +0530 | [diff] [blame] | 1097 |  | 
|  | 1098 | msm_fb_pdata.ext_resolution = resolution; | 
| Aravind Venkateswaran | 7f934ae | 2012-08-20 14:43:23 -0700 | [diff] [blame] | 1099 | hdmi_msm_data.is_mhl_enabled = mhl_display_enabled; | 
| Aravind Venkateswaran | 8ac7f41 | 2012-03-16 17:57:30 -0700 | [diff] [blame] | 1100 | } |