From c7561cd80469f2fe4a6be0984db57832ee7f2a3b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 14 Aug 2012 18:12:04 +0200 Subject: ALSA: PCI: Replace CONFIG_PM with CONFIG_PM_SLEEP Otherwise we may get compile warnings due to unused functions. Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index cd553f592e2d..5c4115289a9a 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2620,7 +2620,7 @@ static int snd_intel8x0_free(struct intel8x0 *chip) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP /* * power management */ @@ -2741,7 +2741,7 @@ static SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume); #define INTEL8X0_PM_OPS &intel8x0_pm #else #define INTEL8X0_PM_OPS NULL -#endif /* CONFIG_PM */ +#endif /* CONFIG_PM_SLEEP */ #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ -- cgit v1.2.3 From e36e3b86c78cee9c7435eb33e0ef8a788193e812 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 3 Aug 2012 18:01:40 +0200 Subject: ALSA: Implement channel maps for standard onboard AC97 drivers Just set the channel maps depending on the hardware availability. Signed-off-by: Takashi Iwai --- sound/pci/atiixp.c | 9 +++++++++ sound/pci/fm801.c | 7 +++++++ sound/pci/intel8x0.c | 20 ++++++++++++++++++++ sound/pci/via82xx.c | 23 +++++++++++++++++++++++ 4 files changed, 59 insertions(+) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index c744df5bb1c6..368df8b0853e 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1250,6 +1250,7 @@ static struct atiixp_dma_ops snd_atiixp_spdif_dma_ops = { static int __devinit snd_atiixp_pcm_new(struct atiixp *chip) { struct snd_pcm *pcm; + struct snd_pcm_chmap *chmap; struct snd_ac97_bus *pbus = chip->ac97_bus; int err, i, num_pcms; @@ -1293,6 +1294,14 @@ static int __devinit snd_atiixp_pcm_new(struct atiixp *chip) snd_dma_pci_data(chip->pci), 64*1024, 128*1024); + err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, + snd_pcm_alt_chmaps, chip->max_channels, 0, + &chmap); + if (err < 0) + return err; + chmap->channel_mask = SND_PCM_CHMAP_MASK_2468; + chip->ac97[0]->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap; + /* no SPDIF support on codec? */ if (chip->pcms[ATI_PCM_SPDIF] && ! chip->pcms[ATI_PCM_SPDIF]->rates) return 0; diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index ce3e548de41d..cc2e91d15538 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -711,6 +711,13 @@ static int __devinit snd_fm801_pcm(struct fm801 *chip, int device, struct snd_pc snd_dma_pci_data(chip->pci), chip->multichannel ? 128*1024 : 64*1024, 128*1024); + err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, + snd_pcm_alt_chmaps, + chip->multichannel ? 6 : 2, 0, + NULL); + if (err < 0) + return err; + if (rpcm) *rpcm = pcm; return 0; diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 5c4115289a9a..848102e5d864 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -1541,6 +1541,26 @@ static int __devinit snd_intel8x0_pcm1(struct intel8x0 *chip, int device, snd_dma_pci_data(chip->pci), rec->prealloc_size, rec->prealloc_max_size); + if (rec->ac97_idx == ICHD_PCMOUT && rec->playback_ops) { + struct snd_pcm_chmap *chmap; + int chs = 2; + if (rec->ac97_idx == ICHD_PCMOUT) { + if (chip->multi8) + chs = 8; + else if (chip->multi6) + chs = 6; + else if (chip->multi4) + chs = 4; + } + err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, + snd_pcm_alt_chmaps, chs, 0, + &chmap); + if (err < 0) + return err; + chmap->channel_mask = SND_PCM_CHMAP_MASK_2468; + chip->ac97[0]->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap; + } + return 0; } diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index e3d32e2d574e..f0b4efdb483c 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -1440,6 +1440,7 @@ static void init_viadev(struct via82xx *chip, int idx, unsigned int reg_offset, static int __devinit snd_via8233_pcm_new(struct via82xx *chip) { struct snd_pcm *pcm; + struct snd_pcm_chmap *chmap; int i, err; chip->playback_devno = 0; /* x 4 */ @@ -1467,6 +1468,12 @@ static int __devinit snd_via8233_pcm_new(struct via82xx *chip) snd_dma_pci_data(chip->pci), 64*1024, VIA_MAX_BUFSIZE); + err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, + snd_pcm_std_chmaps, 2, 0, + &chmap); + if (err < 0) + return err; + /* PCM #1: multi-channel playback and 2nd capture */ err = snd_pcm_new(chip->card, chip->card->shortname, 1, 1, 1, &pcm); if (err < 0) @@ -1484,6 +1491,14 @@ static int __devinit snd_via8233_pcm_new(struct via82xx *chip) snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(chip->pci), 64*1024, VIA_MAX_BUFSIZE); + + err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, + snd_pcm_alt_chmaps, 6, 0, + &chmap); + if (err < 0) + return err; + chip->ac97->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap; + return 0; } @@ -1493,6 +1508,7 @@ static int __devinit snd_via8233_pcm_new(struct via82xx *chip) static int __devinit snd_via8233a_pcm_new(struct via82xx *chip) { struct snd_pcm *pcm; + struct snd_pcm_chmap *chmap; int err; chip->multi_devno = 0; @@ -1519,6 +1535,13 @@ static int __devinit snd_via8233a_pcm_new(struct via82xx *chip) snd_dma_pci_data(chip->pci), 64*1024, VIA_MAX_BUFSIZE); + err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, + snd_pcm_alt_chmaps, 6, 0, + &chmap); + if (err < 0) + return err; + chip->ac97->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap; + /* SPDIF supported? */ if (! ac97_can_spdif(chip->ac97)) return 0; -- cgit v1.2.3 From 395d9dd5dd13c6aa3c8c61a31126af98cd1e747d Mon Sep 17 00:00:00 2001 From: Peter Senna Tschudin Date: Fri, 28 Sep 2012 11:24:57 +0200 Subject: sound: Remove unnecessary semicolon A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r1@ statement S; position p,p1; @@ S@p1;@p @script:python r2@ p << r1.p; p1 << r1.p1; @@ if p[0].line != p1[0].line_end: cocci.include_match(False) @@ position r1.p; @@ -;@p // Signed-off-by: Peter Senna Tschudin Signed-off-by: Takashi Iwai --- sound/drivers/opl3/opl3_midi.c | 2 +- sound/drivers/vx/vx_pcm.c | 2 +- sound/isa/sb/emu8000_callback.c | 2 +- sound/isa/wavefront/wavefront_synth.c | 2 +- sound/oss/audio.c | 2 +- sound/oss/opl3.c | 2 +- sound/oss/pss.c | 2 +- sound/oss/sb_ess.c | 22 +++++++++++----------- sound/oss/sb_mixer.c | 4 ++-- sound/oss/sys_timer.c | 4 ++-- sound/oss/uart6850.c | 2 +- sound/pci/asihpi/asihpi.c | 2 +- sound/pci/au88x0/au88x0_game.c | 2 +- sound/pci/au88x0/au88x0_pcm.c | 2 +- sound/pci/emu10k1/emu10k1_callback.c | 2 +- sound/pci/emu10k1/emupcm.c | 2 +- sound/pci/intel8x0.c | 2 +- sound/pci/mixart/mixart_hwdep.c | 2 +- sound/sparc/amd7930.c | 4 ++-- sound/sparc/dbri.c | 2 +- 20 files changed, 33 insertions(+), 33 deletions(-) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c index 2bfe4bcb7a7d..0c796bcbc0a3 100644 --- a/sound/drivers/opl3/opl3_midi.c +++ b/sound/drivers/opl3/opl3_midi.c @@ -163,7 +163,7 @@ static int opl3_get_voice(struct snd_opl3 *opl3, int instr_4op, struct best *bp; for (i = 0; i < END; i++) { - best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */; + best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */ best[i].voice = -1; } diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 5e897b236cec..deed5efff33c 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -184,7 +184,7 @@ static int vx_set_format(struct vx_core *chip, struct vx_pipe *pipe, default : snd_BUG(); return -EINVAL; - }; + } return vx_set_stream_format(chip, pipe, header); } diff --git a/sound/isa/sb/emu8000_callback.c b/sound/isa/sb/emu8000_callback.c index 344b4355be1c..72a9ac5efb40 100644 --- a/sound/isa/sb/emu8000_callback.c +++ b/sound/isa/sb/emu8000_callback.c @@ -175,7 +175,7 @@ get_voice(struct snd_emux *emu, struct snd_emux_port *port) hw = emu->hw; for (i = 0; i < END; i++) { - best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */; + best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */ best[i].voice = -1; } diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index 405f8b6a58b5..b1bf8d4e6494 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c @@ -538,7 +538,7 @@ munge_int32 (unsigned int src, /* Note: we leave the upper bits in place */ dst++; - }; + } return dst; }; diff --git a/sound/oss/audio.c b/sound/oss/audio.c index 4b958b1c497c..09c932f899b8 100644 --- a/sound/oss/audio.c +++ b/sound/oss/audio.c @@ -354,7 +354,7 @@ int audio_read(int dev, struct file *file, char __user *buf, int count) if(copy_to_user(&(buf)[p], fixit, l)) return -EFAULT; - }; + } DMAbuf_rmchars(dev, buf_no, l); diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c index 407cd677950b..c5c24409ceb0 100644 --- a/sound/oss/opl3.c +++ b/sound/oss/opl3.c @@ -1190,7 +1190,7 @@ static int opl3_init(int ioaddr, struct module *owner) for (i = 0; i < 18; i++) pv_map[i].ioaddr = devc->left_io; - }; + } conf_printf2(devc->fm_info.name, ioaddr, 0, -1, -1); for (i = 0; i < SBFM_MAXINSTR; i++) diff --git a/sound/oss/pss.c b/sound/oss/pss.c index 0f32a561f15f..145e36b2cfd0 100644 --- a/sound/oss/pss.c +++ b/sound/oss/pss.c @@ -359,7 +359,7 @@ static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size { /*_____ Send the next byte */ outw (*block++, REG (PSS_DATA)); - }; + } count++; } diff --git a/sound/oss/sb_ess.c b/sound/oss/sb_ess.c index 5c773dff5ac5..c0be085e4a20 100644 --- a/sound/oss/sb_ess.c +++ b/sound/oss/sb_ess.c @@ -1104,15 +1104,15 @@ int ess_init(sb_devc * devc, struct address_info *hw_config) default: printk (KERN_ERR "Invalid esstype=%d specified\n", devc->sbmo.esstype); return 0; - }; + } if (submodel != -1) { devc->submodel = submodel; sprintf (modelname, "ES%d", devc->sbmo.esstype); chip = modelname; - }; + } if (chip == NULL && (ess_minor & 0x0f) < 8) { chip = "ES688"; - }; + } #ifdef FKS_TEST FKS_test (devc); #endif @@ -1122,7 +1122,7 @@ FKS_test (devc); */ if (chip == NULL && devc->sbmo.esstype == ESSTYPE_LIKE20) { chip = "ES1688"; - }; + } if (chip == NULL) { int type; @@ -1150,8 +1150,8 @@ FKS_test (devc); if ((type & 0x00ff) != ((type >> 8) & 0x00ff)) { printk ("ess_init: Unrecognized %04x\n", type); } - }; - }; + } + } #if 0 /* * this one failed: @@ -1182,10 +1182,10 @@ FKS_test (devc); chip = "ES1788"; devc->submodel = SUBMDL_ES1788; } - }; + } if (chip == NULL) { chip = "ES1688"; - }; + } printk ( KERN_INFO "ESS chip %s %s%s\n" , chip @@ -1293,7 +1293,7 @@ printk(KERN_INFO "ess_set_dma_hw: dma8=%d,dma16=%d,dup=%d\n" default: printk(KERN_ERR "ESS1887: Invalid DMA16 %d\n", dma); return 0; - }; + } ess_chgmixer (devc, 0x78, 0x20, dma16_bits); ess_chgmixer (devc, 0x7d, 0x07, dma_bits); } @@ -1584,7 +1584,7 @@ printk(KERN_INFO "FKS: write mixer %x: %x\n", port, value); udelay(20); outb(((unsigned char) (value & 0xff)), MIXER_DATA); udelay(20); - }; + } spin_unlock_irqrestore(&devc->lock, flags); } @@ -1761,7 +1761,7 @@ int ess_mixer_reset (sb_devc * devc) ess_chgmixer(devc, 0x7a, 0x18, 0x08); ess_chgmixer(devc, 0x1c, 0x07, 0x07); break; - }; + } /* * Call set_recmask for proper initialization */ diff --git a/sound/oss/sb_mixer.c b/sound/oss/sb_mixer.c index f8f3b7a66b73..acf7586aeb47 100644 --- a/sound/oss/sb_mixer.c +++ b/sound/oss/sb_mixer.c @@ -410,7 +410,7 @@ static int set_recmask(sb_devc * devc, int mask) case MDL_SMW: if (devc->model == MDL_ESS && ess_set_recmask (devc, &devmask)) { break; - }; + } if (devmask != SOUND_MASK_MIC && devmask != SOUND_MASK_LINE && devmask != SOUND_MASK_CD) @@ -666,7 +666,7 @@ static void sb_mixer_reset(sb_devc * devc) if (devc->model != MDL_ESS || !ess_mixer_reset (devc)) { set_recmask(devc, SOUND_MASK_MIC); - }; + } } int sb_mixer_init(sb_devc * devc, struct module *owner) diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c index 8db6aefe15e4..9f039831114c 100644 --- a/sound/oss/sys_timer.c +++ b/sound/oss/sys_timer.c @@ -57,7 +57,7 @@ poll_def_tmr(unsigned long dummy) { def_tmr.expires = (1) + jiffies; add_timer(&def_tmr); - }; + } if (tmr_running) { @@ -103,7 +103,7 @@ def_tmr_open(int dev, int mode) { def_tmr.expires = (1) + jiffies; add_timer(&def_tmr); - }; + } return 0; } diff --git a/sound/oss/uart6850.c b/sound/oss/uart6850.c index f3f914aa92ee..1079133dd6ab 100644 --- a/sound/oss/uart6850.c +++ b/sound/oss/uart6850.c @@ -146,7 +146,7 @@ static int uart6850_open(int dev, int mode, { /* printk("Midi6850: Midi busy\n");*/ return -EBUSY; - }; + } uart6850_cmd(UART_RESET); uart6850_input_loop(); diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index a51e3ce3c800..eedc017c1cd8 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -2658,7 +2658,7 @@ static int __devinit snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) hpi_ctl.dst_node_type, hpi_ctl.dst_node_index); continue; - }; + } if (err < 0) return err; } diff --git a/sound/pci/au88x0/au88x0_game.c b/sound/pci/au88x0/au88x0_game.c index c07c792bde8d..30a456700d89 100644 --- a/sound/pci/au88x0/au88x0_game.c +++ b/sound/pci/au88x0/au88x0_game.c @@ -100,7 +100,7 @@ static int __devinit vortex_gameport_register(vortex_t * vortex) if (!gp) { printk(KERN_ERR "vortex: cannot allocate memory for gameport\n"); return -ENOMEM; - }; + } gameport_set_name(gp, "AU88x0 Gameport"); gameport_set_phys(gp, "pci%s/gameport0", pci_name(vortex->pci_dev)); diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index e59f120742a4..b2405020284c 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c @@ -585,7 +585,7 @@ static int snd_vortex_pcm_vol_put(struct snd_kcontrol *kcontrol, case 4: mixin = p->mixin[i]; break; - }; + } vol = p->vol[i]; vortex_mix_setinputvolumebyte(vortex, vortex->mixplayb[i], mixin, vol); diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c index a0afa5057488..cae36597aa71 100644 --- a/sound/pci/emu10k1/emu10k1_callback.c +++ b/sound/pci/emu10k1/emu10k1_callback.c @@ -228,7 +228,7 @@ lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw, int i; for (i = 0; i < V_END; i++) { - best[i].time = (unsigned int)-1; /* XXX MAX_?INT really */; + best[i].time = (unsigned int)-1; /* XXX MAX_?INT really */ best[i].voice = -1; } diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index e22b8e2bbd88..0e6664fa6cd9 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -1310,7 +1310,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream) runtime->hw.channels_min = runtime->hw.channels_max = 16; break; - }; + } #endif #if 0 /* For 96kHz */ diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 848102e5d864..ea4b706c8d63 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2226,7 +2226,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock, case DEVICE_INTEL_ICH4: chip->spdif_idx = ICHD_SPBAR; break; - }; + } } chip->in_ac97_init = 1; diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c index bfbdc91e4cb3..e0f4d87555a0 100644 --- a/sound/pci/mixart/mixart_hwdep.c +++ b/sound/pci/mixart/mixart_hwdep.c @@ -538,7 +538,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw if ((err = snd_card_register(chip->card)) < 0) return err; - }; + } snd_printdd("miXart firmware downloaded and successfully set up\n"); diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index b63b3a86d3f4..5701787c0e6b 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c @@ -813,7 +813,7 @@ static int snd_amd7930_get_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem default: swval = &amd->pgain; break; - }; + } ucontrol->value.integer.value[0] = *swval; @@ -838,7 +838,7 @@ static int snd_amd7930_put_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem default: swval = &amd->pgain; break; - }; + } spin_lock_irqsave(&amd->lock, flags); diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index a6b0deb77746..ae35f5342e10 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -592,7 +592,7 @@ static __u32 reverse_bytes(__u32 b, int len) break; default: printk(KERN_ERR "DBRI reverse_bytes: unsupported length\n"); - }; + } return b; } -- cgit v1.2.3