Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Google, Inc. |
Taniya Das | 2e94819 | 2011-12-20 11:15:13 +0530 | [diff] [blame] | 3 | * Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved. |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 4 | * |
| 5 | * This software is licensed under the terms of the GNU General Public |
| 6 | * License version 2, as published by the Free Software Foundation, and |
| 7 | * may be copied, distributed, and modified under those terms. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/platform_device.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | #include <linux/msm_rotator.h> |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 19 | #include <linux/dma-mapping.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 20 | #include <linux/msm_kgsl.h> |
| 21 | #include <linux/android_pmem.h> |
| 22 | #include <linux/regulator/machine.h> |
Taniya Das | 2e94819 | 2011-12-20 11:15:13 +0530 | [diff] [blame] | 23 | #include <linux/init.h> |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 24 | #include <mach/irqs.h> |
| 25 | #include <mach/msm_iomap.h> |
| 26 | #include <mach/dma.h> |
| 27 | #include <mach/board.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 28 | #include <asm/clkdev.h> |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 29 | |
| 30 | #include "devices.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 31 | #include "gpio_hw.h" |
| 32 | #include "footswitch.h" |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 33 | |
| 34 | #include <asm/mach/flash.h> |
| 35 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 36 | #include <asm/mach/mmc.h> |
| 37 | #include <mach/msm_hsusb.h> |
| 38 | #ifdef CONFIG_PMIC8058 |
| 39 | #include <linux/mfd/pmic8058.h> |
| 40 | #endif |
| 41 | #include <mach/dal_axi.h> |
| 42 | #include <mach/msm_memtypes.h> |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 43 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 44 | /* EBI THERMAL DRIVER */ |
| 45 | static struct resource msm_ebi0_thermal_resources[] = { |
| 46 | { |
| 47 | .start = 0xA8600000, |
| 48 | .end = 0xA86005FF, |
| 49 | .name = "physbase", |
| 50 | .flags = IORESOURCE_MEM |
| 51 | } |
| 52 | }; |
| 53 | |
| 54 | struct platform_device msm_ebi0_thermal = { |
| 55 | .name = "msm_popmem-tm", |
| 56 | .id = 0, |
| 57 | .num_resources = 1, |
| 58 | .resource = msm_ebi0_thermal_resources |
| 59 | }; |
| 60 | |
| 61 | static struct resource msm_ebi1_thermal_resources[] = { |
| 62 | { |
| 63 | .start = 0xA8700000, |
| 64 | .end = 0xA87005FF, |
| 65 | .name = "physbase", |
| 66 | .flags = IORESOURCE_MEM |
| 67 | } |
| 68 | }; |
| 69 | |
| 70 | struct platform_device msm_ebi1_thermal = { |
| 71 | .name = "msm_popmem-tm", |
| 72 | .id = 1, |
| 73 | .num_resources = 1, |
| 74 | .resource = msm_ebi1_thermal_resources |
| 75 | }; |
| 76 | |
Laxminath Kasam | 1d8255d | 2012-02-15 13:10:19 +0530 | [diff] [blame] | 77 | static struct resource resources_adsp[] = { |
| 78 | { |
| 79 | .start = INT_ADSP_A9_A11, |
| 80 | .end = INT_ADSP_A9_A11, |
| 81 | .flags = IORESOURCE_IRQ, |
| 82 | }, |
| 83 | }; |
| 84 | |
| 85 | struct platform_device msm_adsp_device = { |
| 86 | .name = "msm_adsp", |
| 87 | .id = -1, |
| 88 | .num_resources = ARRAY_SIZE(resources_adsp), |
| 89 | .resource = resources_adsp, |
| 90 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 91 | |
| 92 | static struct resource resources_uart1[] = { |
| 93 | { |
| 94 | .start = INT_UART1, |
| 95 | .end = INT_UART1, |
| 96 | .flags = IORESOURCE_IRQ, |
| 97 | }, |
| 98 | { |
Taniya Das | 298de8c | 2012-02-16 11:45:31 +0530 | [diff] [blame^] | 99 | .start = MSM7X30_UART1_PHYS, |
| 100 | .end = MSM7X30_UART1_PHYS + MSM7X30_UART1_SIZE - 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 101 | .flags = IORESOURCE_MEM, |
| 102 | }, |
| 103 | }; |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 104 | |
| 105 | static struct resource resources_uart2[] = { |
| 106 | { |
| 107 | .start = INT_UART2, |
| 108 | .end = INT_UART2, |
| 109 | .flags = IORESOURCE_IRQ, |
| 110 | }, |
| 111 | { |
Taniya Das | 298de8c | 2012-02-16 11:45:31 +0530 | [diff] [blame^] | 112 | .start = MSM7X30_UART2_PHYS, |
| 113 | .end = MSM7X30_UART2_PHYS + MSM7X30_UART2_SIZE - 1, |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 114 | .flags = IORESOURCE_MEM, |
Stepan Moskovchenko | d41cb8c | 2011-01-17 20:33:32 -0800 | [diff] [blame] | 115 | .name = "uart_resource" |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 116 | }, |
| 117 | }; |
| 118 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 119 | static struct resource resources_uart3[] = { |
| 120 | { |
| 121 | .start = INT_UART3, |
| 122 | .end = INT_UART3, |
| 123 | .flags = IORESOURCE_IRQ, |
| 124 | }, |
| 125 | { |
Taniya Das | 298de8c | 2012-02-16 11:45:31 +0530 | [diff] [blame^] | 126 | .start = MSM7X30_UART3_PHYS, |
| 127 | .end = MSM7X30_UART3_PHYS + MSM7X30_UART3_SIZE - 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 128 | .flags = IORESOURCE_MEM, |
| 129 | }, |
| 130 | }; |
| 131 | |
| 132 | struct platform_device msm_device_uart1 = { |
| 133 | .name = "msm_serial", |
| 134 | .id = 0, |
| 135 | .num_resources = ARRAY_SIZE(resources_uart1), |
| 136 | .resource = resources_uart1, |
| 137 | }; |
| 138 | |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 139 | struct platform_device msm_device_uart2 = { |
| 140 | .name = "msm_serial", |
| 141 | .id = 1, |
| 142 | .num_resources = ARRAY_SIZE(resources_uart2), |
| 143 | .resource = resources_uart2, |
| 144 | }; |
| 145 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 146 | struct platform_device msm_device_uart3 = { |
| 147 | .name = "msm_serial", |
| 148 | .id = 2, |
| 149 | .num_resources = ARRAY_SIZE(resources_uart3), |
| 150 | .resource = resources_uart3, |
Niranjana Vishwanathapura | a8855e9 | 2010-10-06 13:52:10 -0700 | [diff] [blame] | 151 | }; |
| 152 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 153 | #define MSM_UART1DM_PHYS 0xA3300000 |
| 154 | #define MSM_UART2DM_PHYS 0xA3200000 |
| 155 | static struct resource msm_uart1_dm_resources[] = { |
| 156 | { |
| 157 | .start = MSM_UART1DM_PHYS, |
| 158 | .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1, |
| 159 | .flags = IORESOURCE_MEM, |
| 160 | }, |
| 161 | { |
| 162 | .start = INT_UART1DM_IRQ, |
| 163 | .end = INT_UART1DM_IRQ, |
| 164 | .flags = IORESOURCE_IRQ, |
| 165 | }, |
| 166 | { |
| 167 | .start = INT_UART1DM_RX, |
| 168 | .end = INT_UART1DM_RX, |
| 169 | .flags = IORESOURCE_IRQ, |
| 170 | }, |
| 171 | { |
| 172 | .start = DMOV_HSUART1_TX_CHAN, |
| 173 | .end = DMOV_HSUART1_RX_CHAN, |
| 174 | .name = "uartdm_channels", |
| 175 | .flags = IORESOURCE_DMA, |
| 176 | }, |
| 177 | { |
| 178 | .start = DMOV_HSUART1_TX_CRCI, |
| 179 | .end = DMOV_HSUART1_RX_CRCI, |
| 180 | .name = "uartdm_crci", |
| 181 | .flags = IORESOURCE_DMA, |
| 182 | }, |
| 183 | }; |
| 184 | |
| 185 | static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32); |
| 186 | |
| 187 | struct platform_device msm_device_uart_dm1 = { |
| 188 | .name = "msm_serial_hs", |
| 189 | .id = 0, |
| 190 | .num_resources = ARRAY_SIZE(msm_uart1_dm_resources), |
| 191 | .resource = msm_uart1_dm_resources, |
| 192 | .dev = { |
| 193 | .dma_mask = &msm_uart_dm1_dma_mask, |
| 194 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 195 | }, |
| 196 | }; |
| 197 | |
| 198 | static struct resource msm_uart2_dm_resources[] = { |
| 199 | { |
| 200 | .start = MSM_UART2DM_PHYS, |
| 201 | .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1, |
| 202 | .flags = IORESOURCE_MEM, |
| 203 | }, |
| 204 | { |
| 205 | .start = INT_UART2DM_IRQ, |
| 206 | .end = INT_UART2DM_IRQ, |
| 207 | .flags = IORESOURCE_IRQ, |
| 208 | }, |
| 209 | { |
| 210 | .start = INT_UART2DM_RX, |
| 211 | .end = INT_UART2DM_RX, |
| 212 | .flags = IORESOURCE_IRQ, |
| 213 | }, |
| 214 | { |
| 215 | .start = DMOV_HSUART2_TX_CHAN, |
| 216 | .end = DMOV_HSUART2_RX_CHAN, |
| 217 | .name = "uartdm_channels", |
| 218 | .flags = IORESOURCE_DMA, |
| 219 | }, |
| 220 | { |
| 221 | .start = DMOV_HSUART2_TX_CRCI, |
| 222 | .end = DMOV_HSUART2_RX_CRCI, |
| 223 | .name = "uartdm_crci", |
| 224 | .flags = IORESOURCE_DMA, |
| 225 | }, |
| 226 | }; |
| 227 | |
| 228 | static u64 msm_uart_dm2_dma_mask = DMA_BIT_MASK(32); |
| 229 | |
| 230 | struct platform_device msm_device_uart_dm2 = { |
| 231 | .name = "msm_serial_hs", |
| 232 | .id = 1, |
| 233 | .num_resources = ARRAY_SIZE(msm_uart2_dm_resources), |
| 234 | .resource = msm_uart2_dm_resources, |
| 235 | .dev = { |
| 236 | .dma_mask = &msm_uart_dm2_dma_mask, |
| 237 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 238 | }, |
| 239 | }; |
| 240 | |
| 241 | #define MSM_I2C_SIZE SZ_4K |
| 242 | #define MSM_I2C_PHYS 0xACD00000 |
| 243 | #define MSM_I2C_2_PHYS 0xACF00000 |
| 244 | static struct resource resources_i2c_2[] = { |
| 245 | { |
| 246 | .start = MSM_I2C_2_PHYS, |
| 247 | .end = MSM_I2C_2_PHYS + MSM_I2C_SIZE - 1, |
| 248 | .flags = IORESOURCE_MEM, |
| 249 | }, |
| 250 | { |
| 251 | .start = INT_PWB_I2C_2, |
| 252 | .end = INT_PWB_I2C_2, |
| 253 | .flags = IORESOURCE_IRQ, |
| 254 | }, |
| 255 | }; |
| 256 | |
| 257 | struct platform_device msm_device_i2c_2 = { |
| 258 | .name = "msm_i2c", |
| 259 | .id = 2, |
| 260 | .num_resources = ARRAY_SIZE(resources_i2c_2), |
| 261 | .resource = resources_i2c_2, |
| 262 | }; |
| 263 | |
| 264 | static struct resource resources_i2c[] = { |
| 265 | { |
| 266 | .start = MSM_I2C_PHYS, |
| 267 | .end = MSM_I2C_PHYS + MSM_I2C_SIZE - 1, |
| 268 | .flags = IORESOURCE_MEM, |
| 269 | }, |
| 270 | { |
| 271 | .start = INT_PWB_I2C, |
| 272 | .end = INT_PWB_I2C, |
| 273 | .flags = IORESOURCE_IRQ, |
| 274 | }, |
| 275 | }; |
| 276 | |
| 277 | struct platform_device msm_device_i2c = { |
| 278 | .name = "msm_i2c", |
| 279 | .id = 0, |
| 280 | .num_resources = ARRAY_SIZE(resources_i2c), |
| 281 | .resource = resources_i2c, |
| 282 | }; |
| 283 | |
| 284 | #define MSM_QUP_PHYS 0xA8301000 |
| 285 | #define MSM_GSBI_QUP_I2C_PHYS 0xA8300000 |
| 286 | #define MSM_QUP_SIZE SZ_4K |
| 287 | static struct resource resources_qup[] = { |
| 288 | { |
| 289 | .name = "qup_phys_addr", |
| 290 | .start = MSM_QUP_PHYS, |
| 291 | .end = MSM_QUP_PHYS + MSM_QUP_SIZE - 1, |
| 292 | .flags = IORESOURCE_MEM, |
| 293 | }, |
| 294 | { |
| 295 | .name = "gsbi_qup_i2c_addr", |
| 296 | .start = MSM_GSBI_QUP_I2C_PHYS, |
| 297 | .end = MSM_GSBI_QUP_I2C_PHYS + 4 - 1, |
| 298 | .flags = IORESOURCE_MEM, |
| 299 | }, |
| 300 | { |
| 301 | .name = "qup_in_intr", |
| 302 | .start = INT_PWB_QUP_IN, |
| 303 | .end = INT_PWB_QUP_IN, |
| 304 | .flags = IORESOURCE_IRQ, |
| 305 | }, |
| 306 | { |
| 307 | .name = "qup_out_intr", |
| 308 | .start = INT_PWB_QUP_OUT, |
| 309 | .end = INT_PWB_QUP_OUT, |
| 310 | .flags = IORESOURCE_IRQ, |
| 311 | }, |
| 312 | { |
| 313 | .name = "qup_err_intr", |
| 314 | .start = INT_PWB_QUP_ERR, |
| 315 | .end = INT_PWB_QUP_ERR, |
| 316 | .flags = IORESOURCE_IRQ, |
| 317 | }, |
| 318 | }; |
| 319 | |
| 320 | struct platform_device qup_device_i2c = { |
| 321 | .name = "qup_i2c", |
| 322 | .id = 4, |
| 323 | .num_resources = ARRAY_SIZE(resources_qup), |
| 324 | .resource = resources_qup, |
| 325 | }; |
| 326 | |
Anirudh Ghayal | 9d9cdc2 | 2011-10-10 17:17:07 +0530 | [diff] [blame] | 327 | #ifdef CONFIG_MSM_SSBI |
| 328 | #define MSM_SSBI_PMIC1_PHYS 0xAD900000 |
| 329 | static struct resource msm_ssbi_pmic1_resources[] = { |
| 330 | { |
| 331 | .start = MSM_SSBI_PMIC1_PHYS, |
| 332 | .end = MSM_SSBI_PMIC1_PHYS + SZ_4K - 1, |
| 333 | .flags = IORESOURCE_MEM, |
| 334 | }, |
| 335 | }; |
| 336 | |
| 337 | struct platform_device msm_device_ssbi_pmic1 = { |
| 338 | .name = "msm_ssbi", |
| 339 | .id = 0, |
| 340 | .resource = msm_ssbi_pmic1_resources, |
| 341 | .num_resources = ARRAY_SIZE(msm_ssbi_pmic1_resources), |
| 342 | }; |
| 343 | #endif |
| 344 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 345 | #ifdef CONFIG_I2C_SSBI |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 346 | #define MSM_SSBI7_PHYS 0xAC800000 |
| 347 | static struct resource msm_ssbi7_resources[] = { |
| 348 | { |
| 349 | .name = "ssbi_base", |
| 350 | .start = MSM_SSBI7_PHYS, |
| 351 | .end = MSM_SSBI7_PHYS + SZ_4K - 1, |
| 352 | .flags = IORESOURCE_MEM, |
| 353 | }, |
| 354 | }; |
| 355 | |
| 356 | struct platform_device msm_device_ssbi7 = { |
| 357 | .name = "i2c_ssbi", |
| 358 | .id = 7, |
| 359 | .num_resources = ARRAY_SIZE(msm_ssbi7_resources), |
| 360 | .resource = msm_ssbi7_resources, |
| 361 | }; |
| 362 | #endif /* CONFIG_I2C_SSBI */ |
| 363 | |
| 364 | #define MSM_HSUSB_PHYS 0xA3600000 |
| 365 | static struct resource resources_hsusb_otg[] = { |
Pavankumar Kondeti | 5155e2c | 2010-12-08 13:37:08 +0530 | [diff] [blame] | 366 | { |
| 367 | .start = MSM_HSUSB_PHYS, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 368 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
Pavankumar Kondeti | 5155e2c | 2010-12-08 13:37:08 +0530 | [diff] [blame] | 369 | .flags = IORESOURCE_MEM, |
| 370 | }, |
| 371 | { |
| 372 | .start = INT_USB_HS, |
| 373 | .end = INT_USB_HS, |
| 374 | .flags = IORESOURCE_IRQ, |
| 375 | }, |
| 376 | }; |
| 377 | |
Pavankumar Kondeti | 5155e2c | 2010-12-08 13:37:08 +0530 | [diff] [blame] | 378 | static u64 dma_mask = 0xffffffffULL; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 379 | struct platform_device msm_device_hsusb_otg = { |
| 380 | .name = "msm_hsusb_otg", |
| 381 | .id = -1, |
| 382 | .num_resources = ARRAY_SIZE(resources_hsusb_otg), |
| 383 | .resource = resources_hsusb_otg, |
| 384 | .dev = { |
| 385 | .dma_mask = &dma_mask, |
| 386 | .coherent_dma_mask = 0xffffffffULL, |
| 387 | }, |
| 388 | }; |
| 389 | |
| 390 | static struct resource resources_hsusb_peripheral[] = { |
| 391 | { |
| 392 | .start = MSM_HSUSB_PHYS, |
| 393 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 394 | .flags = IORESOURCE_MEM, |
| 395 | }, |
| 396 | { |
| 397 | .start = INT_USB_HS, |
| 398 | .end = INT_USB_HS, |
| 399 | .flags = IORESOURCE_IRQ, |
| 400 | }, |
| 401 | }; |
| 402 | |
| 403 | static struct resource resources_gadget_peripheral[] = { |
| 404 | { |
| 405 | .start = MSM_HSUSB_PHYS, |
| 406 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 407 | .flags = IORESOURCE_MEM, |
| 408 | }, |
| 409 | { |
| 410 | .start = INT_USB_HS, |
| 411 | .end = INT_USB_HS, |
| 412 | .flags = IORESOURCE_IRQ, |
| 413 | }, |
| 414 | }; |
| 415 | |
| 416 | struct platform_device msm_device_hsusb_peripheral = { |
| 417 | .name = "msm_hsusb_peripheral", |
| 418 | .id = -1, |
| 419 | .num_resources = ARRAY_SIZE(resources_hsusb_peripheral), |
| 420 | .resource = resources_hsusb_peripheral, |
| 421 | .dev = { |
| 422 | .dma_mask = &dma_mask, |
| 423 | .coherent_dma_mask = 0xffffffffULL, |
| 424 | }, |
| 425 | }; |
| 426 | |
| 427 | struct platform_device msm_device_gadget_peripheral = { |
| 428 | .name = "msm_hsusb", |
| 429 | .id = -1, |
| 430 | .num_resources = ARRAY_SIZE(resources_gadget_peripheral), |
| 431 | .resource = resources_gadget_peripheral, |
| 432 | .dev = { |
| 433 | .dma_mask = &dma_mask, |
| 434 | .coherent_dma_mask = 0xffffffffULL, |
| 435 | }, |
| 436 | }; |
| 437 | |
Pavankumar Kondeti | 5155e2c | 2010-12-08 13:37:08 +0530 | [diff] [blame] | 438 | static struct resource resources_hsusb_host[] = { |
| 439 | { |
| 440 | .start = MSM_HSUSB_PHYS, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 441 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
Pavankumar Kondeti | 5155e2c | 2010-12-08 13:37:08 +0530 | [diff] [blame] | 442 | .flags = IORESOURCE_MEM, |
| 443 | }, |
| 444 | { |
| 445 | .start = INT_USB_HS, |
| 446 | .end = INT_USB_HS, |
| 447 | .flags = IORESOURCE_IRQ, |
| 448 | }, |
| 449 | }; |
| 450 | |
| 451 | struct platform_device msm_device_hsusb_host = { |
| 452 | .name = "msm_hsusb_host", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 453 | .id = 0, |
Pavankumar Kondeti | 5155e2c | 2010-12-08 13:37:08 +0530 | [diff] [blame] | 454 | .num_resources = ARRAY_SIZE(resources_hsusb_host), |
| 455 | .resource = resources_hsusb_host, |
| 456 | .dev = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 457 | .dma_mask = &dma_mask, |
| 458 | .coherent_dma_mask = 0xffffffffULL, |
Pavankumar Kondeti | 5155e2c | 2010-12-08 13:37:08 +0530 | [diff] [blame] | 459 | }, |
| 460 | }; |
| 461 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 462 | static struct platform_device *msm_host_devices[] = { |
| 463 | &msm_device_hsusb_host, |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 464 | }; |
| 465 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 466 | int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat) |
| 467 | { |
| 468 | struct platform_device *pdev; |
Daniel Walker | 1093276 | 2010-05-12 12:02:25 -0700 | [diff] [blame] | 469 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 470 | pdev = msm_host_devices[host]; |
| 471 | if (!pdev) |
| 472 | return -ENODEV; |
| 473 | pdev->dev.platform_data = plat; |
| 474 | return platform_device_register(pdev); |
| 475 | } |
| 476 | |
| 477 | struct platform_device asoc_msm_pcm = { |
| 478 | .name = "msm-dsp-audio", |
| 479 | .id = 0, |
| 480 | }; |
| 481 | |
| 482 | struct platform_device asoc_msm_dai0 = { |
| 483 | .name = "msm-codec-dai", |
| 484 | .id = 0, |
| 485 | }; |
| 486 | |
| 487 | struct platform_device asoc_msm_dai1 = { |
| 488 | .name = "msm-cpu-dai", |
| 489 | .id = 0, |
| 490 | }; |
| 491 | |
| 492 | #if defined (CONFIG_SND_MSM_MVS_DAI_SOC) |
| 493 | struct platform_device asoc_msm_mvs = { |
| 494 | .name = "msm-mvs-audio", |
| 495 | .id = 0, |
| 496 | }; |
| 497 | |
| 498 | struct platform_device asoc_mvs_dai0 = { |
| 499 | .name = "mvs-codec-dai", |
| 500 | .id = 0, |
| 501 | }; |
| 502 | |
| 503 | struct platform_device asoc_mvs_dai1 = { |
| 504 | .name = "mvs-cpu-dai", |
| 505 | .id = 0, |
| 506 | }; |
| 507 | #endif |
| 508 | |
| 509 | #define MSM_NAND_PHYS 0xA0200000 |
| 510 | #define MSM_NANDC01_PHYS 0xA0240000 |
| 511 | #define MSM_NANDC10_PHYS 0xA0280000 |
| 512 | #define MSM_NANDC11_PHYS 0xA02C0000 |
| 513 | #define EBI2_REG_BASE 0xA0000000 |
| 514 | static struct resource resources_nand[] = { |
| 515 | [0] = { |
| 516 | .name = "msm_nand_dmac", |
| 517 | .start = DMOV_NAND_CHAN, |
| 518 | .end = DMOV_NAND_CHAN, |
| 519 | .flags = IORESOURCE_DMA, |
| 520 | }, |
| 521 | [1] = { |
| 522 | .name = "msm_nand_phys", |
| 523 | .start = MSM_NAND_PHYS, |
| 524 | .end = MSM_NAND_PHYS + 0x7FF, |
| 525 | .flags = IORESOURCE_MEM, |
| 526 | }, |
| 527 | [2] = { |
| 528 | .name = "msm_nandc01_phys", |
| 529 | .start = MSM_NANDC01_PHYS, |
| 530 | .end = MSM_NANDC01_PHYS + 0x7FF, |
| 531 | .flags = IORESOURCE_MEM, |
| 532 | }, |
| 533 | [3] = { |
| 534 | .name = "msm_nandc10_phys", |
| 535 | .start = MSM_NANDC10_PHYS, |
| 536 | .end = MSM_NANDC10_PHYS + 0x7FF, |
| 537 | .flags = IORESOURCE_MEM, |
| 538 | }, |
| 539 | [4] = { |
| 540 | .name = "msm_nandc11_phys", |
| 541 | .start = MSM_NANDC11_PHYS, |
| 542 | .end = MSM_NANDC11_PHYS + 0x7FF, |
| 543 | .flags = IORESOURCE_MEM, |
| 544 | }, |
| 545 | [5] = { |
| 546 | .name = "ebi2_reg_base", |
| 547 | .start = EBI2_REG_BASE, |
| 548 | .end = EBI2_REG_BASE + 0x60, |
| 549 | .flags = IORESOURCE_MEM, |
| 550 | }, |
| 551 | }; |
| 552 | |
| 553 | static struct resource resources_otg[] = { |
| 554 | { |
| 555 | .start = MSM_HSUSB_PHYS, |
| 556 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 557 | .flags = IORESOURCE_MEM, |
| 558 | }, |
| 559 | { |
| 560 | .start = INT_USB_HS, |
| 561 | .end = INT_USB_HS, |
| 562 | .flags = IORESOURCE_IRQ, |
| 563 | }, |
| 564 | { |
| 565 | .name = "vbus_on", |
Anirudh Ghayal | c201933 | 2011-11-12 06:29:10 +0530 | [diff] [blame] | 566 | .start = PMIC8058_IRQ_BASE + PM8058_CHGVAL_IRQ, |
| 567 | .end = PMIC8058_IRQ_BASE + PM8058_CHGVAL_IRQ, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 568 | .flags = IORESOURCE_IRQ, |
| 569 | }, |
| 570 | }; |
| 571 | |
| 572 | struct platform_device msm_device_otg = { |
| 573 | .name = "msm_otg", |
| 574 | .id = -1, |
| 575 | .num_resources = ARRAY_SIZE(resources_otg), |
| 576 | .resource = resources_otg, |
| 577 | .dev = { |
| 578 | .coherent_dma_mask = 0xffffffffULL, |
| 579 | }, |
| 580 | }; |
| 581 | |
| 582 | struct flash_platform_data msm_nand_data = { |
| 583 | .parts = NULL, |
| 584 | .nr_parts = 0, |
| 585 | .interleave = 0, |
| 586 | }; |
| 587 | |
| 588 | struct platform_device msm_device_nand = { |
| 589 | .name = "msm_nand", |
| 590 | .id = -1, |
| 591 | .num_resources = ARRAY_SIZE(resources_nand), |
| 592 | .resource = resources_nand, |
| 593 | .dev = { |
| 594 | .platform_data = &msm_nand_data, |
| 595 | }, |
| 596 | }; |
| 597 | |
Angshuman Sarkar | bad32df | 2012-02-01 19:52:52 +0530 | [diff] [blame] | 598 | static struct resource smd_resource[] = { |
| 599 | { |
| 600 | .name = "a9_m2a_0", |
| 601 | .start = INT_A9_M2A_0, |
| 602 | .flags = IORESOURCE_IRQ, |
| 603 | }, |
| 604 | { |
| 605 | .name = "a9_m2a_5", |
| 606 | .start = INT_A9_M2A_5, |
| 607 | .flags = IORESOURCE_IRQ, |
| 608 | }, |
| 609 | { |
| 610 | .name = "adsp_a11_smsm", |
| 611 | .start = INT_ADSP_A11, |
| 612 | .flags = IORESOURCE_IRQ, |
| 613 | }, |
| 614 | }; |
| 615 | |
| 616 | static struct smd_subsystem_config smd_config_list[] = { |
| 617 | { |
| 618 | .irq_config_id = SMD_MODEM, |
| 619 | .subsys_name = "modem", |
| 620 | .edge = SMD_APPS_MODEM, |
| 621 | |
| 622 | .smd_int.irq_name = "a9_m2a_0", |
| 623 | .smd_int.flags = IRQF_TRIGGER_RISING, |
| 624 | .smd_int.irq_id = -1, |
| 625 | .smd_int.device_name = "smd_dev", |
| 626 | .smd_int.dev_id = 0, |
| 627 | |
| 628 | .smd_int.out_bit_pos = 1 << 0, |
Taniya Das | 298de8c | 2012-02-16 11:45:31 +0530 | [diff] [blame^] | 629 | .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE, |
Angshuman Sarkar | bad32df | 2012-02-01 19:52:52 +0530 | [diff] [blame] | 630 | .smd_int.out_offset = 0x8, |
| 631 | |
| 632 | .smsm_int.irq_name = "a9_m2a_5", |
| 633 | .smsm_int.flags = IRQF_TRIGGER_RISING, |
| 634 | .smsm_int.irq_id = -1, |
| 635 | .smsm_int.device_name = "smd_dev", |
| 636 | .smsm_int.dev_id = 0, |
| 637 | |
| 638 | .smsm_int.out_bit_pos = 1 << 5, |
Taniya Das | 298de8c | 2012-02-16 11:45:31 +0530 | [diff] [blame^] | 639 | .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE, |
Angshuman Sarkar | bad32df | 2012-02-01 19:52:52 +0530 | [diff] [blame] | 640 | .smsm_int.out_offset = 0x8, |
| 641 | |
| 642 | } |
| 643 | }; |
| 644 | |
| 645 | static struct smd_platform smd_platform_data = { |
| 646 | .num_ss_configs = ARRAY_SIZE(smd_config_list), |
| 647 | .smd_ss_configs = smd_config_list, |
| 648 | }; |
| 649 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 650 | struct platform_device msm_device_smd = { |
| 651 | .name = "msm_smd", |
| 652 | .id = -1, |
Angshuman Sarkar | bad32df | 2012-02-01 19:52:52 +0530 | [diff] [blame] | 653 | .resource = smd_resource, |
| 654 | .num_resources = ARRAY_SIZE(smd_resource), |
| 655 | .dev = { |
| 656 | .platform_data = &smd_platform_data, |
| 657 | } |
| 658 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 659 | }; |
| 660 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 661 | static struct resource msm_dmov_resource[] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 662 | { |
| 663 | .start = INT_ADM_AARM, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 664 | .flags = IORESOURCE_IRQ, |
| 665 | }, |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 666 | { |
| 667 | .start = 0xAC400000, |
| 668 | .end = 0xAC400000 + SZ_4K - 1, |
| 669 | .flags = IORESOURCE_MEM, |
| 670 | }, |
| 671 | }; |
| 672 | |
| 673 | static struct msm_dmov_pdata msm_dmov_pdata = { |
| 674 | .sd = 2, |
| 675 | .sd_size = 0x400, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 676 | }; |
| 677 | |
| 678 | struct platform_device msm_device_dmov = { |
| 679 | .name = "msm_dmov", |
| 680 | .id = -1, |
| 681 | .resource = msm_dmov_resource, |
| 682 | .num_resources = ARRAY_SIZE(msm_dmov_resource), |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 683 | .dev = { |
| 684 | .platform_data = &msm_dmov_pdata, |
| 685 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 686 | }; |
| 687 | |
| 688 | #define MSM_SDC1_BASE 0xA0400000 |
| 689 | #define MSM_SDC2_BASE 0xA0500000 |
| 690 | #define MSM_SDC3_BASE 0xA3000000 |
| 691 | #define MSM_SDC4_BASE 0xA3100000 |
| 692 | static struct resource resources_sdc1[] = { |
| 693 | { |
| 694 | .start = MSM_SDC1_BASE, |
| 695 | .end = MSM_SDC1_BASE + SZ_4K - 1, |
| 696 | .flags = IORESOURCE_MEM, |
| 697 | }, |
| 698 | { |
| 699 | .start = INT_SDC1_0, |
| 700 | .end = INT_SDC1_1, |
| 701 | .flags = IORESOURCE_IRQ, |
| 702 | }, |
| 703 | { |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 704 | .name = "sdcc_dma_chnl", |
| 705 | .start = DMOV_SDC1_CHAN, |
| 706 | .end = DMOV_SDC1_CHAN, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 707 | .flags = IORESOURCE_DMA, |
| 708 | }, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 709 | { |
| 710 | .name = "sdcc_dma_crci", |
| 711 | .start = DMOV_SDC1_CRCI, |
| 712 | .end = DMOV_SDC1_CRCI, |
| 713 | .flags = IORESOURCE_DMA, |
| 714 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 715 | }; |
| 716 | |
| 717 | static struct resource resources_sdc2[] = { |
| 718 | { |
| 719 | .start = MSM_SDC2_BASE, |
| 720 | .end = MSM_SDC2_BASE + SZ_4K - 1, |
| 721 | .flags = IORESOURCE_MEM, |
| 722 | }, |
| 723 | { |
| 724 | .start = INT_SDC2_0, |
| 725 | .end = INT_SDC2_1, |
| 726 | .flags = IORESOURCE_IRQ, |
| 727 | }, |
| 728 | { |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 729 | .name = "sdcc_dma_chnl", |
| 730 | .start = DMOV_SDC2_CHAN, |
| 731 | .end = DMOV_SDC2_CHAN, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 732 | .flags = IORESOURCE_DMA, |
| 733 | }, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 734 | { |
| 735 | .name = "sdcc_dma_crci", |
| 736 | .start = DMOV_SDC2_CRCI, |
| 737 | .end = DMOV_SDC2_CRCI, |
| 738 | .flags = IORESOURCE_DMA, |
| 739 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 740 | }; |
| 741 | |
| 742 | static struct resource resources_sdc3[] = { |
| 743 | { |
| 744 | .start = MSM_SDC3_BASE, |
| 745 | .end = MSM_SDC3_BASE + SZ_4K - 1, |
| 746 | .flags = IORESOURCE_MEM, |
| 747 | }, |
| 748 | { |
| 749 | .start = INT_SDC3_0, |
| 750 | .end = INT_SDC3_1, |
| 751 | .flags = IORESOURCE_IRQ, |
| 752 | }, |
| 753 | { |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 754 | .name = "sdcc_dma_chnl", |
Pankaj Kumar | e657b9f | 2011-10-12 20:11:12 +0530 | [diff] [blame] | 755 | .start = DMOV_SDC3_CHAN, |
| 756 | .end = DMOV_SDC3_CHAN, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 757 | .flags = IORESOURCE_DMA, |
| 758 | }, |
| 759 | { |
| 760 | .name = "sdcc_dma_crci", |
Pankaj Kumar | e657b9f | 2011-10-12 20:11:12 +0530 | [diff] [blame] | 761 | .start = DMOV_SDC3_CRCI, |
| 762 | .end = DMOV_SDC3_CRCI, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 763 | .flags = IORESOURCE_DMA, |
| 764 | }, |
| 765 | }; |
| 766 | |
| 767 | static struct resource resources_sdc4[] = { |
| 768 | { |
| 769 | .start = MSM_SDC4_BASE, |
| 770 | .end = MSM_SDC4_BASE + SZ_4K - 1, |
| 771 | .flags = IORESOURCE_MEM, |
| 772 | }, |
| 773 | { |
| 774 | .start = INT_SDC4_0, |
| 775 | .end = INT_SDC4_1, |
| 776 | .flags = IORESOURCE_IRQ, |
| 777 | }, |
| 778 | { |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 779 | .name = "sdcc_dma_chnl", |
Pankaj Kumar | e657b9f | 2011-10-12 20:11:12 +0530 | [diff] [blame] | 780 | .start = DMOV_SDC4_CHAN, |
| 781 | .end = DMOV_SDC4_CHAN, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 782 | .flags = IORESOURCE_DMA, |
| 783 | }, |
| 784 | { |
| 785 | .name = "sdcc_dma_crci", |
Pankaj Kumar | e657b9f | 2011-10-12 20:11:12 +0530 | [diff] [blame] | 786 | .start = DMOV_SDC4_CRCI, |
| 787 | .end = DMOV_SDC4_CRCI, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 788 | .flags = IORESOURCE_DMA, |
| 789 | }, |
| 790 | }; |
| 791 | |
| 792 | struct platform_device msm_device_sdc1 = { |
| 793 | .name = "msm_sdcc", |
| 794 | .id = 1, |
| 795 | .num_resources = ARRAY_SIZE(resources_sdc1), |
| 796 | .resource = resources_sdc1, |
| 797 | .dev = { |
| 798 | .coherent_dma_mask = 0xffffffff, |
| 799 | }, |
| 800 | }; |
| 801 | |
| 802 | struct platform_device msm_device_sdc2 = { |
| 803 | .name = "msm_sdcc", |
| 804 | .id = 2, |
| 805 | .num_resources = ARRAY_SIZE(resources_sdc2), |
| 806 | .resource = resources_sdc2, |
| 807 | .dev = { |
| 808 | .coherent_dma_mask = 0xffffffff, |
| 809 | }, |
| 810 | }; |
| 811 | |
| 812 | struct platform_device msm_device_sdc3 = { |
| 813 | .name = "msm_sdcc", |
| 814 | .id = 3, |
| 815 | .num_resources = ARRAY_SIZE(resources_sdc3), |
| 816 | .resource = resources_sdc3, |
| 817 | .dev = { |
| 818 | .coherent_dma_mask = 0xffffffff, |
| 819 | }, |
| 820 | }; |
| 821 | |
| 822 | struct platform_device msm_device_sdc4 = { |
| 823 | .name = "msm_sdcc", |
| 824 | .id = 4, |
| 825 | .num_resources = ARRAY_SIZE(resources_sdc4), |
| 826 | .resource = resources_sdc4, |
| 827 | .dev = { |
| 828 | .coherent_dma_mask = 0xffffffff, |
| 829 | }, |
| 830 | }; |
| 831 | |
| 832 | static struct platform_device *msm_sdcc_devices[] __initdata = { |
| 833 | &msm_device_sdc1, |
| 834 | &msm_device_sdc2, |
| 835 | &msm_device_sdc3, |
| 836 | &msm_device_sdc4, |
| 837 | }; |
| 838 | |
| 839 | int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat) |
| 840 | { |
| 841 | struct platform_device *pdev; |
| 842 | |
| 843 | if (controller < 1 || controller > 4) |
| 844 | return -EINVAL; |
| 845 | |
| 846 | pdev = msm_sdcc_devices[controller-1]; |
| 847 | pdev->dev.platform_data = plat; |
| 848 | return platform_device_register(pdev); |
| 849 | } |
| 850 | |
| 851 | static struct resource msm_vidc_720p_resources[] = { |
| 852 | { |
| 853 | .start = 0xA3B00000, |
| 854 | .end = 0xA3B00000 + SZ_4K - 1, |
| 855 | .flags = IORESOURCE_MEM, |
| 856 | }, |
| 857 | { |
| 858 | .start = INT_MFC720, |
| 859 | .end = INT_MFC720, |
| 860 | .flags = IORESOURCE_IRQ, |
| 861 | }, |
| 862 | }; |
| 863 | |
| 864 | struct msm_vidc_platform_data vidc_platform_data = { |
Deepak Kotur | cb4f672 | 2011-10-31 14:06:57 -0700 | [diff] [blame] | 865 | .memtype = MEMTYPE_EBI0, |
Deepika Pepakayala | bebc762 | 2011-12-01 15:13:43 -0800 | [diff] [blame] | 866 | .enable_ion = 0, |
| 867 | .disable_dmx = 0 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 868 | }; |
| 869 | |
| 870 | struct platform_device msm_device_vidc_720p = { |
| 871 | .name = "msm_vidc", |
| 872 | .id = 0, |
| 873 | .num_resources = ARRAY_SIZE(msm_vidc_720p_resources), |
| 874 | .resource = msm_vidc_720p_resources, |
| 875 | .dev = { |
| 876 | .platform_data = &vidc_platform_data, |
| 877 | }, |
| 878 | }; |
| 879 | |
| 880 | #if defined(CONFIG_FB_MSM_MDP40) |
| 881 | #define MDP_BASE 0xA3F00000 |
| 882 | #define PMDH_BASE 0xAD600000 |
| 883 | #define EMDH_BASE 0xAD700000 |
| 884 | #define TVENC_BASE 0xAD400000 |
| 885 | #else |
| 886 | #define MDP_BASE 0xAA200000 |
| 887 | #define PMDH_BASE 0xAA600000 |
| 888 | #define EMDH_BASE 0xAA700000 |
| 889 | #define TVENC_BASE 0xAA400000 |
| 890 | #endif |
| 891 | |
| 892 | static struct resource msm_mdp_resources[] = { |
| 893 | { |
| 894 | .name = "mdp", |
| 895 | .start = MDP_BASE, |
| 896 | .end = MDP_BASE + 0x000F0000 - 1, |
| 897 | .flags = IORESOURCE_MEM, |
| 898 | }, |
| 899 | { |
| 900 | .start = INT_MDP, |
| 901 | .end = INT_MDP, |
| 902 | .flags = IORESOURCE_IRQ, |
| 903 | }, |
| 904 | }; |
| 905 | |
| 906 | static struct resource msm_mddi_resources[] = { |
| 907 | { |
| 908 | .name = "pmdh", |
| 909 | .start = PMDH_BASE, |
| 910 | .end = PMDH_BASE + PAGE_SIZE - 1, |
| 911 | .flags = IORESOURCE_MEM, |
| 912 | } |
| 913 | }; |
| 914 | |
| 915 | static struct resource msm_mddi_ext_resources[] = { |
| 916 | { |
| 917 | .name = "emdh", |
| 918 | .start = EMDH_BASE, |
| 919 | .end = EMDH_BASE + PAGE_SIZE - 1, |
| 920 | .flags = IORESOURCE_MEM, |
| 921 | } |
| 922 | }; |
| 923 | |
| 924 | static struct resource msm_ebi2_lcd_resources[] = { |
| 925 | { |
| 926 | .name = "base", |
| 927 | .start = 0xa0d00000, |
| 928 | .end = 0xa0d00000 + PAGE_SIZE - 1, |
| 929 | .flags = IORESOURCE_MEM, |
| 930 | }, |
| 931 | { |
| 932 | .name = "lcd01", |
| 933 | .start = 0x98000000, |
| 934 | .end = 0x98000000 + 0x80000 - 1, |
| 935 | .flags = IORESOURCE_MEM, |
| 936 | }, |
| 937 | { |
| 938 | .name = "lcd02", |
| 939 | .start = 0x9c000000, |
| 940 | .end = 0x9c000000 + 0x80000 - 1, |
| 941 | .flags = IORESOURCE_MEM, |
| 942 | }, |
| 943 | }; |
| 944 | |
| 945 | static struct resource msm_tvenc_resources[] = { |
| 946 | { |
| 947 | .name = "tvenc", |
| 948 | .start = TVENC_BASE, |
| 949 | .end = TVENC_BASE + PAGE_SIZE - 1, |
| 950 | .flags = IORESOURCE_MEM, |
| 951 | } |
| 952 | }; |
| 953 | |
| 954 | #ifdef CONFIG_FB_MSM_TVOUT |
| 955 | static struct resource tvout_device_resources[] = { |
| 956 | { |
| 957 | .name = "tvout_device_irq", |
| 958 | .start = INT_TV_ENC, |
| 959 | .end = INT_TV_ENC, |
| 960 | .flags = IORESOURCE_IRQ, |
| 961 | }, |
| 962 | }; |
| 963 | #endif |
| 964 | |
| 965 | static struct platform_device msm_mdp_device = { |
| 966 | .name = "mdp", |
| 967 | .id = 0, |
| 968 | .num_resources = ARRAY_SIZE(msm_mdp_resources), |
| 969 | .resource = msm_mdp_resources, |
| 970 | }; |
| 971 | |
| 972 | static struct platform_device msm_mddi_device = { |
| 973 | .name = "mddi", |
| 974 | .id = 0, |
| 975 | .num_resources = ARRAY_SIZE(msm_mddi_resources), |
| 976 | .resource = msm_mddi_resources, |
| 977 | }; |
| 978 | |
| 979 | static struct platform_device msm_mddi_ext_device = { |
| 980 | .name = "mddi_ext", |
| 981 | .id = 0, |
| 982 | .num_resources = ARRAY_SIZE(msm_mddi_ext_resources), |
| 983 | .resource = msm_mddi_ext_resources, |
| 984 | }; |
| 985 | |
| 986 | static struct platform_device msm_ebi2_lcd_device = { |
| 987 | .name = "ebi2_lcd", |
| 988 | .id = 0, |
| 989 | .num_resources = ARRAY_SIZE(msm_ebi2_lcd_resources), |
| 990 | .resource = msm_ebi2_lcd_resources, |
| 991 | }; |
| 992 | |
| 993 | static struct platform_device msm_lcdc_device = { |
| 994 | .name = "lcdc", |
| 995 | .id = 0, |
| 996 | }; |
| 997 | |
| 998 | static struct platform_device msm_dtv_device = { |
| 999 | .name = "dtv", |
| 1000 | .id = 0, |
| 1001 | }; |
| 1002 | |
| 1003 | static struct platform_device msm_tvenc_device = { |
| 1004 | .name = "tvenc", |
| 1005 | .id = 0, |
| 1006 | .num_resources = ARRAY_SIZE(msm_tvenc_resources), |
| 1007 | .resource = msm_tvenc_resources, |
| 1008 | }; |
| 1009 | |
| 1010 | #ifdef CONFIG_FB_MSM_TVOUT |
| 1011 | static struct platform_device tvout_msm_device = { |
| 1012 | .name = "tvout_device", |
| 1013 | .id = 0, |
| 1014 | .num_resources = ARRAY_SIZE(tvout_device_resources), |
| 1015 | .resource = tvout_device_resources, |
| 1016 | }; |
| 1017 | #endif |
| 1018 | |
| 1019 | /* TSIF begin */ |
| 1020 | #if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) |
| 1021 | |
| 1022 | #define MSM_TSIF_PHYS (0xa3400000) |
| 1023 | #define MSM_TSIF_SIZE (0x200) |
| 1024 | |
| 1025 | static struct resource tsif_resources[] = { |
| 1026 | [0] = { |
| 1027 | .flags = IORESOURCE_IRQ, |
| 1028 | .start = INT_TSIF, |
| 1029 | .end = INT_TSIF, |
| 1030 | }, |
| 1031 | [1] = { |
| 1032 | .flags = IORESOURCE_MEM, |
| 1033 | .start = MSM_TSIF_PHYS, |
| 1034 | .end = MSM_TSIF_PHYS + MSM_TSIF_SIZE - 1, |
| 1035 | }, |
| 1036 | [2] = { |
| 1037 | .flags = IORESOURCE_DMA, |
| 1038 | .start = DMOV_TSIF_CHAN, |
| 1039 | .end = DMOV_TSIF_CRCI, |
| 1040 | }, |
| 1041 | }; |
| 1042 | |
| 1043 | static void tsif_release(struct device *dev) |
| 1044 | { |
| 1045 | dev_info(dev, "release\n"); |
| 1046 | } |
| 1047 | |
| 1048 | struct platform_device msm_device_tsif = { |
| 1049 | .name = "msm_tsif", |
| 1050 | .id = 0, |
| 1051 | .num_resources = ARRAY_SIZE(tsif_resources), |
| 1052 | .resource = tsif_resources, |
| 1053 | .dev = { |
| 1054 | .release = tsif_release, |
| 1055 | }, |
| 1056 | }; |
| 1057 | #endif /* defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) */ |
| 1058 | /* TSIF end */ |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | #ifdef CONFIG_MSM_ROTATOR |
| 1063 | static struct resource resources_msm_rotator[] = { |
| 1064 | { |
| 1065 | .start = 0xA3E00000, |
| 1066 | .end = 0xA3F00000 - 1, |
| 1067 | .flags = IORESOURCE_MEM, |
| 1068 | }, |
| 1069 | { |
| 1070 | .start = INT_ROTATOR, |
| 1071 | .end = INT_ROTATOR, |
| 1072 | .flags = IORESOURCE_IRQ, |
| 1073 | }, |
| 1074 | }; |
| 1075 | |
| 1076 | static struct msm_rot_clocks rotator_clocks[] = { |
| 1077 | { |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 1078 | .clk_name = "core_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1079 | .clk_type = ROTATOR_CORE_CLK, |
| 1080 | .clk_rate = 0, |
| 1081 | }, |
| 1082 | { |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 1083 | .clk_name = "iface_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1084 | .clk_type = ROTATOR_PCLK, |
| 1085 | .clk_rate = 0, |
| 1086 | }, |
| 1087 | { |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 1088 | .clk_name = "mem_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1089 | .clk_type = ROTATOR_IMEM_CLK, |
| 1090 | .clk_rate = 0, |
| 1091 | }, |
| 1092 | }; |
| 1093 | |
| 1094 | static struct msm_rotator_platform_data rotator_pdata = { |
| 1095 | .number_of_clocks = ARRAY_SIZE(rotator_clocks), |
| 1096 | .hardware_version_number = 0x1000303, |
| 1097 | .rotator_clks = rotator_clocks, |
| 1098 | .regulator_name = "fs_rot", |
| 1099 | }; |
| 1100 | |
| 1101 | struct platform_device msm_rotator_device = { |
| 1102 | .name = "msm_rotator", |
| 1103 | .id = 0, |
| 1104 | .num_resources = ARRAY_SIZE(resources_msm_rotator), |
| 1105 | .resource = resources_msm_rotator, |
| 1106 | .dev = { |
| 1107 | .platform_data = &rotator_pdata, |
| 1108 | }, |
| 1109 | }; |
| 1110 | #endif |
| 1111 | |
| 1112 | static void __init msm_register_device(struct platform_device *pdev, void *data) |
| 1113 | { |
| 1114 | int ret; |
| 1115 | |
| 1116 | pdev->dev.platform_data = data; |
| 1117 | |
| 1118 | ret = platform_device_register(pdev); |
| 1119 | if (ret) |
| 1120 | dev_err(&pdev->dev, |
| 1121 | "%s: platform_device_register() failed = %d\n", |
| 1122 | __func__, ret); |
| 1123 | } |
| 1124 | |
| 1125 | void __init msm_fb_register_device(char *name, void *data) |
| 1126 | { |
| 1127 | if (!strncmp(name, "mdp", 3)) |
| 1128 | msm_register_device(&msm_mdp_device, data); |
| 1129 | else if (!strncmp(name, "pmdh", 4)) |
| 1130 | msm_register_device(&msm_mddi_device, data); |
| 1131 | else if (!strncmp(name, "emdh", 4)) |
| 1132 | msm_register_device(&msm_mddi_ext_device, data); |
| 1133 | else if (!strncmp(name, "ebi2", 4)) |
| 1134 | msm_register_device(&msm_ebi2_lcd_device, data); |
| 1135 | else if (!strncmp(name, "tvenc", 5)) |
| 1136 | msm_register_device(&msm_tvenc_device, data); |
| 1137 | else if (!strncmp(name, "lcdc", 4)) |
| 1138 | msm_register_device(&msm_lcdc_device, data); |
| 1139 | else if (!strncmp(name, "dtv", 3)) |
| 1140 | msm_register_device(&msm_dtv_device, data); |
| 1141 | #ifdef CONFIG_FB_MSM_TVOUT |
| 1142 | else if (!strncmp(name, "tvout_device", 12)) |
| 1143 | msm_register_device(&tvout_msm_device, data); |
| 1144 | #endif |
| 1145 | else |
| 1146 | printk(KERN_ERR "%s: unknown device! %s\n", __func__, name); |
| 1147 | } |
| 1148 | |
| 1149 | static struct platform_device msm_camera_device = { |
| 1150 | .name = "msm_camera", |
| 1151 | .id = 0, |
| 1152 | }; |
| 1153 | |
| 1154 | void __init msm_camera_register_device(void *res, uint32_t num, |
| 1155 | void *data) |
| 1156 | { |
| 1157 | msm_camera_device.num_resources = num; |
| 1158 | msm_camera_device.resource = res; |
| 1159 | |
| 1160 | msm_register_device(&msm_camera_device, data); |
| 1161 | } |
| 1162 | |
| 1163 | struct resource kgsl_3d0_resources[] = { |
| 1164 | { |
| 1165 | .name = KGSL_3D0_REG_MEMORY, |
| 1166 | .start = 0xA3500000, /* 3D GRP address */ |
| 1167 | .end = 0xA351ffff, |
| 1168 | .flags = IORESOURCE_MEM, |
| 1169 | }, |
| 1170 | { |
| 1171 | .name = KGSL_3D0_IRQ, |
| 1172 | .start = INT_GRP_3D, |
| 1173 | .end = INT_GRP_3D, |
| 1174 | .flags = IORESOURCE_IRQ, |
| 1175 | }, |
| 1176 | }; |
| 1177 | |
| 1178 | static struct kgsl_device_platform_data kgsl_3d0_pdata = { |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1179 | .pwrlevel = { |
| 1180 | { |
| 1181 | .gpu_freq = 245760000, |
| 1182 | .bus_freq = 192000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1183 | }, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1184 | { |
| 1185 | .gpu_freq = 192000000, |
| 1186 | .bus_freq = 152000000, |
| 1187 | }, |
| 1188 | { |
| 1189 | .gpu_freq = 192000000, |
| 1190 | .bus_freq = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1191 | }, |
| 1192 | }, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1193 | .init_level = 0, |
| 1194 | .num_levels = 3, |
| 1195 | .set_grp_async = set_grp3d_async, |
| 1196 | .idle_timeout = HZ/20, |
| 1197 | .nap_allowed = true, |
Kedar Joshi | c11d098 | 2012-02-07 10:59:49 +0530 | [diff] [blame] | 1198 | .idle_needed = true, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1199 | .clk_map = KGSL_CLK_SRC | KGSL_CLK_CORE | |
| 1200 | KGSL_CLK_IFACE | KGSL_CLK_MEM, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1201 | }; |
| 1202 | |
| 1203 | struct platform_device msm_kgsl_3d0 = { |
| 1204 | .name = "kgsl-3d0", |
| 1205 | .id = 0, |
| 1206 | .num_resources = ARRAY_SIZE(kgsl_3d0_resources), |
| 1207 | .resource = kgsl_3d0_resources, |
| 1208 | .dev = { |
| 1209 | .platform_data = &kgsl_3d0_pdata, |
| 1210 | }, |
| 1211 | }; |
| 1212 | |
| 1213 | static struct resource kgsl_2d0_resources[] = { |
| 1214 | { |
| 1215 | .name = KGSL_2D0_REG_MEMORY, |
| 1216 | .start = 0xA3900000, /* Z180 base address */ |
| 1217 | .end = 0xA3900FFF, |
| 1218 | .flags = IORESOURCE_MEM, |
| 1219 | }, |
| 1220 | { |
| 1221 | .name = KGSL_2D0_IRQ, |
| 1222 | .start = INT_GRP_2D, |
| 1223 | .end = INT_GRP_2D, |
| 1224 | .flags = IORESOURCE_IRQ, |
| 1225 | }, |
| 1226 | }; |
| 1227 | |
| 1228 | static struct kgsl_device_platform_data kgsl_2d0_pdata = { |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1229 | .pwrlevel = { |
| 1230 | { |
| 1231 | .gpu_freq = 0, |
| 1232 | .bus_freq = 192000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1233 | }, |
| 1234 | }, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1235 | .init_level = 0, |
| 1236 | .num_levels = 1, |
| 1237 | /* HW workaround, run Z180 SYNC @ 192 MHZ */ |
| 1238 | .set_grp_async = NULL, |
| 1239 | .idle_timeout = HZ/10, |
| 1240 | .nap_allowed = true, |
Kedar Joshi | c11d098 | 2012-02-07 10:59:49 +0530 | [diff] [blame] | 1241 | .idle_needed = true, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 1242 | .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1243 | }; |
| 1244 | |
| 1245 | struct platform_device msm_kgsl_2d0 = { |
| 1246 | .name = "kgsl-2d0", |
| 1247 | .id = 0, |
| 1248 | .num_resources = ARRAY_SIZE(kgsl_2d0_resources), |
| 1249 | .resource = kgsl_2d0_resources, |
| 1250 | .dev = { |
| 1251 | .platform_data = &kgsl_2d0_pdata, |
| 1252 | }, |
| 1253 | }; |
| 1254 | |
| 1255 | struct platform_device *msm_footswitch_devices[] = { |
| 1256 | FS_PCOM(FS_GFX2D0, "fs_gfx2d0"), |
| 1257 | FS_PCOM(FS_GFX3D, "fs_gfx3d"), |
| 1258 | FS_PCOM(FS_MDP, "fs_mdp"), |
| 1259 | FS_PCOM(FS_MFC, "fs_mfc"), |
| 1260 | FS_PCOM(FS_ROT, "fs_rot"), |
| 1261 | FS_PCOM(FS_VFE, "fs_vfe"), |
| 1262 | FS_PCOM(FS_VPE, "fs_vpe"), |
| 1263 | }; |
| 1264 | unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices); |
Taniya Das | 2e94819 | 2011-12-20 11:15:13 +0530 | [diff] [blame] | 1265 | |
| 1266 | static struct resource gpio_resources[] = { |
| 1267 | { |
| 1268 | .start = INT_GPIO_GROUP1, |
| 1269 | .flags = IORESOURCE_IRQ, |
| 1270 | }, |
| 1271 | { |
| 1272 | .start = INT_GPIO_GROUP2, |
| 1273 | .flags = IORESOURCE_IRQ, |
| 1274 | }, |
| 1275 | }; |
| 1276 | |
| 1277 | static struct platform_device msm_device_gpio = { |
| 1278 | .name = "msmgpio", |
| 1279 | .id = -1, |
| 1280 | .resource = gpio_resources, |
| 1281 | .num_resources = ARRAY_SIZE(gpio_resources), |
| 1282 | }; |
| 1283 | |
| 1284 | static int __init msm7630_init_gpio(void) |
| 1285 | { |
| 1286 | platform_device_register(&msm_device_gpio); |
| 1287 | return 0; |
| 1288 | } |
| 1289 | |
| 1290 | postcore_initcall(msm7630_init_gpio); |