#include <mach/gpio.h>
#include <mach/clk.h>
#include <mach/usb_phy.h>
+#include <mach/i2s.h>
+#include <mach/audio.h>
#include <linux/usb/android_composite.h>
.num_resources = ARRAY_SIZE(cpcap_otg_resources),
};
+static struct tegra_audio_platform_data tegra_audio_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" };
static char *usb_functions_adb[] = { "mtp", "adb" };
&tegra_gart_dev,
&ram_console_device,
&tegra_isp,
+ &tegra_i2s_device1,
};
extern struct tegra_sdhci_platform_data stingray_wifi_data; /* sdhci2 */
.wake_any = 0,
};
+static void *das_base = IO_ADDRESS(TEGRA_APB_MISC_BASE);
+
+static inline void das_writel(unsigned long value, unsigned long offset)
+{
+ writel(value, das_base + offset);
+}
+
+#define APB_MISC_DAS_DAP_CTRL_SEL_0 0xc00
+#define APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0 0xc40
+
+static void init_das(void)
+{
+ bool master = tegra_audio_pdata.master;
+
+ /* DAC1 -> DAP1 */
+ das_writel((!master)<<31, APB_MISC_DAS_DAP_CTRL_SEL_0);
+ das_writel(0, APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0);
+
+ /* DAC2 -> DAP2 */
+ das_writel((!master)<<31 | 1, APB_MISC_DAS_DAP_CTRL_SEL_0 + 4);
+ das_writel(1<<28 | 1<<24 | 1,
+ APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0 + 4);
+}
+
extern int nvmap_add_carveout_heap(unsigned long, size_t, const char *,
unsigned int);
tegra_periph_reset_deassert(clk);
clk_put(clk);
+ init_das();
+ tegra_i2s_device1.dev.platform_data = &tegra_audio_pdata;
+
platform_add_devices(stingray_devices, ARRAY_SIZE(stingray_devices));
stingray_i2c_init();