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

Merge tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"Here is a bunch of small fixes that have been collected since the
previous pull request. In addition to various misc fixes, the
following are included:

- HD-audio quirks for Dell, HP, Chromebook, and ALC28x codecs
- HD-audio AMD HDMI regression fix
- Continued PM support/fixes for ice1712 driver
- Multiplatform fixes for ASoC samsung drivers
- Addition of device id tables to a few ASoC drivers
- Bit clock polarity config and error flag fixes in ASoC fsl_sai"

* tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits)
ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb()
ALSA: hda - Make full_reset boolean
ALSA: hda - add headset mic detect quirk for a Dell laptop
sound: dmasound: use module_platform_driver_probe()
ALSA: au1x00: use module_platform_driver()
ALSA: hda - Use runtime helper to check active state.
ALSA: ice1712: Fix boundary checks in PCM pointer ops
ASoC: davinci-mcasp: Fix bit clock polarity settings
ASoC: samsung: Fix build on multiplatform
ASoC: fsl_sai: Fix Bit Clock Polarity configurations
ALSA: hda - Do not assign streams in reverse order
ALSA: hda/realtek - Add eapd shutup to ALC283
ALSA: hda/realtek - Change model name alias for ChromeOS
ASoC: da732x: Print correct major id
ALSA: hda/realtek - Improve HP depop when system change power state on Chromebook
ASoC: cs42l52: Fix mask for REVID
sound/oss: Remove uncompilable DBG macro use
ALSA: ice1712: Save/restore routing and rate registers
ALSA: ice1712: restore AK4xxx volumes on resume
ASoC: alc56(23|32): fix undefined return value of probing code
...

