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: (36 commits)
ALSA: hda - Add VREF powerdown sequence for another board
ALSA: oss - volume control for CSWITCH and CROUTE
ALSA: hda - add missing comma in ad1884_slave_vols
sound: usb-audio: allow period sizes less than 1 ms
sound: usb-audio: save data packet interval in audioformat structure
sound: usb-audio: remove check_hw_params_convention()
sound: usb-audio: show sample format width in proc file
ASoC: fsl_dma: Pass the proper device for dma mapping routines
ASoC: Fix null dereference in ak4535_remove()
ALSA: hda - enable SPDIF output for Intel DX58SO board
ALSA: snd-atmel-abdac: increase periods_min to 6 instead of 4
ALSA: snd-atmel-abdac: replace bus_id with dev_name()
ALSA: snd-atmel-ac97c: replace bus_id with dev_name()
ALSA: snd-atmel-ac97c: cleanup registers when removing driver
ALSA: snd-atmel-ac97c: do a proper reset of the external codec
ALSA: snd-atmel-ac97c: enable interrupts to catch events for error reporting
ALSA: snd-atmel-ac97c: set correct size for buffer hardware parameter
ALSA: snd-atmel-ac97c: do not overwrite OCA and ICA when assigning channels
ALSA: snd-atmel-ac97c: remove dead break statements after return in switch case
ALSA: snd-atmel-ac97c: cleanup register definitions
...

