diff options
author | Chaithrika U S <chaithrika@ti.com> | 2009-08-11 17:01:59 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-08-26 04:55:52 -0400 |
commit | e33ef5e3b368b31705d3024ee6a326f2a85a78fb (patch) | |
tree | d42ede5148b7c4dd0a9245d12eaff33d46e2302f /arch/arm/mach-davinci | |
parent | 5a8d5441f4aac3ef0478d5de723422304c611926 (diff) |
davinci: Audio support for DA830 EVM
Define resources for McASP1 used on DA830/OMAP-L137 EVM, add platform
device defintion, initialization function. Additionally, this patch
also adds version and FIFO related members to platform data structure.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r-- | arch/arm/mach-davinci/board-da830-evm.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-davinci/da830.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 36 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/asp.h | 15 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/da8xx.h | 3 |
5 files changed, 85 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 90256693b8d8..a45340de7465 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <mach/irqs.h> | 23 | #include <mach/irqs.h> |
24 | #include <mach/cp_intc.h> | 24 | #include <mach/cp_intc.h> |
25 | #include <mach/da8xx.h> | 25 | #include <mach/da8xx.h> |
26 | #include <mach/asp.h> | ||
26 | 27 | ||
27 | #define DA830_EVM_PHY_MASK 0x0 | 28 | #define DA830_EVM_PHY_MASK 0x0 |
28 | #define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ | 29 | #define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ |
@@ -51,6 +52,25 @@ static struct davinci_uart_config da830_evm_uart_config __initdata = { | |||
51 | .enabled_uarts = 0x7, | 52 | .enabled_uarts = 0x7, |
52 | }; | 53 | }; |
53 | 54 | ||
55 | static u8 da830_iis_serializer_direction[] = { | ||
56 | RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, | ||
57 | INACTIVE_MODE, TX_MODE, INACTIVE_MODE, INACTIVE_MODE, | ||
58 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, | ||
59 | }; | ||
60 | |||
61 | static struct snd_platform_data da830_evm_snd_data = { | ||
62 | .tx_dma_offset = 0x2000, | ||
63 | .rx_dma_offset = 0x2000, | ||
64 | .op_mode = DAVINCI_MCASP_IIS_MODE, | ||
65 | .num_serializer = ARRAY_SIZE(da830_iis_serializer_direction), | ||
66 | .tdm_slots = 2, | ||
67 | .serial_dir = da830_iis_serializer_direction, | ||
68 | .eventq_no = EVENTQ_0, | ||
69 | .version = MCASP_VERSION_2, | ||
70 | .txnumevt = 1, | ||
71 | .rxnumevt = 1, | ||
72 | }; | ||
73 | |||
54 | static __init void da830_evm_init(void) | 74 | static __init void da830_evm_init(void) |
55 | { | 75 | { |
56 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 76 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
@@ -93,6 +113,13 @@ static __init void da830_evm_init(void) | |||
93 | davinci_serial_init(&da830_evm_uart_config); | 113 | davinci_serial_init(&da830_evm_uart_config); |
94 | i2c_register_board_info(1, da830_evm_i2c_devices, | 114 | i2c_register_board_info(1, da830_evm_i2c_devices, |
95 | ARRAY_SIZE(da830_evm_i2c_devices)); | 115 | ARRAY_SIZE(da830_evm_i2c_devices)); |
116 | |||
117 | ret = da8xx_pinmux_setup(da830_mcasp1_pins); | ||
118 | if (ret) | ||
119 | pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n", | ||
120 | ret); | ||
121 | |||
122 | da8xx_init_mcasp(1, &da830_evm_snd_data); | ||
96 | } | 123 | } |
97 | 124 | ||
98 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 125 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 3a9b6346c310..19b2748357fc 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <mach/common.h> | 23 | #include <mach/common.h> |
24 | #include <mach/time.h> | 24 | #include <mach/time.h> |
25 | #include <mach/da8xx.h> | 25 | #include <mach/da8xx.h> |
26 | #include <mach/asp.h> | ||
26 | 27 | ||
27 | #include "clock.h" | 28 | #include "clock.h" |
28 | #include "mux.h" | 29 | #include "mux.h" |
@@ -411,9 +412,9 @@ static struct davinci_clk da830_clks[] = { | |||
411 | CLK("eqep.0", NULL, &eqep0_clk), | 412 | CLK("eqep.0", NULL, &eqep0_clk), |
412 | CLK("eqep.1", NULL, &eqep1_clk), | 413 | CLK("eqep.1", NULL, &eqep1_clk), |
413 | CLK("da830_lcdc", NULL, &lcdc_clk), | 414 | CLK("da830_lcdc", NULL, &lcdc_clk), |
414 | CLK("soc-audio.0", NULL, &mcasp0_clk), | 415 | CLK("davinci-mcasp.0", NULL, &mcasp0_clk), |
415 | CLK("soc-audio.1", NULL, &mcasp1_clk), | 416 | CLK("davinci-mcasp.1", NULL, &mcasp1_clk), |
416 | CLK("soc-audio.2", NULL, &mcasp2_clk), | 417 | CLK("davinci-mcasp.2", NULL, &mcasp2_clk), |
417 | CLK("musb_hdrc", NULL, &usb20_clk), | 418 | CLK("musb_hdrc", NULL, &usb20_clk), |
418 | CLK(NULL, "aemif", &aemif_clk), | 419 | CLK(NULL, "aemif", &aemif_clk), |
419 | CLK(NULL, "aintc", &aintc_clk), | 420 | CLK(NULL, "aintc", &aintc_clk), |
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 11c0971e13a6..fe0baafcf610 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -281,7 +281,43 @@ static struct platform_device da8xx_emac_device = { | |||
281 | .resource = da8xx_emac_resources, | 281 | .resource = da8xx_emac_resources, |
282 | }; | 282 | }; |
283 | 283 | ||
284 | static struct resource da830_mcasp1_resources[] = { | ||
285 | { | ||
286 | .name = "mcasp1", | ||
287 | .start = DAVINCI_DA830_MCASP1_REG_BASE, | ||
288 | .end = DAVINCI_DA830_MCASP1_REG_BASE + (SZ_1K * 12) - 1, | ||
289 | .flags = IORESOURCE_MEM, | ||
290 | }, | ||
291 | /* TX event */ | ||
292 | { | ||
293 | .start = DAVINCI_DA830_DMA_MCASP1_AXEVT, | ||
294 | .end = DAVINCI_DA830_DMA_MCASP1_AXEVT, | ||
295 | .flags = IORESOURCE_DMA, | ||
296 | }, | ||
297 | /* RX event */ | ||
298 | { | ||
299 | .start = DAVINCI_DA830_DMA_MCASP1_AREVT, | ||
300 | .end = DAVINCI_DA830_DMA_MCASP1_AREVT, | ||
301 | .flags = IORESOURCE_DMA, | ||
302 | }, | ||
303 | }; | ||
304 | |||
305 | static struct platform_device da830_mcasp1_device = { | ||
306 | .name = "davinci-mcasp", | ||
307 | .id = 1, | ||
308 | .num_resources = ARRAY_SIZE(da830_mcasp1_resources), | ||
309 | .resource = da830_mcasp1_resources, | ||
310 | }; | ||
311 | |||
284 | int __init da8xx_register_emac(void) | 312 | int __init da8xx_register_emac(void) |
285 | { | 313 | { |
286 | return platform_device_register(&da8xx_emac_device); | 314 | return platform_device_register(&da8xx_emac_device); |
287 | } | 315 | } |
316 | |||
317 | void __init da8xx_init_mcasp(int id, struct snd_platform_data *pdata) | ||
318 | { | ||
319 | if (id == 1) { /* DA830/OMAP-L137 has 3 instances of McASP */ | ||
320 | da830_mcasp1_device.dev.platform_data = pdata; | ||
321 | platform_device_register(&da830_mcasp1_device); | ||
322 | } | ||
323 | } | ||
diff --git a/arch/arm/mach-davinci/include/mach/asp.h b/arch/arm/mach-davinci/include/mach/asp.h index cdf1f4442330..f3c97ac3425c 100644 --- a/arch/arm/mach-davinci/include/mach/asp.h +++ b/arch/arm/mach-davinci/include/mach/asp.h | |||
@@ -15,6 +15,9 @@ | |||
15 | #define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000 | 15 | #define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000 |
16 | #define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800 | 16 | #define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800 |
17 | 17 | ||
18 | /* Bases of da830 McASP1 register banks */ | ||
19 | #define DAVINCI_DA830_MCASP1_REG_BASE 0x01D04000 | ||
20 | |||
18 | /* EDMA channels of dm644x and dm355 */ | 21 | /* EDMA channels of dm644x and dm355 */ |
19 | #define DAVINCI_DMA_ASP0_TX 2 | 22 | #define DAVINCI_DMA_ASP0_TX 2 |
20 | #define DAVINCI_DMA_ASP0_RX 3 | 23 | #define DAVINCI_DMA_ASP0_RX 3 |
@@ -26,6 +29,10 @@ | |||
26 | #define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9 | 29 | #define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9 |
27 | #define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12 | 30 | #define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12 |
28 | 31 | ||
32 | /* EDMA channels of da830 McASP1 */ | ||
33 | #define DAVINCI_DA830_DMA_MCASP1_AREVT 2 | ||
34 | #define DAVINCI_DA830_DMA_MCASP1_AXEVT 3 | ||
35 | |||
29 | /* Interrupts */ | 36 | /* Interrupts */ |
30 | #define DAVINCI_ASP0_RX_INT IRQ_MBRINT | 37 | #define DAVINCI_ASP0_RX_INT IRQ_MBRINT |
31 | #define DAVINCI_ASP0_TX_INT IRQ_MBXINT | 38 | #define DAVINCI_ASP0_TX_INT IRQ_MBXINT |
@@ -43,6 +50,14 @@ struct snd_platform_data { | |||
43 | u8 op_mode; | 50 | u8 op_mode; |
44 | u8 num_serializer; | 51 | u8 num_serializer; |
45 | u8 *serial_dir; | 52 | u8 *serial_dir; |
53 | u8 version; | ||
54 | u8 txnumevt; | ||
55 | u8 rxnumevt; | ||
56 | }; | ||
57 | |||
58 | enum { | ||
59 | MCASP_VERSION_1 = 0, /* DM646x */ | ||
60 | MCASP_VERSION_2, /* DA8xx/OMAPL1x */ | ||
46 | }; | 61 | }; |
47 | 62 | ||
48 | #define INACTIVE_MODE 0 | 63 | #define INACTIVE_MODE 0 |
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index a8cb5709848d..30c5c407ea85 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <mach/edma.h> | 15 | #include <mach/edma.h> |
16 | #include <mach/i2c.h> | 16 | #include <mach/i2c.h> |
17 | #include <mach/emac.h> | 17 | #include <mach/emac.h> |
18 | #include <mach/asp.h> | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * The cp_intc interrupt controller for the da8xx isn't in the same | 21 | * The cp_intc interrupt controller for the da8xx isn't in the same |
@@ -65,6 +66,7 @@ int da8xx_register_edma(void); | |||
65 | int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); | 66 | int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); |
66 | int da8xx_register_watchdog(void); | 67 | int da8xx_register_watchdog(void); |
67 | int da8xx_register_emac(void); | 68 | int da8xx_register_emac(void); |
69 | void __init da8xx_init_mcasp(int id, struct snd_platform_data *pdata); | ||
68 | 70 | ||
69 | extern struct platform_device da8xx_serial_device; | 71 | extern struct platform_device da8xx_serial_device; |
70 | extern struct emac_platform_data da8xx_emac_pdata; | 72 | extern struct emac_platform_data da8xx_emac_pdata; |
@@ -100,6 +102,7 @@ extern const short da850_uart2_pins[]; | |||
100 | extern const short da850_i2c0_pins[]; | 102 | extern const short da850_i2c0_pins[]; |
101 | extern const short da850_i2c1_pins[]; | 103 | extern const short da850_i2c1_pins[]; |
102 | extern const short da850_cpgmac_pins[]; | 104 | extern const short da850_cpgmac_pins[]; |
105 | extern const short da850_mcasp_pins[]; | ||
103 | 106 | ||
104 | int da8xx_pinmux_setup(const short pins[]); | 107 | int da8xx_pinmux_setup(const short pins[]); |
105 | 108 | ||