Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ASoC: DaVinci EVM board support buildfixes
ASoC: DaVinci I2S updates
ASoC: davinci-pcm buildfixes
ALSA: pcsp: fix printk format warning
ALSA: riptide: postfix increment and off by one
pxa2xx-ac97: fix reset gpio mode setting
ASoC: soc-core: fix crash when removing not instantiated card

+156 -51
+25
arch/arm/mach-davinci/include/mach/asp.h
··· 1 + /* 2 + * <mach/asp.h> - DaVinci Audio Serial Port support 3 + */ 4 + #ifndef __ASM_ARCH_DAVINCI_ASP_H 5 + #define __ASM_ARCH_DAVINCI_ASP_H 6 + 7 + #include <mach/irqs.h> 8 + 9 + /* Bases of register banks */ 10 + #define DAVINCI_ASP0_BASE 0x01E02000 11 + #define DAVINCI_ASP1_BASE 0x01E04000 12 + 13 + /* EDMA channels */ 14 + #define DAVINCI_DMA_ASP0_TX 2 15 + #define DAVINCI_DMA_ASP0_RX 3 16 + #define DAVINCI_DMA_ASP1_TX 8 17 + #define DAVINCI_DMA_ASP1_RX 9 18 + 19 + /* Interrupts */ 20 + #define DAVINCI_ASP0_RX_INT IRQ_MBRINT 21 + #define DAVINCI_ASP0_TX_INT IRQ_MBXINT 22 + #define DAVINCI_ASP1_RX_INT IRQ_MBRINT 23 + #define DAVINCI_ASP1_TX_INT IRQ_MBXINT 24 + 25 + #endif /* __ASM_ARCH_DAVINCI_ASP_H */
+1 -1
sound/arm/pxa2xx-ac97-lib.c
··· 65 65 switch (resetgpio_action) { 66 66 case RESETGPIO_NORMAL_ALTFUNC: 67 67 if (reset_gpio == 113) 68 - mode = 113 | GPIO_OUT | GPIO_DFLT_LOW; 68 + mode = 113 | GPIO_ALT_FN_2_OUT; 69 69 if (reset_gpio == 95) 70 70 mode = 95 | GPIO_ALT_FN_1_OUT; 71 71 break;
+1 -1
sound/drivers/pcsp/pcsp_mixer.c
··· 50 50 uinfo->value.enumerated.items = chip->max_treble + 1; 51 51 if (uinfo->value.enumerated.item > chip->max_treble) 52 52 uinfo->value.enumerated.item = chip->max_treble; 53 - sprintf(uinfo->value.enumerated.name, "%d", 53 + sprintf(uinfo->value.enumerated.name, "%lu", 54 54 PCSP_CALC_RATE(uinfo->value.enumerated.item)); 55 55 return 0; 56 56 }
+6 -4
sound/pci/riptide/riptide.c
··· 889 889 spin_lock_irqsave(&cif->lock, irqflags); 890 890 while (i++ < CMDIF_TIMEOUT && !IS_READY(cif->hwport)) 891 891 udelay(10); 892 - if (i >= CMDIF_TIMEOUT) { 892 + if (i > CMDIF_TIMEOUT) { 893 893 err = -EBUSY; 894 894 goto errout; 895 895 } ··· 907 907 WRITE_PORT_ULONG(cmdport->data1, cmd); /* write cmd */ 908 908 if ((flags & RESP) && ret) { 909 909 while (!IS_DATF(cmdport) && 910 - time++ < CMDIF_TIMEOUT) 910 + time < CMDIF_TIMEOUT) { 911 911 udelay(10); 912 + time++; 913 + } 912 914 if (time < CMDIF_TIMEOUT) { /* read response */ 913 915 ret->retlongs[0] = 914 916 READ_PORT_ULONG(cmdport->data1); ··· 1456 1454 SEND_GPOS(cif, 0, data->id, &rptr); 1457 1455 udelay(1); 1458 1456 } while (i != rptr.retlongs[1] && j++ < MAX_WRITE_RETRY); 1459 - if (j >= MAX_WRITE_RETRY) 1457 + if (j > MAX_WRITE_RETRY) 1460 1458 snd_printk(KERN_ERR "Riptide: Could not stop stream!"); 1461 1459 break; 1462 1460 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ··· 1785 1783 SEND_SACR(cif, val, reg); 1786 1784 SEND_RACR(cif, reg, &rptr); 1787 1785 } while (rptr.retwords[1] != val && i++ < MAX_WRITE_RETRY); 1788 - if (i == MAX_WRITE_RETRY) 1786 + if (i > MAX_WRITE_RETRY) 1789 1787 snd_printdd("Write AC97 reg failed\n"); 1790 1788 } 1791 1789
+4 -3
sound/soc/davinci/Kconfig
··· 10 10 tristate 11 11 12 12 config SND_DAVINCI_SOC_EVM 13 - tristate "SoC Audio support for DaVinci EVM" 14 - depends on SND_DAVINCI_SOC && MACH_DAVINCI_EVM 13 + tristate "SoC Audio support for DaVinci DM6446 or DM355 EVM" 14 + depends on SND_DAVINCI_SOC 15 + depends on MACH_DAVINCI_EVM || MACH_DAVINCI_DM355_EVM 15 16 select SND_DAVINCI_SOC_I2S 16 17 select SND_SOC_TLV320AIC3X 17 18 help 18 19 Say Y if you want to add support for SoC audio on TI 19 - DaVinci EVM platform. 20 + DaVinci DM6446 or DM355 EVM platforms. 20 21 21 22 config SND_DAVINCI_SOC_SFFSDR 22 23 tristate "SoC Audio support for SFFSDR"
+52 -11
sound/soc/davinci/davinci-evm.c
··· 20 20 #include <sound/soc-dapm.h> 21 21 22 22 #include <asm/dma.h> 23 - #include <mach/hardware.h> 23 + #include <asm/mach-types.h> 24 + 25 + #include <mach/asp.h> 26 + #include <mach/edma.h> 27 + #include <mach/mux.h> 24 28 25 29 #include "../codecs/tlv320aic3x.h" 26 30 #include "davinci-pcm.h" ··· 154 150 155 151 /* evm audio private data */ 156 152 static struct aic3x_setup_data evm_aic3x_setup = { 157 - .i2c_bus = 0, 153 + .i2c_bus = 1, 158 154 .i2c_address = 0x1b, 159 155 }; 160 156 ··· 165 161 .codec_data = &evm_aic3x_setup, 166 162 }; 167 163 164 + /* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */ 168 165 static struct resource evm_snd_resources[] = { 169 166 { 170 - .start = DAVINCI_MCBSP_BASE, 171 - .end = DAVINCI_MCBSP_BASE + SZ_8K - 1, 167 + .start = DAVINCI_ASP0_BASE, 168 + .end = DAVINCI_ASP0_BASE + SZ_8K - 1, 172 169 .flags = IORESOURCE_MEM, 173 170 }, 174 171 }; 175 172 176 173 static struct evm_snd_platform_data evm_snd_data = { 177 - .tx_dma_ch = DM644X_DMACH_MCBSP_TX, 178 - .rx_dma_ch = DM644X_DMACH_MCBSP_RX, 174 + .tx_dma_ch = DAVINCI_DMA_ASP0_TX, 175 + .rx_dma_ch = DAVINCI_DMA_ASP0_RX, 176 + }; 177 + 178 + /* DM335 EVM uses ASP1; line-out is a stereo mini-jack */ 179 + static struct resource dm335evm_snd_resources[] = { 180 + { 181 + .start = DAVINCI_ASP1_BASE, 182 + .end = DAVINCI_ASP1_BASE + SZ_8K - 1, 183 + .flags = IORESOURCE_MEM, 184 + }, 185 + }; 186 + 187 + static struct evm_snd_platform_data dm335evm_snd_data = { 188 + .tx_dma_ch = DAVINCI_DMA_ASP1_TX, 189 + .rx_dma_ch = DAVINCI_DMA_ASP1_RX, 179 190 }; 180 191 181 192 static struct platform_device *evm_snd_device; 182 193 183 194 static int __init evm_init(void) 184 195 { 196 + struct resource *resources; 197 + unsigned num_resources; 198 + struct evm_snd_platform_data *data; 199 + int index; 185 200 int ret; 186 201 187 - evm_snd_device = platform_device_alloc("soc-audio", 0); 202 + if (machine_is_davinci_evm()) { 203 + davinci_cfg_reg(DM644X_MCBSP); 204 + 205 + resources = evm_snd_resources; 206 + num_resources = ARRAY_SIZE(evm_snd_resources); 207 + data = &evm_snd_data; 208 + index = 0; 209 + } else if (machine_is_davinci_dm355_evm()) { 210 + /* we don't use ASP1 IRQs, or we'd need to mux them ... */ 211 + davinci_cfg_reg(DM355_EVT8_ASP1_TX); 212 + davinci_cfg_reg(DM355_EVT9_ASP1_RX); 213 + 214 + resources = dm335evm_snd_resources; 215 + num_resources = ARRAY_SIZE(dm335evm_snd_resources); 216 + data = &dm335evm_snd_data; 217 + index = 1; 218 + } else 219 + return -EINVAL; 220 + 221 + evm_snd_device = platform_device_alloc("soc-audio", index); 188 222 if (!evm_snd_device) 189 223 return -ENOMEM; 190 224 191 225 platform_set_drvdata(evm_snd_device, &evm_snd_devdata); 192 226 evm_snd_devdata.dev = &evm_snd_device->dev; 193 - platform_device_add_data(evm_snd_device, &evm_snd_data, 194 - sizeof(evm_snd_data)); 227 + platform_device_add_data(evm_snd_device, data, sizeof(*data)); 195 228 196 - ret = platform_device_add_resources(evm_snd_device, evm_snd_resources, 197 - ARRAY_SIZE(evm_snd_resources)); 229 + ret = platform_device_add_resources(evm_snd_device, resources, 230 + num_resources); 198 231 if (ret) { 199 232 platform_device_put(evm_snd_device); 200 233 return ret;
+23 -3
sound/soc/davinci/davinci-i2s.c
··· 24 24 25 25 #include "davinci-pcm.h" 26 26 27 + 28 + /* 29 + * NOTE: terminology here is confusing. 30 + * 31 + * - This driver supports the "Audio Serial Port" (ASP), 32 + * found on dm6446, dm355, and other DaVinci chips. 33 + * 34 + * - But it labels it a "Multi-channel Buffered Serial Port" 35 + * (McBSP) as on older chips like the dm642 ... which was 36 + * backward-compatible, possibly explaining that confusion. 37 + * 38 + * - OMAP chips have a controller called McBSP, which is 39 + * incompatible with the DaVinci flavor of McBSP. 40 + * 41 + * - Newer DaVinci chips have a controller called McASP, 42 + * incompatible with ASP and with either McBSP. 43 + * 44 + * In short: this uses ASP to implement I2S, not McBSP. 45 + * And it won't be the only DaVinci implemention of I2S. 46 + */ 27 47 #define DAVINCI_MCBSP_DRR_REG 0x00 28 48 #define DAVINCI_MCBSP_DXR_REG 0x04 29 49 #define DAVINCI_MCBSP_SPCR_REG 0x08 ··· 441 421 { 442 422 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 443 423 struct snd_soc_card *card = socdev->card; 444 - struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai; 424 + struct snd_soc_dai *cpu_dai = card->dai_link->cpu_dai; 445 425 struct davinci_mcbsp_dev *dev; 446 426 struct resource *mem, *ioarea; 447 427 struct evm_snd_platform_data *pdata; ··· 468 448 469 449 cpu_dai->private_data = dev; 470 450 471 - dev->clk = clk_get(&pdev->dev, "McBSPCLK"); 451 + dev->clk = clk_get(&pdev->dev, NULL); 472 452 if (IS_ERR(dev->clk)) { 473 453 ret = -ENODEV; 474 454 goto err_free_mem; ··· 503 483 { 504 484 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 505 485 struct snd_soc_card *card = socdev->card; 506 - struct snd_soc_dai *cpu_dai = card->dai_link[pdev->id].cpu_dai; 486 + struct snd_soc_dai *cpu_dai = card->dai_link->cpu_dai; 507 487 struct davinci_mcbsp_dev *dev = cpu_dai->private_data; 508 488 struct resource *mem; 509 489
+41 -28
sound/soc/davinci/davinci-pcm.c
··· 22 22 #include <sound/soc.h> 23 23 24 24 #include <asm/dma.h> 25 + #include <mach/edma.h> 25 26 26 27 #include "davinci-pcm.h" 27 28 ··· 52 51 spinlock_t lock; 53 52 int period; /* current DMA period */ 54 53 int master_lch; /* Master DMA channel */ 55 - int slave_lch; /* Slave DMA channel */ 54 + int slave_lch; /* linked parameter RAM reload slot */ 56 55 struct davinci_pcm_dma_params *params; /* DMA params */ 57 56 }; 58 57 ··· 91 90 dst_bidx = data_type; 92 91 } 93 92 94 - davinci_set_dma_src_params(lch, src, INCR, W8BIT); 95 - davinci_set_dma_dest_params(lch, dst, INCR, W8BIT); 96 - davinci_set_dma_src_index(lch, src_bidx, 0); 97 - davinci_set_dma_dest_index(lch, dst_bidx, 0); 98 - davinci_set_dma_transfer_params(lch, data_type, count, 1, 0, ASYNC); 93 + edma_set_src(lch, src, INCR, W8BIT); 94 + edma_set_dest(lch, dst, INCR, W8BIT); 95 + edma_set_src_index(lch, src_bidx, 0); 96 + edma_set_dest_index(lch, dst_bidx, 0); 97 + edma_set_transfer_params(lch, data_type, count, 1, 0, ASYNC); 99 98 100 99 prtd->period++; 101 100 if (unlikely(prtd->period >= runtime->periods)) 102 101 prtd->period = 0; 103 102 } 104 103 105 - static void davinci_pcm_dma_irq(int lch, u16 ch_status, void *data) 104 + static void davinci_pcm_dma_irq(unsigned lch, u16 ch_status, void *data) 106 105 { 107 106 struct snd_pcm_substream *substream = data; 108 107 struct davinci_runtime_data *prtd = substream->runtime->private_data; ··· 126 125 struct davinci_runtime_data *prtd = substream->runtime->private_data; 127 126 struct snd_soc_pcm_runtime *rtd = substream->private_data; 128 127 struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data; 129 - int tcc = TCC_ANY; 128 + struct edmacc_param p_ram; 130 129 int ret; 131 130 132 131 if (!dma_data) ··· 135 134 prtd->params = dma_data; 136 135 137 136 /* Request master DMA channel */ 138 - ret = davinci_request_dma(prtd->params->channel, prtd->params->name, 137 + ret = edma_alloc_channel(prtd->params->channel, 139 138 davinci_pcm_dma_irq, substream, 140 - &prtd->master_lch, &tcc, EVENTQ_0); 141 - if (ret) 139 + EVENTQ_0); 140 + if (ret < 0) 142 141 return ret; 142 + prtd->master_lch = ret; 143 143 144 - /* Request slave DMA channel */ 145 - ret = davinci_request_dma(PARAM_ANY, "Link", 146 - NULL, NULL, &prtd->slave_lch, &tcc, EVENTQ_0); 147 - if (ret) { 148 - davinci_free_dma(prtd->master_lch); 144 + /* Request parameter RAM reload slot */ 145 + ret = edma_alloc_slot(EDMA_SLOT_ANY); 146 + if (ret < 0) { 147 + edma_free_channel(prtd->master_lch); 149 148 return ret; 150 149 } 150 + prtd->slave_lch = ret; 151 151 152 - /* Link slave DMA channel in loopback */ 153 - davinci_dma_link_lch(prtd->slave_lch, prtd->slave_lch); 152 + /* Issue transfer completion IRQ when the channel completes a 153 + * transfer, then always reload from the same slot (by a kind 154 + * of loopback link). The completion IRQ handler will update 155 + * the reload slot with a new buffer. 156 + * 157 + * REVISIT save p_ram here after setting up everything except 158 + * the buffer and its length (ccnt) ... use it as a template 159 + * so davinci_pcm_enqueue_dma() takes less time in IRQ. 160 + */ 161 + edma_read_slot(prtd->slave_lch, &p_ram); 162 + p_ram.opt |= TCINTEN | EDMA_TCC(prtd->master_lch); 163 + p_ram.link_bcntrld = prtd->slave_lch << 5; 164 + edma_write_slot(prtd->slave_lch, &p_ram); 154 165 155 166 return 0; 156 167 } ··· 178 165 case SNDRV_PCM_TRIGGER_START: 179 166 case SNDRV_PCM_TRIGGER_RESUME: 180 167 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 181 - davinci_start_dma(prtd->master_lch); 168 + edma_start(prtd->master_lch); 182 169 break; 183 170 case SNDRV_PCM_TRIGGER_STOP: 184 171 case SNDRV_PCM_TRIGGER_SUSPEND: 185 172 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 186 - davinci_stop_dma(prtd->master_lch); 173 + edma_stop(prtd->master_lch); 187 174 break; 188 175 default: 189 176 ret = -EINVAL; ··· 198 185 static int davinci_pcm_prepare(struct snd_pcm_substream *substream) 199 186 { 200 187 struct davinci_runtime_data *prtd = substream->runtime->private_data; 201 - struct paramentry_descriptor temp; 188 + struct edmacc_param temp; 202 189 203 190 prtd->period = 0; 204 191 davinci_pcm_enqueue_dma(substream); 205 192 206 - /* Get slave channel dma params for master channel startup */ 207 - davinci_get_dma_params(prtd->slave_lch, &temp); 208 - davinci_set_dma_params(prtd->master_lch, &temp); 193 + /* Copy self-linked parameter RAM entry into master channel */ 194 + edma_read_slot(prtd->slave_lch, &temp); 195 + edma_write_slot(prtd->master_lch, &temp); 209 196 210 197 return 0; 211 198 } ··· 221 208 222 209 spin_lock(&prtd->lock); 223 210 224 - davinci_dma_getposition(prtd->master_lch, &src, &dst); 211 + edma_get_position(prtd->master_lch, &src, &dst); 225 212 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 226 213 count = src - runtime->dma_addr; 227 214 else ··· 266 253 struct snd_pcm_runtime *runtime = substream->runtime; 267 254 struct davinci_runtime_data *prtd = runtime->private_data; 268 255 269 - davinci_dma_unlink_lch(prtd->slave_lch, prtd->slave_lch); 256 + edma_unlink(prtd->slave_lch); 270 257 271 - davinci_free_dma(prtd->slave_lch); 272 - davinci_free_dma(prtd->master_lch); 258 + edma_free_slot(prtd->slave_lch); 259 + edma_free_channel(prtd->master_lch); 273 260 274 261 kfree(prtd); 275 262
+3
sound/soc/soc-core.c
··· 954 954 struct snd_soc_platform *platform = card->platform; 955 955 struct snd_soc_codec_device *codec_dev = socdev->codec_dev; 956 956 957 + if (!card->instantiated) 958 + return 0; 959 + 957 960 run_delayed_work(&card->delayed_work); 958 961 959 962 if (platform->remove)