Skip to contentSkip to conversation

Alsa modularisations and support for tsc2101 3/3 (round 2)

PATCH In review lamikr 2 participants 2 messages Mar 6, 2006 – Mar 22, 2006

Subsystems (4)
lore
Share & tools
lore

lamikr

author
#0 lore raw

PATCH 1/1 Alsa modularisations and support for tsc2101 3/3 (round 2)

OMAP Alsa Patch (3/3)

This 3/3 patch adds the tsc2101 alsa driver support for the omap-h2. Just like the aic23 alsa driver, the codec
specific functionality is separated from the common alsa driver functionality that is in the omap-alsa.c.
tsc2101 mixer supports currently the playback selection between loudspeaker and headset/handset.
Addon of others input and targets should be possible to do afterwards.

In addition it should be possible to add later the support for the dynamic clocks on top of this series of patches, as discussed in the omap-linux mailing list.

OMAP Alsa Patch (3/3)

This 3/3 patch adds the tsc2101 alsa driver support for the omap-h2. Just like the aic23 alsa driver, the codec specific functionality is separated from the common alsa driver functionality that is in the omap-alsa.c. tsc2101 mixer supports currently the playback selection between loudspeaker and headset/handset. Addon of others input and targets should be possible to do afterwards.

In addition it should be possible to add later the support for the dynamic clocks on top of this series of patches, as discussed in the omap-linux mailing list.

---

 arch/arm/mach-omap1/board-h2.c           |   45 +-
 sound/arm/Kconfig                        |   14 
 sound/arm/omap/Makefile                  |    3 
 sound/arm/omap/omap-alsa-tsc2101-mixer.c |  864 ++++++++++++++++++++++++++++++
 sound/arm/omap/omap-alsa-tsc2101-mixer.h |   79 +++
 sound/arm/omap/omap-alsa-tsc2101.c       |  439 +++++++++++++++
 sound/arm/omap/omap-alsa-tsc2101.h       |   61 ++
 7 files changed, 1498 insertions(+), 7 deletions(-)
 create mode 100644 sound/arm/omap/omap-alsa-tsc2101-mixer.c
 create mode 100644 sound/arm/omap/omap-alsa-tsc2101-mixer.h
 create mode 100644 sound/arm/omap/omap-alsa-tsc2101.c
 create mode 100644 sound/arm/omap/omap-alsa-tsc2101.h

a3af5691d0cdc9090242363c4276c76bf2d6cfdf

arch/arm/mach-omap1/board-h2.c +38 -7
index 4364d51..da64711 100644
@@ -40,8 +40,9 @@
 #include <asm/arch/irda.h>
 #include <asm/arch/usb.h>
 #include <asm/arch/keypad.h>
-#include <asm/arch/dma.h>
 #include <asm/arch/common.h>
+#include <asm/arch/mcbsp.h>
+#include <asm/arch/omap-alsa.h>
 
 extern int omap_gpio_init(void);
 
@@ -255,12 +256,6 @@ static int h2_transceiver_mode(struct de
 
 static struct omap_irda_config h2_irda_data = {
 	.transceiver_cap	= IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
-	.rx_channel		= OMAP_DMA_UART3_RX,
-	.tx_channel		= OMAP_DMA_UART3_TX,
-	.dest_start		= UART3_THR,
-	.src_start		= UART3_RHR,
-	.tx_trigger		= 0,
-	.rx_trigger		= 0,
 };
 
 static struct resource h2_irda_resources[] = {
@@ -285,6 +280,41 @@ static struct platform_device h2_lcd_dev
 	.id		= -1,
 };
 
+static struct omap_mcbsp_reg_cfg mcbsp_regs = { 
+	.spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
+	.spcr1 = RINTM(3) | RRST,
+	.rcr2  = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
+                RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(1),
+	.rcr1  = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
+	.xcr2  = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) | 
+                XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG,
+	.xcr1  = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
+	.srgr1 = FWID(15),
+	.srgr2 = GSYNC | CLKSP | FSGM | FPER(31),
+
+	.pcr0  = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP,
+	//.pcr0 = CLKXP | CLKRP,        /* mcbsp: slave */
+};
+ 
+static struct omap_alsa_codec_config alsa_config = {
+	.name                   = "H2 TSC2101",
+	.mcbsp_regs_alsa        = &mcbsp_regs,
+	.codec_configure_dev    = NULL, // tsc2101_configure,
+	.codec_set_samplerate   = NULL, // tsc2101_set_samplerate,
+	.codec_clock_setup      = NULL, // tsc2101_clock_setup,
+	.codec_clock_on         = NULL, // tsc2101_clock_on,
+	.codec_clock_off        = NULL, // tsc2101_clock_off,
+	.get_default_samplerate = NULL, // tsc2101_get_default_samplerate,
+};    
+
+static struct platform_device h2_mcbsp1_device = {
+	.name	= "omap_alsa_mcbsp",
+	.id	= 1,
+	.dev = {
+		.platform_data	= &alsa_config,
+	}, 
+};    
+
 static struct platform_device *h2_devices[] __initdata = {
 	&h2_nor_device,
 	&h2_nand_device,
@@ -292,6 +322,7 @@ static struct platform_device *h2_device
 	&h2_irda_device,
 	&h2_kp_device,
 	&h2_lcd_device,
+	&h2_mcbsp1_device,
 };
 
 static void __init h2_init_smc91x(void)
