From 4cda593c3d864284264008cc0bac2b7ec8ab0773 Mon Sep 17 00:00:00 2001 From: Nitin Pai Date: Thu, 15 Mar 2012 10:57:11 +0530 Subject: arm: tegra: p1852: instantiated audio drivers Instantiated audio drivers for I2S and AHUB. Instantiated the machine driver for P1852 boards. Added clocks that were not initialized by QB which are needed to be on. Bug 948478 Change-Id: I6e696f97ed114ae684a74d9b9869066606dfaa22 Signed-off-by: Nitin Pai Reviewed-on: http://git-master/r/90252 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Manoj Chourasia Reviewed-by: Bob Johnston Tested-by: Bob Johnston Reviewed-by: Varun Wadekar --- arch/arm/mach-tegra/board-p1852.c | 70 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 5 deletions(-) (limited to 'arch/arm/mach-tegra/board-p1852.c') diff --git a/arch/arm/mach-tegra/board-p1852.c b/arch/arm/mach-tegra/board-p1852.c index 4b978da9f63d..b53f9a7311f4 100644 --- a/arch/arm/mach-tegra/board-p1852.c +++ b/arch/arm/mach-tegra/board-p1852.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -113,11 +114,20 @@ static __initdata struct tegra_clk_init_table p1852_clk_init_table[] = { { "sbc5", "pll_m", 100000000, true}, { "sbc6", "pll_m", 100000000, true}, { "cpu_g", "cclk_g", 900000000, true}, - { "i2s0", "clk_m", 12288000, false}, - { "i2s1", "clk_m", 12288000, false}, - { "i2s2", "clk_m", 12288000, false}, - { "i2s3", "clk_m", 12288000, false}, - { "i2s4", "clk_m", 12288000, false}, + { "i2s0", "pll_a_out0", 12288000, false}, + { "i2s1", "pll_a_out0", 12288000, false}, + { "i2s2", "pll_a_out0", 12288000, false}, + { "i2s3", "pll_a_out0", 12288000, false}, + { "i2s4", "pll_a_out0", 12288000, false}, + { "audio0", "i2s0_sync", 12288000, false}, + { "audio1", "i2s1_sync", 12288000, false}, + { "audio2", "i2s2_sync", 12288000, false}, + { "audio3", "i2s3_sync", 12288000, false}, + { "audio4", "i2s4_sync", 12288000, false}, + { "apbif", "clk_m", 12000000, false}, + { "dam0", "clk_m", 12000000, true}, + { "dam1", "clk_m", 12000000, true}, + { "dam2", "clk_m", 12000000, true}, { "vi", "pll_p", 200000000, true}, { "vi_sensor", "pll_p", 150000000, true}, { "vde", "pll_c", 484000000, true}, @@ -221,6 +231,55 @@ static void __init p1852_uart_init(void) ARRAY_SIZE(p1852_uart_devices)); } +static struct tegra_p1852_platform_data p1852_audio_pdata = { + .codec_info[0] = { + .codec_dai_name = "dit-hifi", + .cpu_dai_name = "tegra30-i2s.0", + .codec_name = "spdif-dit.0", + .name = "tegra-i2s-1", + .i2s_format = format_i2s, + .master = 1, + }, + .codec_info[1] = { + .codec_dai_name = "dit-hifi", + .cpu_dai_name = "tegra30-i2s.1", + .codec_name = "spdif-dit.1", + .name = "tegra-i2s-2", + .i2s_format = format_i2s, + .master = 0, + }, + +}; + +static struct platform_device generic_codec_1 = { + .name = "spdif-dit", + .id = 0, +}; +static struct platform_device generic_codec_2 = { + .name = "spdif-dit", + .id = 1, +}; + +static struct platform_device tegra_snd_p1852 = { + .name = "tegra-snd-p1852", + .id = 0, + .dev = { + .platform_data = &p1852_audio_pdata, + }, +}; + +static void p1852_i2s_audio_init(void) +{ + platform_device_register(&tegra_pcm_device); + platform_device_register(&generic_codec_1); + platform_device_register(&generic_codec_2); + platform_device_register(&tegra_i2s_device0); + platform_device_register(&tegra_i2s_device1); + platform_device_register(&tegra_ahub_device); + platform_device_register(&tegra_snd_p1852); +} + + #if defined(CONFIG_SPI_TEGRA) && defined(CONFIG_SPI_SPIDEV) static struct spi_board_info tegra_spi_devices[] __initdata = { { @@ -362,6 +421,7 @@ static void __init tegra_p1852_init(void) tegra_clk_init_from_table(p1852_clk_init_table); p1852_pinmux_init(); p1852_i2c_init(); + p1852_i2s_audio_init(); p1852_gpio_init(); p1852_uart_init(); p1852_usb_init(); -- cgit v1.2.3