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

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:
[ALSA] soc - neo1973_wm8753.c add suspend and shutdown hooks for lm4857 chip
[ALSA] soc - neo1973_wm8753.c change maintainer contact info
[ALSA] soc - neo1973_wm8753.c cleanup checkpatch issues
[ALSA] soc - ln2440sbc_alc650 - Fix checkpatch warnings
[ALSA] soc - s3c24xx-pcm - Fix checkpatch warnings
[ALSA] soc - s3c2443-ac97 - Fix checkpatch warnings
[ALSA] soc - wm8753 - Clean up checkpatch warnings

+85 -53
+18 -16
sound/soc/codecs/wm8753.c
··· 150 150 data[0] = (reg << 1) | ((value >> 8) & 0x0001); 151 151 data[1] = value & 0x00ff; 152 152 153 - wm8753_write_reg_cache (codec, reg, value); 153 + wm8753_write_reg_cache(codec, reg, value); 154 154 if (codec->hw_write(codec->control_data, data, 2) == 2) 155 155 return 0; 156 156 else ··· 249 249 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 250 250 int mode = wm8753_read_reg_cache(codec, WM8753_IOCTL); 251 251 252 - if (((mode &0xc) >> 2) == ucontrol->value.integer.value[0]) 252 + if (((mode & 0xc) >> 2) == ucontrol->value.integer.value[0]) 253 253 return 0; 254 254 255 255 mode &= 0xfff3; ··· 342 342 343 343 for (i = 0; i < ARRAY_SIZE(wm8753_snd_controls); i++) { 344 344 err = snd_ctl_add(codec->card, 345 - snd_soc_cnew(&wm8753_snd_controls[i],codec, NULL)); 345 + snd_soc_cnew(&wm8753_snd_controls[i], 346 + codec, NULL)); 346 347 if (err < 0) 347 348 return err; 348 349 } ··· 723 722 724 723 if ((Ndiv < 6) || (Ndiv > 12)) 725 724 printk(KERN_WARNING 726 - "WM8753 N value outwith recommended range! N = %d\n",Ndiv); 725 + "wm8753: unsupported N = %d\n", Ndiv); 727 726 728 727 pll_div->n = Ndiv; 729 728 Nmod = target % source; ··· 1301 1300 } 1302 1301 1303 1302 #define WM8753_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ 1304 - SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ 1305 - SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 1303 + SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ 1304 + SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\ 1305 + SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 1306 1306 1307 1307 #define WM8753_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ 1308 1308 SNDRV_PCM_FMTBIT_S24_LE) ··· 1509 1507 struct snd_soc_codec *codec = socdev->codec; 1510 1508 1511 1509 /* we only need to suspend if we are a valid card */ 1512 - if(!codec->card) 1510 + if (!codec->card) 1513 1511 return 0; 1514 - 1512 + 1515 1513 wm8753_dapm_event(codec, SNDRV_CTL_POWER_D3cold); 1516 1514 return 0; 1517 1515 } ··· 1525 1523 u16 *cache = codec->reg_cache; 1526 1524 1527 1525 /* we only need to resume if we are a valid card */ 1528 - if(!codec->card) 1526 + if (!codec->card) 1529 1527 return 0; 1530 1528 1531 1529 /* Sync reg_cache with the hardware */ ··· 1615 1613 wm8753_add_widgets(codec); 1616 1614 ret = snd_soc_register_card(socdev); 1617 1615 if (ret < 0) { 1618 - printk(KERN_ERR "wm8753: failed to register card\n"); 1616 + printk(KERN_ERR "wm8753: failed to register card\n"); 1619 1617 goto card_err; 1620 - } 1618 + } 1619 + 1621 1620 return ret; 1622 1621 1623 1622 card_err: ··· 1633 1630 around */ 1634 1631 static struct snd_soc_device *wm8753_socdev; 1635 1632 1636 - #if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) 1633 + #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 1637 1634 1638 1635 /* 1639 1636 * WM8753 2 wire address is determined by GPIO5 ··· 1664 1661 client_template.addr = addr; 1665 1662 1666 1663 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 1667 - if (i2c == NULL){ 1664 + if (!i2c) { 1668 1665 kfree(codec); 1669 1666 return -ENOMEM; 1670 1667 } ··· 1752 1749 wm8753_socdev = socdev; 1753 1750 INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work); 1754 1751 1755 - #if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) 1752 + #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 1756 1753 if (setup->i2c_address) { 1757 1754 normal_i2c[0] = setup->i2c_address; 1758 1755 codec->hw_write = (hw_write_t)i2c_master_send; ··· 1796 1793 run_delayed_work(&codec->delayed_work); 1797 1794 snd_soc_free_pcms(socdev); 1798 1795 snd_soc_dapm_free(socdev); 1799 - #if defined (CONFIG_I2C) || defined (CONFIG_I2C_MODULE) 1796 + #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 1800 1797 i2c_del_driver(&wm8753_i2c_driver); 1801 1798 #endif 1802 1799 kfree(codec->private_data); ··· 1811 1808 .suspend = wm8753_suspend, 1812 1809 .resume = wm8753_resume, 1813 1810 }; 1814 - 1815 1811 EXPORT_SYMBOL_GPL(soc_codec_dev_wm8753); 1816 1812 1817 1813 MODULE_DESCRIPTION("ASoC WM8753 driver");
+2 -2
sound/soc/s3c24xx/ln2440sbc_alc650.c
··· 1 1 /* 2 2 * SoC audio for ln2440sbc 3 - * 3 + * 4 4 * Copyright 2007 KonekTel, a.s. 5 5 * Author: Ivan Kuten 6 6 * ivan.kuten@promwad.com 7 - * 7 + * 8 8 * Heavily based on smdk2443_wm9710.c 9 9 * Copyright 2007 Wolfson Microelectronics PLC. 10 10 * Author: Graeme Gregory
+45 -13
sound/soc/s3c24xx/neo1973_wm8753.c
··· 33 33 #include <asm/arch/regs-gpio.h> 34 34 #include <asm/hardware.h> 35 35 #include <asm/arch/audio.h> 36 - #include <asm/io.h> 36 + #include <linux/io.h> 37 37 #include <asm/arch/spi-gpio.h> 38 38 39 39 #include <asm/plat-s3c24xx/regs-iis.h> ··· 122 122 123 123 /* set MCLK division for sample rate */ 124 124 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK, 125 - S3C2410_IISMOD_32FS ); 125 + S3C2410_IISMOD_32FS); 126 126 if (ret < 0) 127 127 return ret; 128 128 ··· 133 133 134 134 /* set prescaler division for sample rate */ 135 135 ret = cpu_dai->dai_ops.set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER, 136 - S3C24XX_PRESCALE(4,4)); 136 + S3C24XX_PRESCALE(4, 4)); 137 137 if (ret < 0) 138 138 return ret; 139 139 ··· 222 222 .hw_free = neo1973_voice_hw_free, 223 223 }; 224 224 225 - static int neo1973_scenario = 0; 225 + static int neo1973_scenario; 226 226 227 227 static int neo1973_get_scenario(struct snd_kcontrol *kcontrol, 228 228 struct snd_ctl_elem_value *ucontrol) ··· 233 233 234 234 static int set_scenario_endpoints(struct snd_soc_codec *codec, int scenario) 235 235 { 236 - switch(neo1973_scenario) { 236 + switch (neo1973_scenario) { 237 237 case NEO_AUDIO_OFF: 238 238 snd_soc_dapm_set_endpoint(codec, "Audio Out", 0); 239 239 snd_soc_dapm_set_endpoint(codec, "GSM Line Out", 0); ··· 334 334 static int lm4857_get_reg(struct snd_kcontrol *kcontrol, 335 335 struct snd_ctl_elem_value *ucontrol) 336 336 { 337 - int reg=kcontrol->private_value & 0xFF; 337 + int reg = kcontrol->private_value & 0xFF; 338 338 int shift = (kcontrol->private_value >> 8) & 0x0F; 339 339 int mask = (kcontrol->private_value >> 16) & 0xFF; 340 340 ··· 349 349 int shift = (kcontrol->private_value >> 8) & 0x0F; 350 350 int mask = (kcontrol->private_value >> 16) & 0xFF; 351 351 352 - if (((lm4857_regs[reg] >> shift ) & mask) == 352 + if (((lm4857_regs[reg] >> shift) & mask) == 353 353 ucontrol->value.integer.value[0]) 354 354 return 0; 355 355 356 - lm4857_regs[reg] &= ~ (mask << shift); 356 + lm4857_regs[reg] &= ~(mask << shift); 357 357 lm4857_regs[reg] |= ucontrol->value.integer.value[0] << shift; 358 358 lm4857_write_regs(); 359 359 return 1; ··· 398 398 399 399 400 400 /* example machine audio_mapnections */ 401 - static const char* audio_map[][3] = { 401 + static const char *audio_map[][3] = { 402 402 403 403 /* Connections to the lm4857 amp */ 404 404 {"Audio Out", NULL, "LOUT1"}, ··· 450 450 }; 451 451 452 452 static const struct soc_enum neo_scenario_enum[] = { 453 - SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(neo_scenarios),neo_scenarios), 453 + SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(neo_scenarios), neo_scenarios), 454 454 }; 455 455 456 456 static const struct snd_kcontrol_new wm8753_neo1973_controls[] = { ··· 521 521 /* 522 522 * BT Codec DAI 523 523 */ 524 - static struct snd_soc_cpu_dai bt_dai = 525 - { .name = "Bluetooth", 524 + static struct snd_soc_cpu_dai bt_dai = { 525 + .name = "Bluetooth", 526 526 .id = 0, 527 527 .type = SND_SOC_DAI_PCM, 528 528 .playback = { ··· 616 616 return i2c_probe(adap, &addr_data, lm4857_amp_probe); 617 617 } 618 618 619 + static u8 lm4857_state; 620 + 621 + static int lm4857_suspend(struct i2c_client *dev, pm_message_t state) 622 + { 623 + dev_dbg(&dev->dev, "lm4857_suspend\n"); 624 + lm4857_state = lm4857_regs[LM4857_CTRL] & 0xf; 625 + if (lm4857_state) { 626 + lm4857_regs[LM4857_CTRL] &= 0xf0; 627 + lm4857_write_regs(); 628 + } 629 + return 0; 630 + } 631 + 632 + static int lm4857_resume(struct i2c_client *dev) 633 + { 634 + if (lm4857_state) { 635 + lm4857_regs[LM4857_CTRL] |= (lm4857_state & 0x0f); 636 + lm4857_write_regs(); 637 + } 638 + return 0; 639 + } 640 + 641 + static void lm4857_shutdown(struct i2c_client *dev) 642 + { 643 + dev_dbg(&dev->dev, "lm4857_shutdown\n"); 644 + lm4857_regs[LM4857_CTRL] &= 0xf0; 645 + lm4857_write_regs(); 646 + } 647 + 619 648 /* corgi i2c codec control layer */ 620 649 static struct i2c_driver lm4857_i2c_driver = { 621 650 .driver = { ··· 652 623 .owner = THIS_MODULE, 653 624 }, 654 625 .id = I2C_DRIVERID_LM4857, 626 + .suspend = lm4857_suspend, 627 + .resume = lm4857_resume, 628 + .shutdown = lm4857_shutdown, 655 629 .attach_adapter = lm4857_i2c_attach, 656 630 .detach_client = lm4857_i2c_detach, 657 631 .command = NULL, ··· 699 667 module_exit(neo1973_exit); 700 668 701 669 /* Module information */ 702 - MODULE_AUTHOR("Graeme Gregory, graeme.gregory@wolfsonmicro.com, www.wolfsonmicro.com"); 670 + MODULE_AUTHOR("Graeme Gregory, graeme@openmoko.org, www.openmoko.org"); 703 671 MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973"); 704 672 MODULE_LICENSE("GPL");
+4 -5
sound/soc/s3c24xx/s3c2443-ac97.c
··· 19 19 #include <linux/module.h> 20 20 #include <linux/platform_device.h> 21 21 #include <linux/interrupt.h> 22 + #include <linux/io.h> 22 23 #include <linux/wait.h> 23 24 #include <linux/delay.h> 24 25 #include <linux/clk.h> ··· 31 30 #include <sound/soc.h> 32 31 33 32 #include <asm/hardware.h> 34 - #include <asm/io.h> 35 33 #include <asm/plat-s3c/regs-ac97.h> 36 34 #include <asm/arch/regs-gpio.h> 37 35 #include <asm/arch/regs-clock.h> ··· 47 47 }; 48 48 static struct s3c24xx_ac97_info s3c24xx_ac97; 49 49 50 - DECLARE_COMPLETION(ac97_completion); 50 + static DECLARE_COMPLETION(ac97_completion); 51 51 static u32 codec_ready; 52 52 static DECLARE_MUTEX(ac97_mutex); 53 53 ··· 290 290 u32 ac_glbctrl; 291 291 292 292 ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); 293 - switch(cmd) { 293 + switch (cmd) { 294 294 case SNDRV_PCM_TRIGGER_START: 295 295 case SNDRV_PCM_TRIGGER_RESUME: 296 296 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ··· 333 333 u32 ac_glbctrl; 334 334 335 335 ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL); 336 - switch(cmd) { 336 + switch (cmd) { 337 337 case SNDRV_PCM_TRIGGER_START: 338 338 case SNDRV_PCM_TRIGGER_RESUME: 339 339 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ··· 391 391 .trigger = s3c2443_ac97_mic_trigger,}, 392 392 }, 393 393 }; 394 - 395 394 EXPORT_SYMBOL_GPL(s3c2443_ac97_dai); 396 395 EXPORT_SYMBOL_GPL(soc_ac97_ops); 397 396
+16 -17
sound/soc/s3c24xx/s3c24xx-pcm.c
··· 20 20 21 21 #include <linux/module.h> 22 22 #include <linux/init.h> 23 + #include <linux/io.h> 23 24 #include <linux/platform_device.h> 24 25 #include <linux/slab.h> 25 26 #include <linux/dma-mapping.h> ··· 31 30 #include <sound/soc.h> 32 31 33 32 #include <asm/dma.h> 34 - #include <asm/io.h> 35 33 #include <asm/hardware.h> 36 34 #include <asm/arch/dma.h> 37 35 #include <asm/arch/audio.h> ··· 93 93 while (prtd->dma_loaded < prtd->dma_limit) { 94 94 unsigned long len = prtd->dma_period; 95 95 96 - DBG("dma_loaded: %d\n",prtd->dma_loaded); 96 + DBG("dma_loaded: %d\n", prtd->dma_loaded); 97 97 98 98 if ((pos + len) > prtd->dma_end) { 99 99 len = prtd->dma_end - pos; ··· 101 101 __func__, len); 102 102 } 103 103 104 - ret = s3c2410_dma_enqueue(prtd->params->channel, 104 + ret = s3c2410_dma_enqueue(prtd->params->channel, 105 105 substream, pos, len); 106 106 107 107 if (ret == 0) { ··· 129 129 return; 130 130 131 131 prtd = substream->runtime->private_data; 132 - 132 + 133 133 if (substream) 134 134 snd_pcm_period_elapsed(substream); 135 135 ··· 150 150 struct snd_soc_pcm_runtime *rtd = substream->private_data; 151 151 struct s3c24xx_pcm_dma_params *dma = rtd->dai->cpu_dai->dma_data; 152 152 unsigned long totbytes = params_buffer_bytes(params); 153 - int ret=0; 153 + int ret = 0; 154 154 155 155 DBG("Entered %s\n", __func__); 156 156 ··· 223 223 /* return if this is a bufferless transfer e.g. 224 224 * codec <--> BT codec or GSM modem -- lg FIXME */ 225 225 if (!prtd->params) 226 - return 0; 226 + return 0; 227 227 228 228 /* channel needs configuring for mem=>device, increment memory addr, 229 229 * sync to pclk, half-word transfers to the IIS-FIFO. */ ··· 293 293 return ret; 294 294 } 295 295 296 - static snd_pcm_uframes_t 297 - s3c24xx_pcm_pointer(struct snd_pcm_substream *substream) 296 + static snd_pcm_uframes_t 297 + s3c24xx_pcm_pointer(struct snd_pcm_substream *substream) 298 298 { 299 299 struct snd_pcm_runtime *runtime = substream->runtime; 300 300 struct s3c24xx_runtime_data *prtd = runtime->private_data; ··· 313 313 314 314 spin_unlock(&prtd->lock); 315 315 316 - DBG("Pointer %x %x\n",src,dst); 316 + DBG("Pointer %x %x\n", src, dst); 317 317 318 318 /* we seem to be getting the odd error from the pcm library due 319 319 * to out-of-bounds pointers. this is maybe due to the dma engine ··· 355 355 356 356 DBG("Entered %s\n", __func__); 357 357 358 - if (prtd) 359 - kfree(prtd); 360 - else 358 + if (!prtd) 361 359 DBG("s3c24xx_pcm_close called with prtd == NULL\n"); 360 + 361 + kfree(prtd); 362 362 363 363 return 0; 364 364 } ··· 371 371 DBG("Entered %s\n", __func__); 372 372 373 373 return dma_mmap_writecombine(substream->pcm->card->dev, vma, 374 - runtime->dma_area, 375 - runtime->dma_addr, 376 - runtime->dma_bytes); 374 + runtime->dma_area, 375 + runtime->dma_addr, 376 + runtime->dma_bytes); 377 377 } 378 378 379 379 static struct snd_pcm_ops s3c24xx_pcm_ops = { ··· 432 432 433 433 static u64 s3c24xx_pcm_dmamask = DMA_32BIT_MASK; 434 434 435 - static int s3c24xx_pcm_new(struct snd_card *card, 435 + static int s3c24xx_pcm_new(struct snd_card *card, 436 436 struct snd_soc_codec_dai *dai, struct snd_pcm *pcm) 437 437 { 438 438 int ret = 0; ··· 467 467 .pcm_new = s3c24xx_pcm_new, 468 468 .pcm_free = s3c24xx_pcm_free_dma_buffers, 469 469 }; 470 - 471 470 EXPORT_SYMBOL_GPL(s3c24xx_soc_platform); 472 471 473 472 MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");