Skip to content

Commit

Permalink
ALSA: pci: Remove superfluous snd_pcm_suspend*() calls
Browse files Browse the repository at this point in the history
The call of snd_pcm_suspend_all() & co became superfluous since we
call it in the PCM PM ops.  Let's remove them.

Reviewed-by: Jaroslav Kysela <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 15, 2019
1 parent 3c40dfe commit 17bc481
Show file tree
Hide file tree
Showing 32 changed files with 2 additions and 85 deletions.
4 changes: 1 addition & 3 deletions sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,10 +1882,8 @@ static int ali_suspend(struct device *dev)
return 0;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < chip->num_of_codecs; i++) {
snd_pcm_suspend_all(chip->pcm[i]);
for (i = 0; i < chip->num_of_codecs; i++)
snd_ac97_suspend(chip->ac97[i]);
}

spin_lock_irq(&chip->reg_lock);

Expand Down
1 change: 0 additions & 1 deletion sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ static int snd_als300_suspend(struct device *dev)
struct snd_als300 *chip = card->private_data;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);
return 0;
}
Expand Down
1 change: 0 additions & 1 deletion sound/pci/als4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,6 @@ static int snd_als4000_suspend(struct device *dev)

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);

snd_pcm_suspend_all(chip->pcm);
snd_sbmixer_suspend(chip);
return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/atiixp_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,6 @@ static int snd_atiixp_suspend(struct device *dev)
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < NUM_ATI_PCMDEVS; i++)
snd_pcm_suspend_all(chip->pcmdevs[i]);
for (i = 0; i < NUM_ATI_CODECS; i++)
snd_ac97_suspend(chip->ac97[i]);
snd_atiixp_aclink_down(chip);
Expand Down
4 changes: 0 additions & 4 deletions sound/pci/azt3328.c
Original file line number Diff line number Diff line change
Expand Up @@ -2699,10 +2699,6 @@ snd_azf3328_suspend(struct device *dev)

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);

/* same pcm object for playback/capture */
snd_pcm_suspend_all(chip->pcm[AZF_CODEC_PLAYBACK]);
snd_pcm_suspend_all(chip->pcm[AZF_CODEC_I2S_OUT]);

snd_azf3328_suspend_ac97(chip);

snd_azf3328_suspend_regs(chip, chip->ctrl_io,
Expand Down
3 changes: 0 additions & 3 deletions sound/pci/ca0106/ca0106_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,11 +1910,8 @@ static int snd_ca0106_suspend(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct snd_ca0106 *chip = card->private_data;
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < 4; i++)
snd_pcm_suspend_all(chip->pcm[i]);
if (chip->details->ac97)
snd_ac97_suspend(chip->ac97);
snd_ca0106_mixer_suspend(chip);
Expand Down
4 changes: 0 additions & 4 deletions sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3351,10 +3351,6 @@ static int snd_cmipci_suspend(struct device *dev)

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);

snd_pcm_suspend_all(cm->pcm);
snd_pcm_suspend_all(cm->pcm2);
snd_pcm_suspend_all(cm->pcm_spdif);

/* save registers */
for (i = 0; i < ARRAY_SIZE(saved_regs); i++)
cm->saved_regs[i] = snd_cmipci_read(cm, saved_regs[i]);
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/cs4281.c
Original file line number Diff line number Diff line change
Expand Up @@ -2002,8 +2002,6 @@ static int cs4281_suspend(struct device *dev)
unsigned int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);

snd_ac97_suspend(chip->ac97);
snd_ac97_suspend(chip->ac97_secondary);

Expand Down
6 changes: 0 additions & 6 deletions sound/pci/cs46xx/cs46xx_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3781,12 +3781,6 @@ static int snd_cs46xx_suspend(struct device *dev)

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
chip->in_suspend = 1;
snd_pcm_suspend_all(chip->pcm);
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_pcm_suspend_all(chip->pcm_rear);
snd_pcm_suspend_all(chip->pcm_center_lfe);
snd_pcm_suspend_all(chip->pcm_iec958);
#endif
// chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL);
// chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE);

