From: Chris Fries Date: Thu, 7 Oct 2010 02:19:59 +0000 (-0500) Subject: [ARM] tegra: stingray: add second i2s to support capture at various rates X-Git-Tag: firefly_0821_release~9834^2~479 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eb718c8108add0145850894515a9066c7f793cf3;p=firefly-linux-kernel-4.4.55.git [ARM] tegra: stingray: add second i2s to support capture at various rates Add tegra_i2s_device2, to support CPCAP CODEC capture independent of STDAC. This gives us independent control of the codec sampling rate. Change-Id: Ib0f78667c15592b9bc11e100b8097bed27686523 Signed-off-by: Iliyan Malchev --- diff --git a/arch/arm/mach-tegra/board-stingray.c b/arch/arm/mach-tegra/board-stingray.c index 2b26aeec2d97..d1ed4db1f157 100644 --- a/arch/arm/mach-tegra/board-stingray.c +++ b/arch/arm/mach-tegra/board-stingray.c @@ -286,6 +286,7 @@ static struct platform_device cpcap_audio_device = { }, }; +/* This is the CPCAP Stereo DAC interface. */ static struct tegra_audio_platform_data tegra_audio_pdata = { .master = false, .dma_on = true, /* use dma by default */ @@ -297,6 +298,18 @@ static struct tegra_audio_platform_data tegra_audio_pdata = { .bit_size = I2S_BIT_SIZE_16, }; +/* Connected to CPCAP CODEC - Switchable to Bluetooth Audio. */ +static struct tegra_audio_platform_data tegra_audio2_pdata = { + .master = false, + .dma_on = true, /* use dma by default */ + .i2s_clk_rate = 240000000, + .dap_clk = "clk_dev1", + .audio_sync_clk = "audio_2x", + .mode = I2S_BIT_FORMAT_I2S, + .fifo_fmt = I2S_FIFO_16_LSB, + .bit_size = I2S_BIT_SIZE_16, +}; + static char *usb_functions_mtp[] = { "mtp" }; static char *usb_functions_mtp_adb[] = { "mtp", "adb" }; #ifdef CONFIG_USB_ANDROID_RNDIS @@ -628,6 +641,7 @@ static struct platform_device *stingray_devices[] __initdata = { &ram_console_device, &tegra_camera, &tegra_i2s_device1, + &tegra_i2s_device2, &mdm6600_modem, }; @@ -916,6 +930,7 @@ static void init_das(void) das_writel((!master)<<31, APB_MISC_DAS_DAP_CTRL_SEL_0); das_writel(0, APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0); + master = tegra_audio2_pdata.master; /* DAC2 -> DAP2 */ das_writel((!master)<<31 | 1, APB_MISC_DAS_DAP_CTRL_SEL_0 + 4); das_writel(1<<28 | 1<<24 | 1, @@ -1021,6 +1036,7 @@ static void __init tegra_stingray_init(void) init_das(); tegra_i2s_device1.dev.platform_data = &tegra_audio_pdata; + tegra_i2s_device2.dev.platform_data = &tegra_audio2_pdata; cpcap_device_register(&cpcap_audio_device); tegra_ehci1_device.dev.platform_data = &tegra_ehci_pdata[0];