diff options
Diffstat (limited to 'arch/arm/mach-davinci/board-dm355-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-dm355-evm.c | 83 |
1 files changed, 79 insertions, 4 deletions
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index d6ab64ccd496..77e806798822 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/videodev2.h> | ||
24 | #include <media/tvp514x.h> | ||
23 | #include <linux/spi/spi.h> | 25 | #include <linux/spi/spi.h> |
24 | #include <linux/spi/eeprom.h> | 26 | #include <linux/spi/eeprom.h> |
25 | 27 | ||
@@ -117,6 +119,8 @@ static struct davinci_i2c_platform_data i2c_pdata = { | |||
117 | .bus_delay = 0 /* usec */, | 119 | .bus_delay = 0 /* usec */, |
118 | }; | 120 | }; |
119 | 121 | ||
122 | static struct snd_platform_data dm355_evm_snd_data; | ||
123 | |||
120 | static int dm355evm_mmc_gpios = -EINVAL; | 124 | static int dm355evm_mmc_gpios = -EINVAL; |
121 | 125 | ||
122 | static void dm355evm_mmcsd_gpios(unsigned gpio) | 126 | static void dm355evm_mmcsd_gpios(unsigned gpio) |
@@ -134,11 +138,11 @@ static void dm355evm_mmcsd_gpios(unsigned gpio) | |||
134 | } | 138 | } |
135 | 139 | ||
136 | static struct i2c_board_info dm355evm_i2c_info[] = { | 140 | static struct i2c_board_info dm355evm_i2c_info[] = { |
137 | { I2C_BOARD_INFO("dm355evm_msp", 0x25), | 141 | { I2C_BOARD_INFO("dm355evm_msp", 0x25), |
138 | .platform_data = dm355evm_mmcsd_gpios, | 142 | .platform_data = dm355evm_mmcsd_gpios, |
139 | /* plus irq */ }, | 143 | }, |
140 | /* { I2C_BOARD_INFO("tlv320aic3x", 0x1b), }, */ | 144 | /* { plus irq }, */ |
141 | /* { I2C_BOARD_INFO("tvp5146", 0x5d), }, */ | 145 | { I2C_BOARD_INFO("tlv320aic33", 0x1b), }, |
142 | }; | 146 | }; |
143 | 147 | ||
144 | static void __init evm_init_i2c(void) | 148 | static void __init evm_init_i2c(void) |
@@ -177,6 +181,72 @@ static struct platform_device dm355evm_dm9000 = { | |||
177 | .num_resources = ARRAY_SIZE(dm355evm_dm9000_rsrc), | 181 | .num_resources = ARRAY_SIZE(dm355evm_dm9000_rsrc), |
178 | }; | 182 | }; |
179 | 183 | ||
184 | static struct tvp514x_platform_data tvp5146_pdata = { | ||
185 | .clk_polarity = 0, | ||
186 | .hs_polarity = 1, | ||
187 | .vs_polarity = 1 | ||
188 | }; | ||
189 | |||
190 | #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) | ||
191 | /* Inputs available at the TVP5146 */ | ||
192 | static struct v4l2_input tvp5146_inputs[] = { | ||
193 | { | ||
194 | .index = 0, | ||
195 | .name = "Composite", | ||
196 | .type = V4L2_INPUT_TYPE_CAMERA, | ||
197 | .std = TVP514X_STD_ALL, | ||
198 | }, | ||
199 | { | ||
200 | .index = 1, | ||
201 | .name = "S-Video", | ||
202 | .type = V4L2_INPUT_TYPE_CAMERA, | ||
203 | .std = TVP514X_STD_ALL, | ||
204 | }, | ||
205 | }; | ||
206 | |||
207 | /* | ||
208 | * this is the route info for connecting each input to decoder | ||
209 | * ouput that goes to vpfe. There is a one to one correspondence | ||
210 | * with tvp5146_inputs | ||
211 | */ | ||
212 | static struct vpfe_route tvp5146_routes[] = { | ||
213 | { | ||
214 | .input = INPUT_CVBS_VI2B, | ||
215 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
216 | }, | ||
217 | { | ||
218 | .input = INPUT_SVIDEO_VI2C_VI1C, | ||
219 | .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, | ||
220 | }, | ||
221 | }; | ||
222 | |||
223 | static struct vpfe_subdev_info vpfe_sub_devs[] = { | ||
224 | { | ||
225 | .name = "tvp5146", | ||
226 | .grp_id = 0, | ||
227 | .num_inputs = ARRAY_SIZE(tvp5146_inputs), | ||
228 | .inputs = tvp5146_inputs, | ||
229 | .routes = tvp5146_routes, | ||
230 | .can_route = 1, | ||
231 | .ccdc_if_params = { | ||
232 | .if_type = VPFE_BT656, | ||
233 | .hdpol = VPFE_PINPOL_POSITIVE, | ||
234 | .vdpol = VPFE_PINPOL_POSITIVE, | ||
235 | }, | ||
236 | .board_info = { | ||
237 | I2C_BOARD_INFO("tvp5146", 0x5d), | ||
238 | .platform_data = &tvp5146_pdata, | ||
239 | }, | ||
240 | } | ||
241 | }; | ||
242 | |||
243 | static struct vpfe_config vpfe_cfg = { | ||
244 | .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), | ||
245 | .sub_devs = vpfe_sub_devs, | ||
246 | .card_name = "DM355 EVM", | ||
247 | .ccdc = "DM355 CCDC", | ||
248 | }; | ||
249 | |||
180 | static struct platform_device *davinci_evm_devices[] __initdata = { | 250 | static struct platform_device *davinci_evm_devices[] __initdata = { |
181 | &dm355evm_dm9000, | 251 | &dm355evm_dm9000, |
182 | &davinci_nand_device, | 252 | &davinci_nand_device, |
@@ -188,6 +258,8 @@ static struct davinci_uart_config uart_config __initdata = { | |||
188 | 258 | ||
189 | static void __init dm355_evm_map_io(void) | 259 | static void __init dm355_evm_map_io(void) |
190 | { | 260 | { |
261 | /* setup input configuration for VPFE input devices */ | ||
262 | dm355_set_vpfe_config(&vpfe_cfg); | ||
191 | dm355_init(); | 263 | dm355_init(); |
192 | } | 264 | } |
193 | 265 | ||
@@ -279,6 +351,9 @@ static __init void dm355_evm_init(void) | |||
279 | 351 | ||
280 | dm355_init_spi0(BIT(0), dm355_evm_spi_info, | 352 | dm355_init_spi0(BIT(0), dm355_evm_spi_info, |
281 | ARRAY_SIZE(dm355_evm_spi_info)); | 353 | ARRAY_SIZE(dm355_evm_spi_info)); |
354 | |||
355 | /* DM335 EVM uses ASP1; line-out is a stereo mini-jack */ | ||
356 | dm355_init_asp1(ASP1_TX_EVT_EN | ASP1_RX_EVT_EN, &dm355_evm_snd_data); | ||
282 | } | 357 | } |
283 | 358 | ||
284 | static __init void dm355_evm_irq_init(void) | 359 | static __init void dm355_evm_irq_init(void) |