Skip to content

Commit

Permalink
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/perex/alsa

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa:
  [ALSA] hda-intel - Add check of MSI availabity
  [ALSA] version 1.0.13
  [ALSA] Fix addition of user-defined boolean controls
  [ALSA] Fix AC97 power-saving mode
  [ALSA] Fix re-use of va_list
  [ALSA] hda_intel: add ATI RS690 HDMI audio support
  [ALSA] hda-codec - Add model entry for ASUS U5F laptop
  [ALSA] Fix dependency of snd-adlib driver in Kconfig
  [ALSA] Various fixes for suspend/resume of ALSA PCI drivers
  [ALSA] hda-codec - Fix assignment of PCM devices for Realtek codecs
  [ALSA] sound/isa/opti9xx/opti92x-ad1848.c: check kmalloc() return value
  [ALSA] sound/isa/ad1816a/ad1816a.c: check kmalloc() return value
  [ALSA] sound/isa/cmi8330.c: check kmalloc() return value
  [ALSA] sound/isa/gus/interwave.c: check kmalloc() return value
  • Loading branch information
Linus Torvalds committed Oct 23, 2006
2 parents 73441c6 + 68e7fff commit dee6515
Show file tree
Hide file tree
Showing 38 changed files with 330 additions and 168 deletions.
2 changes: 1 addition & 1 deletion include/sound/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* include/version.h. Generated by alsa/ksync script. */
#define CONFIG_SND_VERSION "1.0.13"
#define CONFIG_SND_DATE " (Fri Oct 06 18:28:19 2006 UTC)"
#define CONFIG_SND_DATE " (Sun Oct 22 08:56:16 2006 UTC)"
4 changes: 0 additions & 4 deletions sound/core/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,10 +1018,6 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
}
switch (info->type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
private_size = sizeof(char);
if (info->count > 128)
return -EINVAL;
break;
case SNDRV_CTL_ELEM_TYPE_INTEGER:
private_size = sizeof(long);
if (info->count > 128)
Expand Down
5 changes: 4 additions & 1 deletion sound/core/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ int snd_iprintf(struct snd_info_buffer *buffer, char *fmt,...)
len = buffer->len - buffer->size;
va_start(args, fmt);
for (;;) {
res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, args);
va_list ap;
va_copy(ap, args);
res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, ap);
va_end(ap);
if (res < len)
break;
err = resize_info_buffer(buffer, buffer->len + PAGE_SIZE);
Expand Down
1 change: 1 addition & 0 deletions sound/isa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ config SND_CS4231_LIB

config SND_ADLIB
tristate "AdLib FM card"
depends on SND
select SND_OPL3_LIB
help
Say Y here to include support for AdLib FM cards.
Expand Down
2 changes: 2 additions & 0 deletions sound/isa/ad1816a/ad1816a.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
int err;

