diff options
author | Miguel Aguilar <miguel.aguilar@ridgerun.com> | 2009-09-02 17:33:29 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-11-25 13:21:17 -0500 |
commit | e9ab3214a8fc546d62e22064caa559b912620106 (patch) | |
tree | 2695aa397b0bbedd08f151a0b9488b88dd49a823 /arch/arm/mach-davinci/dm365.c | |
parent | ed16067205d79aef6ab885a662380fd1dad3ff6a (diff) |
Davinci: DM365: Add platform device for McBSP
1) Registers the platform device for McBSP on dm365.
2) Add platform data to DM365 EVM board file.
3) Set i2c address for audio codec at DM365 EVM board file.
Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/dm365.c')
-rw-r--r-- | arch/arm/mach-davinci/dm365.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 6c948b1fc406..2674438b5d36 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <mach/time.h> | 32 | #include <mach/time.h> |
33 | #include <mach/serial.h> | 33 | #include <mach/serial.h> |
34 | #include <mach/common.h> | 34 | #include <mach/common.h> |
35 | #include <mach/asp.h> | ||
35 | 36 | ||
36 | #include "clock.h" | 37 | #include "clock.h" |
37 | #include "mux.h" | 38 | #include "mux.h" |
@@ -456,7 +457,7 @@ static struct davinci_clk dm365_clks[] = { | |||
456 | CLK(NULL, "usb", &usb_clk), | 457 | CLK(NULL, "usb", &usb_clk), |
457 | CLK("davinci_emac.1", NULL, &emac_clk), | 458 | CLK("davinci_emac.1", NULL, &emac_clk), |
458 | CLK("voice_codec", NULL, &voicecodec_clk), | 459 | CLK("voice_codec", NULL, &voicecodec_clk), |
459 | CLK("soc-audio.0", NULL, &asp0_clk), | 460 | CLK("davinci-asp.0", NULL, &asp0_clk), |
460 | CLK(NULL, "rto", &rto_clk), | 461 | CLK(NULL, "rto", &rto_clk), |
461 | CLK(NULL, "mjcp", &mjcp_clk), | 462 | CLK(NULL, "mjcp", &mjcp_clk), |
462 | CLK(NULL, NULL, NULL), | 463 | CLK(NULL, NULL, NULL), |
@@ -603,6 +604,9 @@ INT_CFG(DM365, INT_IMX1_ENABLE, 24, 1, 1, false) | |||
603 | INT_CFG(DM365, INT_IMX1_DISABLE, 24, 1, 0, false) | 604 | INT_CFG(DM365, INT_IMX1_DISABLE, 24, 1, 0, false) |
604 | INT_CFG(DM365, INT_NSF_ENABLE, 25, 1, 1, false) | 605 | INT_CFG(DM365, INT_NSF_ENABLE, 25, 1, 1, false) |
605 | INT_CFG(DM365, INT_NSF_DISABLE, 25, 1, 0, false) | 606 | INT_CFG(DM365, INT_NSF_DISABLE, 25, 1, 0, false) |
607 | |||
608 | EVT_CFG(DM365, EVT2_ASP_TX, 0, 1, 0, false) | ||
609 | EVT_CFG(DM365, EVT3_ASP_RX, 1, 1, 0, false) | ||
606 | #endif | 610 | #endif |
607 | }; | 611 | }; |
608 | 612 | ||
@@ -806,6 +810,31 @@ static struct platform_device dm365_edma_device = { | |||
806 | .resource = edma_resources, | 810 | .resource = edma_resources, |
807 | }; | 811 | }; |
808 | 812 | ||
813 | static struct resource dm365_asp_resources[] = { | ||
814 | { | ||
815 | .start = DAVINCI_DM365_ASP0_BASE, | ||
816 | .end = DAVINCI_DM365_ASP0_BASE + SZ_8K - 1, | ||
817 | .flags = IORESOURCE_MEM, | ||
818 | }, | ||
819 | { | ||
820 | .start = DAVINCI_DMA_ASP0_TX, | ||
821 | .end = DAVINCI_DMA_ASP0_TX, | ||
822 | .flags = IORESOURCE_DMA, | ||
823 | }, | ||
824 | { | ||
825 | .start = DAVINCI_DMA_ASP0_RX, | ||
826 | .end = DAVINCI_DMA_ASP0_RX, | ||
827 | .flags = IORESOURCE_DMA, | ||
828 | }, | ||
829 | }; | ||
830 | |||
831 | static struct platform_device dm365_asp_device = { | ||
832 | .name = "davinci-asp", | ||
833 | .id = 0, | ||
834 | .num_resources = ARRAY_SIZE(dm365_asp_resources), | ||
835 | .resource = dm365_asp_resources, | ||
836 | }; | ||
837 | |||
809 | static struct map_desc dm365_io_desc[] = { | 838 | static struct map_desc dm365_io_desc[] = { |
810 | { | 839 | { |
811 | .virtual = IO_VIRT, | 840 | .virtual = IO_VIRT, |
@@ -907,6 +936,20 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { | |||
907 | .sram_len = SZ_32K, | 936 | .sram_len = SZ_32K, |
908 | }; | 937 | }; |
909 | 938 | ||
939 | void __init dm365_init_asp(struct snd_platform_data *pdata) | ||
940 | { | ||
941 | davinci_cfg_reg(DM365_MCBSP0_BDX); | ||
942 | davinci_cfg_reg(DM365_MCBSP0_X); | ||
943 | davinci_cfg_reg(DM365_MCBSP0_BFSX); | ||
944 | davinci_cfg_reg(DM365_MCBSP0_BDR); | ||
945 | davinci_cfg_reg(DM365_MCBSP0_R); | ||
946 | davinci_cfg_reg(DM365_MCBSP0_BFSR); | ||
947 | davinci_cfg_reg(DM365_EVT2_ASP_TX); | ||
948 | davinci_cfg_reg(DM365_EVT3_ASP_RX); | ||
949 | dm365_asp_device.dev.platform_data = pdata; | ||
950 | platform_device_register(&dm365_asp_device); | ||
951 | } | ||
952 | |||
910 | void __init dm365_init(void) | 953 | void __init dm365_init(void) |
911 | { | 954 | { |
912 | davinci_common_init(&davinci_soc_info_dm365); | 955 | davinci_common_init(&davinci_soc_info_dm365); |