Skip to contentSkip to conversation

TSC2102 OMAP audio driver

PATCH In review andrzej zaborowski 4 participants 5 messages Aug 18, 2006 – Oct 19, 2006 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 TSC2102 OMAP audio driver

ALSA driver for OMAP boards with a TSC2102 chip. It is based on the TSC2101 and AIC23 drivers. The chip has only one audio playback output and no inputs. It can play stereo sound with 16-bit samples (only) and supports different sampling rates between 8 and 48 kHz. The patch also includes an ALSA mixer. The mixer controlls two volume levels, for left and right channels, each with 128 steps. It can also toggle the analog de-emphasis filter and bass boost filter which are incorporated in the chip.

In addition to that the chip has an equaliser filter, but the mixer doesn't use it because the coefficients of the filter are difficult to map to other values used in normal equalisers. Maybe they should have constant values per board.

sound/arm/Kconfig +13 -0
diff -pNaur -X b/Documentation/dontdiff a/sound/arm/Kconfig b/sound/arm/Kconfig
@@ -63,4 +63,17 @@ config SND_OMAP_TSC2101
  	  To compile this driver as a module, choose M here: the module
  	  will be called snd-omap-tsc2101.
 
+config SND_OMAP_TSC2102
+ 	tristate "OMAP TSC2102 alsa driver"
+ 	depends on ARCH_OMAP && SND
+ 	select SND_PCM
+	select TSC2102
+	select SPI_OMAP_UWIRE
+ 	help
+ 	  Say Y here if you have a OMAP platform board
+ 	  and want to use its TSC2102 audio chip.
+
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called snd-omap-tsc2102.
+
 endmenu
sound/arm/omap/Makefile +3 -0
diff -pNaur -X b/Documentation/dontdiff a/sound/arm/omap/Makefile b/sound/arm/omap/Makefile
@@ -7,3 +7,6 @@ snd-omap-alsa-aic23-objs := omap-alsa.o 
 
 obj-$(CONFIG_SND_OMAP_TSC2101) += snd-omap-alsa-tsc2101.o
 snd-omap-alsa-tsc2101-objs := omap-alsa.o omap-alsa-dma.o omap-alsa-tsc2101.o omap-alsa-tsc2101-mixer.o
+
+obj-$(CONFIG_SND_OMAP_TSC2102) += snd-omap-alsa-tsc2102.o
+snd-omap-alsa-tsc2102-objs := omap-alsa.o omap-alsa-dma.o omap-alsa-tsc2102.o omap-alsa-tsc2102-mixer.o
sound/arm/omap/omap-alsa-tsc2102-mixer.c +283 -0

283 lines not on this page · raw message

sound/arm/omap/omap-alsa-tsc2102.c +326 -0

326 lines not on this page · raw message

sound/arm/omap/omap-alsa-tsc2102.h +43 -0

43 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · --- andrzej zaborowski

ALSA driver for OMAP boards with a TSC2102 chip. It is based on the TSC2101 and AIC23 drivers. The chip has only one audio playback output
and no inputs. It can play stereo sound with 16-bit samples (only)

Quoted 8 lines

and
supports different sampling rates between 8 and 48 kHz. The patch also
includes an ALSA mixer. The mixer controlls two volume levels, for left and right channels, each with 128 steps. It can also toggle the analog de-emphasis filter and bass boost filter which are incorporated
in the chip.

Driver looks very clean. But just two cosmetic changes if you like.

+#ifndef OMAP_ALSA_TSC2102_H_
+#define OMAP_ALSA_TSC2102_H_
+
+#include <linux/types.h>

Why you are including types.h here?

+ err = clk_set_rate(tsc2102_bclk, CODEC_CLOCK);
+ if (err) {
+ printk(KERN_WARNING "Cannot set BCLK clock rate "
+ "for TSC2102 codec, error code = %d\n", err);
+ }

You can remove curly braces here.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#2 lore raw
In reply to andrzej zaborowski

sound/arm/Kconfig config SND_OMAP_TSC2101 · line 71

Quoted 6 lines · andrzej zaborowski
sound/arm/Kconfig +6 -0
+config SND_OMAP_TSC2102
+       tristate "OMAP TSC2102 alsa driver"
+       depends on ARCH_OMAP && SND
+       select SND_PCM
+       select TSC2102
+       select SPI_OMAP_UWIRE

Don't select SPI_OMAP_UWIRE, there's no reason it couldn't be used with one of the other SPI controllers ...

#3 lore raw

Thanks for your comments.

I'm attaching a second version.

Signature · 1 line
balrog 2oo6
sound/arm/Kconfig +12 -0
@@ -63,4 +63,16 @@ config SND_OMAP_TSC2101
  	  To compile this driver as a module, choose M here: the module
  	  will be called snd-omap-tsc2101.
 
+config SND_OMAP_TSC2102
+ 	tristate "OMAP TSC2102 alsa driver"
+ 	depends on ARCH_OMAP && SND
+ 	select SND_PCM
+	select TSC2102
+ 	help
+ 	  Say Y here if you have an OMAP platform board
+ 	  and want to use its TSC2102 audio chip.
+
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called snd-omap-tsc2102.
+
 endmenu
sound/arm/omap/Makefile +3 -0
@@ -7,3 +7,6 @@ snd-omap-alsa-aic23-objs := omap-alsa.o 
 
 obj-$(CONFIG_SND_OMAP_TSC2101) += snd-omap-alsa-tsc2101.o
 snd-omap-alsa-tsc2101-objs := omap-alsa.o omap-alsa-dma.o omap-alsa-tsc2101.o omap-alsa-tsc2101-mixer.o
+
+obj-$(CONFIG_SND_OMAP_TSC2102) += snd-omap-alsa-tsc2102.o
+snd-omap-alsa-tsc2102-objs := omap-alsa.o omap-alsa-dma.o omap-alsa-tsc2102.o omap-alsa-tsc2102-mixer.o
sound/arm/omap/omap-alsa-tsc2102-mixer.c new file +283 -0

283 lines not on this page · raw message

sound/arm/omap/omap-alsa-tsc2102.c new file +317 -0

317 lines not on this page · raw message

sound/arm/omap/omap-alsa-tsc2102.h new file +41 -0

41 lines not on this page · raw message

#4 lore raw
Quoted 3 lines · andrzej zaborowski

Thanks for your comments.

I'm attaching a second version.

Pushing today.

Tony