+323 -183
+12 -9
Documentation/devicetree/bindings/sound/fsl,ssi.txt
··· 20 20 have. 21 21 - interrupt-parent: The phandle for the interrupt controller that 22 22 services interrupts for this device. 23 - - fsl,mode: The operating mode for the SSI interface. 24 - "i2s-slave" - I2S mode, SSI is clock slave 25 - "i2s-master" - I2S mode, SSI is clock master 26 - "lj-slave" - left-justified mode, SSI is clock slave 27 - "lj-master" - l.j. mode, SSI is clock master 28 - "rj-slave" - right-justified mode, SSI is clock slave 29 - "rj-master" - r.j., SSI is clock master 30 - "ac97-slave" - AC97 mode, SSI is clock slave 31 - "ac97-master" - AC97 mode, SSI is clock master 32 23 - fsl,playback-dma: Phandle to a node for the DMA channel to use for 33 24 playback of audio. This is typically dictated by SOC 34 25 design. See the notes below. ··· 38 47 be connected together, and SRFS and STFS be connected 39 48 together. This would still allow different sample sizes, 40 49 but not different sample rates. 50 + - clocks: "ipg" - Required clock for the SSI unit 51 + "baud" - Required clock for SSI master mode. Otherwise this 52 + clock is not used 41 53 42 54 Required are also ac97 link bindings if ac97 is used. See 43 55 Documentation/devicetree/bindings/sound/soc-ac97link.txt for the necessary ··· 58 64 Documentation/devicetree/bindings/dma/dma.txt. 59 65 - dma-names: Two dmas have to be defined, "tx" and "rx", if fsl,imx-fiq 60 66 is not defined. 67 + - fsl,mode: The operating mode for the SSI interface. 68 + "i2s-slave" - I2S mode, SSI is clock slave 69 + "i2s-master" - I2S mode, SSI is clock master 70 + "lj-slave" - left-justified mode, SSI is clock slave 71 + "lj-master" - l.j. mode, SSI is clock master 72 + "rj-slave" - right-justified mode, SSI is clock slave 73 + "rj-master" - r.j., SSI is clock master 74 + "ac97-slave" - AC97 mode, SSI is clock slave 75 + "ac97-master" - AC97 mode, SSI is clock master 61 76 62 77 Child 'codec' node required properties: 63 78 - compatible: Compatible list, contains the name of the codec
+1
include/sound/cs8427.h
··· 188 188 189 189 struct snd_pcm_substream; 190 190 191 + int snd_cs8427_init(struct snd_i2c_bus *bus, struct snd_i2c_device *device); 191 192 int snd_cs8427_create(struct snd_i2c_bus *bus, unsigned char addr, 192 193 unsigned int reset_timeout, struct snd_i2c_device **r_cs8427); 193 194 int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
+38 -19
sound/i2c/cs8427.c
··· 150 150 kfree(device->private_data); 151 151 } 152 152 153 - int snd_cs8427_create(struct snd_i2c_bus *bus, 154 - unsigned char addr, 155 - unsigned int reset_timeout, 156 - struct snd_i2c_device **r_cs8427) 153 + int snd_cs8427_init(struct snd_i2c_bus *bus, 154 + struct snd_i2c_device *device) 157 155 { 158 156 static unsigned char initvals1[] = { 159 157 CS8427_REG_CONTROL1 | CS8427_REG_AUTOINC, ··· 198 200 Inhibit E->F transfers. */ 199 201 CS8427_UD | CS8427_EFTUI | CS8427_DETUI, 200 202 }; 203 + struct cs8427 *chip = device->private_data; 201 204 int err; 202 - struct cs8427 *chip; 203 - struct snd_i2c_device *device; 204 205 unsigned char buf[24]; 205 206 206 - if ((err = snd_i2c_device_create(bus, "CS8427", 207 - CS8427_ADDR | (addr & 7), 208 - &device)) < 0) 209 - return err; 210 - chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL); 211 - if (chip == NULL) { 212 - snd_i2c_device_free(device); 213 - return -ENOMEM; 214 - } 215 - device->private_free = snd_cs8427_free; 216 - 217 207 snd_i2c_lock(bus); 218 208 err = snd_cs8427_reg_read(device, CS8427_REG_ID_AND_VER); 219 209 if (err != CS8427_VER8427A) { ··· 250 264 snd_i2c_unlock(bus); 251 265 252 266 /* turn on run bit and rock'n'roll */ 267 + snd_cs8427_reset(device); 268 + 269 + return 0; 270 + 271 + __fail: 272 + snd_i2c_unlock(bus); 273 + 274 + return err; 275 + } 276 + EXPORT_SYMBOL(snd_cs8427_init); 277 + 278 + int snd_cs8427_create(struct snd_i2c_bus *bus, 279 + unsigned char addr, 280 + unsigned int reset_timeout, 281 + struct snd_i2c_device **r_cs8427) 282 + { 283 + int err; 284 + struct cs8427 *chip; 285 + struct snd_i2c_device *device; 286 + 287 + err = snd_i2c_device_create(bus, "CS8427", CS8427_ADDR | (addr & 7), 288 + &device); 289 + if (err < 0) 290 + return err; 291 + chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL); 292 + if (chip == NULL) { 293 + snd_i2c_device_free(device); 294 + return -ENOMEM; 295 + } 296 + device->private_free = snd_cs8427_free; 297 + 253 298 if (reset_timeout < 1) 254 299 reset_timeout = 1; 255 300 chip->reset_timeout = reset_timeout; 256 - snd_cs8427_reset(device); 301 + 302 + err = snd_cs8427_init(bus, device); 303 + if (err) 304 + goto __fail; 257 305 258 306 #if 0 // it's nice for read tests 259 307 { ··· 306 286 return 0; 307 287 308 288 __fail: 309 - snd_i2c_unlock(bus); 310 289 snd_i2c_device_free(device); 311 290 return err < 0 ? err : -EIO; 312 291 }
+1 -12
sound/mips/au1x00.c
··· 725 725 .remove = au1000_ac97_remove, 726 726 }; 727 727 728 - static int __init au1000_ac97_load(void) 729 - { 730 - return platform_driver_register(&au1000_ac97c_driver); 731 - } 732 - 733 - static void __exit au1000_ac97_unload(void) 734 - { 735 - platform_driver_unregister(&au1000_ac97c_driver); 736 - } 737 - 738 - module_init(au1000_ac97_load); 739 - module_exit(au1000_ac97_unload); 728 + module_platform_driver(au1000_ac97c_driver);
-4
sound/oss/ad1848.c
··· 50 50 #include <linux/pnp.h> 51 51 #include <linux/spinlock.h> 52 52 53 - #define DEB(x) 54 - #define DEB1(x) 55 53 #include "sound_config.h" 56 54 57 55 #include "ad1848.h" ··· 1013 1015 unsigned long flags; 1014 1016 ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; 1015 1017 ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; 1016 - 1017 - DEB(printk("ad1848_close(void)\n")); 1018 1018 1019 1019 devc->intr_active = 0; 1020 1020 ad1848_halt(dev);
+1 -13
sound/oss/dmasound/dmasound_paula.c
··· 733 733 }, 734 734 }; 735 735 736 - static int __init amiga_audio_init(void) 737 - { 738 - return platform_driver_probe(&amiga_audio_driver, amiga_audio_probe); 739 - } 740 - 741 - module_init(amiga_audio_init); 742 - 743 - static void __exit amiga_audio_exit(void) 744 - { 745 - platform_driver_unregister(&amiga_audio_driver); 746 - } 747 - 748 - module_exit(amiga_audio_exit); 736 + module_platform_driver_probe(amiga_audio_driver, amiga_audio_probe); 749 737 750 738 MODULE_LICENSE("GPL"); 751 739 MODULE_ALIAS("platform:amiga-audio");
-3
sound/oss/opl3.c
··· 275 275 devc->v_alloc->map[voice] = 0; 276 276 277 277 map = &pv_map[devc->lv_map[voice]]; 278 - DEB(printk("Kill note %d\n", voice)); 279 278 280 279 if (map->voice_mode == 0) 281 280 return 0; ··· 871 872 return; 872 873 873 874 map = &pv_map[devc->lv_map[voice]]; 874 - 875 - DEB(printk("Aftertouch %d\n", voice)); 876 875 877 876 if (map->voice_mode == 0) 878 877 return;
-9
sound/oss/pas2_mixer.c
··· 21 21 22 22 #include "pas2.h" 23 23 24 - #ifndef DEB 25 - #define DEB(what) /* (what) */ 26 - #endif 27 - 28 24 extern int pas_translate_code; 29 25 extern char pas_model; 30 26 extern int *pas_osp; ··· 116 120 { 117 121 int left, right, devmask, changed, i, mixer = 0; 118 122 119 - DEB(printk("static int pas_mixer_set(int whichDev = %d, unsigned int level = %X)\n", whichDev, level)); 120 - 121 123 left = level & 0x7f; 122 124 right = (level & 0x7f00) >> 8; 123 125 ··· 201 207 { 202 208 int foo; 203 209 204 - DEB(printk("pas2_mixer.c: void pas_mixer_reset(void)\n")); 205 - 206 210 for (foo = 0; foo < SOUND_MIXER_NRDEVICES; foo++) 207 211 pas_mixer_set(foo, levels[foo]); 208 212 ··· 212 220 int level,v ; 213 221 int __user *p = (int __user *)arg; 214 222 215 - DEB(printk("pas2_mixer.c: int pas_mixer_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg)); 216 223 if (cmd == SOUND_MIXER_PRIVATE1) { /* Set loudness bit */ 217 224 if (get_user(level, p)) 218 225 return -EFAULT;
-18
sound/oss/pas2_pcm.c
··· 22 22 23 23 #include "pas2.h" 24 24 25 - #ifndef DEB 26 - #define DEB(WHAT) 27 - #endif 28 - 29 25 #define PAS_PCM_INTRBITS (0x08) 30 26 /* 31 27 * Sample buffer timer interrupt enable ··· 152 156 int val, ret; 153 157 int __user *p = arg; 154 158 155 - DEB(printk("pas2_pcm.c: static int pas_audio_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg)); 156 - 157 159 switch (cmd) 158 160 { 159 161 case SOUND_PCM_WRITE_RATE: ··· 198 204 199 205 static void pas_audio_reset(int dev) 200 206 { 201 - DEB(printk("pas2_pcm.c: static void pas_audio_reset(void)\n")); 202 - 203 207 pas_write(pas_read(0xF8A) & ~0x40, 0xF8A); /* Disable PCM */ 204 208 } 205 209 ··· 205 213 { 206 214 int err; 207 215 unsigned long flags; 208 - 209 - DEB(printk("pas2_pcm.c: static int pas_audio_open(int mode = %X)\n", mode)); 210 216 211 217 spin_lock_irqsave(&pas_lock, flags); 212 218 if (pcm_busy) ··· 229 239 { 230 240 unsigned long flags; 231 241 232 - DEB(printk("pas2_pcm.c: static void pas_audio_close(void)\n")); 233 - 234 242 spin_lock_irqsave(&pas_lock, flags); 235 243 236 244 pas_audio_reset(dev); ··· 243 255 int intrflag) 244 256 { 245 257 unsigned long flags, cnt; 246 - 247 - DEB(printk("pas2_pcm.c: static void pas_audio_output_block(char *buf = %P, int count = %X)\n", buf, count)); 248 258 249 259 cnt = count; 250 260 if (audio_devs[dev]->dmap_out->dma > 3) ··· 288 302 { 289 303 unsigned long flags; 290 304 int cnt; 291 - 292 - DEB(printk("pas2_pcm.c: static void pas_audio_start_input(char *buf = %P, int count = %X)\n", buf, count)); 293 305 294 306 cnt = count; 295 307 if (audio_devs[dev]->dmap_out->dma > 3) ··· 372 388 373 389 void __init pas_pcm_init(struct address_info *hw_config) 374 390 { 375 - DEB(printk("pas2_pcm.c: long pas_pcm_init()\n")); 376 - 377 391 pcm_bitsok = 8; 378 392 if (pas_read(0xEF8B) & 0x08) 379 393 pcm_bitsok |= 16;
-4
sound/oss/sb_common.c
··· 226 226 { 227 227 int loopc; 228 228 229 - DEB(printk("Entered sb_dsp_reset()\n")); 230 - 231 229 if (devc->model == MDL_ESS) return ess_dsp_reset (devc); 232 230 233 231 /* This is only for non-ESS chips */ ··· 243 245 DDB(printk("sb: No response to RESET\n")); 244 246 return 0; /* Sorry */ 245 247 } 246 - 247 - DEB(printk("sb_dsp_reset() OK\n")); 248 248 249 249 return 1; 250 250 }
-4
sound/oss/sb_ess.c
··· 865 865 ess_show_mixerregs (devc); 866 866 #endif 867 867 868 - DEB(printk("Entered ess_dsp_reset()\n")); 869 - 870 868 outb(3, DSP_RESET); /* Reset FIFO too */ 871 869 872 870 udelay(10); ··· 878 880 return 0; /* Sorry */ 879 881 } 880 882 ess_extended (devc); 881 - 882 - DEB(printk("sb_dsp_reset() OK\n")); 883 883 884 884 #ifdef FKS_LOGGING 885 885 printk(KERN_INFO "FKS: dsp_reset 2\n");
-6
sound/oss/sequencer.c
··· 216 216 217 217 dev = dev >> 4; 218 218 219 - DEB(printk("sequencer_write(dev=%d, count=%d)\n", dev, count)); 220 - 221 219 if (mode == OPEN_READ) 222 220 return -EIO; 223 221 ··· 957 959 dev = dev >> 4; 958 960 mode = translate_mode(file); 959 961 960 - DEB(printk("sequencer_open(dev=%d)\n", dev)); 961 - 962 962 if (!sequencer_ok) 963 963 { 964 964 /* printk("Sound card: sequencer not initialized\n");*/ ··· 1128 1132 int mode = translate_mode(file); 1129 1133 1130 1134 dev = dev >> 4; 1131 - 1132 - DEB(printk("sequencer_release(dev=%d)\n", dev)); 1133 1135 1134 1136 /* 1135 1137 * Wait until the queue is empty (if we don't have nonblock)
-4
sound/oss/sound_config.h
··· 123 123 #include "sound_calls.h" 124 124 #include "dev_table.h" 125 125 126 - #ifndef DEB 127 - #define DEB(x) 128 - #endif 129 - 130 126 #ifndef DDB 131 127 #define DDB(x) do {} while (0) 132 128 #endif
-6
sound/oss/soundcard.c
··· 154 154 155 155 mutex_lock(&soundcard_mutex); 156 156 157 - DEB(printk("sound_read(dev=%d, count=%d)\n", dev, count)); 158 157 switch (dev & 0x0f) { 159 158 case SND_DEV_DSP: 160 159 case SND_DEV_DSP16: ··· 179 180 int ret = -EINVAL; 180 181 181 182 mutex_lock(&soundcard_mutex); 182 - DEB(printk("sound_write(dev=%d, count=%d)\n", dev, count)); 183 183 switch (dev & 0x0f) { 184 184 case SND_DEV_SEQ: 185 185 case SND_DEV_SEQ2: ··· 204 206 int dev = iminor(inode); 205 207 int retval; 206 208 207 - DEB(printk("sound_open(dev=%d)\n", dev)); 208 209 if ((dev >= SND_NDEVS) || (dev < 0)) { 209 210 printk(KERN_ERR "Invalid minor device %d\n", dev); 210 211 return -ENXIO; ··· 254 257 int dev = iminor(inode); 255 258 256 259 mutex_lock(&soundcard_mutex); 257 - DEB(printk("sound_release(dev=%d)\n", dev)); 258 260 switch (dev & 0x0f) { 259 261 case SND_DEV_CTL: 260 262 module_put(mixer_devs[dev >> 4]->owner); ··· 347 351 if (!access_ok(VERIFY_WRITE, p, len)) 348 352 return -EFAULT; 349 353 } 350 - DEB(printk("sound_ioctl(dev=%d, cmd=0x%x, arg=0x%x)\n", dev, cmd, arg)); 351 354 if (cmd == OSS_GETVERSION) 352 355 return __put_user(SOUND_VERSION, (int __user *)p); 353 356 ··· 404 409 struct inode *inode = file_inode(file); 405 410 int dev = iminor(inode); 406 411 407 - DEB(printk("sound_poll(dev=%d)\n", dev)); 408 412 switch (dev & 0x0f) { 409 413 case SND_DEV_SEQ: 410 414 case SND_DEV_SEQ2:
+2 -9
sound/oss/uart401.c
··· 274 274 } 275 275 } 276 276 277 - 277 + /* Flush input before enabling interrupts */ 278 278 if (ok) 279 - { 280 - DEB(printk("Reset UART401 OK\n")); 281 - } 279 + uart401_input_loop(devc); 282 280 else 283 281 DDB(printk("Reset UART401 failed - No hardware detected.\n")); 284 - 285 - if (ok) 286 - uart401_input_loop(devc); /* 287 - * Flush input before enabling interrupts 288 - */ 289 282 290 283 return ok; 291 284 }
+10 -9
sound/pci/hda/hda_controller.c
··· 187 187 struct azx_dev *azx_dev = &chip->azx_dev[dev]; 188 188 dsp_lock(azx_dev); 189 189 if (!azx_dev->opened && !dsp_is_locked(azx_dev)) { 190 - res = azx_dev; 191 - if (res->assigned_key == key) { 192 - res->opened = 1; 193 - res->assigned_key = key; 190 + if (azx_dev->assigned_key == key) { 191 + azx_dev->opened = 1; 192 + azx_dev->assigned_key = key; 194 193 dsp_unlock(azx_dev); 195 194 return azx_dev; 196 195 } 196 + if (!res) 197 + res = azx_dev; 197 198 } 198 199 dsp_unlock(azx_dev); 199 200 } ··· 1605 1604 } 1606 1605 1607 1606 /* reset codec link */ 1608 - static int azx_reset(struct azx *chip, int full_reset) 1607 + static int azx_reset(struct azx *chip, bool full_reset) 1609 1608 { 1610 1609 if (!full_reset) 1611 1610 goto __skip; ··· 1702 1701 /* 1703 1702 * reset and start the controller registers 1704 1703 */ 1705 - void azx_init_chip(struct azx *chip, int full_reset) 1704 + void azx_init_chip(struct azx *chip, bool full_reset) 1706 1705 { 1707 1706 if (chip->initialized) 1708 1707 return; ··· 1759 1758 1760 1759 #ifdef CONFIG_PM_RUNTIME 1761 1760 if (chip->driver_caps & AZX_DCAPS_PM_RUNTIME) 1762 - if (chip->card->dev->power.runtime_status != RPM_ACTIVE) 1761 + if (!pm_runtime_active(chip->card->dev)) 1763 1762 return IRQ_NONE; 1764 1763 #endif 1765 1764 ··· 1842 1841 1843 1842 bus->in_reset = 1; 1844 1843 azx_stop_chip(chip); 1845 - azx_init_chip(chip, 1); 1844 + azx_init_chip(chip, true); 1846 1845 #ifdef CONFIG_PM 1847 1846 if (chip->initialized) { 1848 1847 struct azx_pcm *p; ··· 1949 1948 * get back to the sanity state. 1950 1949 */ 1951 1950 azx_stop_chip(chip); 1952 - azx_init_chip(chip, 1); 1951 + azx_init_chip(chip, true); 1953 1952 } 1954 1953 } 1955 1954 }
+1 -1
sound/pci/hda/hda_controller.h
··· 37 37 void azx_free_stream_pages(struct azx *chip); 38 38 39 39 /* Low level azx interface */ 40 - void azx_init_chip(struct azx *chip, int full_reset); 40 + void azx_init_chip(struct azx *chip, bool full_reset); 41 41 void azx_stop_chip(struct azx *chip); 42 42 void azx_enter_link_reset(struct azx *chip); 43 43 irqreturn_t azx_interrupt(int irq, void *dev_id);
+2 -2
sound/pci/hda/hda_intel.c
··· 636 636 return -EIO; 637 637 azx_init_pci(chip); 638 638 639 - azx_init_chip(chip, 1); 639 + azx_init_chip(chip, true); 640 640 641 641 snd_hda_resume(chip->bus); 642 642 snd_power_change_state(card, SNDRV_CTL_POWER_D0); ··· 689 689 status = azx_readw(chip, STATESTS); 690 690 691 691 azx_init_pci(chip); 692 - azx_init_chip(chip, 1); 692 + azx_init_chip(chip, true); 693 693 694 694 bus = chip->bus; 695 695 if (status && bus) {
+20 -3
sound/pci/hda/patch_realtek.c
··· 3026 3026 bool hp_pin_sense; 3027 3027 int val; 3028 3028 3029 + if (!spec->gen.autocfg.hp_outs) { 3030 + if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) 3031 + hp_pin = spec->gen.autocfg.line_out_pins[0]; 3032 + } 3033 + 3029 3034 alc283_restore_default_value(codec); 3030 3035 3031 3036 if (!hp_pin) ··· 3067 3062 bool hp_pin_sense; 3068 3063 int val; 3069 3064 3065 + if (!spec->gen.autocfg.hp_outs) { 3066 + if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) 3067 + hp_pin = spec->gen.autocfg.line_out_pins[0]; 3068 + } 3069 + 3070 3070 if (!hp_pin) { 3071 3071 alc269_shutup(codec); 3072 3072 return; ··· 3095 3085 3096 3086 if (hp_pin_sense) 3097 3087 msleep(100); 3088 + alc_auto_setup_eapd(codec, false); 3098 3089 snd_hda_shutup_pins(codec); 3099 3090 alc_write_coef_idx(codec, 0x43, 0x9614); 3100 3091 } ··· 3372 3361 3373 3362 if (spec->mute_led_polarity) 3374 3363 enabled = !enabled; 3375 - pinval = AC_PINCTL_IN_EN | 3376 - (enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80); 3364 + pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); 3365 + pinval &= ~AC_PINCTL_VREFEN; 3366 + pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; 3377 3367 if (spec->mute_led_nid) 3378 3368 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); 3379 3369 } ··· 4006 3994 spec->gen.mixer_nid = 0; 4007 3995 break; 4008 3996 case HDA_FIXUP_ACT_INIT: 3997 + /* MIC2-VREF control */ 3998 + /* Set to manual mode */ 3999 + val = alc_read_coef_idx(codec, 0x06); 4000 + alc_write_coef_idx(codec, 0x06, val & ~0x000c); 4009 4001 /* Enable Line1 input control by verb */ 4010 4002 val = alc_read_coef_idx(codec, 0x1a); 4011 4003 alc_write_coef_idx(codec, 0x1a, val | (1 << 4)); ··· 4618 4602 SND_PCI_QUIRK(0x1028, 0x0658, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4619 4603 SND_PCI_QUIRK(0x1028, 0x065f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4620 4604 SND_PCI_QUIRK(0x1028, 0x0662, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4605 + SND_PCI_QUIRK(0x1028, 0x0667, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4621 4606 SND_PCI_QUIRK(0x1028, 0x0668, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), 4622 4607 SND_PCI_QUIRK(0x1028, 0x0669, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE), 4623 4608 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), ··· 4785 4768 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 4786 4769 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 4787 4770 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, 4788 - {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-chrome"}, 4771 + {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, 4789 4772 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, 4790 4773 {} 4791 4774 };
+28 -3
sound/pci/ice1712/delta.c
··· 579 579 #ifdef CONFIG_PM_SLEEP 580 580 static int snd_ice1712_delta_resume(struct snd_ice1712 *ice) 581 581 { 582 - unsigned char akm_backup[AK4XXX_IMAGE_SIZE]; 582 + unsigned char akm_img_bak[AK4XXX_IMAGE_SIZE]; 583 + unsigned char akm_vol_bak[AK4XXX_IMAGE_SIZE]; 584 + 585 + /* init spdif */ 586 + switch (ice->eeprom.subvendor) { 587 + case ICE1712_SUBDEVICE_AUDIOPHILE: 588 + case ICE1712_SUBDEVICE_DELTA410: 589 + case ICE1712_SUBDEVICE_DELTA1010E: 590 + case ICE1712_SUBDEVICE_DELTA1010LT: 591 + case ICE1712_SUBDEVICE_VX442: 592 + case ICE1712_SUBDEVICE_DELTA66E: 593 + snd_cs8427_init(ice->i2c, ice->cs8427); 594 + break; 595 + case ICE1712_SUBDEVICE_DELTA1010: 596 + case ICE1712_SUBDEVICE_MEDIASTATION: 597 + /* nothing */ 598 + break; 599 + case ICE1712_SUBDEVICE_DELTADIO2496: 600 + case ICE1712_SUBDEVICE_DELTA66: 601 + /* Set spdif defaults */ 602 + snd_ice1712_delta_cs8403_spdif_write(ice, ice->spdif.cs8403_bits); 603 + break; 604 + } 605 + 583 606 /* init codec and restore registers */ 584 607 if (ice->akm_codecs) { 585 - memcpy(akm_backup, ice->akm->images, sizeof(akm_backup)); 608 + memcpy(akm_img_bak, ice->akm->images, sizeof(akm_img_bak)); 609 + memcpy(akm_vol_bak, ice->akm->volumes, sizeof(akm_vol_bak)); 586 610 snd_akm4xxx_init(ice->akm); 587 - memcpy(ice->akm->images, akm_backup, sizeof(akm_backup)); 611 + memcpy(ice->akm->images, akm_img_bak, sizeof(akm_img_bak)); 612 + memcpy(ice->akm->volumes, akm_vol_bak, sizeof(akm_vol_bak)); 588 613 snd_akm4xxx_reset(ice->akm, 0); 589 614 } 590 615
+42 -5
sound/pci/ice1712/ice1712.c
··· 685 685 if (!(snd_ice1712_read(ice, ICE1712_IREG_PBK_CTRL) & 1)) 686 686 return 0; 687 687 ptr = runtime->buffer_size - inw(ice->ddma_port + 4); 688 + ptr = bytes_to_frames(substream->runtime, ptr); 688 689 if (ptr == runtime->buffer_size) 689 690 ptr = 0; 690 - return bytes_to_frames(substream->runtime, ptr); 691 + return ptr; 691 692 } 692 693 693 694 static snd_pcm_uframes_t snd_ice1712_playback_ds_pointer(struct snd_pcm_substream *substream) ··· 705 704 addr = ICE1712_DSC_ADDR0; 706 705 ptr = snd_ice1712_ds_read(ice, substream->number * 2, addr) - 707 706 ice->playback_con_virt_addr[substream->number]; 707 + ptr = bytes_to_frames(substream->runtime, ptr); 708 708 if (ptr == substream->runtime->buffer_size) 709 709 ptr = 0; 710 - return bytes_to_frames(substream->runtime, ptr); 710 + return ptr; 711 711 } 712 712 713 713 static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *substream) ··· 719 717 if (!(snd_ice1712_read(ice, ICE1712_IREG_CAP_CTRL) & 1)) 720 718 return 0; 721 719 ptr = inl(ICEREG(ice, CONCAP_ADDR)) - ice->capture_con_virt_addr; 720 + ptr = bytes_to_frames(substream->runtime, ptr); 722 721 if (ptr == substream->runtime->buffer_size) 723 722 ptr = 0; 724 - return bytes_to_frames(substream->runtime, ptr); 723 + return ptr; 725 724 } 726 725 727 726 static const struct snd_pcm_hardware snd_ice1712_playback = { ··· 1051 1048 old = inb(ICEMT(ice, RATE)); 1052 1049 if (!force && old == val) 1053 1050 goto __out; 1051 + 1052 + ice->cur_rate = rate; 1054 1053 outb(val, ICEMT(ice, RATE)); 1055 1054 spin_unlock_irqrestore(&ice->reg_lock, flags); 1056 1055 ··· 1119 1114 if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_PLAYBACK_START)) 1120 1115 return 0; 1121 1116 ptr = ice->playback_pro_size - (inw(ICEMT(ice, PLAYBACK_SIZE)) << 2); 1117 + ptr = bytes_to_frames(substream->runtime, ptr); 1122 1118 if (ptr == substream->runtime->buffer_size) 1123 1119 ptr = 0; 1124 - return bytes_to_frames(substream->runtime, ptr); 1120 + return ptr; 1125 1121 } 1126 1122 1127 1123 static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substream *substream) ··· 1133 1127 if (!(inl(ICEMT(ice, PLAYBACK_CONTROL)) & ICE1712_CAPTURE_START_SHADOW)) 1134 1128 return 0; 1135 1129 ptr = ice->capture_pro_size - (inw(ICEMT(ice, CAPTURE_SIZE)) << 2); 1130 + ptr = bytes_to_frames(substream->runtime, ptr); 1136 1131 if (ptr == substream->runtime->buffer_size) 1137 1132 ptr = 0; 1138 - return bytes_to_frames(substream->runtime, ptr); 1133 + return ptr; 1139 1134 } 1140 1135 1141 1136 static const struct snd_pcm_hardware snd_ice1712_playback_pro = { ··· 2839 2832 snd_pcm_suspend_all(ice->pcm_ds); 2840 2833 snd_ac97_suspend(ice->ac97); 2841 2834 2835 + spin_lock_irq(&ice->reg_lock); 2836 + ice->pm_saved_is_spdif_master = is_spdif_master(ice); 2837 + ice->pm_saved_spdif_ctrl = inw(ICEMT(ice, ROUTE_SPDOUT)); 2838 + ice->pm_saved_route = inw(ICEMT(ice, ROUTE_PSDOUT03)); 2839 + spin_unlock_irq(&ice->reg_lock); 2840 + 2842 2841 if (ice->pm_suspend) 2843 2842 ice->pm_suspend(ice); 2844 2843 ··· 2859 2846 struct pci_dev *pci = to_pci_dev(dev); 2860 2847 struct snd_card *card = dev_get_drvdata(dev); 2861 2848 struct snd_ice1712 *ice = card->private_data; 2849 + int rate; 2862 2850 2863 2851 if (!ice->pm_suspend_enabled) 2864 2852 return 0; ··· 2874 2860 2875 2861 pci_set_master(pci); 2876 2862 2863 + if (ice->cur_rate) 2864 + rate = ice->cur_rate; 2865 + else 2866 + rate = PRO_RATE_DEFAULT; 2867 + 2877 2868 if (snd_ice1712_chip_init(ice) < 0) { 2878 2869 snd_card_disconnect(card); 2879 2870 return -EIO; 2880 2871 } 2881 2872 2873 + ice->cur_rate = rate; 2874 + 2882 2875 if (ice->pm_resume) 2883 2876 ice->pm_resume(ice); 2877 + 2878 + if (ice->pm_saved_is_spdif_master) { 2879 + /* switching to external clock via SPDIF */ 2880 + spin_lock_irq(&ice->reg_lock); 2881 + outb(inb(ICEMT(ice, RATE)) | ICE1712_SPDIF_MASTER, 2882 + ICEMT(ice, RATE)); 2883 + spin_unlock_irq(&ice->reg_lock); 2884 + snd_ice1712_set_input_clock_source(ice, 1); 2885 + } else { 2886 + /* internal on-card clock */ 2887 + snd_ice1712_set_pro_rate(ice, rate, 1); 2888 + snd_ice1712_set_input_clock_source(ice, 0); 2889 + } 2890 + 2891 + outw(ice->pm_saved_spdif_ctrl, ICEMT(ice, ROUTE_SPDOUT)); 2892 + outw(ice->pm_saved_route, ICEMT(ice, ROUTE_PSDOUT03)); 2884 2893 2885 2894 if (ice->ac97) 2886 2895 snd_ac97_resume(ice->ac97);
+1 -2
sound/soc/codecs/alc5623.c
··· 902 902 { 903 903 struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); 904 904 struct snd_soc_dapm_context *dapm = &codec->dapm; 905 - int ret; 906 905 907 906 alc5623_reset(codec); 908 907 ··· 960 961 return -EINVAL; 961 962 } 962 963 963 - return ret; 964 + return 0; 964 965 } 965 966 966 967 /* power down chip */
+8 -2
sound/soc/codecs/alc5632.c
··· 1061 1061 static int alc5632_probe(struct snd_soc_codec *codec) 1062 1062 { 1063 1063 struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); 1064 - int ret; 1065 1064 1066 1065 /* power on device */ 1067 1066 alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY); ··· 1074 1075 return -EINVAL; 1075 1076 } 1076 1077 1077 - return ret; 1078 + return 0; 1078 1079 } 1079 1080 1080 1081 /* power down chip */ ··· 1190 1191 }; 1191 1192 MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table); 1192 1193 1194 + static const struct of_device_id alc5632_of_match[] = { 1195 + { .compatible = "realtek,alc5632", }, 1196 + { } 1197 + }; 1198 + MODULE_DEVICE_TABLE(of, alc5632_of_match); 1199 + 1193 1200 /* i2c codec control layer */ 1194 1201 static struct i2c_driver alc5632_i2c_driver = { 1195 1202 .driver = { 1196 1203 .name = "alc5632", 1197 1204 .owner = THIS_MODULE, 1205 + .of_match_table = of_match_ptr(alc5632_of_match), 1198 1206 }, 1199 1207 .probe = alc5632_i2c_probe, 1200 1208 .remove = alc5632_i2c_remove,
+1 -1
sound/soc/codecs/cs42l52.c
··· 1259 1259 } 1260 1260 1261 1261 dev_info(&i2c_client->dev, "Cirrus Logic CS42L52, Revision: %02X\n", 1262 - reg & 0xFF); 1262 + reg & CS42L52_CHIP_REV_MASK); 1263 1263 1264 1264 /* Set Platform Data */ 1265 1265 if (cs42l52->pdata.mica_diff_cfg)
+1 -1
sound/soc/codecs/cs42l52.h
··· 37 37 #define CS42L52_CHIP_REV_A0 0x00 38 38 #define CS42L52_CHIP_REV_A1 0x01 39 39 #define CS42L52_CHIP_REV_B0 0x02 40 - #define CS42L52_CHIP_REV_MASK 0x03 40 + #define CS42L52_CHIP_REV_MASK 0x07 41 41 42 42 #define CS42L52_PWRCTL1 0x02 43 43 #define CS42L52_PWRCTL1_PDN_ALL 0x9F
+5 -6
sound/soc/codecs/cs42xx8.c
··· 495 495 regcache_cache_bypass(cs42xx8->regmap, true); 496 496 497 497 /* Validate the chip ID */ 498 - regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); 499 - if (val < 0) { 500 - dev_err(dev, "failed to get device ID: %x", val); 501 - ret = -EINVAL; 498 + ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); 499 + if (ret < 0) { 500 + dev_err(dev, "failed to get device ID, ret = %d", ret); 502 501 goto err_enable; 503 502 } 504 503 505 504 /* The top four bits of the chip ID should be 0000 */ 506 - if ((val & CS42XX8_CHIPID_CHIP_ID_MASK) != 0x00) { 505 + if (((val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4) != 0x00) { 507 506 dev_err(dev, "unmatched chip ID: %d\n", 508 - val & CS42XX8_CHIPID_CHIP_ID_MASK); 507 + (val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4); 509 508 ret = -EINVAL; 510 509 goto err_enable; 511 510 }
+2 -1
sound/soc/codecs/da732x.c
··· 1571 1571 } 1572 1572 1573 1573 dev_info(&i2c->dev, "Revision: %d.%d\n", 1574 - (reg & DA732X_ID_MAJOR_MASK), (reg & DA732X_ID_MINOR_MASK)); 1574 + (reg & DA732X_ID_MAJOR_MASK) >> 4, 1575 + (reg & DA732X_ID_MINOR_MASK)); 1575 1576 1576 1577 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_da732x, 1577 1578 da732x_dai, ARRAY_SIZE(da732x_dai));
+7
sound/soc/codecs/max98090.c
··· 2399 2399 }; 2400 2400 MODULE_DEVICE_TABLE(i2c, max98090_i2c_id); 2401 2401 2402 + static const struct of_device_id max98090_of_match[] = { 2403 + { .compatible = "maxim,max98090", }, 2404 + { } 2405 + }; 2406 + MODULE_DEVICE_TABLE(of, max98090_of_match); 2407 + 2402 2408 static struct i2c_driver max98090_i2c_driver = { 2403 2409 .driver = { 2404 2410 .name = "max98090", 2405 2411 .owner = THIS_MODULE, 2406 2412 .pm = &max98090_pm, 2413 + .of_match_table = of_match_ptr(max98090_of_match), 2407 2414 }, 2408 2415 .probe = max98090_i2c_probe, 2409 2416 .remove = max98090_i2c_remove,
+9
sound/soc/codecs/rt5640.c
··· 2074 2074 }; 2075 2075 MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); 2076 2076 2077 + #if defined(CONFIG_OF) 2078 + static const struct of_device_id rt5640_of_match[] = { 2079 + { .compatible = "realtek,rt5640", }, 2080 + {}, 2081 + }; 2082 + MODULE_DEVICE_TABLE(of, rt5640_of_match); 2083 + #endif 2084 + 2077 2085 #ifdef CONFIG_ACPI 2078 2086 static struct acpi_device_id rt5640_acpi_match[] = { 2079 2087 { "INT33CA", 0 }, ··· 2211 2203 .name = "rt5640", 2212 2204 .owner = THIS_MODULE, 2213 2205 .acpi_match_table = ACPI_PTR(rt5640_acpi_match), 2206 + .of_match_table = of_match_ptr(rt5640_of_match), 2214 2207 }, 2215 2208 .probe = rt5640_i2c_probe, 2216 2209 .remove = rt5640_i2c_remove,
+7
sound/soc/codecs/tlv320aic23-i2c.c
··· 43 43 44 44 MODULE_DEVICE_TABLE(i2c, tlv320aic23_id); 45 45 46 + static const struct of_device_id tlv320aic23_of_match[] = { 47 + { .compatible = "ti,tlv320aic23", }, 48 + { } 49 + }; 50 + MODULE_DEVICE_TABLE(of, tlv320aic23_of_match); 51 + 46 52 static struct i2c_driver tlv320aic23_i2c_driver = { 47 53 .driver = { 48 54 .name = "tlv320aic23-codec", 55 + .of_match_table = of_match_ptr(tlv320aic23_of_match), 49 56 }, 50 57 .probe = tlv320aic23_i2c_probe, 51 58 .remove = __exit_p(tlv320aic23_i2c_remove),
+3 -3
sound/soc/davinci/davinci-mcasp.c
··· 336 336 mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); 337 337 mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); 338 338 339 - mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); 339 + mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); 340 340 mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); 341 341 break; 342 342 ··· 344 344 mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); 345 345 mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); 346 346 347 - mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); 347 + mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); 348 348 mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); 349 349 break; 350 350 ··· 352 352 mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); 353 353 mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); 354 354 355 - mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); 355 + mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); 356 356 mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); 357 357 break; 358 358
+86 -7
sound/soc/fsl/fsl_sai.c
··· 23 23 24 24 #include "fsl_sai.h" 25 25 26 + #define FSL_SAI_FLAGS (FSL_SAI_CSR_SEIE |\ 27 + FSL_SAI_CSR_FEIE) 28 + 29 + static irqreturn_t fsl_sai_isr(int irq, void *devid) 30 + { 31 + struct fsl_sai *sai = (struct fsl_sai *)devid; 32 + struct device *dev = &sai->pdev->dev; 33 + u32 xcsr, mask; 34 + 35 + /* Only handle those what we enabled */ 36 + mask = (FSL_SAI_FLAGS >> FSL_SAI_CSR_xIE_SHIFT) << FSL_SAI_CSR_xF_SHIFT; 37 + 38 + /* Tx IRQ */ 39 + regmap_read(sai->regmap, FSL_SAI_TCSR, &xcsr); 40 + xcsr &= mask; 41 + 42 + if (xcsr & FSL_SAI_CSR_WSF) 43 + dev_dbg(dev, "isr: Start of Tx word detected\n"); 44 + 45 + if (xcsr & FSL_SAI_CSR_SEF) 46 + dev_warn(dev, "isr: Tx Frame sync error detected\n"); 47 + 48 + if (xcsr & FSL_SAI_CSR_FEF) { 49 + dev_warn(dev, "isr: Transmit underrun detected\n"); 50 + /* FIFO reset for safety */ 51 + xcsr |= FSL_SAI_CSR_FR; 52 + } 53 + 54 + if (xcsr & FSL_SAI_CSR_FWF) 55 + dev_dbg(dev, "isr: Enabled transmit FIFO is empty\n"); 56 + 57 + if (xcsr & FSL_SAI_CSR_FRF) 58 + dev_dbg(dev, "isr: Transmit FIFO watermark has been reached\n"); 59 + 60 + regmap_update_bits(sai->regmap, FSL_SAI_TCSR, 61 + FSL_SAI_CSR_xF_W_MASK | FSL_SAI_CSR_FR, xcsr); 62 + 63 + /* Rx IRQ */ 64 + regmap_read(sai->regmap, FSL_SAI_RCSR, &xcsr); 65 + xcsr &= mask; 66 + 67 + if (xcsr & FSL_SAI_CSR_WSF) 68 + dev_dbg(dev, "isr: Start of Rx word detected\n"); 69 + 70 + if (xcsr & FSL_SAI_CSR_SEF) 71 + dev_warn(dev, "isr: Rx Frame sync error detected\n"); 72 + 73 + if (xcsr & FSL_SAI_CSR_FEF) { 74 + dev_warn(dev, "isr: Receive overflow detected\n"); 75 + /* FIFO reset for safety */ 76 + xcsr |= FSL_SAI_CSR_FR; 77 + } 78 + 79 + if (xcsr & FSL_SAI_CSR_FWF) 80 + dev_dbg(dev, "isr: Enabled receive FIFO is full\n"); 81 + 82 + if (xcsr & FSL_SAI_CSR_FRF) 83 + dev_dbg(dev, "isr: Receive FIFO watermark has been reached\n"); 84 + 85 + regmap_update_bits(sai->regmap, FSL_SAI_RCSR, 86 + FSL_SAI_CSR_xF_W_MASK | FSL_SAI_CSR_FR, xcsr); 87 + 88 + return IRQ_HANDLED; 89 + } 90 + 26 91 static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, 27 92 int clk_id, unsigned int freq, int fsl_dir) 28 93 { ··· 179 114 * that is, together with the last bit of the previous 180 115 * data word. 181 116 */ 182 - val_cr2 &= ~FSL_SAI_CR2_BCP; 117 + val_cr2 |= FSL_SAI_CR2_BCP; 183 118 val_cr4 |= FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP; 184 119 break; 185 120 case SND_SOC_DAIFMT_LEFT_J: ··· 187 122 * Frame high, one word length for frame sync, 188 123 * frame sync asserts with the first bit of the frame. 189 124 */ 190 - val_cr2 &= ~FSL_SAI_CR2_BCP; 125 + val_cr2 |= FSL_SAI_CR2_BCP; 191 126 val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); 192 127 break; 193 128 case SND_SOC_DAIFMT_DSP_A: ··· 197 132 * that is, together with the last bit of the previous 198 133 * data word. 199 134 */ 200 - val_cr2 &= ~FSL_SAI_CR2_BCP; 135 + val_cr2 |= FSL_SAI_CR2_BCP; 201 136 val_cr4 &= ~FSL_SAI_CR4_FSP; 202 137 val_cr4 |= FSL_SAI_CR4_FSE; 203 138 sai->is_dsp_mode = true; ··· 207 142 * Frame high, one bit for frame sync, 208 143 * frame sync asserts with the first bit of the frame. 209 144 */ 210 - val_cr2 &= ~FSL_SAI_CR2_BCP; 145 + val_cr2 |= FSL_SAI_CR2_BCP; 211 146 val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); 212 147 sai->is_dsp_mode = true; 213 148 break; ··· 438 373 { 439 374 struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev); 440 375 441 - regmap_update_bits(sai->regmap, FSL_SAI_TCSR, 0xffffffff, 0x0); 442 - regmap_update_bits(sai->regmap, FSL_SAI_RCSR, 0xffffffff, 0x0); 376 + regmap_update_bits(sai->regmap, FSL_SAI_TCSR, 0xffffffff, FSL_SAI_FLAGS); 377 + regmap_update_bits(sai->regmap, FSL_SAI_RCSR, 0xffffffff, FSL_SAI_FLAGS); 443 378 regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, 444 379 FSL_SAI_MAXBURST_TX * 2); 445 380 regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, ··· 555 490 struct fsl_sai *sai; 556 491 struct resource *res; 557 492 void __iomem *base; 558 - int ret; 493 + int irq, ret; 559 494 560 495 sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); 561 496 if (!sai) 562 497 return -ENOMEM; 498 + 499 + sai->pdev = pdev; 563 500 564 501 sai->big_endian_regs = of_property_read_bool(np, "big-endian-regs"); 565 502 if (sai->big_endian_regs) ··· 579 512 if (IS_ERR(sai->regmap)) { 580 513 dev_err(&pdev->dev, "regmap init failed\n"); 581 514 return PTR_ERR(sai->regmap); 515 + } 516 + 517 + irq = platform_get_irq(pdev, 0); 518 + if (irq < 0) { 519 + dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); 520 + return irq; 521 + } 522 + 523 + ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai); 524 + if (ret) { 525 + dev_err(&pdev->dev, "failed to claim irq %u\n", irq); 526 + return ret; 582 527 } 583 528 584 529 sai->dma_params_rx.addr = res->start + FSL_SAI_RDR;
+15
sound/soc/fsl/fsl_sai.h
··· 37 37 38 38 /* SAI Transmit/Recieve Control Register */ 39 39 #define FSL_SAI_CSR_TERE BIT(31) 40 + #define FSL_SAI_CSR_FR BIT(25) 41 + #define FSL_SAI_CSR_xF_SHIFT 16 42 + #define FSL_SAI_CSR_xF_W_SHIFT 18 43 + #define FSL_SAI_CSR_xF_MASK (0x1f << FSL_SAI_CSR_xF_SHIFT) 44 + #define FSL_SAI_CSR_xF_W_MASK (0x7 << FSL_SAI_CSR_xF_W_SHIFT) 45 + #define FSL_SAI_CSR_WSF BIT(20) 46 + #define FSL_SAI_CSR_SEF BIT(19) 47 + #define FSL_SAI_CSR_FEF BIT(18) 40 48 #define FSL_SAI_CSR_FWF BIT(17) 49 + #define FSL_SAI_CSR_FRF BIT(16) 50 + #define FSL_SAI_CSR_xIE_SHIFT 8 51 + #define FSL_SAI_CSR_WSIE BIT(12) 52 + #define FSL_SAI_CSR_SEIE BIT(11) 53 + #define FSL_SAI_CSR_FEIE BIT(10) 54 + #define FSL_SAI_CSR_FWIE BIT(9) 41 55 #define FSL_SAI_CSR_FRIE BIT(8) 42 56 #define FSL_SAI_CSR_FRDE BIT(0) 43 57 ··· 113 99 #define FSL_SAI_MAXBURST_RX 6 114 100 115 101 struct fsl_sai { 102 + struct platform_device *pdev; 116 103 struct regmap *regmap; 117 104 118 105 bool big_endian_regs;
+3 -3
sound/soc/samsung/ac97.c
··· 39 39 }; 40 40 static struct s3c_ac97_info s3c_ac97; 41 41 42 - static struct s3c2410_dma_client s3c_dma_client_out = { 42 + static struct s3c_dma_client s3c_dma_client_out = { 43 43 .name = "AC97 PCMOut" 44 44 }; 45 45 46 - static struct s3c2410_dma_client s3c_dma_client_in = { 46 + static struct s3c_dma_client s3c_dma_client_in = { 47 47 .name = "AC97 PCMIn" 48 48 }; 49 49 50 - static struct s3c2410_dma_client s3c_dma_client_micin = { 50 + static struct s3c_dma_client s3c_dma_client_micin = { 51 51 .name = "AC97 MicIn" 52 52 }; 53 53
+5 -1
sound/soc/samsung/dma.h
··· 14 14 15 15 #include <sound/dmaengine_pcm.h> 16 16 17 + struct s3c_dma_client { 18 + char *name; 19 + }; 20 + 17 21 struct s3c_dma_params { 18 - struct s3c2410_dma_client *client; /* stream identifier */ 22 + struct s3c_dma_client *client; /* stream identifier */ 19 23 int channel; /* Channel ID */ 20 24 dma_addr_t dma_addr; 21 25 int dma_size; /* Size of the DMA transfer */
+3 -3
sound/soc/samsung/i2s.c
··· 1211 1211 pri_dai->dma_playback.dma_addr = regs_base + I2STXD; 1212 1212 pri_dai->dma_capture.dma_addr = regs_base + I2SRXD; 1213 1213 pri_dai->dma_playback.client = 1214 - (struct s3c2410_dma_client *)&pri_dai->dma_playback; 1214 + (struct s3c_dma_client *)&pri_dai->dma_playback; 1215 1215 pri_dai->dma_playback.ch_name = "tx"; 1216 1216 pri_dai->dma_capture.client = 1217 - (struct s3c2410_dma_client *)&pri_dai->dma_capture; 1217 + (struct s3c_dma_client *)&pri_dai->dma_capture; 1218 1218 pri_dai->dma_capture.ch_name = "rx"; 1219 1219 pri_dai->dma_playback.dma_size = 4; 1220 1220 pri_dai->dma_capture.dma_size = 4; ··· 1233 1233 } 1234 1234 sec_dai->dma_playback.dma_addr = regs_base + I2STXDS; 1235 1235 sec_dai->dma_playback.client = 1236 - (struct s3c2410_dma_client *)&sec_dai->dma_playback; 1236 + (struct s3c_dma_client *)&sec_dai->dma_playback; 1237 1237 sec_dai->dma_playback.ch_name = "tx-sec"; 1238 1238 1239 1239 if (!np) {
+2 -3
sound/soc/samsung/pcm.c
··· 20 20 #include <sound/pcm_params.h> 21 21 22 22 #include <linux/platform_data/asoc-s3c.h> 23 - #include <mach/dma.h> 24 23 25 24 #include "dma.h" 26 25 #include "pcm.h" ··· 131 132 struct s3c_dma_params *dma_capture; 132 133 }; 133 134 134 - static struct s3c2410_dma_client s3c_pcm_dma_client_out = { 135 + static struct s3c_dma_client s3c_pcm_dma_client_out = { 135 136 .name = "PCM Stereo out" 136 137 }; 137 138 138 - static struct s3c2410_dma_client s3c_pcm_dma_client_in = { 139 + static struct s3c_dma_client s3c_pcm_dma_client_in = { 139 140 .name = "PCM Stereo in" 140 141 }; 141 142
+2 -2
sound/soc/samsung/s3c2412-i2s.c
··· 33 33 #include "regs-i2s-v2.h" 34 34 #include "s3c2412-i2s.h" 35 35 36 - static struct s3c2410_dma_client s3c2412_dma_client_out = { 36 + static struct s3c_dma_client s3c2412_dma_client_out = { 37 37 .name = "I2S PCM Stereo out" 38 38 }; 39 39 40 - static struct s3c2410_dma_client s3c2412_dma_client_in = { 40 + static struct s3c_dma_client s3c2412_dma_client_in = { 41 41 .name = "I2S PCM Stereo in" 42 42 }; 43 43
+2 -2
sound/soc/samsung/s3c24xx-i2s.c
··· 31 31 #include "dma.h" 32 32 #include "s3c24xx-i2s.h" 33 33 34 - static struct s3c2410_dma_client s3c24xx_dma_client_out = { 34 + static struct s3c_dma_client s3c24xx_dma_client_out = { 35 35 .name = "I2S PCM Stereo out" 36 36 }; 37 37 38 - static struct s3c2410_dma_client s3c24xx_dma_client_in = { 38 + static struct s3c_dma_client s3c24xx_dma_client_in = { 39 39 .name = "I2S PCM Stereo in" 40 40 }; 41 41
+1 -2
sound/soc/samsung/spdif.c
··· 18 18 #include <sound/pcm_params.h> 19 19 20 20 #include <linux/platform_data/asoc-s3c.h> 21 - #include <mach/dma.h> 22 21 23 22 #include "dma.h" 24 23 #include "spdif.h" ··· 93 94 struct s3c_dma_params *dma_playback; 94 95 }; 95 96 96 - static struct s3c2410_dma_client spdif_dma_client_out = { 97 + static struct s3c_dma_client spdif_dma_client_out = { 97 98 .name = "S/PDIF Stereo out", 98 99 }; 99 100
+2 -1
sound/usb/pcm.c
··· 1501 1501 * The error should be lower than 2ms since the estimate relies 1502 1502 * on two reads of a counter updated every ms. 1503 1503 */ 1504 - if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) 1504 + if (printk_ratelimit() && 1505 + abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) 1505 1506 dev_dbg(&subs->dev->dev, 1506 1507 "delay: estimated %d, actual %d\n", 1507 1508 est_delay, subs->last_delay);