aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-omap/eac.h
diff options
context:
space:
mode:
authorKai Svahn <kai.svahn@nokia.com>2007-01-26 16:14:34 -0500
committerTony Lindgren <tony@atomide.com>2007-09-20 12:59:26 -0400
commit8777297b5e5fb7f908b51b56548b7cf7dbbf2022 (patch)
tree2e09681cd8eb80ad9fb389103f158514ea8d8abd /include/asm-arm/arch-omap/eac.h
parent23300597948131d07eebeb1308c2ba0a1c147494 (diff)
ARM: OMAP: Merge driver headers from N800 tree
This patch merges omap specific driver headers from N800 tree. Signed-off-by: Kai Svahn <kai.svahn@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'include/asm-arm/arch-omap/eac.h')
-rw-r--r--include/asm-arm/arch-omap/eac.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/include/asm-arm/arch-omap/eac.h b/include/asm-arm/arch-omap/eac.h
new file mode 100644
index 000000000000..6662cb02bafc
--- /dev/null
+++ b/include/asm-arm/arch-omap/eac.h
@@ -0,0 +1,101 @@
1/*
2 * linux/include/asm-arm/arch-omap2/eac.h
3 *
4 * Defines for Enhanced Audio Controller
5 *
6 * Contact: Jarkko Nikula <jarkko.nikula@nokia.com>
7 *
8 * Copyright (C) 2006 Nokia Corporation
9 * Copyright (C) 2004 Texas Instruments, Inc.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * version 2 as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 * 02110-1301 USA
24 *
25 */
26
27#ifndef __ASM_ARM_ARCH_OMAP2_EAC_H
28#define __ASM_ARM_ARCH_OMAP2_EAC_H
29
30#include <asm/arch/io.h>
31#include <asm/arch/hardware.h>
32#include <asm/irq.h>
33
34#include <sound/driver.h>
35#include <sound/core.h>
36
37/* master codec clock source */
38#define EAC_MCLK_EXT_MASK 0x100
39enum eac_mclk_src {
40 EAC_MCLK_INT_11290000, /* internal 96 MHz / 8.5 = 11.29 Mhz */
41 EAC_MCLK_EXT_11289600 = EAC_MCLK_EXT_MASK,
42 EAC_MCLK_EXT_12288000,
43 EAC_MCLK_EXT_2x11289600,
44 EAC_MCLK_EXT_2x12288000,
45};
46
47/* codec port interface mode */
48enum eac_codec_mode {
49 EAC_CODEC_PCM,
50 EAC_CODEC_AC97,
51 EAC_CODEC_I2S_MASTER, /* codec port, I.e. EAC is the master */
52 EAC_CODEC_I2S_SLAVE,
53};
54
55/* configuration structure for I2S mode */
56struct eac_i2s_conf {
57 /* if enabled, then first data slot (left channel) is signaled as
58 * positive level of frame sync EAC.AC_FS */
59 unsigned polarity_changed_mode:1;
60 /* if enabled, then serial data starts one clock cycle after the
61 * of EAC.AC_FS for first audio slot */
62 unsigned sync_delay_enable:1;
63};
64
65/* configuration structure for EAC codec port */
66struct eac_codec {
67 enum eac_mclk_src mclk_src;
68
69 enum eac_codec_mode codec_mode;
70 union {
71 struct eac_i2s_conf i2s;
72 } codec_conf;
73
74 int default_rate; /* audio sampling rate */
75
76 int (* set_power)(void *private_data, int dac, int adc);
77 int (* register_controls)(void *private_data,
78 struct snd_card *card);
79 const char *short_name;
80
81 void *private_data;
82};
83
84/* structure for passing platform dependent data to the EAC driver */
85struct eac_platform_data {
86 int (* init)(struct device *eac_dev);
87 void (* cleanup)(struct device *eac_dev);
88 /* these callbacks are used to configure & control external MCLK
89 * source. NULL if not used */
90 int (* enable_ext_clocks)(struct device *eac_dev);
91 void (* disable_ext_clocks)(struct device *eac_dev);
92};
93
94extern void omap_init_eac(struct eac_platform_data *pdata);
95
96extern int eac_register_codec(struct device *eac_dev, struct eac_codec *codec);
97extern void eac_unregister_codec(struct device *eac_dev);
98
99extern int eac_set_mode(struct device *eac_dev, int play, int rec);
100
101#endif /* __ASM_ARM_ARCH_OMAP2_EAC_H */