+1131 -233
+71
Documentation/sound/alsa/soc/jack.txt
··· 1 + ASoC jack detection 2 + =================== 3 + 4 + ALSA has a standard API for representing physical jacks to user space, 5 + the kernel side of which can be seen in include/sound/jack.h. ASoC 6 + provides a version of this API adding two additional features: 7 + 8 + - It allows more than one jack detection method to work together on one 9 + user visible jack. In embedded systems it is common for multiple 10 + to be present on a single jack but handled by separate bits of 11 + hardware. 12 + 13 + - Integration with DAPM, allowing DAPM endpoints to be updated 14 + automatically based on the detected jack status (eg, turning off the 15 + headphone outputs if no headphones are present). 16 + 17 + This is done by splitting the jacks up into three things working 18 + together: the jack itself represented by a struct snd_soc_jack, sets of 19 + snd_soc_jack_pins representing DAPM endpoints to update and blocks of 20 + code providing jack reporting mechanisms. 21 + 22 + For example, a system may have a stereo headset jack with two reporting 23 + mechanisms, one for the headphone and one for the microphone. Some 24 + systems won't be able to use their speaker output while a headphone is 25 + connected and so will want to make sure to update both speaker and 26 + headphone when the headphone jack status changes. 27 + 28 + The jack - struct snd_soc_jack 29 + ============================== 30 + 31 + This represents a physical jack on the system and is what is visible to 32 + user space. The jack itself is completely passive, it is set up by the 33 + machine driver and updated by jack detection methods. 34 + 35 + Jacks are created by the machine driver calling snd_soc_jack_new(). 36 + 37 + snd_soc_jack_pin 38 + ================ 39 + 40 + These represent a DAPM pin to update depending on some of the status 41 + bits supported by the jack. Each snd_soc_jack has zero or more of these 42 + which are updated automatically. They are created by the machine driver 43 + and associated with the jack using snd_soc_jack_add_pins(). The status 44 + of the endpoint may configured to be the opposite of the jack status if 45 + required (eg, enabling a built in microphone if a microphone is not 46 + connected via a jack). 47 + 48 + Jack detection methods 49 + ====================== 50 + 51 + Actual jack detection is done by code which is able to monitor some 52 + input to the system and update a jack by calling snd_soc_jack_report(), 53 + specifying a subset of bits to update. The jack detection code should 54 + be set up by the machine driver, taking configuration for the jack to 55 + update and the set of things to report when the jack is connected. 56 + 57 + Often this is done based on the status of a GPIO - a handler for this is 58 + provided by the snd_soc_jack_add_gpio() function. Other methods are 59 + also available, for example integrated into CODECs. One example of 60 + CODEC integrated jack detection can be see in the WM8350 driver. 61 + 62 + Each jack may have multiple reporting mechanisms, though it will need at 63 + least one to be useful. 64 + 65 + Machine drivers 66 + =============== 67 + 68 + These are all hooked together by the machine driver depending on the 69 + system hardware. The machine driver will set up the snd_soc_jack and 70 + the list of pins to update then set up one or more jack detection 71 + mechanisms to update that jack based on their current status.
+10 -5
sound/arm/pxa2xx-ac97-lib.c
··· 238 238 239 239 bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97) 240 240 { 241 + unsigned long gsr; 242 + 241 243 #ifdef CONFIG_PXA25x 242 244 if (cpu_is_pxa25x()) 243 245 pxa_ac97_warm_pxa25x(); ··· 256 254 else 257 255 #endif 258 256 BUG(); 259 - 260 - if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR))) { 257 + gsr = GSR | gsr_bits; 258 + if (!(gsr & (GSR_PCR | GSR_SCR))) { 261 259 printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n", 262 - __func__, gsr_bits); 260 + __func__, gsr); 263 261 264 262 return false; 265 263 } ··· 270 268 271 269 bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97) 272 270 { 271 + unsigned long gsr; 272 + 273 273 #ifdef CONFIG_PXA25x 274 274 if (cpu_is_pxa25x()) 275 275 pxa_ac97_cold_pxa25x(); ··· 289 285 #endif 290 286 BUG(); 291 287 292 - if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR))) { 288 + gsr = GSR | gsr_bits; 289 + if (!(gsr & (GSR_PCR | GSR_SCR))) { 293 290 printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n", 294 - __func__, gsr_bits); 291 + __func__, gsr); 295 292 296 293 return false; 297 294 }
+2 -2
sound/atmel/abdac.c
··· 165 165 .buffer_bytes_max = 64 * 4096, 166 166 .period_bytes_min = 4096, 167 167 .period_bytes_max = 4096, 168 - .periods_min = 4, 168 + .periods_min = 6, 169 169 .periods_max = 64, 170 170 }; 171 171 ··· 502 502 platform_set_drvdata(pdev, card); 503 503 504 504 dev_info(&pdev->dev, "Atmel ABDAC at 0x%p using %s\n", 505 - dac->regs, dac->dma.chan->dev->device.bus_id); 505 + dac->regs, dev_name(&dac->dma.chan->dev->device)); 506 506 507 507 return retval; 508 508
+109 -19
sound/atmel/ac97c.c
··· 1 1 /* 2 - * Driver for the Atmel AC97C controller 2 + * Driver for Atmel AC97C 3 3 * 4 4 * Copyright (C) 2005-2009 Atmel Corporation 5 5 * ··· 10 10 #include <linux/clk.h> 11 11 #include <linux/delay.h> 12 12 #include <linux/bitmap.h> 13 + #include <linux/device.h> 13 14 #include <linux/dmaengine.h> 14 15 #include <linux/dma-mapping.h> 15 16 #include <linux/init.h> ··· 66 65 /* Serialize access to opened variable */ 67 66 spinlock_t lock; 68 67 void __iomem *regs; 68 + int irq; 69 69 int opened; 70 70 int reset_pin; 71 71 }; ··· 152 150 .rate_max = 48000, 153 151 .channels_min = 1, 154 152 .channels_max = 2, 155 - .buffer_bytes_max = 64 * 4096, 153 + .buffer_bytes_max = 2 * 2 * 64 * 2048, 156 154 .period_bytes_min = 4096, 157 155 .period_bytes_max = 4096, 158 - .periods_min = 4, 156 + .periods_min = 6, 159 157 .periods_max = 64, 160 158 }; 161 159 ··· 299 297 { 300 298 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); 301 299 struct snd_pcm_runtime *runtime = substream->runtime; 302 - unsigned long word = 0; 300 + unsigned long word = ac97c_readl(chip, OCA); 303 301 int retval; 302 + 303 + word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT)); 304 304 305 305 /* assign channels to AC97C channel A */ 306 306 switch (runtime->channels) { ··· 316 312 default: 317 313 /* TODO: support more than two channels */ 318 314 return -EINVAL; 319 - break; 320 315 } 321 316 ac97c_writel(chip, OCA, word); 322 317 ··· 327 324 word |= AC97C_CMR_CEM_LITTLE; 328 325 break; 329 326 case SNDRV_PCM_FORMAT_S16_BE: /* fall through */ 330 - default: 331 327 word &= ~(AC97C_CMR_CEM_LITTLE); 332 328 break; 329 + default: 330 + word = ac97c_readl(chip, OCA); 331 + word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT)); 332 + ac97c_writel(chip, OCA, word); 333 + return -EINVAL; 333 334 } 334 335 336 + /* Enable underrun interrupt on channel A */ 337 + word |= AC97C_CSR_UNRUN; 338 + 335 339 ac97c_writel(chip, CAMR, word); 340 + 341 + /* Enable channel A event interrupt */ 342 + word = ac97c_readl(chip, IMR); 343 + word |= AC97C_SR_CAEVT; 344 + ac97c_writel(chip, IER, word); 336 345 337 346 /* set variable rate if needed */ 338 347 if (runtime->rate != 48000) { ··· 374 359 { 375 360 struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); 376 361 struct snd_pcm_runtime *runtime = substream->runtime; 377 - unsigned long word = 0; 362 + unsigned long word = ac97c_readl(chip, ICA); 378 363 int retval; 364 + 365 + word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT)); 379 366 380 367 /* assign channels to AC97C channel A */ 381 368 switch (runtime->channels) { ··· 391 374 default: 392 375 /* TODO: support more than two channels */ 393 376 return -EINVAL; 394 - break; 395 377 } 396 378 ac97c_writel(chip, ICA, word); 397 379 ··· 402 386 word |= AC97C_CMR_CEM_LITTLE; 403 387 break; 404 388 case SNDRV_PCM_FORMAT_S16_BE: /* fall through */ 405 - default: 406 389 word &= ~(AC97C_CMR_CEM_LITTLE); 407 390 break; 391 + default: 392 + word = ac97c_readl(chip, ICA); 393 + word &= ~(AC97C_CH_MASK(PCM_LEFT) | AC97C_CH_MASK(PCM_RIGHT)); 394 + ac97c_writel(chip, ICA, word); 395 + return -EINVAL; 408 396 } 409 397 398 + /* Enable overrun interrupt on channel A */ 399 + word |= AC97C_CSR_OVRUN; 400 + 410 401 ac97c_writel(chip, CAMR, word); 402 + 403 + /* Enable channel A event interrupt */ 404 + word = ac97c_readl(chip, IMR); 405 + word |= AC97C_SR_CAEVT; 406 + ac97c_writel(chip, IER, word); 411 407 412 408 /* set variable rate if needed */ 413 409 if (runtime->rate != 48000) { ··· 571 543 .pointer = atmel_ac97c_capture_pointer, 572 544 }; 573 545 546 + static irqreturn_t atmel_ac97c_interrupt(int irq, void *dev) 547 + { 548 + struct atmel_ac97c *chip = (struct atmel_ac97c *)dev; 549 + irqreturn_t retval = IRQ_NONE; 550 + u32 sr = ac97c_readl(chip, SR); 551 + u32 casr = ac97c_readl(chip, CASR); 552 + u32 cosr = ac97c_readl(chip, COSR); 553 + 554 + if (sr & AC97C_SR_CAEVT) { 555 + dev_info(&chip->pdev->dev, "channel A event%s%s%s%s%s%s\n", 556 + casr & AC97C_CSR_OVRUN ? " OVRUN" : "", 557 + casr & AC97C_CSR_RXRDY ? " RXRDY" : "", 558 + casr & AC97C_CSR_UNRUN ? " UNRUN" : "", 559 + casr & AC97C_CSR_TXEMPTY ? " TXEMPTY" : "", 560 + casr & AC97C_CSR_TXRDY ? " TXRDY" : "", 561 + !casr ? " NONE" : ""); 562 + retval = IRQ_HANDLED; 563 + } 564 + 565 + if (sr & AC97C_SR_COEVT) { 566 + dev_info(&chip->pdev->dev, "codec channel event%s%s%s%s%s\n", 567 + cosr & AC97C_CSR_OVRUN ? " OVRUN" : "", 568 + cosr & AC97C_CSR_RXRDY ? " RXRDY" : "", 569 + cosr & AC97C_CSR_TXEMPTY ? " TXEMPTY" : "", 570 + cosr & AC97C_CSR_TXRDY ? " TXRDY" : "", 571 + !cosr ? " NONE" : ""); 572 + retval = IRQ_HANDLED; 573 + } 574 + 575 + if (retval == IRQ_NONE) { 576 + dev_err(&chip->pdev->dev, "spurious interrupt sr 0x%08x " 577 + "casr 0x%08x cosr 0x%08x\n", sr, casr, cosr); 578 + } 579 + 580 + return retval; 581 + } 582 + 574 583 static int __devinit atmel_ac97c_pcm_new(struct atmel_ac97c *chip) 575 584 { 576 585 struct snd_pcm *pcm; ··· 730 665 731 666 static void atmel_ac97c_reset(struct atmel_ac97c *chip) 732 667 { 733 - ac97c_writel(chip, MR, AC97C_MR_WRST); 668 + ac97c_writel(chip, MR, 0); 669 + ac97c_writel(chip, MR, AC97C_MR_ENA); 670 + ac97c_writel(chip, CAMR, 0); 671 + ac97c_writel(chip, COMR, 0); 734 672 735 673 if (gpio_is_valid(chip->reset_pin)) { 736 674 gpio_set_value(chip->reset_pin, 0); 737 675 /* AC97 v2.2 specifications says minimum 1 us. */ 738 - udelay(10); 676 + udelay(2); 739 677 gpio_set_value(chip->reset_pin, 1); 740 678 } 741 - 742 - udelay(1); 743 - ac97c_writel(chip, MR, AC97C_MR_ENA); 744 679 } 745 680 746 681 static int __devinit atmel_ac97c_probe(struct platform_device *pdev) ··· 755 690 .read = atmel_ac97c_read, 756 691 }; 757 692 int retval; 693 + int irq; 758 694 759 695 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 760 696 if (!regs) { ··· 766 700 pdata = pdev->dev.platform_data; 767 701 if (!pdata) { 768 702 dev_dbg(&pdev->dev, "no platform data\n"); 703 + return -ENXIO; 704 + } 705 + 706 + irq = platform_get_irq(pdev, 0); 707 + if (irq < 0) { 708 + dev_dbg(&pdev->dev, "could not get irq\n"); 769 709 return -ENXIO; 770 710 } 771 711 ··· 790 718 } 791 719 792 720 chip = get_chip(card); 721 + 722 + retval = request_irq(irq, atmel_ac97c_interrupt, 0, "AC97C", chip); 723 + if (retval) { 724 + dev_dbg(&pdev->dev, "unable to request irq %d\n", irq); 725 + goto err_request_irq; 726 + } 727 + chip->irq = irq; 793 728 794 729 spin_lock_init(&chip->lock); 795 730 ··· 826 747 827 748 snd_card_set_dev(card, &pdev->dev); 828 749 750 + atmel_ac97c_reset(chip); 751 + 752 + /* Enable overrun interrupt from codec channel */ 753 + ac97c_writel(chip, COMR, AC97C_CSR_OVRUN); 754 + ac97c_writel(chip, IER, ac97c_readl(chip, IMR) | AC97C_SR_COEVT); 755 + 829 756 retval = snd_ac97_bus(card, 0, &ops, chip, &chip->ac97_bus); 830 757 if (retval) { 831 758 dev_dbg(&pdev->dev, "could not register on ac97 bus\n"); 832 759 goto err_ac97_bus; 833 760 } 834 - 835 - atmel_ac97c_reset(chip); 836 761 837 762 retval = atmel_ac97c_mixer_new(chip); 838 763 if (retval) { ··· 856 773 chip->dma.rx_chan = dma_request_channel(mask, filter, dws); 857 774 858 775 dev_info(&chip->pdev->dev, "using %s for DMA RX\n", 859 - chip->dma.rx_chan->dev->device.bus_id); 776 + dev_name(&chip->dma.rx_chan->dev->device)); 860 777 set_bit(DMA_RX_CHAN_PRESENT, &chip->flags); 861 778 } 862 779 ··· 872 789 chip->dma.tx_chan = dma_request_channel(mask, filter, dws); 873 790 874 791 dev_info(&chip->pdev->dev, "using %s for DMA TX\n", 875 - chip->dma.tx_chan->dev->device.bus_id); 792 + dev_name(&chip->dma.tx_chan->dev->device)); 876 793 set_bit(DMA_TX_CHAN_PRESENT, &chip->flags); 877 794 } 878 795 ··· 892 809 retval = snd_card_register(card); 893 810 if (retval) { 894 811 dev_dbg(&pdev->dev, "could not register sound card\n"); 895 - goto err_ac97_bus; 812 + goto err_dma; 896 813 } 897 814 898 815 platform_set_drvdata(pdev, card); ··· 919 836 920 837 iounmap(chip->regs); 921 838 err_ioremap: 839 + free_irq(irq, chip); 840 + err_request_irq: 922 841 snd_card_free(card); 923 842 err_snd_card_new: 924 843 clk_disable(pclk); ··· 969 884 if (gpio_is_valid(chip->reset_pin)) 970 885 gpio_free(chip->reset_pin); 971 886 887 + ac97c_writel(chip, CAMR, 0); 888 + ac97c_writel(chip, COMR, 0); 889 + ac97c_writel(chip, MR, 0); 890 + 972 891 clk_disable(chip->pclk); 973 892 clk_put(chip->pclk); 974 893 iounmap(chip->regs); 894 + free_irq(chip->irq, chip); 975 895 976 896 if (test_bit(DMA_RX_CHAN_PRESENT, &chip->flags)) 977 897 dma_release_channel(chip->dma.rx_chan);
+8 -6
sound/atmel/ac97c.h
··· 1 1 /* 2 - * Register definitions for the Atmel AC97C controller 2 + * Register definitions for Atmel AC97C 3 3 * 4 4 * Copyright (C) 2005-2009 Atmel Corporation 5 5 * ··· 17 17 #define AC97C_CATHR 0x24 18 18 #define AC97C_CASR 0x28 19 19 #define AC97C_CAMR 0x2c 20 - #define AC97C_CBRHR 0x30 21 - #define AC97C_CBTHR 0x34 22 - #define AC97C_CBSR 0x38 23 - #define AC97C_CBMR 0x3c 24 20 #define AC97C_CORHR 0x40 25 21 #define AC97C_COTHR 0x44 26 22 #define AC97C_COSR 0x48 ··· 42 46 #define AC97C_MR_VRA (1 << 2) 43 47 44 48 #define AC97C_CSR_TXRDY (1 << 0) 49 + #define AC97C_CSR_TXEMPTY (1 << 1) 45 50 #define AC97C_CSR_UNRUN (1 << 2) 46 51 #define AC97C_CSR_RXRDY (1 << 4) 52 + #define AC97C_CSR_OVRUN (1 << 5) 47 53 #define AC97C_CSR_ENDTX (1 << 10) 48 54 #define AC97C_CSR_ENDRX (1 << 14) 49 55 ··· 59 61 #define AC97C_CMR_DMAEN (1 << 22) 60 62 61 63 #define AC97C_SR_CAEVT (1 << 3) 64 + #define AC97C_SR_COEVT (1 << 2) 65 + #define AC97C_SR_WKUP (1 << 1) 66 + #define AC97C_SR_SOF (1 << 0) 62 67 68 + #define AC97C_CH_MASK(slot) \ 69 + (0x7 << (3 * (AC97_SLOT_##slot - 3))) 63 70 #define AC97C_CH_ASSIGN(slot, channel) \ 64 71 (AC97C_CHANNEL_##channel << (3 * (AC97_SLOT_##slot - 3))) 65 72 #define AC97C_CHANNEL_NONE 0x0 66 73 #define AC97C_CHANNEL_A 0x1 67 - #define AC97C_CHANNEL_B 0x2 68 74 69 75 #endif /* __SOUND_ATMEL_AC97C_H */
+8
sound/core/oss/mixer_oss.c
··· 703 703 if (left || right) { 704 704 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) 705 705 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0); 706 + if (slot->present & SNDRV_MIXER_OSS_PRESENT_CSWITCH) 707 + snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], left, right, 0); 706 708 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) 707 709 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0); 708 710 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) 709 711 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1); 712 + if (slot->present & SNDRV_MIXER_OSS_PRESENT_CROUTE) 713 + snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], left, right, 1); 710 714 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) 711 715 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1); 712 716 } else { 713 717 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) { 714 718 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0); 719 + } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CSWITCH) { 720 + snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], left, right, 0); 715 721 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) { 716 722 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0); 717 723 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) { 718 724 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1); 725 + } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CROUTE) { 726 + snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], left, right, 1); 719 727 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) { 720 728 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1); 721 729 }
+1
sound/isa/opl3sa2.c
··· 481 481 OPL3SA2_SINGLE("Mic Playback Switch", 0, 0x09, 7, 1, 1), 482 482 OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, 483 483 db_scale_5bit_12db_max), 484 + OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0), 484 485 }; 485 486 486 487 static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = {
+1 -1
sound/pci/hda/patch_analog.c
··· 3256 3256 "Mic Playback Volume", 3257 3257 "CD Playback Volume", 3258 3258 "Internal Mic Playback Volume", 3259 - "Docking Mic Playback Volume" 3259 + "Docking Mic Playback Volume", 3260 3260 /* "Beep Playback Volume", */ 3261 3261 "IEC958 Playback Volume", 3262 3262 NULL
+5
sound/pci/hda/patch_realtek.c
··· 8764 8764 {} 8765 8765 }; 8766 8766 8767 + static hda_nid_t alc883_slave_dig_outs[] = { 8768 + ALC1200_DIGOUT_NID, 0, 8769 + }; 8770 + 8767 8771 static hda_nid_t alc1200_slave_dig_outs[] = { 8768 8772 ALC883_DIGOUT_NID, 0, 8769 8773 }; ··· 8813 8809 .dac_nids = alc883_dac_nids, 8814 8810 .dig_out_nid = ALC883_DIGOUT_NID, 8815 8811 .dig_in_nid = ALC883_DIGIN_NID, 8812 + .slave_dig_outs = alc883_slave_dig_outs, 8816 8813 .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_intel_modes), 8817 8814 .channel_mode = alc883_3ST_6ch_intel_modes, 8818 8815 .need_dac_fix = 1,
+20
sound/pci/hda/patch_sigmatel.c
··· 4413 4413 if (spec->num_pwrs > 0) 4414 4414 stac92xx_pin_sense(codec, event->nid); 4415 4415 stac92xx_report_jack(codec, event->nid); 4416 + 4417 + switch (codec->subsystem_id) { 4418 + case 0x103c308f: 4419 + if (event->nid == 0xb) { 4420 + int pin = AC_PINCTL_IN_EN; 4421 + 4422 + if (get_pin_presence(codec, 0xa) 4423 + && get_pin_presence(codec, 0xb)) 4424 + pin |= AC_PINCTL_VREF_80; 4425 + if (!get_pin_presence(codec, 0xb)) 4426 + pin |= AC_PINCTL_VREF_80; 4427 + 4428 + /* toggle VREF state based on mic + hp pin 4429 + * status 4430 + */ 4431 + stac92xx_auto_set_pinctl(codec, 0x0a, pin); 4432 + } 4433 + } 4416 4434 break; 4417 4435 case STAC_VREF_EVENT: 4418 4436 data = snd_hda_codec_read(codec, codec->afg, 0, ··· 4913 4895 switch (codec->vendor_id) { 4914 4896 case 0x111d7604: 4915 4897 case 0x111d7605: 4898 + case 0x111d76d5: 4916 4899 if (spec->board_config == STAC_92HD83XXX_PWR_REF) 4917 4900 break; 4918 4901 spec->num_pwrs = 0; ··· 5726 5707 { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx}, 5727 5708 { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx}, 5728 5709 { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx}, 5710 + { .id = 0x111d76d5, .name = "92HD81B1C5", .patch = patch_stac92hd83xxx}, 5729 5711 { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx}, 5730 5712 { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx }, 5731 5713 { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx },
+1 -1
sound/ppc/powermac.c
··· 51 51 /* 52 52 */ 53 53 54 - static int __init snd_pmac_probe(struct platform_device *devptr) 54 + static int __devinit snd_pmac_probe(struct platform_device *devptr) 55 55 { 56 56 struct snd_card *card; 57 57 struct snd_pmac *chip;
+2 -1
sound/soc/codecs/ak4535.c
··· 659 659 snd_soc_free_pcms(socdev); 660 660 snd_soc_dapm_free(socdev); 661 661 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 662 - i2c_unregister_device(codec->control_data); 662 + if (codec->control_data) 663 + i2c_unregister_device(codec->control_data); 663 664 i2c_del_driver(&ak4535_i2c_driver); 664 665 #endif 665 666 kfree(codec->private_data);
+58 -1
sound/soc/codecs/twl4030.c
··· 122 122 unsigned int bypass_state; 123 123 unsigned int codec_powered; 124 124 unsigned int codec_muted; 125 + 126 + struct snd_pcm_substream *master_substream; 127 + struct snd_pcm_substream *slave_substream; 125 128 }; 126 129 127 130 /* ··· 1220 1217 return 0; 1221 1218 } 1222 1219 1220 + static int twl4030_startup(struct snd_pcm_substream *substream) 1221 + { 1222 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 1223 + struct snd_soc_device *socdev = rtd->socdev; 1224 + struct snd_soc_codec *codec = socdev->codec; 1225 + struct twl4030_priv *twl4030 = codec->private_data; 1226 + 1227 + /* If we already have a playback or capture going then constrain 1228 + * this substream to match it. 1229 + */ 1230 + if (twl4030->master_substream) { 1231 + struct snd_pcm_runtime *master_runtime; 1232 + master_runtime = twl4030->master_substream->runtime; 1233 + 1234 + snd_pcm_hw_constraint_minmax(substream->runtime, 1235 + SNDRV_PCM_HW_PARAM_RATE, 1236 + master_runtime->rate, 1237 + master_runtime->rate); 1238 + 1239 + snd_pcm_hw_constraint_minmax(substream->runtime, 1240 + SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 1241 + master_runtime->sample_bits, 1242 + master_runtime->sample_bits); 1243 + 1244 + twl4030->slave_substream = substream; 1245 + } else 1246 + twl4030->master_substream = substream; 1247 + 1248 + return 0; 1249 + } 1250 + 1251 + static void twl4030_shutdown(struct snd_pcm_substream *substream) 1252 + { 1253 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 1254 + struct snd_soc_device *socdev = rtd->socdev; 1255 + struct snd_soc_codec *codec = socdev->codec; 1256 + struct twl4030_priv *twl4030 = codec->private_data; 1257 + 1258 + if (twl4030->master_substream == substream) 1259 + twl4030->master_substream = twl4030->slave_substream; 1260 + 1261 + twl4030->slave_substream = NULL; 1262 + } 1263 + 1223 1264 static int twl4030_hw_params(struct snd_pcm_substream *substream, 1224 1265 struct snd_pcm_hw_params *params, 1225 1266 struct snd_soc_dai *dai) ··· 1271 1224 struct snd_soc_pcm_runtime *rtd = substream->private_data; 1272 1225 struct snd_soc_device *socdev = rtd->socdev; 1273 1226 struct snd_soc_codec *codec = socdev->card->codec; 1227 + struct twl4030_priv *twl4030 = codec->private_data; 1274 1228 u8 mode, old_mode, format, old_format; 1229 + 1230 + if (substream == twl4030->slave_substream) 1231 + /* Ignoring hw_params for slave substream */ 1232 + return 0; 1275 1233 1276 1234 /* bit rate */ 1277 1235 old_mode = twl4030_read_reg_cache(codec, ··· 1310 1258 break; 1311 1259 case 48000: 1312 1260 mode |= TWL4030_APLL_RATE_48000; 1261 + break; 1262 + case 96000: 1263 + mode |= TWL4030_APLL_RATE_96000; 1313 1264 break; 1314 1265 default: 1315 1266 printk(KERN_ERR "TWL4030 hw params: unknown rate %d\n", ··· 1439 1384 #define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE) 1440 1385 1441 1386 static struct snd_soc_dai_ops twl4030_dai_ops = { 1387 + .startup = twl4030_startup, 1388 + .shutdown = twl4030_shutdown, 1442 1389 .hw_params = twl4030_hw_params, 1443 1390 .set_sysclk = twl4030_set_dai_sysclk, 1444 1391 .set_fmt = twl4030_set_dai_fmt, ··· 1452 1395 .stream_name = "Playback", 1453 1396 .channels_min = 2, 1454 1397 .channels_max = 2, 1455 - .rates = TWL4030_RATES, 1398 + .rates = TWL4030_RATES | SNDRV_PCM_RATE_96000, 1456 1399 .formats = TWL4030_FORMATS,}, 1457 1400 .capture = { 1458 1401 .stream_name = "Capture",
+1
sound/soc/codecs/twl4030.h
··· 109 109 #define TWL4030_APLL_RATE_32000 0x80 110 110 #define TWL4030_APLL_RATE_44100 0x90 111 111 #define TWL4030_APLL_RATE_48000 0xA0 112 + #define TWL4030_APLL_RATE_96000 0xE0 112 113 #define TWL4030_SEL_16K 0x04 113 114 #define TWL4030_CODECPDZ 0x02 114 115 #define TWL4030_OPT_MODE 0x01
+37
sound/soc/codecs/wm9705.c
··· 317 317 return -EIO; 318 318 } 319 319 320 + #ifdef CONFIG_PM 321 + static int wm9705_soc_suspend(struct platform_device *pdev) 322 + { 323 + struct snd_soc_device *socdev = platform_get_drvdata(pdev); 324 + struct snd_soc_codec *codec = socdev->card->codec; 325 + 326 + soc_ac97_ops.write(codec->ac97, AC97_POWERDOWN, 0xffff); 327 + 328 + return 0; 329 + } 330 + 331 + static int wm9705_soc_resume(struct platform_device *pdev) 332 + { 333 + struct snd_soc_device *socdev = platform_get_drvdata(pdev); 334 + struct snd_soc_codec *codec = socdev->card->codec; 335 + int i, ret; 336 + u16 *cache = codec->reg_cache; 337 + 338 + ret = wm9705_reset(codec); 339 + if (ret < 0) { 340 + printk(KERN_ERR "could not reset AC97 codec\n"); 341 + return ret; 342 + } 343 + 344 + for (i = 2; i < ARRAY_SIZE(wm9705_reg) << 1; i += 2) { 345 + soc_ac97_ops.write(codec->ac97, i, cache[i>>1]); 346 + } 347 + 348 + return 0; 349 + } 350 + #else 351 + #define wm9705_soc_suspend NULL 352 + #define wm9705_soc_resume NULL 353 + #endif 354 + 320 355 static int wm9705_soc_probe(struct platform_device *pdev) 321 356 { 322 357 struct snd_soc_device *socdev = platform_get_drvdata(pdev); ··· 442 407 struct snd_soc_codec_device soc_codec_dev_wm9705 = { 443 408 .probe = wm9705_soc_probe, 444 409 .remove = wm9705_soc_remove, 410 + .suspend = wm9705_soc_suspend, 411 + .resume = wm9705_soc_resume, 445 412 }; 446 413 EXPORT_SYMBOL_GPL(soc_codec_dev_wm9705); 447 414
+23 -6
sound/soc/fsl/fsl_dma.c
··· 300 300 if (!card->dev->coherent_dma_mask) 301 301 card->dev->coherent_dma_mask = fsl_dma_dmamask; 302 302 303 - ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev, 303 + ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, 304 304 fsl_dma_hardware.buffer_bytes_max, 305 305 &pcm->streams[0].substream->dma_buffer); 306 306 if (ret) { ··· 310 310 return -ENOMEM; 311 311 } 312 312 313 - ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->dev, 313 + ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, 314 314 fsl_dma_hardware.buffer_bytes_max, 315 315 &pcm->streams[1].substream->dma_buffer); 316 316 if (ret) { ··· 418 418 return -EBUSY; 419 419 } 420 420 421 - dma_private = dma_alloc_coherent(substream->pcm->dev, 421 + dma_private = dma_alloc_coherent(substream->pcm->card->dev, 422 422 sizeof(struct fsl_dma_private), &ld_buf_phys, GFP_KERNEL); 423 423 if (!dma_private) { 424 424 dev_err(substream->pcm->card->dev, ··· 445 445 dev_err(substream->pcm->card->dev, 446 446 "can't register ISR for IRQ %u (ret=%i)\n", 447 447 dma_private->irq, ret); 448 - dma_free_coherent(substream->pcm->dev, 448 + dma_free_coherent(substream->pcm->card->dev, 449 449 sizeof(struct fsl_dma_private), 450 450 dma_private, dma_private->ld_buf_phys); 451 451 return ret; ··· 697 697 else 698 698 position = in_be32(&dma_channel->dar); 699 699 700 + /* 701 + * When capture is started, the SSI immediately starts to fill its FIFO. 702 + * This means that the DMA controller is not started until the FIFO is 703 + * full. However, ALSA calls this function before that happens, when 704 + * MR.DAR is still zero. In this case, just return zero to indicate 705 + * that nothing has been received yet. 706 + */ 707 + if (!position) 708 + return 0; 709 + 710 + if ((position < dma_private->dma_buf_phys) || 711 + (position > dma_private->dma_buf_end)) { 712 + dev_err(substream->pcm->card->dev, 713 + "dma pointer is out of range, halting stream\n"); 714 + return SNDRV_PCM_POS_XRUN; 715 + } 716 + 700 717 frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys); 701 718 702 719 /* ··· 778 761 free_irq(dma_private->irq, dma_private); 779 762 780 763 if (dma_private->ld_buf_phys) { 781 - dma_unmap_single(substream->pcm->dev, 764 + dma_unmap_single(substream->pcm->card->dev, 782 765 dma_private->ld_buf_phys, 783 766 sizeof(dma_private->link), DMA_TO_DEVICE); 784 767 } 785 768 786 769 /* Deallocate the fsl_dma_private structure */ 787 - dma_free_coherent(substream->pcm->dev, 770 + dma_free_coherent(substream->pcm->card->dev, 788 771 sizeof(struct fsl_dma_private), 789 772 dma_private, dma_private->ld_buf_phys); 790 773 substream->runtime->private_data = NULL;
+48 -49
sound/soc/fsl/fsl_ssi.c
··· 60 60 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE) 61 61 #endif 62 62 63 + /* SIER bitflag of interrupts to enable */ 64 + #define SIER_FLAGS (CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE | \ 65 + CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TUE0_EN | \ 66 + CCSR_SSI_SIER_TUE1_EN | CCSR_SSI_SIER_RFRC_EN | \ 67 + CCSR_SSI_SIER_RDMAE | CCSR_SSI_SIER_RIE | \ 68 + CCSR_SSI_SIER_ROE0_EN | CCSR_SSI_SIER_ROE1_EN) 69 + 63 70 /** 64 71 * fsl_ssi_private: per-SSI private data 65 72 * ··· 147 140 were interrupted for. We mask it with the Interrupt Enable register 148 141 so that we only check for events that we're interested in. 149 142 */ 150 - sisr = in_be32(&ssi->sisr) & in_be32(&ssi->sier); 143 + sisr = in_be32(&ssi->sisr) & SIER_FLAGS; 151 144 152 145 if (sisr & CCSR_SSI_SISR_RFRC) { 153 146 ssi_private->stats.rfrc++; ··· 331 324 */ 332 325 333 326 /* 4. Enable the interrupts and DMA requests */ 334 - out_be32(&ssi->sier, 335 - CCSR_SSI_SIER_TFRC_EN | CCSR_SSI_SIER_TDMAE | 336 - CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TUE0_EN | 337 - CCSR_SSI_SIER_TUE1_EN | CCSR_SSI_SIER_RFRC_EN | 338 - CCSR_SSI_SIER_RDMAE | CCSR_SSI_SIER_RIE | 339 - CCSR_SSI_SIER_ROE0_EN | CCSR_SSI_SIER_ROE1_EN); 327 + out_be32(&ssi->sier, SIER_FLAGS); 340 328 341 329 /* 342 330 * Set the watermark for transmit FIFI 0 and receive FIFO 0. We ··· 468 466 case SNDRV_PCM_TRIGGER_START: 469 467 clrbits32(&ssi->scr, CCSR_SSI_SCR_SSIEN); 470 468 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 471 - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 469 + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 472 470 setbits32(&ssi->scr, 473 471 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE); 474 - } else { 475 - long timeout = jiffies + 10; 476 - 472 + else 477 473 setbits32(&ssi->scr, 478 474 CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE); 479 - 480 - /* Wait until the SSI has filled its FIFO. Without this 481 - * delay, ALSA complains about overruns. When the FIFO 482 - * is full, the DMA controller initiates its first 483 - * transfer. Until then, however, the DMA's DAR 484 - * register is zero, which translates to an 485 - * out-of-bounds pointer. This makes ALSA think an 486 - * overrun has occurred. 487 - */ 488 - while (!(in_be32(&ssi->sisr) & CCSR_SSI_SISR_RFF0) && 489 - (jiffies < timeout)); 490 - if (!(in_be32(&ssi->sisr) & CCSR_SSI_SISR_RFF0)) 491 - return -EIO; 492 - } 493 475 break; 494 476 495 477 case SNDRV_PCM_TRIGGER_STOP: ··· 592 606 .ops = &fsl_ssi_dai_ops, 593 607 }; 594 608 609 + /* Show the statistics of a flag only if its interrupt is enabled. The 610 + * compiler will optimze this code to a no-op if the interrupt is not 611 + * enabled. 612 + */ 613 + #define SIER_SHOW(flag, name) \ 614 + do { \ 615 + if (SIER_FLAGS & CCSR_SSI_SIER_##flag) \ 616 + length += sprintf(buf + length, #name "=%u\n", \ 617 + ssi_private->stats.name); \ 618 + } while (0) 619 + 620 + 595 621 /** 596 622 * fsl_sysfs_ssi_show: display SSI statistics 597 623 * 598 - * Display the statistics for the current SSI device. 624 + * Display the statistics for the current SSI device. To avoid confusion, 625 + * we only show those counts that are enabled. 599 626 */ 600 627 static ssize_t fsl_sysfs_ssi_show(struct device *dev, 601 628 struct device_attribute *attr, char *buf) 602 629 { 603 630 struct fsl_ssi_private *ssi_private = 604 - container_of(attr, struct fsl_ssi_private, dev_attr); 605 - ssize_t length; 631 + container_of(attr, struct fsl_ssi_private, dev_attr); 632 + ssize_t length = 0; 606 633 607 - length = sprintf(buf, "rfrc=%u", ssi_private->stats.rfrc); 608 - length += sprintf(buf + length, "\ttfrc=%u", ssi_private->stats.tfrc); 609 - length += sprintf(buf + length, "\tcmdau=%u", ssi_private->stats.cmdau); 610 - length += sprintf(buf + length, "\tcmddu=%u", ssi_private->stats.cmddu); 611 - length += sprintf(buf + length, "\trxt=%u", ssi_private->stats.rxt); 612 - length += sprintf(buf + length, "\trdr1=%u", ssi_private->stats.rdr1); 613 - length += sprintf(buf + length, "\trdr0=%u", ssi_private->stats.rdr0); 614 - length += sprintf(buf + length, "\ttde1=%u", ssi_private->stats.tde1); 615 - length += sprintf(buf + length, "\ttde0=%u", ssi_private->stats.tde0); 616 - length += sprintf(buf + length, "\troe1=%u", ssi_private->stats.roe1); 617 - length += sprintf(buf + length, "\troe0=%u", ssi_private->stats.roe0); 618 - length += sprintf(buf + length, "\ttue1=%u", ssi_private->stats.tue1); 619 - length += sprintf(buf + length, "\ttue0=%u", ssi_private->stats.tue0); 620 - length += sprintf(buf + length, "\ttfs=%u", ssi_private->stats.tfs); 621 - length += sprintf(buf + length, "\trfs=%u", ssi_private->stats.rfs); 622 - length += sprintf(buf + length, "\ttls=%u", ssi_private->stats.tls); 623 - length += sprintf(buf + length, "\trls=%u", ssi_private->stats.rls); 624 - length += sprintf(buf + length, "\trff1=%u", ssi_private->stats.rff1); 625 - length += sprintf(buf + length, "\trff0=%u", ssi_private->stats.rff0); 626 - length += sprintf(buf + length, "\ttfe1=%u", ssi_private->stats.tfe1); 627 - length += sprintf(buf + length, "\ttfe0=%u\n", ssi_private->stats.tfe0); 634 + SIER_SHOW(RFRC_EN, rfrc); 635 + SIER_SHOW(TFRC_EN, tfrc); 636 + SIER_SHOW(CMDAU_EN, cmdau); 637 + SIER_SHOW(CMDDU_EN, cmddu); 638 + SIER_SHOW(RXT_EN, rxt); 639 + SIER_SHOW(RDR1_EN, rdr1); 640 + SIER_SHOW(RDR0_EN, rdr0); 641 + SIER_SHOW(TDE1_EN, tde1); 642 + SIER_SHOW(TDE0_EN, tde0); 643 + SIER_SHOW(ROE1_EN, roe1); 644 + SIER_SHOW(ROE0_EN, roe0); 645 + SIER_SHOW(TUE1_EN, tue1); 646 + SIER_SHOW(TUE0_EN, tue0); 647 + SIER_SHOW(TFS_EN, tfs); 648 + SIER_SHOW(RFS_EN, rfs); 649 + SIER_SHOW(TLS_EN, tls); 650 + SIER_SHOW(RLS_EN, rls); 651 + SIER_SHOW(RFF1_EN, rff1); 652 + SIER_SHOW(RFF0_EN, rff0); 653 + SIER_SHOW(TFE1_EN, tfe1); 654 + SIER_SHOW(TFE0_EN, tfe0); 628 655 629 656 return length; 630 657 }
+11
sound/soc/omap/omap-mcbsp.c
··· 146 146 struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data); 147 147 int err = 0; 148 148 149 + if (cpu_is_omap343x() && mcbsp_data->bus_id == 1) { 150 + /* 151 + * McBSP2 in OMAP3 has 1024 * 32-bit internal audio buffer. 152 + * Set constraint for minimum buffer size to the same than FIFO 153 + * size in order to avoid underruns in playback startup because 154 + * HW is keeping the DMA request active until FIFO is filled. 155 + */ 156 + snd_pcm_hw_constraint_minmax(substream->runtime, 157 + SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4096, UINT_MAX); 158 + } 159 + 149 160 if (!cpu_dai->active) 150 161 err = omap_mcbsp_request(mcbsp_data->bus_id); 151 162
+10
sound/soc/pxa/Kconfig
··· 116 116 Say Y if you want to add support for SoC audio on the 117 117 Marvell Zylonite reference platform. 118 118 119 + config SND_PXA2XX_SOC_MAGICIAN 120 + tristate "SoC Audio support for HTC Magician" 121 + depends on SND_PXA2XX_SOC && MACH_MAGICIAN 122 + select SND_PXA2XX_SOC_I2S 123 + select SND_PXA_SOC_SSP 124 + select SND_SOC_UDA1380 125 + help 126 + Say Y if you want to add support for SoC audio on the 127 + HTC Magician. 128 + 119 129 config SND_PXA2XX_SOC_MIOA701 120 130 tristate "SoC Audio support for MIO A701" 121 131 depends on SND_PXA2XX_SOC && MACH_MIOA701
+2
sound/soc/pxa/Makefile
··· 20 20 snd-soc-em-x270-objs := em-x270.o 21 21 snd-soc-palm27x-objs := palm27x.o 22 22 snd-soc-zylonite-objs := zylonite.o 23 + snd-soc-magician-objs := magician.o 23 24 snd-soc-mioa701-objs := mioa701_wm9713.o 24 25 25 26 obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o ··· 32 31 obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o 33 32 obj-$(CONFIG_SND_PXA2XX_SOC_EM_X270) += snd-soc-em-x270.o 34 33 obj-$(CONFIG_SND_PXA2XX_SOC_PALM27X) += snd-soc-palm27x.o 34 + obj-$(CONFIG_SND_PXA2XX_SOC_MAGICIAN) += snd-soc-magician.o 35 35 obj-$(CONFIG_SND_PXA2XX_SOC_MIOA701) += snd-soc-mioa701.o 36 36 obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o
+560
sound/soc/pxa/magician.c
··· 1 + /* 2 + * SoC audio for HTC Magician 3 + * 4 + * Copyright (c) 2006 Philipp Zabel <philipp.zabel@gmail.com> 5 + * 6 + * based on spitz.c, 7 + * Authors: Liam Girdwood <lrg@slimlogic.co.uk> 8 + * Richard Purdie <richard@openedhand.com> 9 + * 10 + * This program is free software; you can redistribute it and/or modify it 11 + * under the terms of the GNU General Public License as published by the 12 + * Free Software Foundation; either version 2 of the License, or (at your 13 + * option) any later version. 14 + * 15 + */ 16 + 17 + #include <linux/module.h> 18 + #include <linux/timer.h> 19 + #include <linux/interrupt.h> 20 + #include <linux/platform_device.h> 21 + #include <linux/delay.h> 22 + #include <linux/gpio.h> 23 + 24 + #include <sound/core.h> 25 + #include <sound/pcm.h> 26 + #include <sound/pcm_params.h> 27 + #include <sound/soc.h> 28 + #include <sound/soc-dapm.h> 29 + 30 + #include <mach/pxa-regs.h> 31 + #include <mach/hardware.h> 32 + #include <mach/magician.h> 33 + #include <asm/mach-types.h> 34 + #include "../codecs/uda1380.h" 35 + #include "pxa2xx-pcm.h" 36 + #include "pxa2xx-i2s.h" 37 + #include "pxa-ssp.h" 38 + 39 + #define MAGICIAN_MIC 0 40 + #define MAGICIAN_MIC_EXT 1 41 + 42 + static int magician_hp_switch; 43 + static int magician_spk_switch = 1; 44 + static int magician_in_sel = MAGICIAN_MIC; 45 + 46 + static void magician_ext_control(struct snd_soc_codec *codec) 47 + { 48 + if (magician_spk_switch) 49 + snd_soc_dapm_enable_pin(codec, "Speaker"); 50 + else 51 + snd_soc_dapm_disable_pin(codec, "Speaker"); 52 + if (magician_hp_switch) 53 + snd_soc_dapm_enable_pin(codec, "Headphone Jack"); 54 + else 55 + snd_soc_dapm_disable_pin(codec, "Headphone Jack"); 56 + 57 + switch (magician_in_sel) { 58 + case MAGICIAN_MIC: 59 + snd_soc_dapm_disable_pin(codec, "Headset Mic"); 60 + snd_soc_dapm_enable_pin(codec, "Call Mic"); 61 + break; 62 + case MAGICIAN_MIC_EXT: 63 + snd_soc_dapm_disable_pin(codec, "Call Mic"); 64 + snd_soc_dapm_enable_pin(codec, "Headset Mic"); 65 + break; 66 + } 67 + 68 + snd_soc_dapm_sync(codec); 69 + } 70 + 71 + static int magician_startup(struct snd_pcm_substream *substream) 72 + { 73 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 74 + struct snd_soc_codec *codec = rtd->socdev->card->codec; 75 + 76 + /* check the jack status at stream startup */ 77 + magician_ext_control(codec); 78 + 79 + return 0; 80 + } 81 + 82 + /* 83 + * Magician uses SSP port for playback. 84 + */ 85 + static int magician_playback_hw_params(struct snd_pcm_substream *substream, 86 + struct snd_pcm_hw_params *params) 87 + { 88 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 89 + struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 90 + struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 91 + unsigned int acps, acds, width, rate; 92 + unsigned int div4 = PXA_SSP_CLK_SCDB_4; 93 + int ret = 0; 94 + 95 + rate = params_rate(params); 96 + width = snd_pcm_format_physical_width(params_format(params)); 97 + 98 + /* 99 + * rate = SSPSCLK / (2 * width(16 or 32)) 100 + * SSPSCLK = (ACPS / ACDS) / SSPSCLKDIV(div4 or div1) 101 + */ 102 + switch (params_rate(params)) { 103 + case 8000: 104 + /* off by a factor of 2: bug in the PXA27x audio clock? */ 105 + acps = 32842000; 106 + switch (width) { 107 + case 16: 108 + /* 513156 Hz ~= _2_ * 8000 Hz * 32 (+0.23%) */ 109 + acds = PXA_SSP_CLK_AUDIO_DIV_16; 110 + break; 111 + case 32: 112 + /* 1026312 Hz ~= _2_ * 8000 Hz * 64 (+0.23%) */ 113 + acds = PXA_SSP_CLK_AUDIO_DIV_8; 114 + } 115 + break; 116 + case 11025: 117 + acps = 5622000; 118 + switch (width) { 119 + case 16: 120 + /* 351375 Hz ~= 11025 Hz * 32 (-0.41%) */ 121 + acds = PXA_SSP_CLK_AUDIO_DIV_4; 122 + break; 123 + case 32: 124 + /* 702750 Hz ~= 11025 Hz * 64 (-0.41%) */ 125 + acds = PXA_SSP_CLK_AUDIO_DIV_2; 126 + } 127 + break; 128 + case 22050: 129 + acps = 5622000; 130 + switch (width) { 131 + case 16: 132 + /* 702750 Hz ~= 22050 Hz * 32 (-0.41%) */ 133 + acds = PXA_SSP_CLK_AUDIO_DIV_2; 134 + break; 135 + case 32: 136 + /* 1405500 Hz ~= 22050 Hz * 64 (-0.41%) */ 137 + acds = PXA_SSP_CLK_AUDIO_DIV_1; 138 + } 139 + break; 140 + case 44100: 141 + acps = 5622000; 142 + switch (width) { 143 + case 16: 144 + /* 1405500 Hz ~= 44100 Hz * 32 (-0.41%) */ 145 + acds = PXA_SSP_CLK_AUDIO_DIV_2; 146 + break; 147 + case 32: 148 + /* 2811000 Hz ~= 44100 Hz * 64 (-0.41%) */ 149 + acds = PXA_SSP_CLK_AUDIO_DIV_1; 150 + } 151 + break; 152 + case 48000: 153 + acps = 12235000; 154 + switch (width) { 155 + case 16: 156 + /* 1529375 Hz ~= 48000 Hz * 32 (-0.44%) */ 157 + acds = PXA_SSP_CLK_AUDIO_DIV_2; 158 + break; 159 + case 32: 160 + /* 3058750 Hz ~= 48000 Hz * 64 (-0.44%) */ 161 + acds = PXA_SSP_CLK_AUDIO_DIV_1; 162 + } 163 + break; 164 + case 96000: 165 + acps = 12235000; 166 + switch (width) { 167 + case 16: 168 + /* 3058750 Hz ~= 96000 Hz * 32 (-0.44%) */ 169 + acds = PXA_SSP_CLK_AUDIO_DIV_1; 170 + break; 171 + case 32: 172 + /* 6117500 Hz ~= 96000 Hz * 64 (-0.44%) */ 173 + acds = PXA_SSP_CLK_AUDIO_DIV_2; 174 + div4 = PXA_SSP_CLK_SCDB_1; 175 + break; 176 + } 177 + break; 178 + } 179 + 180 + /* set codec DAI configuration */ 181 + ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_MSB | 182 + SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); 183 + if (ret < 0) 184 + return ret; 185 + 186 + /* set cpu DAI configuration */ 187 + ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A | 188 + SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBS_CFS); 189 + if (ret < 0) 190 + return ret; 191 + 192 + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 1, 1); 193 + if (ret < 0) 194 + return ret; 195 + 196 + /* set audio clock as clock source */ 197 + ret = snd_soc_dai_set_sysclk(cpu_dai, PXA_SSP_CLK_AUDIO, 0, 198 + SND_SOC_CLOCK_OUT); 199 + if (ret < 0) 200 + return ret; 201 + 202 + /* set the SSP audio system clock ACDS divider */ 203 + ret = snd_soc_dai_set_clkdiv(cpu_dai, 204 + PXA_SSP_AUDIO_DIV_ACDS, acds); 205 + if (ret < 0) 206 + return ret; 207 + 208 + /* set the SSP audio system clock SCDB divider4 */ 209 + ret = snd_soc_dai_set_clkdiv(cpu_dai, 210 + PXA_SSP_AUDIO_DIV_SCDB, div4); 211 + if (ret < 0) 212 + return ret; 213 + 214 + /* set SSP audio pll clock */ 215 + ret = snd_soc_dai_set_pll(cpu_dai, 0, 0, acps); 216 + if (ret < 0) 217 + return ret; 218 + 219 + return 0; 220 + } 221 + 222 + /* 223 + * Magician uses I2S for capture. 224 + */ 225 + static int magician_capture_hw_params(struct snd_pcm_substream *substream, 226 + struct snd_pcm_hw_params *params) 227 + { 228 + struct snd_soc_pcm_runtime *rtd = substream->private_data; 229 + struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 230 + struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 231 + int ret = 0; 232 + 233 + /* set codec DAI configuration */ 234 + ret = snd_soc_dai_set_fmt(codec_dai, 235 + SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | 236 + SND_SOC_DAIFMT_CBS_CFS); 237 + if (ret < 0) 238 + return ret; 239 + 240 + /* set cpu DAI configuration */ 241 + ret = snd_soc_dai_set_fmt(cpu_dai, 242 + SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | 243 + SND_SOC_DAIFMT_CBS_CFS); 244 + if (ret < 0) 245 + return ret; 246 + 247 + /* set the I2S system clock as output */ 248 + ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, 249 + SND_SOC_CLOCK_OUT); 250 + if (ret < 0) 251 + return ret; 252 + 253 + return 0; 254 + } 255 + 256 + static struct snd_soc_ops magician_capture_ops = { 257 + .startup = magician_startup, 258 + .hw_params = magician_capture_hw_params, 259 + }; 260 + 261 + static struct snd_soc_ops magician_playback_ops = { 262 + .startup = magician_startup, 263 + .hw_params = magician_playback_hw_params, 264 + }; 265 + 266 + static int magician_get_hp(struct snd_kcontrol *kcontrol, 267 + struct snd_ctl_elem_value *ucontrol) 268 + { 269 + ucontrol->value.integer.value[0] = magician_hp_switch; 270 + return 0; 271 + } 272 + 273 + static int magician_set_hp(struct snd_kcontrol *kcontrol, 274 + struct snd_ctl_elem_value *ucontrol) 275 + { 276 + struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 277 + 278 + if (magician_hp_switch == ucontrol->value.integer.value[0]) 279 + return 0; 280 + 281 + magician_hp_switch = ucontrol->value.integer.value[0]; 282 + magician_ext_control(codec); 283 + return 1; 284 + } 285 + 286 + static int magician_get_spk(struct snd_kcontrol *kcontrol, 287 + struct snd_ctl_elem_value *ucontrol) 288 + { 289 + ucontrol->value.integer.value[0] = magician_spk_switch; 290 + return 0; 291 + } 292 + 293 + static int magician_set_spk(struct snd_kcontrol *kcontrol, 294 + struct snd_ctl_elem_value *ucontrol) 295 + { 296 + struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 297 + 298 + if (magician_spk_switch == ucontrol->value.integer.value[0]) 299 + return 0; 300 + 301 + magician_spk_switch = ucontrol->value.integer.value[0]; 302 + magician_ext_control(codec); 303 + return 1; 304 + } 305 + 306 + static int magician_get_input(struct snd_kcontrol *kcontrol, 307 + struct snd_ctl_elem_value *ucontrol) 308 + { 309 + ucontrol->value.integer.value[0] = magician_in_sel; 310 + return 0; 311 + } 312 + 313 + static int magician_set_input(struct snd_kcontrol *kcontrol, 314 + struct snd_ctl_elem_value *ucontrol) 315 + { 316 + if (magician_in_sel == ucontrol->value.integer.value[0]) 317 + return 0; 318 + 319 + magician_in_sel = ucontrol->value.integer.value[0]; 320 + 321 + switch (magician_in_sel) { 322 + case MAGICIAN_MIC: 323 + gpio_set_value(EGPIO_MAGICIAN_IN_SEL1, 1); 324 + break; 325 + case MAGICIAN_MIC_EXT: 326 + gpio_set_value(EGPIO_MAGICIAN_IN_SEL1, 0); 327 + } 328 + 329 + return 1; 330 + } 331 + 332 + static int magician_spk_power(struct snd_soc_dapm_widget *w, 333 + struct snd_kcontrol *k, int event) 334 + { 335 + gpio_set_value(EGPIO_MAGICIAN_SPK_POWER, SND_SOC_DAPM_EVENT_ON(event)); 336 + return 0; 337 + } 338 + 339 + static int magician_hp_power(struct snd_soc_dapm_widget *w, 340 + struct snd_kcontrol *k, int event) 341 + { 342 + gpio_set_value(EGPIO_MAGICIAN_EP_POWER, SND_SOC_DAPM_EVENT_ON(event)); 343 + return 0; 344 + } 345 + 346 + static int magician_mic_bias(struct snd_soc_dapm_widget *w, 347 + struct snd_kcontrol *k, int event) 348 + { 349 + gpio_set_value(EGPIO_MAGICIAN_MIC_POWER, SND_SOC_DAPM_EVENT_ON(event)); 350 + return 0; 351 + } 352 + 353 + /* magician machine dapm widgets */ 354 + static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = { 355 + SND_SOC_DAPM_HP("Headphone Jack", magician_hp_power), 356 + SND_SOC_DAPM_SPK("Speaker", magician_spk_power), 357 + SND_SOC_DAPM_MIC("Call Mic", magician_mic_bias), 358 + SND_SOC_DAPM_MIC("Headset Mic", magician_mic_bias), 359 + }; 360 + 361 + /* magician machine audio_map */ 362 + static const struct snd_soc_dapm_route audio_map[] = { 363 + 364 + /* Headphone connected to VOUTL, VOUTR */ 365 + {"Headphone Jack", NULL, "VOUTL"}, 366 + {"Headphone Jack", NULL, "VOUTR"}, 367 + 368 + /* Speaker connected to VOUTL, VOUTR */ 369 + {"Speaker", NULL, "VOUTL"}, 370 + {"Speaker", NULL, "VOUTR"}, 371 + 372 + /* Mics are connected to VINM */ 373 + {"VINM", NULL, "Headset Mic"}, 374 + {"VINM", NULL, "Call Mic"}, 375 + }; 376 + 377 + static const char *input_select[] = {"Call Mic", "Headset Mic"}; 378 + static const struct soc_enum magician_in_sel_enum = 379 + SOC_ENUM_SINGLE_EXT(2, input_select); 380 + 381 + static const struct snd_kcontrol_new uda1380_magician_controls[] = { 382 + SOC_SINGLE_BOOL_EXT("Headphone Switch", 383 + (unsigned long)&magician_hp_switch, 384 + magician_get_hp, magician_set_hp), 385 + SOC_SINGLE_BOOL_EXT("Speaker Switch", 386 + (unsigned long)&magician_spk_switch, 387 + magician_get_spk, magician_set_spk), 388 + SOC_ENUM_EXT("Input Select", magician_in_sel_enum, 389 + magician_get_input, magician_set_input), 390 + }; 391 + 392 + /* 393 + * Logic for a uda1380 as connected on a HTC Magician 394 + */ 395 + static int magician_uda1380_init(struct snd_soc_codec *codec) 396 + { 397 + int err; 398 + 399 + /* NC codec pins */ 400 + snd_soc_dapm_nc_pin(codec, "VOUTLHP"); 401 + snd_soc_dapm_nc_pin(codec, "VOUTRHP"); 402 + 403 + /* FIXME: is anything connected here? */ 404 + snd_soc_dapm_nc_pin(codec, "VINL"); 405 + snd_soc_dapm_nc_pin(codec, "VINR"); 406 + 407 + /* Add magician specific controls */ 408 + err = snd_soc_add_controls(codec, uda1380_magician_controls, 409 + ARRAY_SIZE(uda1380_magician_controls)); 410 + if (err < 0) 411 + return err; 412 + 413 + /* Add magician specific widgets */ 414 + snd_soc_dapm_new_controls(codec, uda1380_dapm_widgets, 415 + ARRAY_SIZE(uda1380_dapm_widgets)); 416 + 417 + /* Set up magician specific audio path interconnects */ 418 + snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); 419 + 420 + snd_soc_dapm_sync(codec); 421 + return 0; 422 + } 423 + 424 + /* magician digital audio interface glue - connects codec <--> CPU */ 425 + static struct snd_soc_dai_link magician_dai[] = { 426 + { 427 + .name = "uda1380", 428 + .stream_name = "UDA1380 Playback", 429 + .cpu_dai = &pxa_ssp_dai[PXA_DAI_SSP1], 430 + .codec_dai = &uda1380_dai[UDA1380_DAI_PLAYBACK], 431 + .init = magician_uda1380_init, 432 + .ops = &magician_playback_ops, 433 + }, 434 + { 435 + .name = "uda1380", 436 + .stream_name = "UDA1380 Capture", 437 + .cpu_dai = &pxa_i2s_dai, 438 + .codec_dai = &uda1380_dai[UDA1380_DAI_CAPTURE], 439 + .ops = &magician_capture_ops, 440 + } 441 + }; 442 + 443 + /* magician audio machine driver */ 444 + static struct snd_soc_card snd_soc_card_magician = { 445 + .name = "Magician", 446 + .dai_link = magician_dai, 447 + .num_links = ARRAY_SIZE(magician_dai), 448 + .platform = &pxa2xx_soc_platform, 449 + }; 450 + 451 + /* magician audio private data */ 452 + static struct uda1380_setup_data magician_uda1380_setup = { 453 + .i2c_address = 0x18, 454 + .dac_clk = UDA1380_DAC_CLK_WSPLL, 455 + }; 456 + 457 + /* magician audio subsystem */ 458 + static struct snd_soc_device magician_snd_devdata = { 459 + .card = &snd_soc_card_magician, 460 + .codec_dev = &soc_codec_dev_uda1380, 461 + .codec_data = &magician_uda1380_setup, 462 + }; 463 + 464 + static struct platform_device *magician_snd_device; 465 + 466 + static int __init magician_init(void) 467 + { 468 + int ret; 469 + 470 + if (!machine_is_magician()) 471 + return -ENODEV; 472 + 473 + ret = gpio_request(EGPIO_MAGICIAN_CODEC_POWER, "CODEC_POWER"); 474 + if (ret) 475 + goto err_request_power; 476 + ret = gpio_request(EGPIO_MAGICIAN_CODEC_RESET, "CODEC_RESET"); 477 + if (ret) 478 + goto err_request_reset; 479 + ret = gpio_request(EGPIO_MAGICIAN_SPK_POWER, "SPK_POWER"); 480 + if (ret) 481 + goto err_request_spk; 482 + ret = gpio_request(EGPIO_MAGICIAN_EP_POWER, "EP_POWER"); 483 + if (ret) 484 + goto err_request_ep; 485 + ret = gpio_request(EGPIO_MAGICIAN_MIC_POWER, "MIC_POWER"); 486 + if (ret) 487 + goto err_request_mic; 488 + ret = gpio_request(EGPIO_MAGICIAN_IN_SEL0, "IN_SEL0"); 489 + if (ret) 490 + goto err_request_in_sel0; 491 + ret = gpio_request(EGPIO_MAGICIAN_IN_SEL1, "IN_SEL1"); 492 + if (ret) 493 + goto err_request_in_sel1; 494 + 495 + gpio_set_value(EGPIO_MAGICIAN_CODEC_POWER, 1); 496 + gpio_set_value(EGPIO_MAGICIAN_IN_SEL0, 0); 497 + 498 + /* we may need to have the clock running here - pH5 */ 499 + gpio_set_value(EGPIO_MAGICIAN_CODEC_RESET, 1); 500 + udelay(5); 501 + gpio_set_value(EGPIO_MAGICIAN_CODEC_RESET, 0); 502 + 503 + magician_snd_device = platform_device_alloc("soc-audio", -1); 504 + if (!magician_snd_device) { 505 + ret = -ENOMEM; 506 + goto err_pdev; 507 + } 508 + 509 + platform_set_drvdata(magician_snd_device, &magician_snd_devdata); 510 + magician_snd_devdata.dev = &magician_snd_device->dev; 511 + ret = platform_device_add(magician_snd_device); 512 + if (ret) { 513 + platform_device_put(magician_snd_device); 514 + goto err_pdev; 515 + } 516 + 517 + return 0; 518 + 519 + err_pdev: 520 + gpio_free(EGPIO_MAGICIAN_IN_SEL1); 521 + err_request_in_sel1: 522 + gpio_free(EGPIO_MAGICIAN_IN_SEL0); 523 + err_request_in_sel0: 524 + gpio_free(EGPIO_MAGICIAN_MIC_POWER); 525 + err_request_mic: 526 + gpio_free(EGPIO_MAGICIAN_EP_POWER); 527 + err_request_ep: 528 + gpio_free(EGPIO_MAGICIAN_SPK_POWER); 529 + err_request_spk: 530 + gpio_free(EGPIO_MAGICIAN_CODEC_RESET); 531 + err_request_reset: 532 + gpio_free(EGPIO_MAGICIAN_CODEC_POWER); 533 + err_request_power: 534 + return ret; 535 + } 536 + 537 + static void __exit magician_exit(void) 538 + { 539 + platform_device_unregister(magician_snd_device); 540 + 541 + gpio_set_value(EGPIO_MAGICIAN_SPK_POWER, 0); 542 + gpio_set_value(EGPIO_MAGICIAN_EP_POWER, 0); 543 + gpio_set_value(EGPIO_MAGICIAN_MIC_POWER, 0); 544 + gpio_set_value(EGPIO_MAGICIAN_CODEC_POWER, 0); 545 + 546 + gpio_free(EGPIO_MAGICIAN_IN_SEL1); 547 + gpio_free(EGPIO_MAGICIAN_IN_SEL0); 548 + gpio_free(EGPIO_MAGICIAN_MIC_POWER); 549 + gpio_free(EGPIO_MAGICIAN_EP_POWER); 550 + gpio_free(EGPIO_MAGICIAN_SPK_POWER); 551 + gpio_free(EGPIO_MAGICIAN_CODEC_RESET); 552 + gpio_free(EGPIO_MAGICIAN_CODEC_POWER); 553 + } 554 + 555 + module_init(magician_init); 556 + module_exit(magician_exit); 557 + 558 + MODULE_AUTHOR("Philipp Zabel"); 559 + MODULE_DESCRIPTION("ALSA SoC Magician"); 560 + MODULE_LICENSE("GPL");
+9 -3
sound/soc/pxa/pxa-ssp.c
··· 627 627 u32 sscr0; 628 628 u32 sspsp; 629 629 int width = snd_pcm_format_physical_width(params_format(params)); 630 + int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf; 630 631 631 632 /* select correct DMA params */ 632 633 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) 633 634 dma = 1; /* capture DMA offset is 1,3 */ 634 - if (chn == 2) 635 - dma += 2; /* stereo DMA offset is 2, mono is 0 */ 635 + /* Network mode with one active slot (ttsa == 1) can be used 636 + * to force 16-bit frame width on the wire (for S16_LE), even 637 + * with two channels. Use 16-bit DMA transfers for this case. 638 + */ 639 + if (((chn == 2) && (ttsa != 1)) || (width == 32)) 640 + dma += 2; /* 32-bit DMA offset is 2, 16-bit is 0 */ 641 + 636 642 cpu_dai->dma_data = ssp_dma_params[cpu_dai->id][dma]; 637 643 638 644 dev_dbg(&ssp->pdev->dev, "pxa_ssp_hw_params: dma %d\n", dma); ··· 718 712 /* When we use a network mode, we always require TDM slots 719 713 * - complain loudly and fail if they've not been set up yet. 720 714 */ 721 - if ((sscr0 & SSCR0_MOD) && !(ssp_read_reg(ssp, SSTSA) & 0xf)) { 715 + if ((sscr0 & SSCR0_MOD) && !ttsa) { 722 716 dev_err(&ssp->pdev->dev, "No TDM timeslot configured\n"); 723 717 return -EINVAL; 724 718 }
+15 -5
sound/soc/soc-core.c
··· 98 98 int err; 99 99 100 100 codec->ac97->dev.bus = &ac97_bus_type; 101 - codec->ac97->dev.parent = NULL; 101 + codec->ac97->dev.parent = codec->card->dev; 102 102 codec->ac97->dev.release = soc_ac97_device_release; 103 103 104 104 dev_set_name(&codec->ac97->dev, "%d-%d:%s", ··· 767 767 { 768 768 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 769 769 struct snd_soc_card *card = socdev->card; 770 + struct snd_soc_dai *cpu_dai = card->dai_link[0].cpu_dai; 770 771 771 - dev_dbg(socdev->dev, "scheduling resume work\n"); 772 - 773 - if (!schedule_work(&card->deferred_resume_work)) 774 - dev_err(socdev->dev, "resume work item may be lost\n"); 772 + /* AC97 devices might have other drivers hanging off them so 773 + * need to resume immediately. Other drivers don't have that 774 + * problem and may take a substantial amount of time to resume 775 + * due to I/O costs and anti-pop so handle them out of line. 776 + */ 777 + if (cpu_dai->ac97_control) { 778 + dev_dbg(socdev->dev, "Resuming AC97 immediately\n"); 779 + soc_resume_deferred(&card->deferred_resume_work); 780 + } else { 781 + dev_dbg(socdev->dev, "Scheduling resume work\n"); 782 + if (!schedule_work(&card->deferred_resume_work)) 783 + dev_err(socdev->dev, "resume work item may be lost\n"); 784 + } 775 785 776 786 return 0; 777 787 }
+119 -134
sound/usb/usbaudio.c
··· 121 121 unsigned char attributes; /* corresponding attributes of cs endpoint */ 122 122 unsigned char endpoint; /* endpoint */ 123 123 unsigned char ep_attr; /* endpoint attributes */ 124 + unsigned char datainterval; /* log_2 of data packet interval */ 124 125 unsigned int maxpacksize; /* max. packet size */ 125 126 unsigned int rates; /* rate bitmasks */ 126 127 unsigned int rate_min, rate_max; /* min/max rates */ ··· 171 170 unsigned int curframesize; /* current packet size in frames (for capture) */ 172 171 unsigned int fill_max: 1; /* fill max packet size always */ 173 172 unsigned int fmt_type; /* USB audio format type (1-3) */ 174 - unsigned int packs_per_ms; /* packets per millisecond (for playback) */ 175 173 176 174 unsigned int running: 1; /* running status */ 177 175 ··· 607 607 break; 608 608 } 609 609 } 610 - /* finish at the frame boundary at/after the period boundary */ 611 - if (period_elapsed && 612 - (i & (subs->packs_per_ms - 1)) == subs->packs_per_ms - 1) 610 + if (period_elapsed) /* finish at the period boundary */ 613 611 break; 614 612 } 615 613 if (subs->hwptr_done + offs > runtime->buffer_size) { ··· 1065 1067 packs_per_ms = 8 >> subs->datainterval; 1066 1068 else 1067 1069 packs_per_ms = 1; 1068 - subs->packs_per_ms = packs_per_ms; 1069 1070 1070 1071 if (is_playback) { 1071 1072 urb_packs = max(nrpacks, 1); ··· 1084 1087 minsize -= minsize >> 3; 1085 1088 minsize = max(minsize, 1u); 1086 1089 total_packs = (period_bytes + minsize - 1) / minsize; 1087 - /* round up to multiple of packs_per_ms */ 1088 - total_packs = (total_packs + packs_per_ms - 1) 1089 - & ~(packs_per_ms - 1); 1090 1090 /* we need at least two URBs for queueing */ 1091 - if (total_packs < 2 * packs_per_ms) { 1092 - total_packs = 2 * packs_per_ms; 1091 + if (total_packs < 2) { 1092 + total_packs = 2; 1093 1093 } else { 1094 1094 /* and we don't want too long a queue either */ 1095 1095 maxpacks = max(MAX_QUEUE * packs_per_ms, urb_packs * 2); 1096 1096 total_packs = min(total_packs, maxpacks); 1097 1097 } 1098 1098 } else { 1099 + while (urb_packs > 1 && urb_packs * maxsize >= period_bytes) 1100 + urb_packs >>= 1; 1099 1101 total_packs = MAX_URBS * urb_packs; 1100 1102 } 1101 1103 subs->nurbs = (total_packs + urb_packs - 1) / urb_packs; ··· 1346 1350 subs->datapipe = usb_sndisocpipe(dev, ep); 1347 1351 else 1348 1352 subs->datapipe = usb_rcvisocpipe(dev, ep); 1349 - if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH && 1350 - get_endpoint(alts, 0)->bInterval >= 1 && 1351 - get_endpoint(alts, 0)->bInterval <= 4) 1352 - subs->datainterval = get_endpoint(alts, 0)->bInterval - 1; 1353 - else 1354 - subs->datainterval = 0; 1353 + subs->datainterval = fmt->datainterval; 1355 1354 subs->syncpipe = subs->syncinterval = 0; 1356 1355 subs->maxpacksize = fmt->maxpacksize; 1357 1356 subs->fill_max = 0; ··· 1559 1568 #define hwc_debug(fmt, args...) /**/ 1560 1569 #endif 1561 1570 1562 - static int hw_check_valid_format(struct snd_pcm_hw_params *params, struct audioformat *fp) 1571 + static int hw_check_valid_format(struct snd_usb_substream *subs, 1572 + struct snd_pcm_hw_params *params, 1573 + struct audioformat *fp) 1563 1574 { 1564 1575 struct snd_interval *it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); 1565 1576 struct snd_interval *ct = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); 1566 1577 struct snd_mask *fmts = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); 1578 + struct snd_interval *pt = hw_param_interval(params, SNDRV_PCM_HW_PARAM_PERIOD_TIME); 1579 + unsigned int ptime; 1567 1580 1568 1581 /* check the format */ 1569 1582 if (!snd_mask_test(fmts, fp->format)) { ··· 1588 1593 hwc_debug(" > check: rate_max %d < min %d\n", fp->rate_max, it->min); 1589 1594 return 0; 1590 1595 } 1596 + /* check whether the period time is >= the data packet interval */ 1597 + if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH) { 1598 + ptime = 125 * (1 << fp->datainterval); 1599 + if (ptime > pt->max || (ptime == pt->max && pt->openmax)) { 1600 + hwc_debug(" > check: ptime %u > max %u\n", ptime, pt->max); 1601 + return 0; 1602 + } 1603 + } 1591 1604 return 1; 1592 1605 } 1593 1606 ··· 1614 1611 list_for_each(p, &subs->fmt_list) { 1615 1612 struct audioformat *fp; 1616 1613 fp = list_entry(p, struct audioformat, list); 1617 - if (!hw_check_valid_format(params, fp)) 1614 + if (!hw_check_valid_format(subs, params, fp)) 1618 1615 continue; 1619 1616 if (changed++) { 1620 1617 if (rmin > fp->rate_min) ··· 1668 1665 list_for_each(p, &subs->fmt_list) { 1669 1666 struct audioformat *fp; 1670 1667 fp = list_entry(p, struct audioformat, list); 1671 - if (!hw_check_valid_format(params, fp)) 1668 + if (!hw_check_valid_format(subs, params, fp)) 1672 1669 continue; 1673 1670 if (changed++) { 1674 1671 if (rmin > fp->channels) ··· 1721 1718 list_for_each(p, &subs->fmt_list) { 1722 1719 struct audioformat *fp; 1723 1720 fp = list_entry(p, struct audioformat, list); 1724 - if (!hw_check_valid_format(params, fp)) 1721 + if (!hw_check_valid_format(subs, params, fp)) 1725 1722 continue; 1726 1723 fbits |= (1ULL << fp->format); 1727 1724 } ··· 1739 1736 return changed; 1740 1737 } 1741 1738 1742 - #define MAX_MASK 64 1743 - 1744 - /* 1745 - * check whether the registered audio formats need special hw-constraints 1746 - */ 1747 - static int check_hw_params_convention(struct snd_usb_substream *subs) 1739 + static int hw_rule_period_time(struct snd_pcm_hw_params *params, 1740 + struct snd_pcm_hw_rule *rule) 1748 1741 { 1749 - int i; 1750 - u32 *channels; 1751 - u32 *rates; 1752 - u32 cmaster, rmaster; 1753 - u32 rate_min = 0, rate_max = 0; 1754 - struct list_head *p; 1755 - int err = 1; 1742 + struct snd_usb_substream *subs = rule->private; 1743 + struct audioformat *fp; 1744 + struct snd_interval *it; 1745 + unsigned char min_datainterval; 1746 + unsigned int pmin; 1747 + int changed; 1756 1748 1757 - channels = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL); 1758 - rates = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL); 1759 - if (!channels || !rates) { 1760 - err = -ENOMEM; 1761 - goto __out; 1762 - } 1763 - 1764 - list_for_each(p, &subs->fmt_list) { 1765 - struct audioformat *f; 1766 - f = list_entry(p, struct audioformat, list); 1767 - /* unconventional channels? */ 1768 - if (f->channels > 32) 1769 - goto __out; 1770 - /* continuous rate min/max matches? */ 1771 - if (f->rates & SNDRV_PCM_RATE_CONTINUOUS) { 1772 - if (rate_min && f->rate_min != rate_min) 1773 - goto __out; 1774 - if (rate_max && f->rate_max != rate_max) 1775 - goto __out; 1776 - rate_min = f->rate_min; 1777 - rate_max = f->rate_max; 1778 - } 1779 - /* combination of continuous rates and fixed rates? */ 1780 - if (rates[f->format] & SNDRV_PCM_RATE_CONTINUOUS) { 1781 - if (f->rates != rates[f->format]) 1782 - goto __out; 1783 - } 1784 - if (f->rates & SNDRV_PCM_RATE_CONTINUOUS) { 1785 - if (rates[f->format] && rates[f->format] != f->rates) 1786 - goto __out; 1787 - } 1788 - channels[f->format] |= 1 << (f->channels - 1); 1789 - rates[f->format] |= f->rates; 1790 - /* needs knot? */ 1791 - if (f->rates & SNDRV_PCM_RATE_KNOT) 1792 - goto __out; 1793 - } 1794 - /* check whether channels and rates match for all formats */ 1795 - cmaster = rmaster = 0; 1796 - for (i = 0; i < MAX_MASK; i++) { 1797 - if (cmaster != channels[i] && cmaster && channels[i]) 1798 - goto __out; 1799 - if (rmaster != rates[i] && rmaster && rates[i]) 1800 - goto __out; 1801 - if (channels[i]) 1802 - cmaster = channels[i]; 1803 - if (rates[i]) 1804 - rmaster = rates[i]; 1805 - } 1806 - /* check whether channels match for all distinct rates */ 1807 - memset(channels, 0, MAX_MASK * sizeof(u32)); 1808 - list_for_each(p, &subs->fmt_list) { 1809 - struct audioformat *f; 1810 - f = list_entry(p, struct audioformat, list); 1811 - if (f->rates & SNDRV_PCM_RATE_CONTINUOUS) 1749 + it = hw_param_interval(params, SNDRV_PCM_HW_PARAM_PERIOD_TIME); 1750 + hwc_debug("hw_rule_period_time: (%u,%u)\n", it->min, it->max); 1751 + min_datainterval = 0xff; 1752 + list_for_each_entry(fp, &subs->fmt_list, list) { 1753 + if (!hw_check_valid_format(subs, params, fp)) 1812 1754 continue; 1813 - for (i = 0; i < 32; i++) { 1814 - if (f->rates & (1 << i)) 1815 - channels[i] |= 1 << (f->channels - 1); 1816 - } 1755 + min_datainterval = min(min_datainterval, fp->datainterval); 1817 1756 } 1818 - cmaster = 0; 1819 - for (i = 0; i < 32; i++) { 1820 - if (cmaster != channels[i] && cmaster && channels[i]) 1821 - goto __out; 1822 - if (channels[i]) 1823 - cmaster = channels[i]; 1757 + if (min_datainterval == 0xff) { 1758 + hwc_debug(" --> get emtpy\n"); 1759 + it->empty = 1; 1760 + return -EINVAL; 1824 1761 } 1825 - err = 0; 1826 - 1827 - __out: 1828 - kfree(channels); 1829 - kfree(rates); 1830 - return err; 1762 + pmin = 125 * (1 << min_datainterval); 1763 + changed = 0; 1764 + if (it->min < pmin) { 1765 + it->min = pmin; 1766 + it->openmin = 0; 1767 + changed = 1; 1768 + } 1769 + if (snd_interval_checkempty(it)) { 1770 + it->empty = 1; 1771 + return -EINVAL; 1772 + } 1773 + hwc_debug(" --> (%u,%u) (changed = %d)\n", it->min, it->max, changed); 1774 + return changed; 1831 1775 } 1832 1776 1833 1777 /* ··· 1822 1872 static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs) 1823 1873 { 1824 1874 struct list_head *p; 1875 + unsigned int pt, ptmin; 1876 + int param_period_time_if_needed; 1825 1877 int err; 1826 1878 1827 1879 runtime->hw.formats = subs->formats; ··· 1833 1881 runtime->hw.channels_min = 256; 1834 1882 runtime->hw.channels_max = 0; 1835 1883 runtime->hw.rates = 0; 1884 + ptmin = UINT_MAX; 1836 1885 /* check min/max rates and channels */ 1837 1886 list_for_each(p, &subs->fmt_list) { 1838 1887 struct audioformat *fp; ··· 1852 1899 runtime->hw.period_bytes_min = runtime->hw.period_bytes_max = 1853 1900 fp->frame_size; 1854 1901 } 1902 + pt = 125 * (1 << fp->datainterval); 1903 + ptmin = min(ptmin, pt); 1855 1904 } 1856 1905 1857 - /* set the period time minimum 1ms */ 1858 - /* FIXME: high-speed mode allows 125us minimum period, but many parts 1859 - * in the current code assume the 1ms period. 1860 - */ 1906 + param_period_time_if_needed = SNDRV_PCM_HW_PARAM_PERIOD_TIME; 1907 + if (snd_usb_get_speed(subs->dev) != USB_SPEED_HIGH) 1908 + /* full speed devices have fixed data packet interval */ 1909 + ptmin = 1000; 1910 + if (ptmin == 1000) 1911 + /* if period time doesn't go below 1 ms, no rules needed */ 1912 + param_period_time_if_needed = -1; 1861 1913 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1862 - 1000, 1863 - /*(nrpacks * MAX_URBS) * 1000*/ UINT_MAX); 1914 + ptmin, UINT_MAX); 1864 1915 1865 - err = check_hw_params_convention(subs); 1866 - if (err < 0) 1916 + if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1917 + hw_rule_rate, subs, 1918 + SNDRV_PCM_HW_PARAM_FORMAT, 1919 + SNDRV_PCM_HW_PARAM_CHANNELS, 1920 + param_period_time_if_needed, 1921 + -1)) < 0) 1867 1922 return err; 1868 - else if (err) { 1869 - hwc_debug("setting extra hw constraints...\n"); 1870 - if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1871 - hw_rule_rate, subs, 1872 - SNDRV_PCM_HW_PARAM_FORMAT, 1873 - SNDRV_PCM_HW_PARAM_CHANNELS, 1874 - -1)) < 0) 1875 - return err; 1876 - if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 1877 - hw_rule_channels, subs, 1878 - SNDRV_PCM_HW_PARAM_FORMAT, 1879 - SNDRV_PCM_HW_PARAM_RATE, 1880 - -1)) < 0) 1881 - return err; 1882 - if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, 1883 - hw_rule_format, subs, 1884 - SNDRV_PCM_HW_PARAM_RATE, 1885 - SNDRV_PCM_HW_PARAM_CHANNELS, 1886 - -1)) < 0) 1887 - return err; 1888 - if ((err = snd_usb_pcm_check_knot(runtime, subs)) < 0) 1923 + if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 1924 + hw_rule_channels, subs, 1925 + SNDRV_PCM_HW_PARAM_FORMAT, 1926 + SNDRV_PCM_HW_PARAM_RATE, 1927 + param_period_time_if_needed, 1928 + -1)) < 0) 1929 + return err; 1930 + if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, 1931 + hw_rule_format, subs, 1932 + SNDRV_PCM_HW_PARAM_RATE, 1933 + SNDRV_PCM_HW_PARAM_CHANNELS, 1934 + param_period_time_if_needed, 1935 + -1)) < 0) 1936 + return err; 1937 + if (param_period_time_if_needed >= 0) { 1938 + err = snd_pcm_hw_rule_add(runtime, 0, 1939 + SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1940 + hw_rule_period_time, subs, 1941 + SNDRV_PCM_HW_PARAM_FORMAT, 1942 + SNDRV_PCM_HW_PARAM_CHANNELS, 1943 + SNDRV_PCM_HW_PARAM_RATE, 1944 + -1); 1945 + if (err < 0) 1889 1946 return err; 1890 1947 } 1948 + if ((err = snd_usb_pcm_check_knot(runtime, subs)) < 0) 1949 + return err; 1891 1950 return 0; 1892 1951 } 1893 1952 ··· 2112 2147 fp = list_entry(p, struct audioformat, list); 2113 2148 snd_iprintf(buffer, " Interface %d\n", fp->iface); 2114 2149 snd_iprintf(buffer, " Altset %d\n", fp->altsetting); 2115 - snd_iprintf(buffer, " Format: %#x\n", fp->format); 2150 + snd_iprintf(buffer, " Format: %#x (%d bits)\n", 2151 + fp->format, snd_pcm_format_width(fp->format)); 2116 2152 snd_iprintf(buffer, " Channels: %d\n", fp->channels); 2117 2153 snd_iprintf(buffer, " Endpoint: %d %s (%s)\n", 2118 2154 fp->endpoint & USB_ENDPOINT_NUMBER_MASK, ··· 2132 2166 } 2133 2167 snd_iprintf(buffer, "\n"); 2134 2168 } 2169 + if (snd_usb_get_speed(subs->dev) == USB_SPEED_HIGH) 2170 + snd_iprintf(buffer, " Data packet interval: %d us\n", 2171 + 125 * (1 << fp->datainterval)); 2135 2172 // snd_iprintf(buffer, " Max Packet Size = %d\n", fp->maxpacksize); 2136 2173 // snd_iprintf(buffer, " EP Attribute = %#x\n", fp->attributes); 2137 2174 } ··· 2628 2659 return 0; 2629 2660 } 2630 2661 2662 + static unsigned char parse_datainterval(struct snd_usb_audio *chip, 2663 + struct usb_host_interface *alts) 2664 + { 2665 + if (snd_usb_get_speed(chip->dev) == USB_SPEED_HIGH && 2666 + get_endpoint(alts, 0)->bInterval >= 1 && 2667 + get_endpoint(alts, 0)->bInterval <= 4) 2668 + return get_endpoint(alts, 0)->bInterval - 1; 2669 + else 2670 + return 0; 2671 + } 2672 + 2631 2673 static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip, 2632 2674 int iface, int altno); 2633 2675 static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) ··· 2744 2764 fp->altset_idx = i; 2745 2765 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 2746 2766 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 2767 + fp->datainterval = parse_datainterval(chip, alts); 2747 2768 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 2748 2769 if (snd_usb_get_speed(dev) == USB_SPEED_HIGH) 2749 2770 fp->maxpacksize = (((fp->maxpacksize >> 11) & 3) + 1) ··· 2936 2955 return -EINVAL; 2937 2956 } 2938 2957 alts = &iface->altsetting[fp->altset_idx]; 2958 + fp->datainterval = parse_datainterval(chip, alts); 2939 2959 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 2940 2960 usb_set_interface(chip->dev, fp->iface, 0); 2941 2961 init_usb_pitch(chip->dev, fp->iface, alts, fp); ··· 3031 3049 fp->iface = altsd->bInterfaceNumber; 3032 3050 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 3033 3051 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 3052 + fp->datainterval = 0; 3034 3053 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 3035 3054 3036 3055 switch (fp->maxpacksize) { ··· 3099 3116 fp->iface = altsd->bInterfaceNumber; 3100 3117 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 3101 3118 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 3119 + fp->datainterval = parse_datainterval(chip, alts); 3102 3120 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 3103 3121 fp->rate_max = fp->rate_min = combine_triple(&alts->extra[8]); 3104 3122 ··· 3152 3168 fp->iface = altsd->bInterfaceNumber; 3153 3169 fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress; 3154 3170 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes; 3171 + fp->datainterval = parse_datainterval(chip, alts); 3155 3172 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize); 3156 3173 fp->rate_max = fp->rate_min = combine_triple(&alts->extra[15]); 3157 3174