2 * linux/include/asm-arm/arch-omap2/eac.h
4 * Defines for Enhanced Audio Controller
6 * Contact: Jarkko Nikula <jarkko.nikula@nokia.com>
8 * Copyright (C) 2006 Nokia Corporation
9 * Copyright (C) 2004 Texas Instruments, Inc.
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.
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.
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
27 #ifndef __ASM_ARM_ARCH_OMAP2_EAC_H
28 #define __ASM_ARM_ARCH_OMAP2_EAC_H
30 #include <asm/arch/io.h>
31 #include <asm/arch/hardware.h>
34 #include <sound/core.h>
36 /* master codec clock source */
37 #define EAC_MCLK_EXT_MASK 0x100
39 EAC_MCLK_INT_11290000, /* internal 96 MHz / 8.5 = 11.29 Mhz */
40 EAC_MCLK_EXT_11289600 = EAC_MCLK_EXT_MASK,
41 EAC_MCLK_EXT_12288000,
42 EAC_MCLK_EXT_2x11289600,
43 EAC_MCLK_EXT_2x12288000,
46 /* codec port interface mode */
50 EAC_CODEC_I2S_MASTER, /* codec port, I.e. EAC is the master */
54 /* configuration structure for I2S mode */
56 /* if enabled, then first data slot (left channel) is signaled as
57 * positive level of frame sync EAC.AC_FS */
58 unsigned polarity_changed_mode:1;
59 /* if enabled, then serial data starts one clock cycle after the
60 * of EAC.AC_FS for first audio slot */
61 unsigned sync_delay_enable:1;
64 /* configuration structure for EAC codec port */
66 enum eac_mclk_src mclk_src;
68 enum eac_codec_mode codec_mode;
70 struct eac_i2s_conf i2s;
73 int default_rate; /* audio sampling rate */
75 int (* set_power)(void *private_data, int dac, int adc);
76 int (* register_controls)(void *private_data,
77 struct snd_card *card);
78 const char *short_name;
83 /* structure for passing platform dependent data to the EAC driver */
84 struct eac_platform_data {
85 int (* init)(struct device *eac_dev);
86 void (* cleanup)(struct device *eac_dev);
87 /* these callbacks are used to configure & control external MCLK
88 * source. NULL if not used */
89 int (* enable_ext_clocks)(struct device *eac_dev);
90 void (* disable_ext_clocks)(struct device *eac_dev);
93 extern void omap_init_eac(struct eac_platform_data *pdata);
95 extern int eac_register_codec(struct device *eac_dev, struct eac_codec *codec);
96 extern void eac_unregister_codec(struct device *eac_dev);
98 extern int eac_set_mode(struct device *eac_dev, int play, int rec);
100 #endif /* __ASM_ARM_ARCH_OMAP2_EAC_H */