]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/oss/omap-audio-tsc2101.c
h63xx: tsc2101 alsa sound support
[linux-2.6-omap-h63xx.git] / sound / oss / omap-audio-tsc2101.c
index 63dda67448f02fd07ba21558f71db7effedcbf36..55d131a832dd9c0f0de764b2b80dfa576db70429 100644 (file)
@@ -33,8 +33,8 @@
 #include <linux/errno.h>
 #include <linux/sound.h>
 #include <linux/soundcard.h>
+#include <linux/mutex.h>
 
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 #include <asm/hardware.h>
 #include <asm/arch/dma.h>
@@ -48,7 +48,7 @@
 #include "omap-audio.h"
 #include "omap-audio-dma-intfc.h"
 #include <asm/arch/mcbsp.h>
-#ifdef CONFIG_ARCH_OMAP16XX
+#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_MACH_OMAP_H6300)
 #include <../drivers/ssi/omap-uwire.h>
 #include <asm/arch/dsp_common.h>
 #elif defined(CONFIG_ARCH_OMAP24XX)
 
 #ifdef CONFIG_ARCH_OMAP16XX
 #define PLATFORM_NAME "OMAP16XX"
+#elif CONFIG_MACH_OMAP_H6300
+#define PLATFORM_NAME "OMAP15XX"
 #elif defined(CONFIG_ARCH_OMAP24XX)
 #define PLATFORM_NAME "OMAP2"
 #endif
 
+#if CONFIG_ARCH_OMAP16XX
+#define OMAP_DSP_BASE        0xE0000000
+#endif
+
 /* Define to set the tsc as the master w.r.t McBSP */
 #define TSC_MASTER
 
 /*********** Debug Macros ********/
 /* To Generate a rather shrill tone -test the entire path */
 //#define TONE_GEN
-/* To Generate a tone for each keyclick - test the tsc,spi paths*/
+///* To Generate a tone for each keyclick - test the tsc,spi paths*/
 //#define TEST_KEYCLICK
 /* To dump the tsc registers for debug */
 //#define TSC_DUMP_REGISTERS
@@ -230,6 +236,17 @@ static const struct sample_rate_reg_info
 };
 
 static struct omap_mcbsp_reg_cfg initial_config = {
+#ifdef CONFIG_MACH_OMAP_H6300
+       .spcr2 = 0x0005,
+       .spcr1 = 0x0005,
+       .rcr2  = 0x8041,
+       .rcr1  = 0x8041,
+       .xcr2  = 0x00a1,
+       .xcr1  = 0x00a1,
+       .srgr2 = 0xb000,
+       .srgr1 = 0xb000,
+       .pcr0  = 0x0081,
+#else
        .spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
        .spcr1 = RINTM(3) | RRST,
        .rcr2  = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
@@ -244,7 +261,7 @@ static struct omap_mcbsp_reg_cfg initial_config = {
        /* platform specific initialization */
 #ifdef CONFIG_MACH_OMAP_H2
        .pcr0  = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP,
-#elif defined(CONFIG_MACH_OMAP_H3) || defined(CONFIG_MACH_OMAP_H4)
+#elif defined(CONFIG_MACH_OMAP_H3) || defined(CONFIG_MACH_OMAP_H4) || defined(CONFIG_MACH_OMAP_APOLLON)
 
 #ifndef TSC_MASTER
        .pcr0  = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,
@@ -253,6 +270,7 @@ static struct omap_mcbsp_reg_cfg initial_config = {
 #endif                         /* tsc Master defs */
 
 #endif                         /* platform specific inits */
+#endif /* CONFIG_MACH_OMAP_H6300 */
 };
 
 /***************************** MODULES SPECIFIC FUNCTION PROTOTYPES ********************/
@@ -326,7 +344,7 @@ static audio_state_t tsc2101_state = {
        .hw_remove      = omap_tsc2101_remove,
        .hw_suspend     = omap_tsc2101_suspend,
        .hw_resume      = omap_tsc2101_resume,
-       .sem            = __SEMAPHORE_INIT(tsc2101_state.sem, 1),
+       .mutex          = __MUTEX_INITIALIZER(tsc2101_state.mutex),
 };
 
 /* This will be defined in the Audio.h */