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