sound/arm/Kconfig +14 -0
index cf07154..cccdf23 100644
@@ -44,5 +44,19 @@ config SND_OMAP_AIC23
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called snd-omap-aic23.
+	  
+config SND_OMAP_TSC2101
+ 	tristate "OMAP TSC2101 alsa driver"
+ 	depends on ARCH_OMAP && SND
+ 	select SND_PCM
+         select OMAP_TSC2101
+         select OMAP_UWIRE if ARCH_OMAP
+ 	help
+ 	  Say Y here if you have a OMAP platform board
+ 	  and want to use its TSC2101 audio chip. Driver has
+ 	  been tested with H2 and iPAQ h6300.
+ 
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called snd-omap-tsc2101.
 
 endmenu
sound/arm/omap/Makefile +3 -0
index 74160da..354c7b4 100644
@@ -4,3 +4,6 @@
 #
 obj-$(CONFIG_SND_OMAP_AIC23) += snd-omap-alsa-aic23.o
 snd-omap-alsa-aic23-objs := omap-alsa.o omap-alsa-dma.o omap-alsa-aic23.o omap-alsa-aic23-mixer.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
sound/arm/omap/omap-alsa-tsc2101-mixer.c new file +864 -0

864 lines not on this page · raw message

sound/arm/omap/omap-alsa-tsc2101-mixer.h new file +79 -0

79 lines not on this page · raw message

sound/arm/omap/omap-alsa-tsc2101.c new file +439 -0

439 lines not on this page · raw message

sound/arm/omap/omap-alsa-tsc2101.h new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
1.2.2
#1 lore raw
Quoted 10 lines · lamikr

OMAP Alsa Patch (3/3)

This 3/3 patch adds the tsc2101 alsa driver support for the omap-h2. Just like the aic23 alsa driver, the codec
specific functionality is separated from the common alsa driver functionality that is in the omap-alsa.c.
tsc2101 mixer supports currently the playback selection between loudspeaker and headset/handset.
Addon of others input and targets should be possible to do afterwards.

Quoted 3 lines

In addition it should be possible to add later the support for the dynamic clocks on top of this series of patches, as discussed in the omap-linux mailing list.

Leaving out the following irda chunk:

arch/arm/mach-omap1/board-h2.c static int h2_transceiver_mode(struct de · line 261

Quoted 13 lines
arch/arm/mach-omap1/board-h2.c +0 -6
@@ -255,12 +256,6 @@ static int h2_transceiver_mode(struct de
 
 static struct omap_irda_config h2_irda_data = {
 	.transceiver_cap	= IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
-	.rx_channel		= OMAP_DMA_UART3_RX,
-	.tx_channel		= OMAP_DMA_UART3_TX,
-	.dest_start		= UART3_THR,
-	.src_start		= UART3_RHR,
-	.tx_trigger		= 0,
-	.rx_trigger		= 0,
 };
 
 static struct resource h2_irda_resources[] = {

Regards,

Tony