Merge remote branch 'common/android-2.6.36' into android-tegra-2.6.36
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-tegra / include / mach / audio.h
1 /*
2  * arch/arm/mach-tegra/include/mach/audio.h
3  *
4  * Copyright (C) 2010 Google, Inc.
5  *
6  * Author:
7  *      Iliyan Malchev <malchev@google.com>
8  *
9  * This software is licensed under the terms of the GNU General Public
10  * License version 2, as published by the Free Software Foundation, and
11  * may be copied, distributed, and modified under those terms.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  */
19
20 #ifndef __ARCH_ARM_MACH_TEGRA_AUDIO_H
21 #define __ARCH_ARM_MACH_TEGRA_AUDIO_H
22
23 #include <linux/kernel.h>
24 #include <linux/types.h>
25 #include <mach/i2s.h>
26
27 #define FIFO1           0
28 #define FIFO2           1
29
30 /* FIXME: this is not enforced by the hardware. */
31 #define I2S_FIFO_TX             FIFO1
32 #define I2S_FIFO_RX             FIFO2
33
34 #define TEGRA_AUDIO_ENABLE_TX   1
35 #define TEGRA_AUDIO_ENABLE_RX   2
36
37 struct tegra_audio_platform_data {
38         bool i2s_master;
39         bool dsp_master;
40         int i2s_master_clk; /* When I2S mode and master, the framesync rate. */
41         int dsp_master_clk; /* When DSP mode and master, the framesync rate. */
42         bool dma_on;
43         unsigned long i2s_clk_rate;
44         const char *dap_clk;
45         const char *audio_sync_clk;
46
47         int mode; /* I2S, LJM, RJM, etc. */
48         int fifo_fmt;
49         int bit_size;
50         int i2s_bus_width; /* 32-bit for 16-bit packed I2S */
51         int dsp_bus_width; /* 16-bit for DSP data format */
52         int mask; /* enable tx and rx? */
53         bool stereo_capture; /* True if hardware supports stereo */
54         void *driver_data;
55 };
56
57 #endif /* __ARCH_ARM_MACH_TEGRA_AUDIO_H */