config: tegra3: enable /dev mount with ACL
[linux-2.6.git] / drivers / mfd / timberdale.c
index 1ac77d1..696879e 100644 (file)
 #include <linux/spi/mc33880.h>
 
 #include <media/timb_radio.h>
+#include <media/timb_video.h>
+
+#include <linux/timb_dma.h>
+
+#include <linux/ks8842.h>
 
 #include "timberdale.h"
 
@@ -84,7 +89,7 @@ timberdale_ocores_platform_data = {
        .num_devices = ARRAY_SIZE(timberdale_i2c_board_info)
 };
 
-const static __devinitconst struct resource timberdale_xiic_resources[] = {
+static const __devinitconst struct resource timberdale_xiic_resources[] = {
        {
                .start  = XIICOFFSET,
                .end    = XIICEND,
@@ -97,7 +102,7 @@ const static __devinitconst struct resource timberdale_xiic_resources[] = {
        },
 };
 
-const static __devinitconst struct resource timberdale_ocores_resources[] = {
+static const __devinitconst struct resource timberdale_ocores_resources[] = {
        {
                .start  = OCORESOFFSET,
                .end    = OCORESEND,
@@ -146,7 +151,7 @@ static __devinitdata struct xspi_platform_data timberdale_xspi_platform_data = {
         */
 };
 
-const static __devinitconst struct resource timberdale_spi_resources[] = {
+static const __devinitconst struct resource timberdale_spi_resources[] = {
        {
                .start  = SPIOFFSET,
                .end    = SPIEND,
@@ -159,7 +164,13 @@ const static __devinitconst struct resource timberdale_spi_resources[] = {
        },
 };
 
-const static __devinitconst struct resource timberdale_eth_resources[] = {
+static __devinitdata struct ks8842_platform_data
+       timberdale_ks8842_platform_data = {
+       .rx_dma_channel = DMA_ETH_RX,
+       .tx_dma_channel = DMA_ETH_TX
+};
+
+static const __devinitconst struct resource timberdale_eth_resources[] = {
        {
                .start  = ETHOFFSET,
                .end    = ETHEND,
@@ -179,7 +190,7 @@ static __devinitdata struct timbgpio_platform_data
        .irq_base = 200,
 };
 
-const static __devinitconst struct resource timberdale_gpio_resources[] = {
+static const __devinitconst struct resource timberdale_gpio_resources[] = {
        {
                .start  = GPIOOFFSET,
                .end    = GPIOEND,
@@ -192,7 +203,7 @@ const static __devinitconst struct resource timberdale_gpio_resources[] = {
        },
 };
 
-const static __devinitconst struct resource timberdale_mlogicore_resources[] = {
+static const __devinitconst struct resource timberdale_mlogicore_resources[] = {
        {
                .start  = MLCOREOFFSET,
                .end    = MLCOREEND,
@@ -210,7 +221,7 @@ const static __devinitconst struct resource timberdale_mlogicore_resources[] = {
        },
 };
 
-const static __devinitconst struct resource timberdale_uart_resources[] = {
+static const __devinitconst struct resource timberdale_uart_resources[] = {
        {
                .start  = UARTOFFSET,
                .end    = UARTEND,
@@ -223,7 +234,7 @@ const static __devinitconst struct resource timberdale_uart_resources[] = {
        },
 };
 
-const static __devinitconst struct resource timberdale_uartlite_resources[] = {
+static const __devinitconst struct resource timberdale_uartlite_resources[] = {
        {
                .start  = UARTLITEOFFSET,
                .end    = UARTLITEEND,
@@ -236,7 +247,23 @@ const static __devinitconst struct resource timberdale_uartlite_resources[] = {
        },
 };
 
-const static __devinitconst struct resource timberdale_radio_resources[] = {
+static __devinitdata struct i2c_board_info timberdale_adv7180_i2c_board_info = {
+       /* Requires jumper JP9 to be off */
+       I2C_BOARD_INFO("adv7180", 0x42 >> 1),
+       .irq = IRQ_TIMBERDALE_ADV7180
+};
+
+static __devinitdata struct timb_video_platform_data
+       timberdale_video_platform_data = {
+       .dma_channel = DMA_VIDEO_RX,
+       .i2c_adapter = 0,
+       .encoder = {
+               .info = &timberdale_adv7180_i2c_board_info
+       }
+};
+
+static const __devinitconst struct resource
+timberdale_radio_resources[] = {
        {
                .start  = RDSOFFSET,
                .end    = RDSEND,
@@ -260,17 +287,82 @@ static __devinitdata struct i2c_board_info timberdale_saa7706_i2c_board_info = {
 static __devinitdata struct timb_radio_platform_data
        timberdale_radio_platform_data = {
        .i2c_adapter = 0,
-       .tuner = {
-               .module_name = "tef6862",
-               .info = &timberdale_tef6868_i2c_board_info
+       .tuner = &timberdale_tef6868_i2c_board_info,
+       .dsp = &timberdale_saa7706_i2c_board_info
+};
+
+static const __devinitconst struct resource timberdale_video_resources[] = {
+       {
+               .start  = LOGIWOFFSET,
+               .end    = LOGIWEND,
+               .flags  = IORESOURCE_MEM,
        },
-       .dsp = {
-               .module_name = "saa7706h",
-               .info = &timberdale_saa7706_i2c_board_info
+       /*
+       note that the "frame buffer" is located in DMA area
+       starting at 0x1200000
+       */
+};
+
+static __devinitdata struct timb_dma_platform_data timb_dma_platform_data = {
+       .nr_channels = 10,
+       .channels = {
+               {
+                       /* UART RX */
+                       .rx = true,
+                       .descriptors = 2,
+                       .descriptor_elements = 1
+               },
+               {
+                       /* UART TX */
+                       .rx = false,
+                       .descriptors = 2,
+                       .descriptor_elements = 1
+               },
+               {
+                       /* MLB RX */
+                       .rx = true,
+                       .descriptors = 2,
+                       .descriptor_elements = 1
+               },
+               {
+                       /* MLB TX */
+                       .rx = false,
+                       .descriptors = 2,
+                       .descriptor_elements = 1
+               },
+               {
+                       /* Video RX */
+                       .rx = true,
+                       .bytes_per_line = 1440,
+                       .descriptors = 2,
+                       .descriptor_elements = 16
+               },
+               {
+                       /* Video framedrop */
+               },
+               {
+                       /* SDHCI RX */
+                       .rx = true,
+               },
+               {
+                       /* SDHCI TX */
+               },
+               {
+                       /* ETH RX */
+                       .rx = true,
+                       .descriptors = 2,
+                       .descriptor_elements = 1
+               },
+               {
+                       /* ETH TX */
+                       .rx = false,
+                       .descriptors = 2,
+                       .descriptor_elements = 1
+               },
        }
 };
 
-const static __devinitconst struct resource timberdale_dma_resources[] = {
+static const __devinitconst struct resource timberdale_dma_resources[] = {
        {
                .start  = DMAOFFSET,
                .end    = DMAEND,
@@ -285,6 +377,13 @@ const static __devinitconst struct resource timberdale_dma_resources[] = {
 
 static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
        {
+               .name = "timb-dma",
+               .num_resources = ARRAY_SIZE(timberdale_dma_resources),
+               .resources = timberdale_dma_resources,
+               .platform_data = &timb_dma_platform_data,
+               .pdata_size = sizeof(timb_dma_platform_data),
+       },
+       {
                .name = "timb-uart",
                .num_resources = ARRAY_SIZE(timberdale_uart_resources),
                .resources = timberdale_uart_resources,
@@ -294,42 +393,53 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg0[] = {
                .num_resources = ARRAY_SIZE(timberdale_xiic_resources),
                .resources = timberdale_xiic_resources,
                .platform_data = &timberdale_xiic_platform_data,
-               .data_size = sizeof(timberdale_xiic_platform_data),
+               .pdata_size = sizeof(timberdale_xiic_platform_data),
        },
        {
                .name = "timb-gpio",
                .num_resources = ARRAY_SIZE(timberdale_gpio_resources),
                .resources = timberdale_gpio_resources,
                .platform_data = &timberdale_gpio_platform_data,
-               .data_size = sizeof(timberdale_gpio_platform_data),
+               .pdata_size = sizeof(timberdale_gpio_platform_data),
+       },
+       {
+               .name = "timb-video",
+               .num_resources = ARRAY_SIZE(timberdale_video_resources),
+               .resources = timberdale_video_resources,
+               .platform_data = &timberdale_video_platform_data,
+               .pdata_size = sizeof(timberdale_video_platform_data),
        },
        {
                .name = "timb-radio",
                .num_resources = ARRAY_SIZE(timberdale_radio_resources),
                .resources = timberdale_radio_resources,
                .platform_data = &timberdale_radio_platform_data,
-               .data_size = sizeof(timberdale_radio_platform_data),
+               .pdata_size = sizeof(timberdale_radio_platform_data),
        },
        {
                .name = "xilinx_spi",
                .num_resources = ARRAY_SIZE(timberdale_spi_resources),
                .resources = timberdale_spi_resources,
                .platform_data = &timberdale_xspi_platform_data,
-               .data_size = sizeof(timberdale_xspi_platform_data),
+               .pdata_size = sizeof(timberdale_xspi_platform_data),
        },
        {
                .name = "ks8842",
                .num_resources = ARRAY_SIZE(timberdale_eth_resources),
                .resources = timberdale_eth_resources,
+               .platform_data = &timberdale_ks8842_platform_data,
+               .pdata_size = sizeof(timberdale_ks8842_platform_data),
        },
+};
+
+static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
        {
                .name = "timb-dma",
                .num_resources = ARRAY_SIZE(timberdale_dma_resources),
                .resources = timberdale_dma_resources,
+               .platform_data = &timb_dma_platform_data,
+               .pdata_size = sizeof(timb_dma_platform_data),
        },
-};
-
-static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
        {
                .name = "timb-uart",
                .num_resources = ARRAY_SIZE(timberdale_uart_resources),
@@ -345,14 +455,14 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
                .num_resources = ARRAY_SIZE(timberdale_xiic_resources),
                .resources = timberdale_xiic_resources,
                .platform_data = &timberdale_xiic_platform_data,
-               .data_size = sizeof(timberdale_xiic_platform_data),
+               .pdata_size = sizeof(timberdale_xiic_platform_data),
        },
        {
                .name = "timb-gpio",
                .num_resources = ARRAY_SIZE(timberdale_gpio_resources),
                .resources = timberdale_gpio_resources,
                .platform_data = &timberdale_gpio_platform_data,
-               .data_size = sizeof(timberdale_gpio_platform_data),
+               .pdata_size = sizeof(timberdale_gpio_platform_data),
        },
        {
                .name = "timb-mlogicore",
@@ -360,32 +470,43 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg1[] = {
                .resources = timberdale_mlogicore_resources,
        },
        {
+               .name = "timb-video",
+               .num_resources = ARRAY_SIZE(timberdale_video_resources),
+               .resources = timberdale_video_resources,
+               .platform_data = &timberdale_video_platform_data,
+               .pdata_size = sizeof(timberdale_video_platform_data),
+       },
+       {
                .name = "timb-radio",
                .num_resources = ARRAY_SIZE(timberdale_radio_resources),
                .resources = timberdale_radio_resources,
                .platform_data = &timberdale_radio_platform_data,
-               .data_size = sizeof(timberdale_radio_platform_data),
+               .pdata_size = sizeof(timberdale_radio_platform_data),
        },
        {
                .name = "xilinx_spi",
                .num_resources = ARRAY_SIZE(timberdale_spi_resources),
                .resources = timberdale_spi_resources,
                .platform_data = &timberdale_xspi_platform_data,
-               .data_size = sizeof(timberdale_xspi_platform_data),
+               .pdata_size = sizeof(timberdale_xspi_platform_data),
        },
        {
                .name = "ks8842",
                .num_resources = ARRAY_SIZE(timberdale_eth_resources),
                .resources = timberdale_eth_resources,
+               .platform_data = &timberdale_ks8842_platform_data,
+               .pdata_size = sizeof(timberdale_ks8842_platform_data),
        },
+};
+
+static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
        {
                .name = "timb-dma",
                .num_resources = ARRAY_SIZE(timberdale_dma_resources),
                .resources = timberdale_dma_resources,
+               .platform_data = &timb_dma_platform_data,
+               .pdata_size = sizeof(timb_dma_platform_data),
        },
-};
-
-static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
        {
                .name = "timb-uart",
                .num_resources = ARRAY_SIZE(timberdale_uart_resources),
@@ -396,37 +517,46 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg2[] = {
                .num_resources = ARRAY_SIZE(timberdale_xiic_resources),
                .resources = timberdale_xiic_resources,
                .platform_data = &timberdale_xiic_platform_data,
-               .data_size = sizeof(timberdale_xiic_platform_data),
+               .pdata_size = sizeof(timberdale_xiic_platform_data),
        },
        {
                .name = "timb-gpio",
                .num_resources = ARRAY_SIZE(timberdale_gpio_resources),
                .resources = timberdale_gpio_resources,
                .platform_data = &timberdale_gpio_platform_data,
-               .data_size = sizeof(timberdale_gpio_platform_data),
+               .pdata_size = sizeof(timberdale_gpio_platform_data),
+       },
+       {
+               .name = "timb-video",
+               .num_resources = ARRAY_SIZE(timberdale_video_resources),
+               .resources = timberdale_video_resources,
+               .platform_data = &timberdale_video_platform_data,
+               .pdata_size = sizeof(timberdale_video_platform_data),
        },
        {
                .name = "timb-radio",
                .num_resources = ARRAY_SIZE(timberdale_radio_resources),
                .resources = timberdale_radio_resources,
                .platform_data = &timberdale_radio_platform_data,
-               .data_size = sizeof(timberdale_radio_platform_data),
+               .pdata_size = sizeof(timberdale_radio_platform_data),
        },
        {
                .name = "xilinx_spi",
                .num_resources = ARRAY_SIZE(timberdale_spi_resources),
                .resources = timberdale_spi_resources,
                .platform_data = &timberdale_xspi_platform_data,
-               .data_size = sizeof(timberdale_xspi_platform_data),
+               .pdata_size = sizeof(timberdale_xspi_platform_data),
        },
+};
+
+static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
        {
                .name = "timb-dma",
                .num_resources = ARRAY_SIZE(timberdale_dma_resources),
                .resources = timberdale_dma_resources,
+               .platform_data = &timb_dma_platform_data,
+               .pdata_size = sizeof(timb_dma_platform_data),
        },
-};
-
-static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
        {
                .name = "timb-uart",
                .num_resources = ARRAY_SIZE(timberdale_uart_resources),
@@ -437,38 +567,42 @@ static __devinitdata struct mfd_cell timberdale_cells_bar0_cfg3[] = {
                .num_resources = ARRAY_SIZE(timberdale_ocores_resources),
                .resources = timberdale_ocores_resources,
                .platform_data = &timberdale_ocores_platform_data,
-               .data_size = sizeof(timberdale_ocores_platform_data),
+               .pdata_size = sizeof(timberdale_ocores_platform_data),
        },
        {
                .name = "timb-gpio",
                .num_resources = ARRAY_SIZE(timberdale_gpio_resources),
                .resources = timberdale_gpio_resources,
                .platform_data = &timberdale_gpio_platform_data,
-               .data_size = sizeof(timberdale_gpio_platform_data),
+               .pdata_size = sizeof(timberdale_gpio_platform_data),
+       },
+       {
+               .name = "timb-video",
+               .num_resources = ARRAY_SIZE(timberdale_video_resources),
+               .resources = timberdale_video_resources,
+               .platform_data = &timberdale_video_platform_data,
+               .pdata_size = sizeof(timberdale_video_platform_data),
        },
        {
                .name = "timb-radio",
                .num_resources = ARRAY_SIZE(timberdale_radio_resources),
                .resources = timberdale_radio_resources,
                .platform_data = &timberdale_radio_platform_data,
-               .data_size = sizeof(timberdale_radio_platform_data),
+               .pdata_size = sizeof(timberdale_radio_platform_data),
        },
        {
                .name = "xilinx_spi",
                .num_resources = ARRAY_SIZE(timberdale_spi_resources),
                .resources = timberdale_spi_resources,
                .platform_data = &timberdale_xspi_platform_data,
-               .data_size = sizeof(timberdale_xspi_platform_data),
+               .pdata_size = sizeof(timberdale_xspi_platform_data),
        },
        {
                .name = "ks8842",
                .num_resources = ARRAY_SIZE(timberdale_eth_resources),
                .resources = timberdale_eth_resources,
-       },
-       {
-               .name = "timb-dma",
-               .num_resources = ARRAY_SIZE(timberdale_dma_resources),
-               .resources = timberdale_dma_resources,
+               .platform_data = &timberdale_ks8842_platform_data,
+               .pdata_size = sizeof(timberdale_ks8842_platform_data),
        },
 };