From ff77b31c173918111e98cf7f9d704d94c5deb3c2 Mon Sep 17 00:00:00 2001 From: Dara Ramesh Date: Wed, 12 Jan 2011 09:45:54 +0530 Subject: [ARM/tegra] HDA Driver support Adding HDA audio driver support for Tegra3 Original-Change-Id: I81a76a54f6ce5390051d96dbeadf447682f9ff0e Reviewed-on: http://git-master/r/15405 Tested-by: Dara Ramesh Reviewed-by: Dara Ramesh Reviewed-by: Scott Peterson Reviewed-by: Scott Williams Change-Id: I8525ef7317606b895818e73ec92ca174dddf609e --- arch/arm/mach-tegra/board-aruba-pinmux.c | 8 ++++++++ arch/arm/mach-tegra/board-aruba.c | 3 +++ arch/arm/mach-tegra/devices.c | 28 ++++++++++++++++++---------- arch/arm/mach-tegra/tegra3_clocks.c | 4 ++-- 4 files changed, 31 insertions(+), 12 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-tegra/board-aruba-pinmux.c b/arch/arm/mach-tegra/board-aruba-pinmux.c index 069468b3ae00..3db2ede1eb1c 100644 --- a/arch/arm/mach-tegra/board-aruba-pinmux.c +++ b/arch/arm/mach-tegra/board-aruba-pinmux.c @@ -246,11 +246,19 @@ static __initdata struct tegra_pingroup_config aruba_pinmux[] = { DEFAULT_PINMUX(CLK_32K_OUT, BLINK, NORMAL, NORMAL, OUTPUT), DEFAULT_PINMUX(SYS_CLK_REQ, SYSCLK, NORMAL, NORMAL, OUTPUT), DEFAULT_PINMUX(OWR, OWR, NORMAL, NORMAL, INPUT), +#ifdef CONFIG_SND_HDA_TEGRA + DEFAULT_PINMUX(DAP1_FS, HDA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP1_DIN, HDA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP1_DOUT, HDA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP1_SCLK, HDA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CLK1_REQ, DAP1, NORMAL, NORMAL, INPUT), +#else DEFAULT_PINMUX(DAP1_FS, I2S0, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(DAP1_DIN, I2S0, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(DAP1_DOUT, I2S0, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(DAP1_SCLK, I2S0, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(CLK1_REQ, DAP, NORMAL, NORMAL, INPUT), +#endif DEFAULT_PINMUX(CLK1_OUT, EXTPERIPH1, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(SPDIF_IN, SPDIF, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(SPDIF_OUT, SPDIF, NORMAL, NORMAL, OUTPUT), diff --git a/arch/arm/mach-tegra/board-aruba.c b/arch/arm/mach-tegra/board-aruba.c index b9559b652377..cfe990f41033 100644 --- a/arch/arm/mach-tegra/board-aruba.c +++ b/arch/arm/mach-tegra/board-aruba.c @@ -359,6 +359,9 @@ static struct platform_device *aruba_devices[] __initdata = { #endif &aruba_keys_device, &tegra_wdt_device, +#if defined(CONFIG_SND_HDA_TEGRA) + &tegra_hda_device, +#endif &tegra_avp_device, }; diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 4f86a47f613f..c29755dc0530 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c @@ -583,25 +583,33 @@ struct platform_device tegra_audio_device = { .resource = audio_resource, .num_resources = ARRAY_SIZE(audio_resource), }; +#endif + +#if defined(CONFIG_SND_HDA_TEGRA) +static u64 tegra_hda_dma_mask = DMA_BIT_MASK(32); -static struct resource hda_resource[] = { +static struct resource tegra_hda_resources[] = { [0] = { + .start = TEGRA_HDA_BASE, + .end = TEGRA_HDA_BASE + TEGRA_HDA_SIZE - 1 , + .flags = IORESOURCE_MEM + }, + [1] = { .start = INT_HDA, .end = INT_HDA, .flags = IORESOURCE_IRQ }, - [1] = { - .start = TEGRA_HDA_BASE, - .end = TEGRA_HDA_BASE + TEGRA_HDA_SIZE - 1, - .flags = IORESOURCE_MEM - } }; struct platform_device tegra_hda_device = { - .name = "hda", - .id = -1, - .resource = hda_resource, - .num_resources = ARRAY_SIZE(hda_resource), + .name = "tegra-hda", + .id = 0, + .dev = { + .coherent_dma_mask = DMA_BIT_MASK(32), + .dma_mask = &tegra_hda_dma_mask, + }, + .resource = tegra_hda_resources, + .num_resources = ARRAY_SIZE(tegra_hda_resources), }; #endif diff --git a/arch/arm/mach-tegra/tegra3_clocks.c b/arch/arm/mach-tegra/tegra3_clocks.c index 7ee8b0193282..673b490356ce 100644 --- a/arch/arm/mach-tegra/tegra3_clocks.c +++ b/arch/arm/mach-tegra/tegra3_clocks.c @@ -2532,8 +2532,8 @@ struct clk tegra_list_clks[] = { PERIPH_CLK("dam0", "dam.0", NULL, 108, 0x3d8, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71), PERIPH_CLK("dam1", "dam.1", NULL, 109, 0x3dc, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71), PERIPH_CLK("dam2", "dam.2", NULL, 110, 0x3e0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71), - PERIPH_CLK("hda2codec", "hda2codec", NULL, 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), - PERIPH_CLK("hda", "hda", NULL, 125, 0x428, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), + PERIPH_CLK("hda", "hda", NULL, 125, 0x428, 108000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), + PERIPH_CLK("hda2codec_2x", "hda2codec_2x", NULL, 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_2), PERIPH_CLK("hda2hdmi", "hda2hdmi", NULL, 128, 0, 48000000, mux_clk_m, 0), PERIPH_CLK("xio", "xio", NULL, 45, 0x120, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), PERIPH_CLK("twc", "twc", NULL, 16, 0x12c, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), -- cgit v1.2.3