diff options
Diffstat (limited to 'drivers/mfd/timberdale.c')
-rw-r--r-- | drivers/mfd/timberdale.c | 156 |
1 files changed, 133 insertions, 23 deletions
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c index 7f478ec4184b..ac5995026c88 100644 --- a/drivers/mfd/timberdale.c +++ b/drivers/mfd/timberdale.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/i2c-ocores.h> | 33 | #include <linux/i2c-ocores.h> |
34 | #include <linux/i2c-xiic.h> | ||
34 | #include <linux/i2c/tsc2007.h> | 35 | #include <linux/i2c/tsc2007.h> |
35 | 36 | ||
36 | #include <linux/spi/spi.h> | 37 | #include <linux/spi/spi.h> |
@@ -40,6 +41,8 @@ | |||
40 | 41 | ||
41 | #include <media/timb_radio.h> | 42 | #include <media/timb_radio.h> |
42 | 43 | ||
44 | #include <linux/timb_dma.h> | ||
45 | |||
43 | #include "timberdale.h" | 46 | #include "timberdale.h" |
44 | 47 | ||
45 | #define DRIVER_NAME "timberdale" | 48 | #define DRIVER_NAME "timberdale" |
@@ -69,6 +72,12 @@ static struct i2c_board_info timberdale_i2c_board_info[] = { | |||
69 | }, | 72 | }, |
70 | }; | 73 | }; |
71 | 74 | ||
75 | static __devinitdata struct xiic_i2c_platform_data | ||
76 | timberdale_xiic_platform_data = { | ||
77 | .devices = timberdale_i2c_board_info, | ||
78 | .num_devices = ARRAY_SIZE(timberdale_i2c_board_info) | ||
79 | }; | ||
80 | |||
72 | static __devinitdata struct ocores_i2c_platform_data | 81 | static __devinitdata struct ocores_i2c_platform_data |
73 | timberdale_ocores_platform_data = { | 82 | timberdale_ocores_platform_data = { |
74 | .regstep = 4, | 83 | .regstep = 4, |
@@ -77,7 +86,20 @@ timberdale_ocores_platform_data = { | |||
77 | .num_devices = ARRAY_SIZE(timberdale_i2c_board_info) | 86 | .num_devices = ARRAY_SIZE(timberdale_i2c_board_info) |
78 | }; | 87 | }; |
79 | 88 | ||
80 | const static __devinitconst struct resource timberdale_ocores_resources[] = { | 89 | static const __devinitconst struct resource timberdale_xiic_resources[] = { |
90 | { | ||
91 | .start = XIICOFFSET, | ||
92 | .end = XIICEND, | ||
93 | .flags = IORESOURCE_MEM, | ||
94 | }, | ||
95 | { | ||
96 | .start = IRQ_TIMBERDALE_I2C, | ||
97 | .end = IRQ_TIMBERDALE_I2C, | ||
98 | .flags = IORESOURCE_IRQ, | ||
99 | }, | ||
100 | }; | ||
101 | |||
102 | static const __devinitconst struct resource timberdale_ocores_resources[] = { | ||
81 | { | 103 | { |
82 | .start = OCORESOFFSET, | 104 | .start = OCORESOFFSET, |
83 | .end = OCORESEND, | 105 | .end = OCORESEND, |
@@ -126,7 +148,7 @@ static __devinitdata struct xspi_platform_data timberdale_xspi_platform_data = { | |||
126 | */ | 148 | */ |
127 | }; | 149 | }; |
128 | 150 | ||
129 | const static __devinitconst struct resource timberdale_spi_resources[] = { | 151 | static const __devinitconst struct resource timberdale_spi_resources[] = { |
130 | { | 152 | { |
131 | .start = SPIOFFSET, | 153 | .start = SPIOFFSET, |
132 | .end = SPIEND, | 154 | .end = SPIEND, |
@@ -139,7 +161,7 @@ const static __devinitconst struct resource timberdale_spi_resources[] = { | |||
139 | }, | 161 | }, |
140 | }; | 162 | }; |
141 | 163 | ||
142 | const static __devinitconst struct resource timberdale_eth_resources[] = { | 164 | static const __devinitconst struct resource timberdale_eth_resources[] = { |
143 | { | 165 | { |
144 | .start = ETHOFFSET, | 166 | .start = ETHOFFSET, |
145 | .end = ETHEND, | 167 | .end = ETHEND, |
@@ -159,7 +181,7 @@ static __devinitdata struct timbgpio_platform_data | |||
159 | .irq_base = 200, | 181 | .irq_base = 200, |
160 | }; | 182 | }; |
161 | 183 | ||
162 | const static __devinitconst struct resource timberdale_gpio_resources[] = { | 184 | static const __devinitconst struct resource timberdale_gpio_resources[] = { |
163 | { | 185 | { |
164 | .start = GPIOOFFSET, | 186 | .start = GPIOOFFSET, |
165 | .end = GPIOEND, | 187 | .end = GPIOEND, |
@@ -172,7 +194,7 @@ const static __devinitconst struct resource timberdale_gpio_resources[] = { | |||
172 | }, | 194 | }, |
173 | }; | 195 | }; |
174 | 196 | ||
175 | const static __devinitconst struct resource timberdale_mlogicore_resources[] = { | 197 | static const __devinitconst struct resource timberdale_mlogicore_resources[] = { |
176 | { | 198 | { |
177 | .start = MLCOREOFFSET, | 199 | .start = MLCOREOFFSET, |
178 | .end = MLCOREEND, | 200 | .end = MLCOREEND, |
@@ -190,7 +212,7 @@ const static __devinitconst struct resource timberdale_mlogicore_resources[] = { | |||
190 | }, | 212 | }, |
191 | }; | 213 | }; |
192 | 214 | ||
193 | const static __devinitconst struct resource timberdale_uart_resources[] = { | 215 | static const __devinitconst struct resource timberdale_uart_resources[] = { |
194 | { | 216 | { |
195 | .start = UARTOFFSET, | 217 | .start = UARTOFFSET, |
196 | .end = UARTEND, | 218 | .end = UARTEND, |
@@ -203,7 +225,7 @@ const static __devinitconst struct resource timberdale_uart_resources[] = { | |||
203 | }, | 225 | }, |
204 | }; | 226 | }; |
205 | 227 | ||
206 | const static __devinitconst struct resource timberdale_uartlite_resources[] = { | 228 | static const __devinitconst struct resource timberdale_uartlite_resources[] = { |
207 | { | 229 | { |
208 | .start = UARTLITEOFFSET, | 230 | .start = UARTLITEOFFSET, |
209 | .end = UARTLITEEND, | 231 | .end = UARTLITEEND, |
@@ -216,7 +238,7 @@ const static __devinitconst struct resource timberdale_uartlite_resources[] = { | |||
216 | }, | 238 | }, |
217 | }; | 239 | }; |
218 | 240 | ||
219 | const static __devinitconst struct resource timberdale_radio_resources[] = { | 241 | static const __devinitconst struct resource timberdale_radio_resources[] = { |
220 | { | 242 | { |
221 | .start = RDSOFFSET, | 243 | .start = RDSOFFSET, |
222 | .end = RDSEND, | 244 | .end = RDSEND, |
@@ -250,7 +272,66 @@ static __devinitdata struct timb_radio_platform_data | |||
250 | } | 272 | } |
251 | }; | 273 | }; |
252 | 274 | ||
253 | const static __devinitconst struct resource timberdale_dma_resources[] = { | 275 | static __devinitdata struct timb_dma_platform_data timb_dma_platform_data = { |
276 | .nr_channels = 10, | ||
277 | .channels = { | ||
278 | { | ||
279 | /* UART RX */ | ||
280 | .rx = true, | ||
281 | .descriptors = 2, | ||
282 | .descriptor_elements = 1 | ||
283 | }, | ||
284 | { | ||
285 | /* UART TX */ | ||
286 | .rx = false, | ||
287 | .descriptors = 2, | ||
288 | .descriptor_elements = 1 | ||
289 | }, | ||
290 | { | ||
291 | /* MLB RX */ | ||
292 | .rx = true, | ||
293 | .descriptors = 2, | ||
294 | .descriptor_elements = 1 | ||
295 | }, | ||
296 | { | ||
297 | /* MLB TX */ | ||
298 | .rx = false, | ||
299 | .descriptors = 2, | ||
300 | .descriptor_elements = 1 | ||
301 | }, | ||
302 | { | ||
303 | /* Video RX */ | ||
304 | .rx = true, | ||
305 | .bytes_per_line = 1440, | ||
306 | .descriptors = 2, | ||
307 | .descriptor_elements = 16 | ||
308 | }, | ||
309 | { | ||
310 | /* Video framedrop */ | ||
311 | }, | ||
312 | { | ||
313 | /* SDHCI RX */ | ||
314 | .rx = true, | ||
315 | }, | ||
316 | { | ||
317 | /* SDHCI TX */ | ||
318 | }, | ||
319 | { | ||
320 | /* ETH RX */ | ||
321 | .rx = true, | ||
322 | .descriptors = 2, | ||
323 | .descriptor_elements = 1 | ||
324 | }, | ||
325 | { | ||
326 | /* ETH TX */ | ||
327 | .rx = false, | ||
328 | .descriptors = 2, | ||
329 | .descriptor_elements = 1 | ||
330 | }, | ||
331 | } | ||
332 | }; | ||
333 | |||
334 | static const __devinitconst struct resource timberdale_dma_resources[] = { | ||
254 | { | 335 | { |
255 | .start = DMAOFFSET, | 336 | .start = DMAOFFSET, |
256 | .end = DMAEND, | 337 | .end = DMAEND, |
@@ -265,11 +346,25 @@ const static __devinitconst struct resource timberdale_dma_resources[] = { | |||
265 | 346 | ||
266 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = { | 347 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = { |
267 | { | 348 | { |
349 | .name = "timb-dma", | ||
350 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), | ||
351 | .resources = timberdale_dma_resources, | ||
352 | .platform_data = &timb_dma_platform_data, | ||
353 | .data_size = sizeof(timb_dma_platform_data), | ||
354 | }, | ||
355 | { | ||
268 | .name = "timb-uart", | 356 | .name = "timb-uart", |
269 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), | 357 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), |
270 | .resources = timberdale_uart_resources, | 358 | .resources = timberdale_uart_resources, |
271 | }, | 359 | }, |
272 | { | 360 | { |
361 | .name = "xiic-i2c", | ||
362 | .num_resources = ARRAY_SIZE(timberdale_xiic_resources), | ||
363 | .resources = timberdale_xiic_resources, | ||
364 | .platform_data = &timberdale_xiic_platform_data, | ||
365 | .data_size = sizeof(timberdale_xiic_platform_data), | ||
366 | }, | ||
367 | { | ||
273 | .name = "timb-gpio", | 368 | .name = "timb-gpio", |
274 | .num_resources = ARRAY_SIZE(timberdale_gpio_resources), | 369 | .num_resources = ARRAY_SIZE(timberdale_gpio_resources), |
275 | .resources = timberdale_gpio_resources, | 370 | .resources = timberdale_gpio_resources, |
@@ -295,14 +390,16 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = { | |||
295 | .num_resources = ARRAY_SIZE(timberdale_eth_resources), | 390 | .num_resources = ARRAY_SIZE(timberdale_eth_resources), |
296 | .resources = timberdale_eth_resources, | 391 | .resources = timberdale_eth_resources, |
297 | }, | 392 | }, |
393 | }; | ||
394 | |||
395 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = { | ||
298 | { | 396 | { |
299 | .name = "timb-dma", | 397 | .name = "timb-dma", |
300 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), | 398 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), |
301 | .resources = timberdale_dma_resources, | 399 | .resources = timberdale_dma_resources, |
400 | .platform_data = &timb_dma_platform_data, | ||
401 | .data_size = sizeof(timb_dma_platform_data), | ||
302 | }, | 402 | }, |
303 | }; | ||
304 | |||
305 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = { | ||
306 | { | 403 | { |
307 | .name = "timb-uart", | 404 | .name = "timb-uart", |
308 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), | 405 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), |
@@ -314,6 +411,13 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = { | |||
314 | .resources = timberdale_uartlite_resources, | 411 | .resources = timberdale_uartlite_resources, |
315 | }, | 412 | }, |
316 | { | 413 | { |
414 | .name = "xiic-i2c", | ||
415 | .num_resources = ARRAY_SIZE(timberdale_xiic_resources), | ||
416 | .resources = timberdale_xiic_resources, | ||
417 | .platform_data = &timberdale_xiic_platform_data, | ||
418 | .data_size = sizeof(timberdale_xiic_platform_data), | ||
419 | }, | ||
420 | { | ||
317 | .name = "timb-gpio", | 421 | .name = "timb-gpio", |
318 | .num_resources = ARRAY_SIZE(timberdale_gpio_resources), | 422 | .num_resources = ARRAY_SIZE(timberdale_gpio_resources), |
319 | .resources = timberdale_gpio_resources, | 423 | .resources = timberdale_gpio_resources, |
@@ -344,20 +448,29 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = { | |||
344 | .num_resources = ARRAY_SIZE(timberdale_eth_resources), | 448 | .num_resources = ARRAY_SIZE(timberdale_eth_resources), |
345 | .resources = timberdale_eth_resources, | 449 | .resources = timberdale_eth_resources, |
346 | }, | 450 | }, |
451 | }; | ||
452 | |||
453 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = { | ||
347 | { | 454 | { |
348 | .name = "timb-dma", | 455 | .name = "timb-dma", |
349 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), | 456 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), |
350 | .resources = timberdale_dma_resources, | 457 | .resources = timberdale_dma_resources, |
458 | .platform_data = &timb_dma_platform_data, | ||
459 | .data_size = sizeof(timb_dma_platform_data), | ||
351 | }, | 460 | }, |
352 | }; | ||
353 | |||
354 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = { | ||
355 | { | 461 | { |
356 | .name = "timb-uart", | 462 | .name = "timb-uart", |
357 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), | 463 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), |
358 | .resources = timberdale_uart_resources, | 464 | .resources = timberdale_uart_resources, |
359 | }, | 465 | }, |
360 | { | 466 | { |
467 | .name = "xiic-i2c", | ||
468 | .num_resources = ARRAY_SIZE(timberdale_xiic_resources), | ||
469 | .resources = timberdale_xiic_resources, | ||
470 | .platform_data = &timberdale_xiic_platform_data, | ||
471 | .data_size = sizeof(timberdale_xiic_platform_data), | ||
472 | }, | ||
473 | { | ||
361 | .name = "timb-gpio", | 474 | .name = "timb-gpio", |
362 | .num_resources = ARRAY_SIZE(timberdale_gpio_resources), | 475 | .num_resources = ARRAY_SIZE(timberdale_gpio_resources), |
363 | .resources = timberdale_gpio_resources, | 476 | .resources = timberdale_gpio_resources, |
@@ -378,14 +491,16 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = { | |||
378 | .platform_data = &timberdale_xspi_platform_data, | 491 | .platform_data = &timberdale_xspi_platform_data, |
379 | .data_size = sizeof(timberdale_xspi_platform_data), | 492 | .data_size = sizeof(timberdale_xspi_platform_data), |
380 | }, | 493 | }, |
494 | }; | ||
495 | |||
496 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = { | ||
381 | { | 497 | { |
382 | .name = "timb-dma", | 498 | .name = "timb-dma", |
383 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), | 499 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), |
384 | .resources = timberdale_dma_resources, | 500 | .resources = timberdale_dma_resources, |
501 | .platform_data = &timb_dma_platform_data, | ||
502 | .data_size = sizeof(timb_dma_platform_data), | ||
385 | }, | 503 | }, |
386 | }; | ||
387 | |||
388 | static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = { | ||
389 | { | 504 | { |
390 | .name = "timb-uart", | 505 | .name = "timb-uart", |
391 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), | 506 | .num_resources = ARRAY_SIZE(timberdale_uart_resources), |
@@ -424,11 +539,6 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = { | |||
424 | .num_resources = ARRAY_SIZE(timberdale_eth_resources), | 539 | .num_resources = ARRAY_SIZE(timberdale_eth_resources), |
425 | .resources = timberdale_eth_resources, | 540 | .resources = timberdale_eth_resources, |
426 | }, | 541 | }, |
427 | { | ||
428 | .name = "timb-dma", | ||
429 | .num_resources = ARRAY_SIZE(timberdale_dma_resources), | ||
430 | .resources = timberdale_dma_resources, | ||
431 | }, | ||
432 | }; | 542 | }; |
433 | 543 | ||
434 | static const __devinitconst struct resource timberdale_sdhc_resources[] = { | 544 | static const __devinitconst struct resource timberdale_sdhc_resources[] = { |