make uclibc 0.9.30.1 the default
[openwrt.git] / target / linux / s3c24xx / patches-2.6.30 / 090-sound.patch
1 Index: linux-2.6.30-rc6/sound/soc/s3c24xx/Kconfig
2 ===================================================================
3 --- linux-2.6.30-rc6.orig/sound/soc/s3c24xx/Kconfig     2009-05-16 06:12:57.000000000 +0200
4 +++ linux-2.6.30-rc6/sound/soc/s3c24xx/Kconfig  2009-05-18 19:08:35.000000000 +0200
5 @@ -42,10 +42,20 @@
6         tristate "SoC I2S Audio support for Jive"
7         depends on SND_S3C24XX_SOC && MACH_JIVE
8         select SND_SOC_WM8750
9 +       select SND_SOC_WM8750_SPI
10         select SND_S3C2412_SOC_I2S
11         help
12           Sat Y if you want to add support for SoC audio on the Jive.
13  
14 +config SND_S3C24XX_SOC_NEO1973_GTA02_WM8753
15 +       tristate "SoC I2S Audio support for Openmoko Freerunner - WM8753"
16 +       depends on SND_S3C24XX_SOC && MACH_NEO1973_GTA02
17 +       select SND_S3C24XX_SOC_I2S
18 +       select SND_SOC_WM8753
19 +       help
20 +         Say Y if you want to add support for SoC audio on Openmoko Freerunner
21 +         with the WM8753 codec
22 +
23  config SND_S3C24XX_SOC_SMDK2443_WM9710
24         tristate "SoC AC97 Audio support for SMDK2443 - WM9710"
25         depends on SND_S3C24XX_SOC && MACH_SMDK2443
26 Index: linux-2.6.30-rc6/sound/soc/s3c24xx/Makefile
27 ===================================================================
28 --- linux-2.6.30-rc6.orig/sound/soc/s3c24xx/Makefile    2009-05-16 06:12:57.000000000 +0200
29 +++ linux-2.6.30-rc6/sound/soc/s3c24xx/Makefile 2009-05-18 19:08:35.000000000 +0200
30 @@ -19,9 +19,11 @@
31  snd-soc-smdk2443-wm9710-objs := smdk2443_wm9710.o
32  snd-soc-ln2440sbc-alc650-objs := ln2440sbc_alc650.o
33  snd-soc-s3c24xx-uda134x-objs := s3c24xx_uda134x.o
34 +snd-soc-neo1973-gta02-wm8753-objs := gta02_wm8753.o
35  
36  obj-$(CONFIG_SND_S3C24XX_SOC_JIVE_WM8750) += snd-soc-jive-wm8750.o
37  obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
38  obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o
39  obj-$(CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650) += snd-soc-ln2440sbc-alc650.o
40  obj-$(CONFIG_SND_S3C24XX_SOC_S3C24XX_UDA134X) += snd-soc-s3c24xx-uda134x.o
41 +obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_GTA02_WM8753) += snd-soc-neo1973-gta02-wm8753.o
42 Index: linux-2.6.30-rc6/sound/soc/s3c24xx/s3c24xx-i2s.c
43 ===================================================================
44 --- linux-2.6.30-rc6.orig/sound/soc/s3c24xx/s3c24xx-i2s.c       2009-05-16 06:12:57.000000000 +0200
45 +++ linux-2.6.30-rc6/sound/soc/s3c24xx/s3c24xx-i2s.c    2009-05-18 19:08:35.000000000 +0200
46 @@ -284,11 +284,14 @@
47         case SNDRV_PCM_TRIGGER_START:
48         case SNDRV_PCM_TRIGGER_RESUME:
49         case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
50 -               if (!s3c24xx_snd_is_clkmaster()) {
51 -                       ret = s3c24xx_snd_lrsync();
52 -                       if (ret)
53 -                               goto exit_err;
54 -               }
55 +               if (!s3c24xx_snd_is_clkmaster())
56 +                       /* we ignore the return code, if it sync'd then fine,
57 +                        * if it didn't sync, which happens after resume the
58 +                        * first time when there was a live stream at suspend,
59 +                        * just let it timeout, the stream picks up OK after
60 +                        * that and LRCK is evidently working again.
61 +                        */
62 +                       s3c24xx_snd_lrsync();
63  
64                 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
65                         s3c24xx_snd_rxctrl(1);
66 @@ -308,7 +311,6 @@
67                 break;
68         }
69  
70 -exit_err:
71         return ret;
72  }
73  
74 Index: linux-2.6.30-rc6/sound/soc/s3c24xx/s3c24xx-pcm.c
75 ===================================================================
76 --- linux-2.6.30-rc6.orig/sound/soc/s3c24xx/s3c24xx-pcm.c       2009-05-16 06:12:57.000000000 +0200
77 +++ linux-2.6.30-rc6/sound/soc/s3c24xx/s3c24xx-pcm.c    2009-05-18 19:08:35.000000000 +0200
78 @@ -75,11 +75,18 @@
79  {
80         struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
81         dma_addr_t pos = prtd->dma_pos;
82 +       unsigned int limit;
83         int ret;
84  
85         pr_debug("Entered %s\n", __func__);
86  
87 -       while (prtd->dma_loaded < prtd->dma_limit) {
88 +       if (s3c_dma_has_circular()) {
89 +               limit = (prtd->dma_end - prtd->dma_start) / prtd->dma_period;
90 +       } else
91 +               limit = prtd->dma_limit;
92 +
93 +
94 +       while (prtd->dma_loaded < limit) {
95                 unsigned long len = prtd->dma_period;
96  
97                 pr_debug("dma_loaded: %d\n", prtd->dma_loaded);
98 @@ -123,7 +130,7 @@
99                 snd_pcm_period_elapsed(substream);
100  
101         spin_lock(&prtd->lock);
102 -       if (prtd->state & ST_RUNNING) {
103 +       if (prtd->state & ST_RUNNING && !s3c_dma_has_circular()) {
104                 prtd->dma_loaded--;
105                 s3c24xx_pcm_enqueue(substream);
106         }
107 @@ -164,6 +171,11 @@
108                         printk(KERN_ERR "failed to get dma channel\n");
109                         return ret;
110                 }
111 +
112 +               /* use the circular buffering if we have it available. */
113 +               if (s3c_dma_has_circular())
114 +                       s3c2410_dma_setflags(prtd->params->channel,
115 +                                            S3C2410_DMAF_CIRCULAR);
116         }
117  
118         s3c2410_dma_set_buffdone_fn(prtd->params->channel,
119 @@ -218,24 +230,17 @@
120          * sync to pclk, half-word transfers to the IIS-FIFO. */
121         if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
122                 s3c2410_dma_devconfig(prtd->params->channel,
123 -                               S3C2410_DMASRC_MEM, S3C2410_DISRCC_INC |
124 -                               S3C2410_DISRCC_APB, prtd->params->dma_addr);
125 -
126 -               s3c2410_dma_config(prtd->params->channel,
127 -                               prtd->params->dma_size,
128 -                               S3C2410_DCON_SYNC_PCLK |
129 -                               S3C2410_DCON_HANDSHAKE);
130 +                                     S3C2410_DMASRC_MEM,
131 +                                     prtd->params->dma_addr);
132         } else {
133 -               s3c2410_dma_config(prtd->params->channel,
134 -                               prtd->params->dma_size,
135 -                               S3C2410_DCON_HANDSHAKE |
136 -                               S3C2410_DCON_SYNC_PCLK);
137 -
138                 s3c2410_dma_devconfig(prtd->params->channel,
139 -                                       S3C2410_DMASRC_HW, 0x3,
140 -                                       prtd->params->dma_addr);
141 +                                     S3C2410_DMASRC_HW,
142 +                                     prtd->params->dma_addr);
143         }
144  
145 +       s3c2410_dma_config(prtd->params->channel,
146 +                          prtd->params->dma_size);
147 +
148         /* flush the DMA channel */
149         s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_FLUSH);
150         prtd->dma_loaded = 0;