| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * tegra_soc.h -- SoC audio for tegra | |
| 3 * | |
| 4 * (c) 2009 Nvidia Graphics Pvt. Ltd. | |
| 5 * http://www.nvidia.com | |
| 6 * | |
| 7 * Copyright 2007 Wolfson Microelectronics PLC. | |
| 8 * Author: Graeme Gregory | |
| 9 * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com | |
| 10 * | |
| 11 * This program is free software; you can redistribute it and/or modify it | |
| 12 * under the terms of the GNU General Public License as published by the | |
| 13 * Free Software Foundation; either version 2 of the License, or (at your | |
| 14 * option) any later version. | |
| 15 * | |
| 16 */ | |
| 17 | |
| 18 #ifndef __TEGRA_AUDIO__ | |
| 19 #define __TEGRA_AUDIO__ | |
| 20 | |
| 21 #include <linux/init.h> | |
| 22 #include <linux/module.h> | |
| 23 #include <linux/device.h> | |
| 24 #include <linux/delay.h> | |
| 25 #include <linux/clk.h> | |
| 26 #include <linux/jiffies.h> | |
| 27 #include <linux/io.h> | |
| 28 #include <linux/platform_device.h> | |
| 29 #include <linux/slab.h> | |
| 30 #include <linux/dma-mapping.h> | |
| 31 #include <linux/kthread.h> | |
| 32 #include <linux/moduleparam.h> | |
| 33 #include <linux/timer.h> | |
| 34 #include <linux/interrupt.h> | |
| 35 #include <linux/i2c.h> | |
| 36 #include <linux/io.h> | |
| 37 #include <mach/iomap.h> | |
| 38 #include <mach/i2s_api.h> | |
| 39 #include <mach/irqs.h> | |
| 40 #include <mach/pinmux.h> | |
| 41 #include <mach/audio.h> | |
| 42 #include <mach/dma.h> | |
| 43 #include <sound/core.h> | |
| 44 #include <sound/pcm.h> | |
| 45 #include <sound/pcm_params.h> | |
| 46 #include <sound/initval.h> | |
| 47 #include <sound/soc.h> | |
| 48 #include <sound/core.h> | |
| 49 #include <sound/pcm.h> | |
| 50 #include <sound/soc-dapm.h> | |
| 51 #include <sound/soc-dai.h> | |
| 52 #include <sound/tlv.h> | |
| 53 #include <asm/mach-types.h> | |
| 54 #include <asm/hardware/scoop.h> | |
| 55 | |
| 56 #define STATE_INIT 0 | |
| 57 #define STATE_ABORT 1 | |
| 58 #define STATE_EXIT 2 | |
| 59 #define STATE_EXITED 3 | |
| 60 #define STATE_INVALID 4 | |
| 61 | |
| 62 #define APB_MISC_DAS_DAP_CTRL_SEL_0 0xc00 | |
| 63 #define APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0 0xc40 | |
| 64 | |
| 65 #define FIFO1 0 | |
| 66 #define FIFO2 1 | |
| 67 | |
| 68 #define I2S_IFC 0 | |
| 69 #define I2S_INT INT_I2S1 | |
| 70 #define I2S_NAME "i2s1" | |
| 71 #define I2S_FIFO_TX FIFO1 | |
| 72 #define I2S_I2S_FIFO_TX_BUSY I2S_I2S_STATUS_FIFO1_BSY | |
| 73 #define I2S_I2S_FIFO_TX_QS I2S_I2S_STATUS_QS_FIFO1 | |
| 74 #define I2S_FIFO_RX FIFO2 | |
| 75 #define I2S_I2S_FIFO_RX_BUSY I2S_I2S_STATUS_FIFO2_BSY | |
| 76 #define I2S_I2S_FIFO_RX_QS I2S_I2S_STATUS_QS_FIFO2 | |
| 77 | |
| 78 #define I2S_CLK 11289600 | |
| 79 #define TEGRA_DEFAULT_SR 44100 | |
| 80 | |
| 81 #define TEGRA_SAMPLE_RATES \ | |
| 82 (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ | |
| 83 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) | |
| 84 | |
| 85 struct tegra_dma_channel; | |
| 86 | |
| 87 struct tegra_runtime_data { | |
| 88 struct snd_pcm_substream *substream; | |
| 89 int size; | |
| 90 int dma_pos; | |
| 91 struct tegra_dma_req dma_req1, dma_req2; | |
| 92 atomic_t state; | |
| 93 int period_index; | |
| 94 struct tegra_dma_channel *dma_chan; | |
| 95 struct clk *i2s_clk; | |
| 96 struct clk *dap_mclk; | |
| 97 struct clk *audio_sync_clk; | |
| 98 }; | |
| 99 | |
| 100 #endif | |
| OLD | NEW |