X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Foss%2Fomap-audio-tsc2101.c;h=55d131a832dd9c0f0de764b2b80dfa576db70429;hb=c872ebcdd22885f52cb1123472b0a7335f872785;hp=c5fdc6c94e4e5ba467d4372a956ee1c980087927;hpb=a5d84d4a0c6407b2a2647025a03eaa44b0814e28;p=linux-2.6-omap-h63xx.git diff --git a/sound/oss/omap-audio-tsc2101.c b/sound/oss/omap-audio-tsc2101.c index c5fdc6c94e4..55d131a832d 100644 --- a/sound/oss/omap-audio-tsc2101.c +++ b/sound/oss/omap-audio-tsc2101.c @@ -33,8 +33,8 @@ #include #include #include +#include -#include #include #include #include @@ -48,9 +48,10 @@ #include "omap-audio.h" #include "omap-audio-dma-intfc.h" #include -#if CONFIG_ARCH_OMAP16XX +#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_MACH_OMAP_H6300) #include <../drivers/ssi/omap-uwire.h> #include +#elif defined(CONFIG_ARCH_OMAP24XX) #else #error "Unsupported configuration" #endif @@ -70,8 +71,12 @@ #define CODEC_NAME "TSC2101" -#if CONFIG_ARCH_OMAP16XX +#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 @@ -90,9 +95,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 @@ -124,7 +129,7 @@ /*********** 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 @@ -147,16 +152,32 @@ /***************************** 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; @@ -215,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) | @@ -227,9 +259,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, @@ -238,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 ********************/ @@ -311,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 */