Davinci: DM365: Add platform device for McBSP
authorMiguel Aguilar <miguel.aguilar@ridgerun.com>
Wed, 2 Sep 2009 21:33:29 +0000 (15:33 -0600)
committerKevin Hilman <khilman@deeprootsystems.com>
Wed, 25 Nov 2009 18:21:17 +0000 (10:21 -0800)
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>
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/dm365.c
arch/arm/mach-davinci/include/mach/asp.h
arch/arm/mach-davinci/include/mach/dm365.h

index 52dd8046b3051eb05fefd2140586e3f19f9182a2..a5ed178a9d431d0370a82e29818a88c406db738b 100644 (file)
@@ -176,11 +176,16 @@ static struct at24_platform_data eeprom_info = {
        .context        = (void *)0x7f00,
 };
 
+static struct snd_platform_data dm365_evm_snd_data;
+
 static struct i2c_board_info i2c_info[] = {
        {
                I2C_BOARD_INFO("24c256", 0x50),
                .platform_data  = &eeprom_info,
        },
+       {
+               I2C_BOARD_INFO("tlv320aic3x", 0x18),
+       },
 };
 
 static struct davinci_i2c_platform_data i2c_pdata = {
@@ -472,6 +477,8 @@ static __init void dm365_evm_init(void)
 
        /* maybe setup mmc1/etc ... _after_ mmc0 */
        evm_init_cpld();
+
+       dm365_init_asp(&dm365_evm_snd_data);
 }
 
 static __init void dm365_evm_irq_init(void)
index 6c948b1fc406713faca383c828977822fcb68287..2674438b5d36bfabc3fe3e47e017ed4fbb479204 100644 (file)
@@ -32,6 +32,7 @@
 #include <mach/time.h>
 #include <mach/serial.h>
 #include <mach/common.h>
+#include <mach/asp.h>
 
 #include "clock.h"
 #include "mux.h"
@@ -456,7 +457,7 @@ static struct davinci_clk dm365_clks[] = {
        CLK(NULL, "usb", &usb_clk),
        CLK("davinci_emac.1", NULL, &emac_clk),
        CLK("voice_codec", NULL, &voicecodec_clk),
-       CLK("soc-audio.0", NULL, &asp0_clk),
+       CLK("davinci-asp.0", NULL, &asp0_clk),
        CLK(NULL, "rto", &rto_clk),
        CLK(NULL, "mjcp", &mjcp_clk),
        CLK(NULL, NULL, NULL),
@@ -603,6 +604,9 @@ INT_CFG(DM365,  INT_IMX1_ENABLE,     24,    1,    1,     false)
 INT_CFG(DM365,  INT_IMX1_DISABLE,    24,    1,    0,     false)
 INT_CFG(DM365,  INT_NSF_ENABLE,      25,    1,    1,     false)
 INT_CFG(DM365,  INT_NSF_DISABLE,     25,    1,    0,     false)
+
+EVT_CFG(DM365, EVT2_ASP_TX,         0,     1,    0,     false)
+EVT_CFG(DM365, EVT3_ASP_RX,         1,     1,    0,     false)
 #endif
 };
 
@@ -806,6 +810,31 @@ static struct platform_device dm365_edma_device = {
        .resource               = edma_resources,
 };
 
+static struct resource dm365_asp_resources[] = {
+       {
+               .start  = DAVINCI_DM365_ASP0_BASE,
+               .end    = DAVINCI_DM365_ASP0_BASE + SZ_8K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .start  = DAVINCI_DMA_ASP0_TX,
+               .end    = DAVINCI_DMA_ASP0_TX,
+               .flags  = IORESOURCE_DMA,
+       },
+       {
+               .start  = DAVINCI_DMA_ASP0_RX,
+               .end    = DAVINCI_DMA_ASP0_RX,
+               .flags  = IORESOURCE_DMA,
+       },
+};
+
+static struct platform_device dm365_asp_device = {
+       .name           = "davinci-asp",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(dm365_asp_resources),
+       .resource       = dm365_asp_resources,
+};
+
 static struct map_desc dm365_io_desc[] = {
        {
                .virtual        = IO_VIRT,
@@ -907,6 +936,20 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
        .sram_len               = SZ_32K,
 };
 
+void __init dm365_init_asp(struct snd_platform_data *pdata)
+{
+       davinci_cfg_reg(DM365_MCBSP0_BDX);
+       davinci_cfg_reg(DM365_MCBSP0_X);
+       davinci_cfg_reg(DM365_MCBSP0_BFSX);
+       davinci_cfg_reg(DM365_MCBSP0_BDR);
+       davinci_cfg_reg(DM365_MCBSP0_R);
+       davinci_cfg_reg(DM365_MCBSP0_BFSR);
+       davinci_cfg_reg(DM365_EVT2_ASP_TX);
+       davinci_cfg_reg(DM365_EVT3_ASP_RX);
+       dm365_asp_device.dev.platform_data = pdata;
+       platform_device_register(&dm365_asp_device);
+}
+
 void __init dm365_init(void)
 {
        davinci_common_init(&davinci_soc_info_dm365);
index 18e4ce34ece61ade58e555a57ad5f91ea3db85a5..fef12b919c694429499b04e83c326d79b2e2ce39 100644 (file)
@@ -11,6 +11,9 @@
 #define DAVINCI_ASP0_BASE      0x01E02000
 #define DAVINCI_ASP1_BASE      0x01E04000
 
+/* Bases of dm365 register banks */
+#define DAVINCI_DM365_ASP0_BASE        0x01D02000
+
 /* Bases of dm646x register banks */
 #define        DAVINCI_DM646X_MCASP0_REG_BASE          0x01D01000
 #define DAVINCI_DM646X_MCASP1_REG_BASE         0x01D01800
index 09db4343bb4c0a4e6c943dc6674406cb2961faf1..2291c0d2c2a0381ca498065220a036b043bc3da9 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <mach/hardware.h>
 #include <mach/emac.h>
+#include <mach/asp.h>
 
 #define DM365_EMAC_BASE                        (0x01D07000)
 #define DM365_EMAC_CNTRL_OFFSET                (0x0000)
@@ -25,5 +26,6 @@
 #define DM365_EMAC_CNTRL_RAM_SIZE      (0x2000)
 
 void __init dm365_init(void);
+void __init dm365_init_asp(struct snd_platform_data *pdata);
 
 #endif /* __ASM_ARCH_DM365_H */