if (!cfg)
return -ENOMEM;
acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
if (acard->dev == NULL) {
kfree(cfg);
Expand Down
2 changes: 2 additions & 0 deletions sound/isa/cmi8330.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
int err;

if (!cfg)
return -ENOMEM;
acard->cap = pnp_request_card_device(card, id->devs[0].id, NULL);
if (acard->cap == NULL) {
kfree(cfg);
Expand Down
2 changes: 2 additions & 0 deletions sound/isa/gus/interwave.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ static int __devinit snd_interwave_pnp(int dev, struct snd_interwave *iwcard,
struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
int err;

if (!cfg)
return -ENOMEM;
iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
if (iwcard->dev == NULL) {
kfree(cfg);
Expand Down
2 changes: 2 additions & 0 deletions sound/isa/opti9xx/opti92x-ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,8 @@ static int __init snd_card_opti9xx_pnp(struct snd_opti9xx *chip, struct pnp_card
struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
int err;

if (!cfg)
return -ENOMEM;
chip->dev = pnp_request_card_device(card, pid->devs[0].id, NULL);
if (chip->dev == NULL) {
kfree(cfg);
Expand Down
8 changes: 2 additions & 6 deletions sound/pci/ac97/ac97_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@ int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value
ac97->power_up &= ~(1 << (reg>>1));
else
ac97->power_up |= 1 << (reg>>1);
if (power_save)
update_power_regs(ac97);
update_power_regs(ac97);
}
#endif
return err;
Expand Down Expand Up @@ -2337,10 +2336,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
}
}

if (! power_save)
return 0;

if (! powerup && ac97->power_workq)
if (power_save && !powerup && ac97->power_workq)
/* adjust power-down bits after two seconds delay
* (for avoiding loud click noises for many (OSS) apps
* that open/close frequently)
Expand Down
11 changes: 10 additions & 1 deletion sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -2032,8 +2032,10 @@ static int ali_suspend(struct pci_dev *pci, pm_message_t state)
outl(0xffffffff, ALI_REG(chip, ALI_STOP));

spin_unlock_irq(&chip->reg_lock);

pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -2048,8 +2050,15 @@ static int ali_resume(struct pci_dev *pci)
if (! im)
return 0;

pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
pci_enable_device(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "ali5451: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

spin_lock_irq(&chip->reg_lock);

Expand Down
11 changes: 8 additions & 3 deletions sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,9 @@ static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state)
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);

pci_set_power_state(pci, PCI_D3hot);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -779,9 +779,14 @@ static int snd_als300_resume(struct pci_dev *pci)
struct snd_card *card = pci_get_drvdata(pci);
struct snd_als300 *chip = card->private_data;

pci_restore_state(pci);
pci_enable_device(pci);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "als300: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

snd_als300_init(chip);
Expand Down
11 changes: 8 additions & 3 deletions sound/pci/als4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,9 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state)
snd_pcm_suspend_all(chip->pcm);
snd_sbmixer_suspend(chip);

pci_set_power_state(pci, PCI_D3hot);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -816,9 +816,14 @@ static int snd_als4000_resume(struct pci_dev *pci)
struct snd_card_als4000 *acard = card->private_data;
struct snd_sb *chip = acard->chip;

pci_restore_state(pci);
pci_enable_device(pci);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "als4000: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

snd_als4000_configure(chip);
Expand Down
11 changes: 8 additions & 3 deletions sound/pci/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +1442,9 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
snd_atiixp_aclink_down(chip);
snd_atiixp_chip_stop(chip);

pci_set_power_state(pci, PCI_D3hot);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -1454,9 +1454,14 @@ static int snd_atiixp_resume(struct pci_dev *pci)
struct atiixp *chip = card->private_data;
int i;

pci_restore_state(pci);
pci_enable_device(pci);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "atiixp: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

snd_atiixp_aclink_reset(chip);
Expand Down
11 changes: 8 additions & 3 deletions sound/pci/atiixp_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,9 +1128,9 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
snd_atiixp_aclink_down(chip);
snd_atiixp_chip_stop(chip);

pci_set_power_state(pci, PCI_D3hot);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -1140,9 +1140,14 @@ static int snd_atiixp_resume(struct pci_dev *pci)
struct atiixp_modem *chip = card->private_data;
int i;

pci_restore_state(pci);
pci_enable_device(pci);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "atiixp-modem: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

snd_atiixp_aclink_reset(chip);
Expand Down
11 changes: 8 additions & 3 deletions sound/pci/azt3328.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,9 +1903,9 @@ snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state)
for (reg = 0; reg < AZF_IO_SIZE_SYNTH_PM / 2; reg++)
chip->saved_regs_synth[reg] = inw(chip->synth_port + reg * 2);

pci_set_power_state(pci, PCI_D3hot);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -1916,9 +1916,14 @@ snd_azf3328_resume(struct pci_dev *pci)
struct snd_azf3328 *chip = card->private_data;
int reg;

pci_restore_state(pci);
pci_enable_device(pci);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "azt3328: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

for (reg = 0; reg < AZF_IO_SIZE_IO2_PM / 2; reg++)
Expand Down
11 changes: 8 additions & 3 deletions sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3122,9 +3122,9 @@ static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state)
/* disable ints */
snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);

pci_set_power_state(pci, PCI_D3hot);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -3134,9 +3134,14 @@ static int snd_cmipci_resume(struct pci_dev *pci)
struct cmipci *cm = card->private_data;
int i;

pci_restore_state(pci);
pci_enable_device(pci);
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "cmipci: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

/* reset / initialize to a sane state */
Expand Down
9 changes: 8 additions & 1 deletion sound/pci/cs4281.c
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,7 @@ static int cs4281_suspend(struct pci_dev *pci, pm_message_t state)

pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -2060,8 +2061,14 @@ static int cs4281_resume(struct pci_dev *pci)
unsigned int i;
u32 ulCLK;

pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
pci_enable_device(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "cs4281: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
Expand Down
11 changes: 10 additions & 1 deletion sound/pci/cs46xx/cs46xx_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3687,8 +3687,10 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
/* disable CLKRUN */
chip->active_ctrl(chip, -chip->amplifier);
chip->amplifier = amp_saved; /* restore the status */

pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -3698,9 +3700,16 @@ int snd_cs46xx_resume(struct pci_dev *pci)
struct snd_cs46xx *chip = card->private_data;
int amp_saved;

pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
pci_enable_device(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "cs46xx: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

amp_saved = chip->amplifier;
chip->amplifier = 0;
chip->active_ctrl(chip, 1); /* force to on */
Expand Down
11 changes: 9 additions & 2 deletions sound/pci/cs5535audio/cs5535audio_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
snd_ac97_suspend(cs5535au->ac97);
/* save important regs, then disable aclink in hw */
snd_cs5535audio_stop_hardware(cs5535au);

pci_disable_device(pci);
pci_save_state(pci);

pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}

Expand All @@ -87,8 +88,14 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
int timeout;
int i;

pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
pci_enable_device(pci);
if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "cs5535audio: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
pci_set_master(pci);

/* set LNK_WRM_RST to reset AC link */
Expand Down
Loading

0 comments on commit dee6515

Please sign in to comment.