Nagamalleswararao Ganji | 70fac1e | 2011-12-29 19:06:37 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -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> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/bootmem.h> |
| 18 | #include <asm/mach-types.h> |
| 19 | #include <mach/msm_bus_board.h> |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 20 | #include <mach/msm_memtypes.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 21 | #include <mach/board.h> |
| 22 | #include <mach/gpio.h> |
| 23 | #include <mach/gpiomux.h> |
Ajay Dudani | 9114be7 | 2011-12-03 07:46:35 -0800 | [diff] [blame] | 24 | #include <mach/socinfo.h> |
Nagamalleswararao Ganji | 937a119 | 2011-12-07 19:00:52 -0800 | [diff] [blame] | 25 | #include <linux/ion.h> |
| 26 | #include <mach/ion.h> |
| 27 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 28 | #include "devices.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 29 | #include "board-8930.h" |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 30 | |
| 31 | #ifdef CONFIG_FB_MSM_TRIPLE_BUFFER |
Padmanabhan Komanduru | ede0a63 | 2012-01-25 12:01:28 +0530 | [diff] [blame] | 32 | #define MSM_FB_PRIM_BUF_SIZE \ |
| 33 | (roundup((1376 * 768 * 4), 4096) * 3) /* 4 bpp x 3 pages */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 34 | #else |
Padmanabhan Komanduru | ede0a63 | 2012-01-25 12:01:28 +0530 | [diff] [blame] | 35 | #define MSM_FB_PRIM_BUF_SIZE \ |
| 36 | (roundup((1376 * 768 * 4), 4096) * 2) /* 4 bpp x 2 pages */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 37 | #endif |
| 38 | |
| 39 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
Padmanabhan Komanduru | ede0a63 | 2012-01-25 12:01:28 +0530 | [diff] [blame] | 40 | #define MSM_FB_EXT_BUF_SIZE \ |
| 41 | (roundup((1920 * 1088 * 2), 4096) * 1) /* 2 bpp x 1 page */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 42 | #elif defined(CONFIG_FB_MSM_TVOUT) |
Padmanabhan Komanduru | ede0a63 | 2012-01-25 12:01:28 +0530 | [diff] [blame] | 43 | #define MSM_FB_EXT_BUF_SIZE \ |
| 44 | (roundup((720 * 576 * 2), 4096) * 2) /* 2 bpp x 2 pages */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 45 | #else |
| 46 | #define MSM_FB_EXT_BUF_SIZE 0 |
| 47 | #endif |
| 48 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 49 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 50 | /* 4 bpp x 2 page HDMI case */ |
| 51 | #define MSM_FB_SIZE roundup((1920 * 1088 * 4 * 2), 4096) |
| 52 | #else |
| 53 | /* Note: must be multiple of 4096 */ |
Huaibin Yang | 27634b8 | 2011-12-09 00:16:25 -0800 | [diff] [blame] | 54 | #define MSM_FB_SIZE roundup(MSM_FB_PRIM_BUF_SIZE + MSM_FB_EXT_BUF_SIZE, 4096) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 55 | #endif |
| 56 | |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 57 | #ifdef CONFIG_FB_MSM_OVERLAY0_WRITEBACK |
| 58 | #define MSM_FB_OVERLAY0_WRITEBACK_SIZE roundup((1376 * 768 * 3 * 2), 4096) |
| 59 | #else |
| 60 | #define MSM_FB_OVERLAY0_WRITEBACK_SIZE (0) |
| 61 | #endif /* CONFIG_FB_MSM_OVERLAY0_WRITEBACK */ |
| 62 | |
| 63 | #ifdef CONFIG_FB_MSM_OVERLAY1_WRITEBACK |
| 64 | #define MSM_FB_OVERLAY1_WRITEBACK_SIZE roundup((1920 * 1088 * 3 * 2), 4096) |
| 65 | #else |
| 66 | #define MSM_FB_OVERLAY1_WRITEBACK_SIZE (0) |
| 67 | #endif /* CONFIG_FB_MSM_OVERLAY1_WRITEBACK */ |
| 68 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 69 | #define MDP_VSYNC_GPIO 0 |
| 70 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 71 | #define MIPI_CMD_NOVATEK_QHD_PANEL_NAME "mipi_cmd_novatek_qhd" |
| 72 | #define MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME "mipi_video_novatek_qhd" |
| 73 | #define MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME "mipi_video_toshiba_wsvga" |
| 74 | #define MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME "mipi_video_chimei_wxga" |
| 75 | #define MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME "mipi_video_simulator_vga" |
| 76 | #define MIPI_CMD_RENESAS_FWVGA_PANEL_NAME "mipi_cmd_renesas_fwvga" |
| 77 | #define HDMI_PANEL_NAME "hdmi_msm" |
| 78 | #define TVOUT_PANEL_NAME "tvout_msm" |
| 79 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 80 | static struct resource msm_fb_resources[] = { |
| 81 | { |
| 82 | .flags = IORESOURCE_DMA, |
| 83 | } |
| 84 | }; |
| 85 | |
| 86 | static int msm_fb_detect_panel(const char *name) |
| 87 | { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 88 | if (!strncmp(name, MIPI_CMD_NOVATEK_QHD_PANEL_NAME, |
| 89 | strnlen(MIPI_CMD_NOVATEK_QHD_PANEL_NAME, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 90 | PANEL_NAME_MAX_LEN))) |
| 91 | return 0; |
| 92 | |
Ravishangar Kalyanam | a4286d7 | 2012-02-15 16:09:58 -0800 | [diff] [blame] | 93 | #if !defined(CONFIG_FB_MSM_LVDS_MIPI_PANEL_DETECT) && \ |
| 94 | !defined(CONFIG_FB_MSM_MIPI_PANEL_DETECT) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 95 | if (!strncmp(name, MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME, |
| 96 | strnlen(MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME, |
| 97 | PANEL_NAME_MAX_LEN))) |
| 98 | return 0; |
| 99 | |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 100 | if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME, |
| 101 | strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 102 | PANEL_NAME_MAX_LEN))) |
| 103 | return 0; |
| 104 | |
| 105 | if (!strncmp(name, MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME, |
| 106 | strnlen(MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME, |
| 107 | PANEL_NAME_MAX_LEN))) |
| 108 | return 0; |
| 109 | |
| 110 | if (!strncmp(name, MIPI_CMD_RENESAS_FWVGA_PANEL_NAME, |
| 111 | strnlen(MIPI_CMD_RENESAS_FWVGA_PANEL_NAME, |
| 112 | PANEL_NAME_MAX_LEN))) |
| 113 | return 0; |
| 114 | #endif |
| 115 | |
| 116 | if (!strncmp(name, HDMI_PANEL_NAME, |
| 117 | strnlen(HDMI_PANEL_NAME, |
| 118 | PANEL_NAME_MAX_LEN))) |
| 119 | return 0; |
| 120 | |
| 121 | if (!strncmp(name, TVOUT_PANEL_NAME, |
| 122 | strnlen(TVOUT_PANEL_NAME, |
| 123 | PANEL_NAME_MAX_LEN))) |
| 124 | return 0; |
| 125 | |
| 126 | pr_warning("%s: not supported '%s'", __func__, name); |
| 127 | return -ENODEV; |
| 128 | } |
| 129 | |
| 130 | static struct msm_fb_platform_data msm_fb_pdata = { |
| 131 | .detect_client = msm_fb_detect_panel, |
| 132 | }; |
| 133 | |
| 134 | static struct platform_device msm_fb_device = { |
| 135 | .name = "msm_fb", |
| 136 | .id = 0, |
| 137 | .num_resources = ARRAY_SIZE(msm_fb_resources), |
| 138 | .resource = msm_fb_resources, |
| 139 | .dev.platform_data = &msm_fb_pdata, |
| 140 | }; |
| 141 | |
| 142 | static bool dsi_power_on; |
| 143 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 144 | /* |
| 145 | * TODO: When physical 8930/PM8038 hardware becomes |
| 146 | * available, replace mipi_dsi_cdp_panel_power with |
| 147 | * appropriate function. |
| 148 | */ |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 149 | #define DISP_RST_GPIO 58 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 150 | static int mipi_dsi_cdp_panel_power(int on) |
| 151 | { |
| 152 | static struct regulator *reg_l8, *reg_l23, *reg_l2; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 153 | int rc; |
| 154 | |
Jeff Ohlstein | 2cbe5ba | 2011-12-16 13:32:56 -0800 | [diff] [blame] | 155 | pr_debug("%s: state : %d\n", __func__, on); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 156 | |
| 157 | if (!dsi_power_on) { |
| 158 | |
| 159 | reg_l8 = regulator_get(&msm_mipi_dsi1_device.dev, |
| 160 | "dsi_vdc"); |
| 161 | if (IS_ERR(reg_l8)) { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 162 | pr_err("could not get 8038_l8, rc = %ld\n", |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 163 | PTR_ERR(reg_l8)); |
| 164 | return -ENODEV; |
| 165 | } |
| 166 | reg_l23 = regulator_get(&msm_mipi_dsi1_device.dev, |
| 167 | "dsi_vddio"); |
| 168 | if (IS_ERR(reg_l23)) { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 169 | pr_err("could not get 8038_l23, rc = %ld\n", |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 170 | PTR_ERR(reg_l23)); |
| 171 | return -ENODEV; |
| 172 | } |
| 173 | reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev, |
| 174 | "dsi_vdda"); |
| 175 | if (IS_ERR(reg_l2)) { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 176 | pr_err("could not get 8038_l2, rc = %ld\n", |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 177 | PTR_ERR(reg_l2)); |
| 178 | return -ENODEV; |
| 179 | } |
| 180 | rc = regulator_set_voltage(reg_l8, 2800000, 3000000); |
| 181 | if (rc) { |
| 182 | pr_err("set_voltage l8 failed, rc=%d\n", rc); |
| 183 | return -EINVAL; |
| 184 | } |
| 185 | rc = regulator_set_voltage(reg_l23, 1800000, 1800000); |
| 186 | if (rc) { |
| 187 | pr_err("set_voltage l23 failed, rc=%d\n", rc); |
| 188 | return -EINVAL; |
| 189 | } |
| 190 | rc = regulator_set_voltage(reg_l2, 1200000, 1200000); |
| 191 | if (rc) { |
| 192 | pr_err("set_voltage l2 failed, rc=%d\n", rc); |
| 193 | return -EINVAL; |
| 194 | } |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 195 | rc = gpio_request(DISP_RST_GPIO, "disp_rst_n"); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 196 | if (rc) { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 197 | pr_err("request gpio DISP_RST_GPIO failed, rc=%d\n", |
| 198 | rc); |
| 199 | gpio_free(DISP_RST_GPIO); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 200 | return -ENODEV; |
| 201 | } |
| 202 | dsi_power_on = true; |
| 203 | } |
| 204 | if (on) { |
| 205 | rc = regulator_set_optimum_mode(reg_l8, 100000); |
| 206 | if (rc < 0) { |
| 207 | pr_err("set_optimum_mode l8 failed, rc=%d\n", rc); |
| 208 | return -EINVAL; |
| 209 | } |
| 210 | rc = regulator_set_optimum_mode(reg_l23, 100000); |
| 211 | if (rc < 0) { |
| 212 | pr_err("set_optimum_mode l23 failed, rc=%d\n", rc); |
| 213 | return -EINVAL; |
| 214 | } |
| 215 | rc = regulator_set_optimum_mode(reg_l2, 100000); |
| 216 | if (rc < 0) { |
| 217 | pr_err("set_optimum_mode l2 failed, rc=%d\n", rc); |
| 218 | return -EINVAL; |
| 219 | } |
| 220 | rc = regulator_enable(reg_l8); |
| 221 | if (rc) { |
| 222 | pr_err("enable l8 failed, rc=%d\n", rc); |
| 223 | return -ENODEV; |
| 224 | } |
| 225 | rc = regulator_enable(reg_l23); |
| 226 | if (rc) { |
| 227 | pr_err("enable l8 failed, rc=%d\n", rc); |
| 228 | return -ENODEV; |
| 229 | } |
| 230 | rc = regulator_enable(reg_l2); |
| 231 | if (rc) { |
| 232 | pr_err("enable l2 failed, rc=%d\n", rc); |
| 233 | return -ENODEV; |
| 234 | } |
Ravishangar Kalyanam | 87c5fb6 | 2012-01-28 21:24:58 -0800 | [diff] [blame] | 235 | usleep(10000); |
| 236 | gpio_set_value(DISP_RST_GPIO, 1); |
| 237 | usleep(10); |
| 238 | gpio_set_value(DISP_RST_GPIO, 0); |
| 239 | usleep(20); |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 240 | gpio_set_value(DISP_RST_GPIO, 1); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 241 | } else { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 242 | |
| 243 | gpio_set_value(DISP_RST_GPIO, 0); |
| 244 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 245 | rc = regulator_disable(reg_l2); |
| 246 | if (rc) { |
| 247 | pr_err("disable reg_l2 failed, rc=%d\n", rc); |
| 248 | return -ENODEV; |
| 249 | } |
| 250 | rc = regulator_disable(reg_l8); |
| 251 | if (rc) { |
| 252 | pr_err("disable reg_l8 failed, rc=%d\n", rc); |
| 253 | return -ENODEV; |
| 254 | } |
| 255 | rc = regulator_disable(reg_l23); |
| 256 | if (rc) { |
| 257 | pr_err("disable reg_l23 failed, rc=%d\n", rc); |
| 258 | return -ENODEV; |
| 259 | } |
| 260 | rc = regulator_set_optimum_mode(reg_l8, 100); |
| 261 | if (rc < 0) { |
| 262 | pr_err("set_optimum_mode l8 failed, rc=%d\n", rc); |
| 263 | return -EINVAL; |
| 264 | } |
| 265 | rc = regulator_set_optimum_mode(reg_l23, 100); |
| 266 | if (rc < 0) { |
| 267 | pr_err("set_optimum_mode l23 failed, rc=%d\n", rc); |
| 268 | return -EINVAL; |
| 269 | } |
| 270 | rc = regulator_set_optimum_mode(reg_l2, 100); |
| 271 | if (rc < 0) { |
| 272 | pr_err("set_optimum_mode l2 failed, rc=%d\n", rc); |
| 273 | return -EINVAL; |
| 274 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 275 | } |
| 276 | return 0; |
| 277 | } |
| 278 | |
| 279 | static int mipi_dsi_panel_power(int on) |
| 280 | { |
Jeff Ohlstein | 2cbe5ba | 2011-12-16 13:32:56 -0800 | [diff] [blame] | 281 | pr_debug("%s: on=%d\n", __func__, on); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 282 | |
| 283 | return mipi_dsi_cdp_panel_power(on); |
| 284 | } |
| 285 | |
| 286 | static struct mipi_dsi_platform_data mipi_dsi_pdata = { |
| 287 | .vsync_gpio = MDP_VSYNC_GPIO, |
| 288 | .dsi_power_save = mipi_dsi_panel_power, |
| 289 | }; |
| 290 | |
| 291 | #ifdef CONFIG_MSM_BUS_SCALING |
| 292 | |
| 293 | static struct msm_bus_vectors mdp_init_vectors[] = { |
| 294 | { |
| 295 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 296 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 297 | .ab = 0, |
| 298 | .ib = 0, |
| 299 | }, |
| 300 | }; |
| 301 | |
| 302 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 303 | static struct msm_bus_vectors hdmi_as_primary_vectors[] = { |
| 304 | /* If HDMI is used as primary */ |
| 305 | { |
| 306 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 307 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 308 | .ab = 2000000000, |
| 309 | .ib = 2000000000, |
| 310 | }, |
| 311 | }; |
| 312 | static struct msm_bus_paths mdp_bus_scale_usecases[] = { |
| 313 | { |
| 314 | ARRAY_SIZE(mdp_init_vectors), |
| 315 | mdp_init_vectors, |
| 316 | }, |
| 317 | { |
| 318 | ARRAY_SIZE(hdmi_as_primary_vectors), |
| 319 | hdmi_as_primary_vectors, |
| 320 | }, |
| 321 | { |
| 322 | ARRAY_SIZE(hdmi_as_primary_vectors), |
| 323 | hdmi_as_primary_vectors, |
| 324 | }, |
| 325 | { |
| 326 | ARRAY_SIZE(hdmi_as_primary_vectors), |
| 327 | hdmi_as_primary_vectors, |
| 328 | }, |
| 329 | { |
| 330 | ARRAY_SIZE(hdmi_as_primary_vectors), |
| 331 | hdmi_as_primary_vectors, |
| 332 | }, |
| 333 | { |
| 334 | ARRAY_SIZE(hdmi_as_primary_vectors), |
| 335 | hdmi_as_primary_vectors, |
| 336 | }, |
| 337 | }; |
| 338 | #else |
| 339 | static struct msm_bus_vectors mdp_ui_vectors[] = { |
| 340 | { |
| 341 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 342 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 343 | .ab = 216000000 * 2, |
| 344 | .ib = 270000000 * 2, |
| 345 | }, |
| 346 | }; |
| 347 | |
| 348 | static struct msm_bus_vectors mdp_vga_vectors[] = { |
| 349 | /* VGA and less video */ |
| 350 | { |
| 351 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 352 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 353 | .ab = 216000000 * 2, |
| 354 | .ib = 270000000 * 2, |
| 355 | }, |
| 356 | }; |
| 357 | |
| 358 | static struct msm_bus_vectors mdp_720p_vectors[] = { |
| 359 | /* 720p and less video */ |
| 360 | { |
| 361 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 362 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 363 | .ab = 230400000 * 2, |
| 364 | .ib = 288000000 * 2, |
| 365 | }, |
| 366 | }; |
| 367 | |
| 368 | static struct msm_bus_vectors mdp_1080p_vectors[] = { |
| 369 | /* 1080p and less video */ |
| 370 | { |
| 371 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 372 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 373 | .ab = 334080000 * 2, |
| 374 | .ib = 417600000 * 2, |
| 375 | }, |
| 376 | }; |
| 377 | |
| 378 | static struct msm_bus_paths mdp_bus_scale_usecases[] = { |
| 379 | { |
| 380 | ARRAY_SIZE(mdp_init_vectors), |
| 381 | mdp_init_vectors, |
| 382 | }, |
| 383 | { |
| 384 | ARRAY_SIZE(mdp_ui_vectors), |
| 385 | mdp_ui_vectors, |
| 386 | }, |
| 387 | { |
| 388 | ARRAY_SIZE(mdp_ui_vectors), |
| 389 | mdp_ui_vectors, |
| 390 | }, |
| 391 | { |
| 392 | ARRAY_SIZE(mdp_vga_vectors), |
| 393 | mdp_vga_vectors, |
| 394 | }, |
| 395 | { |
| 396 | ARRAY_SIZE(mdp_720p_vectors), |
| 397 | mdp_720p_vectors, |
| 398 | }, |
| 399 | { |
| 400 | ARRAY_SIZE(mdp_1080p_vectors), |
| 401 | mdp_1080p_vectors, |
| 402 | }, |
| 403 | }; |
| 404 | #endif |
| 405 | |
| 406 | static struct msm_bus_scale_pdata mdp_bus_scale_pdata = { |
| 407 | mdp_bus_scale_usecases, |
| 408 | ARRAY_SIZE(mdp_bus_scale_usecases), |
| 409 | .name = "mdp", |
| 410 | }; |
| 411 | |
| 412 | #endif |
| 413 | |
| 414 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 415 | static int mdp_core_clk_rate_table[] = { |
| 416 | 200000000, |
| 417 | 200000000, |
| 418 | 200000000, |
| 419 | 200000000, |
| 420 | }; |
| 421 | #else |
| 422 | static int mdp_core_clk_rate_table[] = { |
| 423 | 85330000, |
Huaibin Yang | 1f180ee | 2012-01-30 16:23:06 -0800 | [diff] [blame] | 424 | 128000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 425 | 160000000, |
| 426 | 200000000, |
| 427 | }; |
| 428 | #endif |
| 429 | |
| 430 | static struct msm_panel_common_pdata mdp_pdata = { |
| 431 | .gpio = MDP_VSYNC_GPIO, |
| 432 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 433 | .mdp_core_clk_rate = 200000000, |
| 434 | #else |
| 435 | .mdp_core_clk_rate = 85330000, |
| 436 | #endif |
| 437 | .mdp_core_clk_table = mdp_core_clk_rate_table, |
| 438 | .num_mdp_clk = ARRAY_SIZE(mdp_core_clk_rate_table), |
| 439 | #ifdef CONFIG_MSM_BUS_SCALING |
| 440 | .mdp_bus_scale_table = &mdp_bus_scale_pdata, |
| 441 | #endif |
| 442 | .mdp_rev = MDP_REV_42, |
Nagamalleswararao Ganji | 937a119 | 2011-12-07 19:00:52 -0800 | [diff] [blame] | 443 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 444 | .mem_hid = ION_CP_MM_HEAP_ID, |
| 445 | #else |
| 446 | .mem_hid = MEMTYPE_EBI1, |
| 447 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 448 | }; |
| 449 | |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 450 | void __init msm8930_mdp_writeback(struct memtype_reserve* reserve_table) |
| 451 | { |
Nagamalleswararao Ganji | 937a119 | 2011-12-07 19:00:52 -0800 | [diff] [blame] | 452 | mdp_pdata.ov0_wb_size = MSM_FB_OVERLAY0_WRITEBACK_SIZE; |
| 453 | mdp_pdata.ov1_wb_size = MSM_FB_OVERLAY1_WRITEBACK_SIZE; |
| 454 | #if defined(CONFIG_ANDROID_PMEM) && !defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 455 | reserve_table[mdp_pdata.mem_hid].size += |
| 456 | mdp_pdata.ov0_wb_size; |
| 457 | reserve_table[mdp_pdata.mem_hid].size += |
| 458 | mdp_pdata.ov1_wb_size; |
| 459 | #endif |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 460 | } |
| 461 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 462 | #define LPM_CHANNEL0 0 |
| 463 | static int toshiba_gpio[] = {LPM_CHANNEL0}; |
| 464 | |
| 465 | static struct mipi_dsi_panel_platform_data toshiba_pdata = { |
| 466 | .gpio = toshiba_gpio, |
| 467 | }; |
| 468 | |
| 469 | static struct platform_device mipi_dsi_toshiba_panel_device = { |
| 470 | .name = "mipi_toshiba", |
| 471 | .id = 0, |
| 472 | .dev = { |
| 473 | .platform_data = &toshiba_pdata, |
| 474 | } |
| 475 | }; |
| 476 | |
| 477 | #define FPGA_3D_GPIO_CONFIG_ADDR 0xB5 |
| 478 | |
| 479 | static struct mipi_dsi_phy_ctrl dsi_novatek_cmd_mode_phy_db = { |
| 480 | |
| 481 | /* DSI_BIT_CLK at 500MHz, 2 lane, RGB888 */ |
| 482 | {0x0F, 0x0a, 0x04, 0x00, 0x20}, /* regulator */ |
| 483 | /* timing */ |
| 484 | {0xab, 0x8a, 0x18, 0x00, 0x92, 0x97, 0x1b, 0x8c, |
| 485 | 0x0c, 0x03, 0x04, 0xa0}, |
| 486 | {0x5f, 0x00, 0x00, 0x10}, /* phy ctrl */ |
| 487 | {0xff, 0x00, 0x06, 0x00}, /* strength */ |
| 488 | /* pll control */ |
| 489 | {0x40, 0xf9, 0x30, 0xda, 0x00, 0x40, 0x03, 0x62, |
| 490 | 0x40, 0x07, 0x03, |
| 491 | 0x00, 0x1a, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x01}, |
| 492 | }; |
| 493 | |
| 494 | static struct mipi_dsi_panel_platform_data novatek_pdata = { |
| 495 | .fpga_3d_config_addr = FPGA_3D_GPIO_CONFIG_ADDR, |
| 496 | .fpga_ctrl_mode = FPGA_SPI_INTF, |
| 497 | .phy_ctrl_settings = &dsi_novatek_cmd_mode_phy_db, |
Ravishangar Kalyanam | 903f65c | 2012-01-28 21:36:22 -0800 | [diff] [blame] | 498 | .dlane_swap = 0x1, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 499 | }; |
| 500 | |
| 501 | static struct platform_device mipi_dsi_novatek_panel_device = { |
| 502 | .name = "mipi_novatek", |
| 503 | .id = 0, |
| 504 | .dev = { |
| 505 | .platform_data = &novatek_pdata, |
| 506 | } |
| 507 | }; |
| 508 | |
| 509 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
| 510 | static struct resource hdmi_msm_resources[] = { |
| 511 | { |
| 512 | .name = "hdmi_msm_qfprom_addr", |
| 513 | .start = 0x00700000, |
| 514 | .end = 0x007060FF, |
| 515 | .flags = IORESOURCE_MEM, |
| 516 | }, |
| 517 | { |
| 518 | .name = "hdmi_msm_hdmi_addr", |
| 519 | .start = 0x04A00000, |
| 520 | .end = 0x04A00FFF, |
| 521 | .flags = IORESOURCE_MEM, |
| 522 | }, |
| 523 | { |
| 524 | .name = "hdmi_msm_irq", |
| 525 | .start = HDMI_IRQ, |
| 526 | .end = HDMI_IRQ, |
| 527 | .flags = IORESOURCE_IRQ, |
| 528 | }, |
| 529 | }; |
| 530 | |
| 531 | static int hdmi_enable_5v(int on); |
| 532 | static int hdmi_core_power(int on, int show); |
| 533 | static int hdmi_cec_power(int on); |
| 534 | |
| 535 | static struct msm_hdmi_platform_data hdmi_msm_data = { |
| 536 | .irq = HDMI_IRQ, |
| 537 | .enable_5v = hdmi_enable_5v, |
| 538 | .core_power = hdmi_core_power, |
| 539 | .cec_power = hdmi_cec_power, |
| 540 | }; |
| 541 | |
| 542 | static struct platform_device hdmi_msm_device = { |
| 543 | .name = "hdmi_msm", |
| 544 | .id = 0, |
| 545 | .num_resources = ARRAY_SIZE(hdmi_msm_resources), |
| 546 | .resource = hdmi_msm_resources, |
| 547 | .dev.platform_data = &hdmi_msm_data, |
| 548 | }; |
| 549 | #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */ |
| 550 | |
| 551 | #ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL |
| 552 | static struct platform_device wfd_panel_device = { |
| 553 | .name = "wfd_panel", |
| 554 | .id = 0, |
| 555 | .dev.platform_data = NULL, |
| 556 | }; |
| 557 | |
| 558 | static struct platform_device wfd_device = { |
| 559 | .name = "msm_wfd", |
| 560 | .id = -1, |
| 561 | }; |
| 562 | #endif |
| 563 | |
| 564 | #ifdef CONFIG_MSM_BUS_SCALING |
| 565 | static struct msm_bus_vectors dtv_bus_init_vectors[] = { |
| 566 | { |
| 567 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 568 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 569 | .ab = 0, |
| 570 | .ib = 0, |
| 571 | }, |
| 572 | }; |
| 573 | |
| 574 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 575 | static struct msm_bus_vectors dtv_bus_def_vectors[] = { |
| 576 | { |
| 577 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 578 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 579 | .ab = 2000000000, |
| 580 | .ib = 2000000000, |
| 581 | }, |
| 582 | }; |
| 583 | #else |
| 584 | static struct msm_bus_vectors dtv_bus_def_vectors[] = { |
| 585 | { |
| 586 | .src = MSM_BUS_MASTER_MDP_PORT0, |
| 587 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 588 | .ab = 566092800 * 2, |
| 589 | .ib = 707616000 * 2, |
| 590 | }, |
| 591 | }; |
| 592 | #endif |
| 593 | |
| 594 | static struct msm_bus_paths dtv_bus_scale_usecases[] = { |
| 595 | { |
| 596 | ARRAY_SIZE(dtv_bus_init_vectors), |
| 597 | dtv_bus_init_vectors, |
| 598 | }, |
| 599 | { |
| 600 | ARRAY_SIZE(dtv_bus_def_vectors), |
| 601 | dtv_bus_def_vectors, |
| 602 | }, |
| 603 | }; |
| 604 | static struct msm_bus_scale_pdata dtv_bus_scale_pdata = { |
| 605 | dtv_bus_scale_usecases, |
| 606 | ARRAY_SIZE(dtv_bus_scale_usecases), |
| 607 | .name = "dtv", |
| 608 | }; |
| 609 | |
| 610 | static struct lcdc_platform_data dtv_pdata = { |
| 611 | .bus_scale_table = &dtv_bus_scale_pdata, |
| 612 | }; |
| 613 | #endif |
| 614 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 615 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 616 | static int hdmi_enable_5v(int on) |
| 617 | { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 618 | static struct regulator *reg_ext_5v; /* HDMI_5V */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 619 | static int prev_on; |
| 620 | int rc; |
| 621 | |
| 622 | if (on == prev_on) |
| 623 | return 0; |
| 624 | |
Ajay Singh Parmar | 0784764 | 2011-12-09 02:57:45 +0530 | [diff] [blame] | 625 | if (!reg_ext_5v) { |
| 626 | reg_ext_5v = regulator_get(&hdmi_msm_device.dev, "hdmi_mvs"); |
| 627 | if (IS_ERR(reg_ext_5v)) { |
| 628 | pr_err("'%s' regulator not found, rc=%ld\n", |
| 629 | "hdmi_mvs", IS_ERR(reg_ext_5v)); |
| 630 | reg_ext_5v = NULL; |
| 631 | return -ENODEV; |
| 632 | } |
| 633 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 634 | |
| 635 | if (on) { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 636 | rc = regulator_enable(reg_ext_5v); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 637 | if (rc) { |
| 638 | pr_err("'%s' regulator enable failed, rc=%d\n", |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 639 | "reg_ext_5v", rc); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 640 | return rc; |
| 641 | } |
| 642 | pr_debug("%s(on): success\n", __func__); |
| 643 | } else { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 644 | rc = regulator_disable(reg_ext_5v); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 645 | if (rc) |
| 646 | pr_warning("'%s' regulator disable failed, rc=%d\n", |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 647 | "reg_ext_5v", rc); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 648 | pr_debug("%s(off): success\n", __func__); |
| 649 | } |
| 650 | |
| 651 | prev_on = on; |
| 652 | |
| 653 | return 0; |
| 654 | } |
| 655 | |
| 656 | static int hdmi_core_power(int on, int show) |
| 657 | { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 658 | /* Both HDMI "avdd" and "vcc" are powered by 8038_l23 regulator */ |
| 659 | static struct regulator *reg_8038_l23; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 660 | static int prev_on; |
| 661 | int rc; |
| 662 | |
| 663 | if (on == prev_on) |
| 664 | return 0; |
| 665 | |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 666 | if (!reg_8038_l23) { |
| 667 | reg_8038_l23 = regulator_get(&hdmi_msm_device.dev, "hdmi_avdd"); |
| 668 | if (IS_ERR(reg_8038_l23)) { |
| 669 | pr_err("could not get reg_8038_l23, rc = %ld\n", |
| 670 | PTR_ERR(reg_8038_l23)); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 671 | return -ENODEV; |
| 672 | } |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 673 | rc = regulator_set_voltage(reg_8038_l23, 1800000, 1800000); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 674 | if (rc) { |
| 675 | pr_err("set_voltage failed for 8921_l23, rc=%d\n", rc); |
| 676 | return -EINVAL; |
| 677 | } |
| 678 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 679 | |
| 680 | if (on) { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 681 | rc = regulator_set_optimum_mode(reg_8038_l23, 100000); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 682 | if (rc < 0) { |
| 683 | pr_err("set_optimum_mode l23 failed, rc=%d\n", rc); |
| 684 | return -EINVAL; |
| 685 | } |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 686 | rc = regulator_enable(reg_8038_l23); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 687 | if (rc) { |
| 688 | pr_err("'%s' regulator enable failed, rc=%d\n", |
| 689 | "hdmi_avdd", rc); |
| 690 | return rc; |
| 691 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 692 | rc = gpio_request(100, "HDMI_DDC_CLK"); |
| 693 | if (rc) { |
| 694 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", |
| 695 | "HDMI_DDC_CLK", 100, rc); |
| 696 | goto error1; |
| 697 | } |
| 698 | rc = gpio_request(101, "HDMI_DDC_DATA"); |
| 699 | if (rc) { |
| 700 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", |
| 701 | "HDMI_DDC_DATA", 101, rc); |
| 702 | goto error2; |
| 703 | } |
| 704 | rc = gpio_request(102, "HDMI_HPD"); |
| 705 | if (rc) { |
| 706 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", |
| 707 | "HDMI_HPD", 102, rc); |
| 708 | goto error3; |
| 709 | } |
| 710 | pr_debug("%s(on): success\n", __func__); |
| 711 | } else { |
| 712 | gpio_free(100); |
| 713 | gpio_free(101); |
| 714 | gpio_free(102); |
| 715 | |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 716 | rc = regulator_disable(reg_8038_l23); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 717 | if (rc) { |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 718 | pr_err("disable reg_8038_l23 failed, rc=%d\n", rc); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 719 | return -ENODEV; |
| 720 | } |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 721 | rc = regulator_set_optimum_mode(reg_8038_l23, 100); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 722 | if (rc < 0) { |
| 723 | pr_err("set_optimum_mode l23 failed, rc=%d\n", rc); |
| 724 | return -EINVAL; |
| 725 | } |
| 726 | pr_debug("%s(off): success\n", __func__); |
| 727 | } |
| 728 | |
| 729 | prev_on = on; |
| 730 | |
| 731 | return 0; |
| 732 | |
| 733 | error3: |
| 734 | gpio_free(101); |
| 735 | error2: |
| 736 | gpio_free(100); |
| 737 | error1: |
Chandan Uddaraju | 59894ca | 2011-12-05 17:07:02 -0800 | [diff] [blame] | 738 | regulator_disable(reg_8038_l23); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 739 | return rc; |
| 740 | } |
| 741 | |
| 742 | static int hdmi_cec_power(int on) |
| 743 | { |
| 744 | static int prev_on; |
| 745 | int rc; |
| 746 | |
| 747 | if (on == prev_on) |
| 748 | return 0; |
| 749 | |
| 750 | if (on) { |
| 751 | rc = gpio_request(99, "HDMI_CEC_VAR"); |
| 752 | if (rc) { |
| 753 | pr_err("'%s'(%d) gpio_request failed, rc=%d\n", |
| 754 | "HDMI_CEC_VAR", 99, rc); |
| 755 | goto error; |
| 756 | } |
| 757 | pr_debug("%s(on): success\n", __func__); |
| 758 | } else { |
| 759 | gpio_free(99); |
| 760 | pr_debug("%s(off): success\n", __func__); |
| 761 | } |
| 762 | |
| 763 | prev_on = on; |
| 764 | |
| 765 | return 0; |
| 766 | error: |
| 767 | return rc; |
| 768 | } |
| 769 | #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */ |
| 770 | |
| 771 | void __init msm8930_init_fb(void) |
| 772 | { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 773 | platform_device_register(&msm_fb_device); |
| 774 | |
| 775 | #ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL |
| 776 | platform_device_register(&wfd_panel_device); |
| 777 | platform_device_register(&wfd_device); |
| 778 | #endif |
| 779 | |
| 780 | platform_device_register(&mipi_dsi_novatek_panel_device); |
| 781 | |
| 782 | #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL |
Aravind Venkateswaran | fff132d | 2012-03-07 13:22:30 -0800 | [diff] [blame^] | 783 | platform_device_register(&hdmi_msm_device); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 784 | #endif |
| 785 | |
| 786 | platform_device_register(&mipi_dsi_toshiba_panel_device); |
| 787 | |
| 788 | msm_fb_register_device("mdp", &mdp_pdata); |
| 789 | msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata); |
| 790 | #ifdef CONFIG_MSM_BUS_SCALING |
| 791 | msm_fb_register_device("dtv", &dtv_pdata); |
| 792 | #endif |
| 793 | } |
| 794 | |
| 795 | void __init msm8930_allocate_fb_region(void) |
| 796 | { |
| 797 | void *addr; |
| 798 | unsigned long size; |
| 799 | |
| 800 | size = MSM_FB_SIZE; |
| 801 | addr = alloc_bootmem_align(size, 0x1000); |
| 802 | msm_fb_resources[0].start = __pa(addr); |
| 803 | msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1; |
| 804 | pr_info("allocating %lu bytes at %p (%lx physical) for fb\n", |
| 805 | size, addr, __pa(addr)); |
| 806 | } |