Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 1 | /* linux/arch/arm/mach-msm/devices.c |
| 2 | * |
| 3 | * Copyright (C) 2008 Google, Inc. |
| 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/interrupt.h> |
| 19 | #include <linux/dma-mapping.h> |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 20 | |
Russell King | 80b02c1 | 2009-01-08 10:01:47 +0000 | [diff] [blame] | 21 | #include <mach/irqs.h> |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 22 | #include <mach/msm_iomap.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 23 | #include <mach/dma.h> |
| 24 | #include <asm/clkdev.h> |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 25 | #include "devices.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 26 | #include "proc_comm.h" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 27 | |
| 28 | #include <asm/mach/flash.h> |
| 29 | #include <linux/mtd/nand.h> |
| 30 | #include <linux/mtd/partitions.h> |
| 31 | |
San Mehat | 5d4f77f | 2008-11-10 16:30:27 -0800 | [diff] [blame] | 32 | #include <mach/mmc.h> |
| 33 | |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 34 | static struct resource resources_uart1[] = { |
| 35 | { |
| 36 | .start = INT_UART1, |
| 37 | .end = INT_UART1, |
| 38 | .flags = IORESOURCE_IRQ, |
| 39 | }, |
| 40 | { |
| 41 | .start = MSM_UART1_PHYS, |
| 42 | .end = MSM_UART1_PHYS + MSM_UART1_SIZE - 1, |
| 43 | .flags = IORESOURCE_MEM, |
Stepan Moskovchenko | d41cb8c | 2011-01-17 20:33:32 -0800 | [diff] [blame] | 44 | .name = "uart_resource" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 45 | }, |
| 46 | }; |
| 47 | |
| 48 | static struct resource resources_uart2[] = { |
| 49 | { |
| 50 | .start = INT_UART2, |
| 51 | .end = INT_UART2, |
| 52 | .flags = IORESOURCE_IRQ, |
| 53 | }, |
| 54 | { |
| 55 | .start = MSM_UART2_PHYS, |
| 56 | .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1, |
| 57 | .flags = IORESOURCE_MEM, |
Stepan Moskovchenko | d41cb8c | 2011-01-17 20:33:32 -0800 | [diff] [blame] | 58 | .name = "uart_resource" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 59 | }, |
| 60 | }; |
| 61 | |
| 62 | static struct resource resources_uart3[] = { |
| 63 | { |
| 64 | .start = INT_UART3, |
| 65 | .end = INT_UART3, |
| 66 | .flags = IORESOURCE_IRQ, |
| 67 | }, |
| 68 | { |
| 69 | .start = MSM_UART3_PHYS, |
| 70 | .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, |
| 71 | .flags = IORESOURCE_MEM, |
Stepan Moskovchenko | d41cb8c | 2011-01-17 20:33:32 -0800 | [diff] [blame] | 72 | .name = "uart_resource" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 73 | }, |
| 74 | }; |
| 75 | |
| 76 | struct platform_device msm_device_uart1 = { |
| 77 | .name = "msm_serial", |
| 78 | .id = 0, |
| 79 | .num_resources = ARRAY_SIZE(resources_uart1), |
| 80 | .resource = resources_uart1, |
| 81 | }; |
| 82 | |
| 83 | struct platform_device msm_device_uart2 = { |
| 84 | .name = "msm_serial", |
| 85 | .id = 1, |
| 86 | .num_resources = ARRAY_SIZE(resources_uart2), |
| 87 | .resource = resources_uart2, |
| 88 | }; |
| 89 | |
| 90 | struct platform_device msm_device_uart3 = { |
| 91 | .name = "msm_serial", |
| 92 | .id = 2, |
| 93 | .num_resources = ARRAY_SIZE(resources_uart3), |
| 94 | .resource = resources_uart3, |
| 95 | }; |
| 96 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 97 | static struct resource msm_uart1_dm_resources[] = { |
| 98 | { |
| 99 | .start = MSM_UART1DM_PHYS, |
| 100 | .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1, |
| 101 | .flags = IORESOURCE_MEM, |
| 102 | }, |
| 103 | { |
| 104 | .start = INT_UART1DM_IRQ, |
| 105 | .end = INT_UART1DM_IRQ, |
| 106 | .flags = IORESOURCE_IRQ, |
| 107 | }, |
| 108 | { |
| 109 | .start = INT_UART1DM_RX, |
| 110 | .end = INT_UART1DM_RX, |
| 111 | .flags = IORESOURCE_IRQ, |
| 112 | }, |
| 113 | { |
| 114 | .start = DMOV_HSUART1_TX_CHAN, |
| 115 | .end = DMOV_HSUART1_RX_CHAN, |
| 116 | .name = "uartdm_channels", |
| 117 | .flags = IORESOURCE_DMA, |
| 118 | }, |
| 119 | { |
| 120 | .start = DMOV_HSUART1_TX_CRCI, |
| 121 | .end = DMOV_HSUART1_RX_CRCI, |
| 122 | .name = "uartdm_crci", |
| 123 | .flags = IORESOURCE_DMA, |
| 124 | }, |
| 125 | }; |
| 126 | |
| 127 | static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32); |
| 128 | |
| 129 | struct platform_device msm_device_uart_dm1 = { |
| 130 | .name = "msm_serial_hs", |
| 131 | .id = 0, |
| 132 | .num_resources = ARRAY_SIZE(msm_uart1_dm_resources), |
| 133 | .resource = msm_uart1_dm_resources, |
| 134 | .dev = { |
| 135 | .dma_mask = &msm_uart_dm1_dma_mask, |
| 136 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 137 | }, |
| 138 | }; |
| 139 | |
| 140 | static struct resource msm_uart2_dm_resources[] = { |
| 141 | { |
| 142 | .start = MSM_UART2DM_PHYS, |
| 143 | .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1, |
| 144 | .flags = IORESOURCE_MEM, |
| 145 | }, |
| 146 | { |
| 147 | .start = INT_UART2DM_IRQ, |
| 148 | .end = INT_UART2DM_IRQ, |
| 149 | .flags = IORESOURCE_IRQ, |
| 150 | }, |
| 151 | { |
| 152 | .start = INT_UART2DM_RX, |
| 153 | .end = INT_UART2DM_RX, |
| 154 | .flags = IORESOURCE_IRQ, |
| 155 | }, |
| 156 | { |
| 157 | .start = DMOV_HSUART2_TX_CHAN, |
| 158 | .end = DMOV_HSUART2_RX_CHAN, |
| 159 | .name = "uartdm_channels", |
| 160 | .flags = IORESOURCE_DMA, |
| 161 | }, |
| 162 | { |
| 163 | .start = DMOV_HSUART2_TX_CRCI, |
| 164 | .end = DMOV_HSUART2_RX_CRCI, |
| 165 | .name = "uartdm_crci", |
| 166 | .flags = IORESOURCE_DMA, |
| 167 | }, |
| 168 | }; |
| 169 | |
| 170 | static u64 msm_uart_dm2_dma_mask = DMA_BIT_MASK(32); |
| 171 | |
| 172 | struct platform_device msm_device_uart_dm2 = { |
| 173 | .name = "msm_serial_hs", |
| 174 | .id = 1, |
| 175 | .num_resources = ARRAY_SIZE(msm_uart2_dm_resources), |
| 176 | .resource = msm_uart2_dm_resources, |
| 177 | .dev = { |
| 178 | .dma_mask = &msm_uart_dm2_dma_mask, |
| 179 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 180 | }, |
| 181 | }; |
| 182 | |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 183 | static struct resource resources_i2c[] = { |
| 184 | { |
| 185 | .start = MSM_I2C_PHYS, |
| 186 | .end = MSM_I2C_PHYS + MSM_I2C_SIZE - 1, |
| 187 | .flags = IORESOURCE_MEM, |
| 188 | }, |
| 189 | { |
| 190 | .start = INT_PWB_I2C, |
| 191 | .end = INT_PWB_I2C, |
| 192 | .flags = IORESOURCE_IRQ, |
| 193 | }, |
| 194 | }; |
| 195 | |
| 196 | struct platform_device msm_device_i2c = { |
| 197 | .name = "msm_i2c", |
| 198 | .id = 0, |
| 199 | .num_resources = ARRAY_SIZE(resources_i2c), |
| 200 | .resource = resources_i2c, |
| 201 | }; |
| 202 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 203 | #define GPIO_I2C_CLK 60 |
| 204 | #define GPIO_I2C_DAT 61 |
| 205 | void msm_set_i2c_mux(bool gpio, int *gpio_clk, int *gpio_dat) |
| 206 | { |
| 207 | unsigned id; |
| 208 | if (gpio) { |
| 209 | id = PCOM_GPIO_CFG(GPIO_I2C_CLK, 0, GPIO_OUTPUT, |
| 210 | GPIO_NO_PULL, GPIO_2MA); |
| 211 | msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0); |
| 212 | id = PCOM_GPIO_CFG(GPIO_I2C_DAT, 0, GPIO_OUTPUT, |
| 213 | GPIO_NO_PULL, GPIO_2MA); |
| 214 | msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0); |
| 215 | *gpio_clk = GPIO_I2C_CLK; |
| 216 | *gpio_dat = GPIO_I2C_DAT; |
| 217 | } else { |
| 218 | id = PCOM_GPIO_CFG(GPIO_I2C_CLK, 1, GPIO_INPUT, |
| 219 | GPIO_NO_PULL, GPIO_8MA); |
| 220 | msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0); |
| 221 | id = PCOM_GPIO_CFG(GPIO_I2C_DAT , 1, GPIO_INPUT, |
| 222 | GPIO_NO_PULL, GPIO_8MA); |
| 223 | msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0); |
| 224 | } |
| 225 | } |
| 226 | |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 227 | static struct resource resources_hsusb[] = { |
| 228 | { |
| 229 | .start = MSM_HSUSB_PHYS, |
| 230 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, |
| 231 | .flags = IORESOURCE_MEM, |
| 232 | }, |
| 233 | { |
| 234 | .start = INT_USB_HS, |
| 235 | .end = INT_USB_HS, |
| 236 | .flags = IORESOURCE_IRQ, |
| 237 | }, |
| 238 | }; |
| 239 | |
| 240 | struct platform_device msm_device_hsusb = { |
| 241 | .name = "msm_hsusb", |
| 242 | .id = -1, |
| 243 | .num_resources = ARRAY_SIZE(resources_hsusb), |
| 244 | .resource = resources_hsusb, |
| 245 | .dev = { |
| 246 | .coherent_dma_mask = 0xffffffff, |
| 247 | }, |
| 248 | }; |
| 249 | |
| 250 | struct flash_platform_data msm_nand_data = { |
| 251 | .parts = NULL, |
| 252 | .nr_parts = 0, |
| 253 | }; |
| 254 | |
| 255 | static struct resource resources_nand[] = { |
| 256 | [0] = { |
| 257 | .start = 7, |
| 258 | .end = 7, |
| 259 | .flags = IORESOURCE_DMA, |
| 260 | }, |
| 261 | }; |
| 262 | |
| 263 | struct platform_device msm_device_nand = { |
| 264 | .name = "msm_nand", |
| 265 | .id = -1, |
| 266 | .num_resources = ARRAY_SIZE(resources_nand), |
| 267 | .resource = resources_nand, |
| 268 | .dev = { |
| 269 | .platform_data = &msm_nand_data, |
| 270 | }, |
| 271 | }; |
| 272 | |
| 273 | struct platform_device msm_device_smd = { |
| 274 | .name = "msm_smd", |
| 275 | .id = -1, |
| 276 | }; |
| 277 | |
| 278 | static struct resource resources_sdc1[] = { |
| 279 | { |
| 280 | .start = MSM_SDC1_PHYS, |
| 281 | .end = MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1, |
| 282 | .flags = IORESOURCE_MEM, |
| 283 | }, |
| 284 | { |
| 285 | .start = INT_SDC1_0, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 286 | .end = INT_SDC1_0, |
| 287 | .flags = IORESOURCE_IRQ, |
| 288 | .name = "cmd_irq", |
| 289 | }, |
| 290 | { |
| 291 | .start = INT_SDC1_1, |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 292 | .end = INT_SDC1_1, |
| 293 | .flags = IORESOURCE_IRQ, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 294 | .name = "pio_irq", |
| 295 | }, |
| 296 | { |
| 297 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, |
| 298 | .name = "status_irq" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 299 | }, |
| 300 | { |
| 301 | .start = 8, |
| 302 | .end = 8, |
| 303 | .flags = IORESOURCE_DMA, |
| 304 | }, |
| 305 | }; |
| 306 | |
| 307 | static struct resource resources_sdc2[] = { |
| 308 | { |
| 309 | .start = MSM_SDC2_PHYS, |
| 310 | .end = MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1, |
| 311 | .flags = IORESOURCE_MEM, |
| 312 | }, |
| 313 | { |
| 314 | .start = INT_SDC2_0, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 315 | .end = INT_SDC2_0, |
| 316 | .flags = IORESOURCE_IRQ, |
| 317 | .name = "cmd_irq", |
| 318 | }, |
| 319 | { |
| 320 | .start = INT_SDC2_1, |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 321 | .end = INT_SDC2_1, |
| 322 | .flags = IORESOURCE_IRQ, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 323 | .name = "pio_irq", |
| 324 | }, |
| 325 | { |
| 326 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, |
| 327 | .name = "status_irq" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 328 | }, |
| 329 | { |
| 330 | .start = 8, |
| 331 | .end = 8, |
| 332 | .flags = IORESOURCE_DMA, |
| 333 | }, |
| 334 | }; |
| 335 | |
| 336 | static struct resource resources_sdc3[] = { |
| 337 | { |
| 338 | .start = MSM_SDC3_PHYS, |
| 339 | .end = MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1, |
| 340 | .flags = IORESOURCE_MEM, |
| 341 | }, |
| 342 | { |
| 343 | .start = INT_SDC3_0, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 344 | .end = INT_SDC3_0, |
| 345 | .flags = IORESOURCE_IRQ, |
| 346 | .name = "cmd_irq", |
| 347 | }, |
| 348 | { |
| 349 | .start = INT_SDC3_1, |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 350 | .end = INT_SDC3_1, |
| 351 | .flags = IORESOURCE_IRQ, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 352 | .name = "pio_irq", |
| 353 | }, |
| 354 | { |
| 355 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, |
| 356 | .name = "status_irq" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 357 | }, |
| 358 | { |
| 359 | .start = 8, |
| 360 | .end = 8, |
| 361 | .flags = IORESOURCE_DMA, |
| 362 | }, |
| 363 | }; |
| 364 | |
| 365 | static struct resource resources_sdc4[] = { |
| 366 | { |
| 367 | .start = MSM_SDC4_PHYS, |
| 368 | .end = MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1, |
| 369 | .flags = IORESOURCE_MEM, |
| 370 | }, |
| 371 | { |
| 372 | .start = INT_SDC4_0, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 373 | .end = INT_SDC4_0, |
| 374 | .flags = IORESOURCE_IRQ, |
| 375 | .name = "cmd_irq", |
| 376 | }, |
| 377 | { |
| 378 | .start = INT_SDC4_1, |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 379 | .end = INT_SDC4_1, |
| 380 | .flags = IORESOURCE_IRQ, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 381 | .name = "pio_irq", |
| 382 | }, |
| 383 | { |
| 384 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, |
| 385 | .name = "status_irq" |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 386 | }, |
| 387 | { |
| 388 | .start = 8, |
| 389 | .end = 8, |
| 390 | .flags = IORESOURCE_DMA, |
| 391 | }, |
| 392 | }; |
| 393 | |
| 394 | struct platform_device msm_device_sdc1 = { |
| 395 | .name = "msm_sdcc", |
| 396 | .id = 1, |
| 397 | .num_resources = ARRAY_SIZE(resources_sdc1), |
| 398 | .resource = resources_sdc1, |
| 399 | .dev = { |
| 400 | .coherent_dma_mask = 0xffffffff, |
| 401 | }, |
| 402 | }; |
| 403 | |
| 404 | struct platform_device msm_device_sdc2 = { |
| 405 | .name = "msm_sdcc", |
| 406 | .id = 2, |
| 407 | .num_resources = ARRAY_SIZE(resources_sdc2), |
| 408 | .resource = resources_sdc2, |
| 409 | .dev = { |
| 410 | .coherent_dma_mask = 0xffffffff, |
| 411 | }, |
| 412 | }; |
| 413 | |
| 414 | struct platform_device msm_device_sdc3 = { |
| 415 | .name = "msm_sdcc", |
| 416 | .id = 3, |
| 417 | .num_resources = ARRAY_SIZE(resources_sdc3), |
| 418 | .resource = resources_sdc3, |
| 419 | .dev = { |
| 420 | .coherent_dma_mask = 0xffffffff, |
| 421 | }, |
| 422 | }; |
| 423 | |
| 424 | struct platform_device msm_device_sdc4 = { |
| 425 | .name = "msm_sdcc", |
| 426 | .id = 4, |
| 427 | .num_resources = ARRAY_SIZE(resources_sdc4), |
| 428 | .resource = resources_sdc4, |
| 429 | .dev = { |
| 430 | .coherent_dma_mask = 0xffffffff, |
| 431 | }, |
| 432 | }; |
San Mehat | 5d4f77f | 2008-11-10 16:30:27 -0800 | [diff] [blame] | 433 | |
| 434 | static struct platform_device *msm_sdcc_devices[] __initdata = { |
| 435 | &msm_device_sdc1, |
| 436 | &msm_device_sdc2, |
| 437 | &msm_device_sdc3, |
| 438 | &msm_device_sdc4, |
| 439 | }; |
| 440 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 441 | int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat, |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 442 | unsigned int stat_irq, unsigned long stat_irq_flags) |
San Mehat | 5d4f77f | 2008-11-10 16:30:27 -0800 | [diff] [blame] | 443 | { |
| 444 | struct platform_device *pdev; |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 445 | struct resource *res; |
San Mehat | 5d4f77f | 2008-11-10 16:30:27 -0800 | [diff] [blame] | 446 | |
| 447 | if (controller < 1 || controller > 4) |
| 448 | return -EINVAL; |
| 449 | |
| 450 | pdev = msm_sdcc_devices[controller-1]; |
| 451 | pdev->dev.platform_data = plat; |
Dima Zavin | 830d843 | 2009-05-22 20:21:50 -0700 | [diff] [blame] | 452 | |
| 453 | res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq"); |
| 454 | if (!res) |
| 455 | return -EINVAL; |
| 456 | else if (stat_irq) { |
| 457 | res->start = res->end = stat_irq; |
| 458 | res->flags &= ~IORESOURCE_DISABLED; |
| 459 | res->flags |= stat_irq_flags; |
| 460 | } |
| 461 | |
San Mehat | 5d4f77f | 2008-11-10 16:30:27 -0800 | [diff] [blame] | 462 | return platform_device_register(pdev); |
| 463 | } |
| 464 | |
Daniel Walker | 50bc0ef | 2010-12-13 14:35:11 -0800 | [diff] [blame] | 465 | static struct resource resources_mddi0[] = { |
| 466 | { |
| 467 | .start = MSM_PMDH_PHYS, |
| 468 | .end = MSM_PMDH_PHYS + MSM_PMDH_SIZE - 1, |
| 469 | .flags = IORESOURCE_MEM, |
| 470 | }, |
| 471 | { |
| 472 | .start = INT_MDDI_PRI, |
| 473 | .end = INT_MDDI_PRI, |
| 474 | .flags = IORESOURCE_IRQ, |
| 475 | }, |
| 476 | }; |
| 477 | |
| 478 | static struct resource resources_mddi1[] = { |
| 479 | { |
| 480 | .start = MSM_EMDH_PHYS, |
| 481 | .end = MSM_EMDH_PHYS + MSM_EMDH_SIZE - 1, |
| 482 | .flags = IORESOURCE_MEM, |
| 483 | }, |
| 484 | { |
| 485 | .start = INT_MDDI_EXT, |
| 486 | .end = INT_MDDI_EXT, |
| 487 | .flags = IORESOURCE_IRQ, |
| 488 | }, |
| 489 | }; |
| 490 | |
| 491 | struct platform_device msm_device_mddi0 = { |
| 492 | .name = "msm_mddi", |
| 493 | .id = 0, |
| 494 | .num_resources = ARRAY_SIZE(resources_mddi0), |
| 495 | .resource = resources_mddi0, |
| 496 | .dev = { |
| 497 | .coherent_dma_mask = 0xffffffff, |
| 498 | }, |
| 499 | }; |
| 500 | |
| 501 | struct platform_device msm_device_mddi1 = { |
| 502 | .name = "msm_mddi", |
| 503 | .id = 1, |
| 504 | .num_resources = ARRAY_SIZE(resources_mddi1), |
| 505 | .resource = resources_mddi1, |
| 506 | .dev = { |
| 507 | .coherent_dma_mask = 0xffffffff, |
| 508 | }, |
| 509 | }; |
| 510 | |
| 511 | static struct resource resources_mdp[] = { |
| 512 | { |
| 513 | .start = MSM_MDP_PHYS, |
| 514 | .end = MSM_MDP_PHYS + MSM_MDP_SIZE - 1, |
| 515 | .name = "mdp", |
| 516 | .flags = IORESOURCE_MEM |
| 517 | }, |
| 518 | { |
| 519 | .start = INT_MDP, |
| 520 | .end = INT_MDP, |
| 521 | .flags = IORESOURCE_IRQ, |
| 522 | }, |
| 523 | }; |
| 524 | |
| 525 | struct platform_device msm_device_mdp = { |
| 526 | .name = "msm_mdp", |
| 527 | .id = 0, |
| 528 | .num_resources = ARRAY_SIZE(resources_mdp), |
| 529 | .resource = resources_mdp, |
| 530 | }; |
| 531 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 532 | static struct resource resources_tssc[] = { |
| 533 | { |
| 534 | .start = MSM_TSSC_PHYS, |
| 535 | .end = MSM_TSSC_PHYS + MSM_TSSC_SIZE - 1, |
| 536 | .name = "tssc", |
| 537 | .flags = IORESOURCE_MEM, |
| 538 | }, |
| 539 | { |
| 540 | .start = INT_TCHSCRN1, |
| 541 | .end = INT_TCHSCRN1, |
| 542 | .name = "tssc1", |
| 543 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, |
| 544 | }, |
| 545 | { |
| 546 | .start = INT_TCHSCRN2, |
| 547 | .end = INT_TCHSCRN2, |
| 548 | .name = "tssc2", |
| 549 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, |
| 550 | }, |
Daniel Walker | 5e96da5 | 2010-05-12 13:43:28 -0700 | [diff] [blame] | 551 | }; |
| 552 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame^] | 553 | struct platform_device msm_device_touchscreen = { |
| 554 | .name = "msm_touchscreen", |
| 555 | .id = 0, |
| 556 | .num_resources = ARRAY_SIZE(resources_tssc), |
| 557 | .resource = resources_tssc, |
| 558 | }; |