Expand Down
1 change: 0 additions & 1 deletion sound/pci/cs5535audio/cs5535audio_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ static int __maybe_unused snd_cs5535audio_suspend(struct device *dev)
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(cs5535au->pcm);
snd_ac97_suspend(cs5535au->ac97);
for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {
struct cs5535audio_dma *dma = &cs5535au->dmas[i];
Expand Down
8 changes: 0 additions & 8 deletions sound/pci/ctxfi/ctatc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,18 +1548,10 @@ static void atc_connect_resources(struct ct_atc *atc)
#ifdef CONFIG_PM_SLEEP
static int atc_suspend(struct ct_atc *atc)
{
int i;
struct hw *hw = atc->hw;

snd_power_change_state(atc->card, SNDRV_CTL_POWER_D3hot);

for (i = FRONT; i < NUM_PCMS; i++) {
if (!atc->pcms[i])
continue;

snd_pcm_suspend_all(atc->pcms[i]);
}

atc_release_resources(atc);

hw->suspend(hw);
Expand Down
3 changes: 0 additions & 3 deletions sound/pci/echoaudio/echoaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2165,9 +2165,6 @@ static int snd_echo_suspend(struct device *dev)
{
struct echoaudio *chip = dev_get_drvdata(dev);

snd_pcm_suspend_all(chip->analog_pcm);
snd_pcm_suspend_all(chip->digital_pcm);

#ifdef ECHOCARD_HAS_MIDI
/* This call can sleep */
if (chip->midi_out)
Expand Down
6 changes: 0 additions & 6 deletions sound/pci/emu10k1/emu10k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,6 @@ static int snd_emu10k1_suspend(struct device *dev)

cancel_delayed_work_sync(&emu->emu1010.firmware_work);

snd_pcm_suspend_all(emu->pcm);
snd_pcm_suspend_all(emu->pcm_mic);
snd_pcm_suspend_all(emu->pcm_efx);
snd_pcm_suspend_all(emu->pcm_multi);
snd_pcm_suspend_all(emu->pcm_p16v);

snd_ac97_suspend(emu->ac97);

snd_emu10k1_efx_suspend(emu);
Expand Down
3 changes: 0 additions & 3 deletions sound/pci/ens1370.c
Original file line number Diff line number Diff line change
Expand Up @@ -2037,9 +2037,6 @@ static int snd_ensoniq_suspend(struct device *dev)

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);

snd_pcm_suspend_all(ensoniq->pcm1);
snd_pcm_suspend_all(ensoniq->pcm2);

#ifdef CHIP1371
snd_ac97_suspend(ensoniq->u.es1371.ac97);
#else
Expand Down
1 change: 0 additions & 1 deletion sound/pci/es1938.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,6 @@ static int es1938_suspend(struct device *dev)
unsigned char *s, *d;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);

/* save mixer-related registers */
for (s = saved_regs, d = chip->saved_regs; *s; s++, d++)
Expand Down
1 change: 0 additions & 1 deletion sound/pci/es1968.c
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,6 @@ static int es1968_suspend(struct device *dev)
chip->in_suspend = 1;
cancel_work_sync(&chip->hwvol_work);
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);
snd_es1968_bob_stop(chip);
return 0;
Expand Down
1 change: 0 additions & 1 deletion sound/pci/fm801.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,6 @@ static int snd_fm801_suspend(struct device *dev)
if (chip->tea575x_tuner & TUNER_ONLY) {
/* FIXME: tea575x suspend */
} else {
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);
snd_ac97_suspend(chip->ac97_sec);
}
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2927,8 +2927,6 @@ static int hda_codec_runtime_suspend(struct device *dev)
unsigned int state;

cancel_delayed_work_sync(&codec->jackpoll_work);
list_for_each_entry(pcm, &codec->pcm_list_head, list)
snd_pcm_suspend_all(pcm->pcm);
state = hda_call_codec_suspend(codec);
if (codec->link_down_at_suspend ||
(codec_has_clkstop(codec) && codec_has_epss(codec) &&
Expand Down
3 changes: 0 additions & 3 deletions sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -2792,9 +2792,6 @@ static int snd_ice1712_suspend(struct device *dev)

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);

snd_pcm_suspend_all(ice->pcm);
snd_pcm_suspend_all(ice->pcm_pro);
snd_pcm_suspend_all(ice->pcm_ds);
snd_ac97_suspend(ice->ac97);

spin_lock_irq(&ice->reg_lock);
Expand Down
3 changes: 0 additions & 3 deletions sound/pci/ice1712/ice1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -2804,9 +2804,6 @@ static int snd_vt1724_suspend(struct device *dev)

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);

snd_pcm_suspend_all(ice->pcm);
snd_pcm_suspend_all(ice->pcm_pro);
snd_pcm_suspend_all(ice->pcm_ds);
snd_ac97_suspend(ice->ac97);

