Permalink
Browse files

beaglebone: dvi cape audio hacks

  • Loading branch information...
1 parent 8f5b87f commit 4d4b4e2a3c52850c4752d7f54252d4dae1cc8fa1 @koenkooi koenkooi committed May 23, 2012
@@ -43,6 +43,8 @@
#include <linux/can/platform/mcp251x.h>
#include <linux/input/ti_tscadc.h>
+#include <sound/tlv320aic3x.h>
+
/* LCD controller is similar to DA850 */
#include <video/da8xx-fb.h>
@@ -315,7 +317,7 @@ static struct tsc_data bone_touchscreen_data = {
};
static u8 am335x_iis_serializer_direction1[] = {
- INACTIVE_MODE, INACTIVE_MODE, TX_MODE, RX_MODE,
+ INACTIVE_MODE, INACTIVE_MODE, RX_MODE, TX_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
@@ -334,6 +336,19 @@ static struct snd_platform_data am335x_evm_snd_data1 = {
.rxnumevt = 1,
};
+static struct snd_platform_data bone_snd_data1 = {
+ .tx_dma_offset = 0x46000000, /* McASP0*/
+ .rx_dma_offset = 0x46000000,
+ .op_mode = DAVINCI_MCASP_IIS_MODE,
+ .num_serializer = ARRAY_SIZE(am335x_iis_serializer_direction1),
+ .tdm_slots = 2,
+ .serial_dir = am335x_iis_serializer_direction1,
+ .asp_chan_q = EVENTQ_2,
+ .version = MCASP_VERSION_3,
+ .txnumevt = 1,
+ .rxnumevt = 1,
+};
+
static struct omap2_hsmmc_info am335x_mmc[] __initdata = {
{
.mmc = 1,
@@ -796,11 +811,18 @@ static struct pinmux_config mcasp1_pin_mux[] = {
{"mii1_crs.mcasp1_aclkx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
{"mii1_rxerr.mcasp1_fsx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
{"mii1_col.mcasp1_axr2", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
- {"rmii1_refclk.mcasp1_axr3", OMAP_MUX_MODE4 |
- AM33XX_PIN_INPUT_PULLDOWN},
+ {"rmii1_refclk.mcasp1_axr3", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
{NULL, 0},
};
+/* Module pin mux for mcasp0 */
+static struct pinmux_config mcasp0_pin_mux[] = {
+ {"mcasp0_aclkx.mcasp0_aclkx", OMAP_MUX_MODE0 |AM33XX_PIN_INPUT_PULLDOWN},
+ {"mcasp0_fsx.mcasp0_fsx", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
+ {"mcasp0_ahclkr.mcasp0_axr2", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
+ {"mcasp0_ahclkx.mcasp0_axr3", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
+ {NULL, 0},
+};
/* Module pin mux for mmc0 */
static struct pinmux_config mmc0_pin_mux[] = {
@@ -1956,6 +1978,15 @@ static void evm_nand_init(int evm_id, int profile)
omap_init_elm();
}
+static struct regulator_consumer_supply bone_audio_supplies[] = {
+ /* tlv320aic3x analog supplies */
+ REGULATOR_SUPPLY("AVDD", "3-001b"),
+ REGULATOR_SUPPLY("DRVDD", "3-001b"),
+ /* tlv320aic3x digital supplies */
+ REGULATOR_SUPPLY("IOVDD", "3-001b"),
+ REGULATOR_SUPPLY("DVDD", "3-001b"),
+};
+
/* TPS65217 voltage regulator support */
/* 1.8V */
@@ -2229,6 +2260,25 @@ static void tt3201_init(int evm_id, int profile)
am33xx_d_can_init(1);
}
+/* Setup McASP 1 */
+static void mcasp1_init(int evm_id, int profile)
+{
+ /* Configure McASP */
+ setup_pin_mux(mcasp1_pin_mux);
+ am335x_register_mcasp(&am335x_evm_snd_data1, 1);
+ return;
+}
+
+/* Setup McASP 0 */
+static void mcasp0_init(int evm_id, int profile)
+{
+ printk("Beaglebone cape: mcasp0 init\n");
+ /* Configure McASP */
+ setup_pin_mux(mcasp0_pin_mux);
+ am335x_register_mcasp(&bone_snd_data1, 0);
+ return;
+}
+
static const char* cape_pins[] = {
/*
From SRM RevA5.0.1:
@@ -2567,7 +2617,8 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
beaglebone_leds_free = 0;
dvileds_init(0,0);
-
+ mcasp0_init(0,0);
+
if (!strncmp("00A1", cape_config.version, 4) || !strncmp("000A", cape_config.version, 4)) {
pr_info("BeagleBone cape: DVI init for revision A1 or older\n");
setup_pin_mux(dvia1_pin_mux);
@@ -2715,6 +2766,9 @@ static struct at24_platform_data cape_eeprom_info = {
};
static struct i2c_board_info __initdata cape_i2c_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("tlv320aic3x", 0x1b),
+ },
{
I2C_BOARD_INFO("24c256", 0x54),
.platform_data = &cape_eeprom_info,
@@ -2741,16 +2795,6 @@ static void i2c2_init(int evm_id, int profile)
return;
}
-
-/* Setup McASP 1 */
-static void mcasp1_init(int evm_id, int profile)
-{
- /* Configure McASP */
- setup_pin_mux(mcasp1_pin_mux);
- am335x_register_mcasp(&am335x_evm_snd_data1, 1);
- return;
-}
-
static void mmc1_init(int evm_id, int profile)
{
setup_pin_mux(mmc1_pin_mux);
@@ -218,7 +218,6 @@ int __init am335x_register_mcasp(struct snd_platform_data *pdata, int ctrl_nr)
dev_name, oh->name);
return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
}
-
#else
int __init am335x_register_mcasp(struct snd_platform_data *pdata, int ctrl_nr)
{
@@ -234,6 +233,7 @@ struct platform_device am33xx_pcm_device = {
static void am33xx_init_pcm(void)
{
+ printk("cape: pcm register");
platform_device_register(&am33xx_pcm_device);
}
@@ -52,7 +52,7 @@
#include "tlv320aic3x.h"
-#define AIC3X_NUM_SUPPLIES 4
+#define AIC3X_NUM_SUPPLIES 0
static const char *aic3x_supply_names[AIC3X_NUM_SUPPLIES] = {
"IOVDD", /* I/O Voltage */
"DVDD", /* Digital Core Voltage */
@@ -244,9 +244,9 @@ static struct snd_soc_dai_link da850_evm_dai = {
static struct snd_soc_dai_link am335x_evm_dai = {
.name = "TLV320AIC3X",
.stream_name = "AIC3X",
- .cpu_dai_name = "davinci-mcasp.1",
+ .cpu_dai_name = "davinci-mcasp.0",
.codec_dai_name = "tlv320aic3x-hifi",
- .codec_name = "tlv320aic3x-codec.2-001b",
+ .codec_name = "tlv320aic3x-codec.3-001b",
.platform_name = "davinci-pcm-audio",
.init = evm_aic3x_init,
.ops = &evm_ops,
@@ -331,8 +331,9 @@ static int __init evm_init(void)
return -EINVAL;
evm_snd_device = platform_device_alloc("soc-audio", index);
- if (!evm_snd_device)
+ if (!evm_snd_device) {
return -ENOMEM;
+ }
platform_set_drvdata(evm_snd_device, evm_snd_dev_data);
ret = platform_device_add(evm_snd_device);

0 comments on commit 4d4b4e2

Please sign in to comment.