]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - sound/arm/omap/omap-alsa-tsc2101.h
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / sound / arm / omap / omap-alsa-tsc2101.h
1 /*
2  * sound/arm/omap/omap-alsa-tsc2101.h
3  * 
4  * Alsa Driver for TSC2101 codec for OMAP platform boards.
5  *
6  * Based on former omap-aic23.h and tsc2101 OSS drivers.
7  * Copyright (C) 2004 Texas Instruments, Inc.
8  *      Written by Nishanth Menon and Sriram Kannan
9  *
10  * Copyright (C) 2006 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
11  *          Alsa modularization by Daniel Petrini (d.pensator@gmail.com)
12  * 
13  * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
14  *
15  * This program is free software; you can redistribute it and/or modify it
16  * under the terms of the GNU General Public License as published by the
17  * Free Software Foundation; either version 2 of the License, or (at your
18  * option) any later version.
19  */
20
21 #ifndef OMAP_ALSA_TSC2101_H_
22 #define OMAP_ALSA_TSC2101_H_
23
24 #include <linux/types.h>
25
26 /* Define to set the tsc as the master w.r.t McBSP or EAC */
27 #define TSC_MASTER
28
29 #define NUMBER_SAMPLE_RATES_SUPPORTED   16
30
31 /*
32  * AUDIO related MACROS
33  */
34 #ifndef DEFAULT_BITPERSAMPLE
35 #define DEFAULT_BITPERSAMPLE            16
36 #endif
37
38 #define DEFAULT_SAMPLE_RATE             44100
39
40 /* FIXME codec clock rate is board-specific */
41 #define CODEC_CLOCK                     12000000
42
43 #define PAGE2_AUDIO_CODEC_REGISTERS     (2)
44
45 struct tsc2101_samplerate_reg_info {
46         u16 sample_rate;
47         u8 divisor;
48         u8 fs_44kHz;    /* if 0 48 khz, if 1 44.1 khz fsref */
49 };
50
51 /*
52  * Defines codec specific functions pointers that can be used from the 
53  * common omap-alse base driver for all omap codecs. (tsc2101 and aic23)
54  */
55 inline void tsc2101_configure(void);
56 void tsc2101_set_samplerate(long rate);
57 void tsc2101_clock_setup(void);
58 int tsc2101_clock_on(void);
59 int tsc2101_clock_off(void);
60 int tsc2101_get_default_samplerate(void);
61
62 #endif /*OMAP_ALSA_TSC2101_H_*/