]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/oss/omap-audio-tsc2101.c
[PATCH] ARM: OMAP: OSS: sem2mutex conversion
[linux-2.6-omap-h63xx.git] / sound / oss / omap-audio-tsc2101.c
index 320e37737e693c1ddeba395eb2115807de6d9b74..f8e6dacf1ff79609cac92972ecc4aa28f0abe50d 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>
 #include "omap-audio.h"
 #include "omap-audio-dma-intfc.h"
 #include <asm/arch/mcbsp.h>
-#if CONFIG_ARCH_OMAP16XX
+#ifdef CONFIG_ARCH_OMAP16XX
 #include <../drivers/ssi/omap-uwire.h>
 #include <asm/arch/dsp_common.h>
+#elif defined(CONFIG_ARCH_OMAP24XX)
 #else
 #error "Unsupported configuration"
 #endif
 
 #define CODEC_NAME              "TSC2101"
 
-#if CONFIG_ARCH_OMAP16XX
+#ifdef CONFIG_ARCH_OMAP16XX
 #define PLATFORM_NAME "OMAP16XX"
-#endif
-
-#if CONFIG_ARCH_OMAP16XX
-#define OMAP_DSP_BASE        0xE0000000
+#elif defined(CONFIG_ARCH_OMAP24XX)
+#define PLATFORM_NAME "OMAP2"
 #endif
 
 /* Define to set the tsc as the master w.r.t McBSP */
@@ -90,9 +89,9 @@
 #define LEAVE_CS                                 0x80
 
 /* Select the McBSP For Audio */
-#if CONFIG_ARCH_OMAP16XX
-#define AUDIO_MCBSP                   OMAP_MCBSP1
-#else
+/* 16XX is MCBSP1 and 24XX is MCBSP2*/
+/* see include/asm-arm/arch-omap/mcbsp.h */
+#ifndef AUDIO_MCBSP
 #error "UnSupported Configuration"
 #endif
 
 
 /***************************** Data Structures **********************************/
 
+static int audio_ifc_start(void)
+{
+       omap_mcbsp_start(AUDIO_MCBSP);
+       return 0;
+}
+
+static int audio_ifc_stop(void)
+{
+       omap_mcbsp_stop(AUDIO_MCBSP);
+       return 0;
+}
+
 static audio_stream_t output_stream = {
-       .id              = "TSC2101 out",
-       .dma_dev         = OMAP_DMA_MCBSP1_TX,
-       .input_or_output = FMODE_WRITE
+       .id                     = "TSC2101 out",
+       .dma_dev                = AUDIO_DMA_TX,
+       .input_or_output        = FMODE_WRITE,
+       .hw_start               = audio_ifc_start,
+       .hw_stop                = audio_ifc_stop,
 };
 
 static audio_stream_t input_stream = {
-       .id              = "TSC2101 in",
-       .dma_dev         = OMAP_DMA_MCBSP1_RX,
-       .input_or_output = FMODE_READ
+       .id                     = "TSC2101 in",
+       .dma_dev                = AUDIO_DMA_RX,
+       .input_or_output        = FMODE_READ,
+       .hw_start               = audio_ifc_start,
+       .hw_stop                = audio_ifc_stop,
 };
 
 static int audio_dev_id, mixer_dev_id;
@@ -227,9 +242,9 @@ static struct omap_mcbsp_reg_cfg initial_config = {
        .srgr2 = GSYNC | CLKSP | FSGM | FPER(31),
 
        /* platform specific initialization */
-#if CONFIG_MACH_OMAP_H2
+#ifdef CONFIG_MACH_OMAP_H2
        .pcr0  = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP,
-#elif CONFIG_MACH_OMAP_H3
+#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,
@@ -311,7 +326,7 @@ static audio_state_t tsc2101_state = {
        .hw_remove      = omap_tsc2101_remove,
        .hw_suspend     = omap_tsc2101_suspend,
        .hw_resume      = omap_tsc2101_resume,
-       .sem            = __MUTEX_INITIALIZER(tsc2101_state.sem),
+       .mutex          = __MUTEX_INITIALIZER(tsc2101_state.mutex),
 };
 
 /* This will be defined in the Audio.h */