spin_lock_irq(&ice->reg_lock);
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2614,8 +2614,6 @@ static int intel8x0_suspend(struct device *dev)
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < chip->pcm_devs; i++)
snd_pcm_suspend_all(chip->pcm[i]);
for (i = 0; i < chip->ncodecs; i++)
snd_ac97_suspend(chip->ac97[i]);
if (chip->device_type == DEVICE_INTEL_ICH4)
Expand Down
3 changes: 0 additions & 3 deletions sound/pci/intel8x0m.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,11 +1025,8 @@ static int intel8x0m_suspend(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct intel8x0m *chip = card->private_data;
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < chip->pcm_devs; i++)
snd_pcm_suspend_all(chip->pcm[i]);
snd_ac97_suspend(chip->ac97);
if (chip->irq >= 0) {
free_irq(chip->irq, chip);
Expand Down
1 change: 0 additions & 1 deletion sound/pci/maestro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2422,7 +2422,6 @@ static int m3_suspend(struct device *dev)
chip->in_suspend = 1;
cancel_work_sync(&chip->hwvol_work);
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);

msleep(10); /* give the assp a chance to idle.. */
Expand Down
1 change: 0 additions & 1 deletion sound/pci/nm256/nm256.c
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,6 @@ static int nm256_suspend(struct device *dev)
struct nm256 *chip = card->private_data;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);
chip->coeffs_current = 0;
return 0;
Expand Down
5 changes: 1 addition & 4 deletions sound/pci/oxygen/oxygen_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,13 +744,10 @@ static int oxygen_pci_suspend(struct device *dev)
{
struct snd_card *card = dev_get_drvdata(dev);
struct oxygen *chip = card->private_data;
unsigned int i, saved_interrupt_mask;
unsigned int saved_interrupt_mask;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);

for (i = 0; i < PCM_COUNT; ++i)
snd_pcm_suspend(chip->streams[i]);

if (chip->model.suspend)
chip->model.suspend(chip);

Expand Down
1 change: 0 additions & 1 deletion sound/pci/riptide/riptide.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,6 @@ static int riptide_suspend(struct device *dev)

chip->in_suspend = 1;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);
return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/rme96.c
Original file line number Diff line number Diff line change
Expand Up @@ -2388,8 +2388,6 @@ static int rme96_suspend(struct device *dev)
struct rme96 *rme96 = card->private_data;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend(rme96->playback_substream);
snd_pcm_suspend(rme96->capture_substream);

/* save capture & playback pointers */
rme96->playback_pointer = readl(rme96->iobase + RME96_IO_GET_PLAY_POS)
Expand Down
1 change: 0 additions & 1 deletion sound/pci/sis7019.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,6 @@ static int sis_suspend(struct device *dev)
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(sis->pcm);
if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT)
snd_ac97_suspend(sis->ac97[0]);
if (sis->codecs_present & SIS_SECONDARY_CODEC_PRESENT)
Expand Down
4 changes: 0 additions & 4 deletions sound/pci/trident/trident_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3915,10 +3915,6 @@ static int snd_trident_suspend(struct device *dev)

trident->in_suspend = 1;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(trident->pcm);
snd_pcm_suspend_all(trident->foldback);
snd_pcm_suspend_all(trident->spdif);

snd_ac97_suspend(trident->ac97);
snd_ac97_suspend(trident->ac97_sec);
return 0;
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/via82xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2278,8 +2278,6 @@ static int snd_via82xx_suspend(struct device *dev)
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < 2; i++)
snd_pcm_suspend_all(chip->pcms[i]);
for (i = 0; i < chip->num_devs; i++)
snd_via82xx_channel_reset(chip, &chip->devs[i]);
synchronize_irq(chip->irq);
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/via82xx_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,6 @@ static int snd_via82xx_suspend(struct device *dev)
int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < 2; i++)
snd_pcm_suspend_all(chip->pcms[i]);
for (i = 0; i < chip->num_devs; i++)
snd_via82xx_channel_reset(chip, &chip->devs[i]);
synchronize_irq(chip->irq);
Expand Down
4 changes: 0 additions & 4 deletions sound/pci/ymfpci/ymfpci_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2304,10 +2304,6 @@ static int snd_ymfpci_suspend(struct device *dev)
unsigned int i;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_pcm_suspend_all(chip->pcm2);
snd_pcm_suspend_all(chip->pcm_spdif);
snd_pcm_suspend_all(chip->pcm_4ch);
snd_ac97_suspend(chip->ac97);
for (i = 0; i < YDSXGR_NUM_SAVED_REGS; i++)
chip->saved_regs[i] = snd_ymfpci_readl(chip, saved_regs_index[i]);
Expand Down

0 comments on commit 17bc481

Please sign in to comment.