Merge tag 'sound-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Sep 2017 19:44:53 +0000 (12:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Sep 2017 19:44:53 +0000 (12:44 -0700)
Pull sound updates from Takashi Iwai:
 "We have touched quite a lot of files but with fewer changes at this
  cycle; as you can see, most of changes are trivial fixes, especially
  constification patches.

  Among the massive attacks by constification gangs, we had a few core
  changes (mostly for ASoC core), as well the fixes and the updates by
  major vendors.

  Some highlights:

  ALSA core:

   - Fix possible races in control API user-TLV codes

   - Small cleanup of PCM core

  ASoC:

   - Continued work for componentization; still half-baked, but we're
     certainly progressing

   - Use of devres for jack detection GPIOs, rather as a cleanup

   - Jack detection support for Qualcomm MSM8916

   - Support for Allwinner H3, Cirrus Logic CS43130, Intel Kabylake
     systems with RT5663, Realtek RT274, TI TLV320AIC32x6 and Wolfson
     WM8523"

* tag 'sound-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (512 commits)
  ALSA: hda/ca0132 - Fix memory leak at error path
  ALSA: hda: Fix forget to free resource in error handling code path in hda_codec_driver_probe
  ASoC: cs43130: Fix unused compiler warnings for PM runtime
  ASoC: cs43130: Fix possible Oops with invalid dev_id
  ASoC: cs43130: fix spelling mistake: "irq_occurrance" -> "irq_occurrence"
  ALSA: atmel: Remove leftovers of AVR32 removal
  ALSA: atmel: convert AC97c driver to GPIO descriptor API
  ALSA: hda/realtek - Enable jack detection function for Intel ALC700
  ALSA: hda: Fix regression of hdmi eld control created based on invalid pcm
  ASoC: Intel: Skylake: Add IPC to configure the copier secondary pins
  ASoC: add missing compile rule for max98371
  ASoC: add missing compile rule for sirf-audio-codec
  ASoC: add missing compile rule for max98371
  ASoC: cs43130: Add devicetree bindings for CS43130
  ASoC: cs43130: Add support for CS43130 codec
  ASoC: make clock direction configurable in asoc-simple
  ALSA: ctxfi: Remove null check before kfree
  ASoC: max98927: Changed device property read function
  ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path
  ASoC: max98927: Added PM suspend and resume function
  ...

493 files changed:
Documentation/devicetree/bindings/sound/cs43130.txt [new file with mode: 0644]
Documentation/devicetree/bindings/sound/dmic.txt [new file with mode: 0644]
Documentation/devicetree/bindings/sound/mt2701-afe-pcm.txt
Documentation/devicetree/bindings/sound/qcom,msm8916-wcd-analog.txt
Documentation/devicetree/bindings/sound/renesas,rsnd.txt
Documentation/devicetree/bindings/sound/rockchip,pdm.txt
Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
Documentation/devicetree/bindings/sound/rockchip-i2s.txt
Documentation/devicetree/bindings/sound/rt274.txt [new file with mode: 0644]
Documentation/devicetree/bindings/sound/rt5663.txt
Documentation/devicetree/bindings/sound/samsung,odroid.txt
Documentation/devicetree/bindings/sound/simple-card.txt
Documentation/devicetree/bindings/sound/simple-scu-card.txt
Documentation/devicetree/bindings/sound/sun4i-i2s.txt
Documentation/devicetree/bindings/sound/tlv320aic32x4.txt
Documentation/devicetree/bindings/sound/tlv320aic3x.txt
Documentation/devicetree/bindings/sound/wm8524.txt [new file with mode: 0644]
include/sound/atmel-abdac.h [deleted file]
include/sound/atmel-ac97c.h [deleted file]
include/sound/core.h
include/sound/rt5663.h [new file with mode: 0644]
include/sound/rt5677.h [deleted file]
include/sound/simple_card_utils.h
include/sound/soc.h
include/sound/tlv320aic32x4.h
include/uapi/sound/snd_sst_tokens.h
sound/aoa/codecs/onyx.c
sound/aoa/codecs/tas.c
sound/aoa/soundbus/i2sbus/pcm.c
sound/arm/aaci.c
sound/arm/pxa2xx-pcm.c
sound/atmel/ac97c.c
sound/core/control.c
sound/core/control_compat.c
sound/core/init.c
sound/core/pcm.c
sound/core/pcm_compat.c
sound/core/pcm_native.c
sound/core/timer.c
sound/drivers/aloop.c
sound/drivers/dummy.c
sound/drivers/ml403-ac97cr.c
sound/drivers/mpu401/mpu401.c
sound/drivers/mpu401/mpu401_uart.c
sound/drivers/opl3/opl3_lib.c
sound/drivers/opl3/opl3_midi.c
sound/drivers/pcsp/pcsp.c
sound/drivers/pcsp/pcsp_lib.c
sound/drivers/vx/vx_core.c
sound/drivers/vx/vx_pcm.c
sound/firewire/bebob/bebob.h
sound/firewire/bebob/bebob_focusrite.c
sound/firewire/bebob/bebob_maudio.c
sound/firewire/bebob/bebob_terratec.c
sound/firewire/bebob/bebob_yamaha_terratec.c
sound/firewire/dice/dice.c
sound/firewire/fireface/ff-pcm.c
sound/firewire/fireface/ff-protocol-ff400.c
sound/firewire/fireface/ff.c
sound/firewire/fireface/ff.h
sound/firewire/fireworks/fireworks_proc.c
sound/firewire/isight.c
sound/firewire/motu/motu-midi.c
sound/firewire/motu/motu-pcm.c
sound/firewire/motu/motu-protocol-v2.c
sound/firewire/motu/motu-protocol-v3.c
sound/firewire/motu/motu-stream.c
sound/firewire/motu/motu.c
sound/firewire/motu/motu.h
sound/firewire/oxfw/oxfw-scs1x.c
sound/firewire/tascam/tascam.c
sound/hda/hdac_i915.c
sound/isa/ad1816a/ad1816a.c
sound/isa/ad1816a/ad1816a_lib.c
sound/isa/ad1848/ad1848.c
sound/isa/als100.c
sound/isa/azt2320.c
sound/isa/cmi8330.c
sound/isa/cs423x/cs4231.c
sound/isa/cs423x/cs4236.c
sound/isa/es1688/es1688.c
sound/isa/es1688/es1688_lib.c
sound/isa/es18xx.c
sound/isa/gus/gus_pcm.c
sound/isa/gus/interwave.c
sound/isa/msnd/msnd.c
sound/isa/msnd/msnd_pinnacle.c
sound/isa/opl3sa2.c
sound/isa/opti9xx/miro.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/isa/sb/emu8000_callback.c
sound/isa/sb/emu8000_pcm.c
sound/isa/sb/sb16.c
sound/isa/sb/sb16_main.c
sound/isa/sb/sb8_main.c
sound/isa/sscape.c
sound/isa/wavefront/wavefront.c
sound/isa/wss/wss_lib.c
sound/mips/hal2.c
sound/mips/sgio2audio.c
sound/parisc/harmony.c
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/als4000.c
sound/pci/asihpi/hpidebug.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/au88x0/au88x0_pcm.c
sound/pci/aw2/aw2-alsa.c
sound/pci/bt87x.c
sound/pci/ca0106/ca0106_main.c
sound/pci/cmipci.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/cs5535audio/cs5535audio_pcm.c
sound/pci/ctxfi/cthw20k1.c
sound/pci/ctxfi/cthw20k2.c
sound/pci/ctxfi/ctpcm.c
sound/pci/ctxfi/ctresource.c
sound/pci/ctxfi/ctsrc.c
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/emu10k1/emupcm.c
sound/pci/emu10k1/p16v.c
sound/pci/ens1370.c
sound/pci/es1938.c
sound/pci/es1968.c
sound/pci/fm801.c
sound/pci/hda/dell_wmi_helper.c
sound/pci/hda/hda_bind.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_ca0132.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/ice1712/delta.c
sound/pci/ice1712/ews.c
sound/pci/ice1712/hoontech.c
sound/pci/ice1712/hoontech.h
sound/pci/ice1712/juli.c
sound/pci/ice1712/phase.c
sound/pci/ice1712/quartet.c
sound/pci/ice1712/revo.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c
sound/pci/korg1212/korg1212.c
sound/pci/lola/lola_pcm.c
sound/pci/lx6464es/lx6464es.c
sound/pci/maestro3.c
sound/pci/mixart/mixart.c
sound/pci/mixart/mixart.h
sound/pci/nm256/nm256.c
sound/pci/pcxhr/pcxhr.c
sound/pci/pcxhr/pcxhr.h
sound/pci/pcxhr/pcxhr_mixer.c
sound/pci/riptide/riptide.c
sound/pci/rme32.c
sound/pci/rme96.c
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/hdspm.c
sound/pci/rme9652/rme9652.c
sound/pci/sis7019.c
sound/pci/sonicvibes.c
sound/pci/trident/trident_main.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/pci/ymfpci/ymfpci_main.c
sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
sound/ppc/pmac.c
sound/ppc/snd_ps3.c
sound/sh/aica.c
sound/sh/sh_dac_audio.c
sound/soc/atmel/atmel-classd.c
sound/soc/atmel/atmel-pdmic.c
sound/soc/au1x/db1200.c
sound/soc/au1x/dbdma2.c
sound/soc/au1x/dma.c
sound/soc/au1x/psc-ac97.c
sound/soc/au1x/psc-i2s.c
sound/soc/bcm/cygnus-ssp.c
sound/soc/blackfin/bf5xx-ac97-pcm.c
sound/soc/blackfin/bf5xx-i2s-pcm.c
sound/soc/blackfin/bf6xx-i2s.c
sound/soc/blackfin/bf6xx-sport.c
sound/soc/cirrus/edb93xx.c
sound/soc/cirrus/snappercl15.c
sound/soc/codecs/88pm860x-codec.c
sound/soc/codecs/Kconfig
sound/soc/codecs/Makefile
sound/soc/codecs/ab8500-codec.c
sound/soc/codecs/ac97.c
sound/soc/codecs/ad1836.c
sound/soc/codecs/ad193x.c
sound/soc/codecs/ad1980.c
sound/soc/codecs/ad73311.c
sound/soc/codecs/adau1373.c
sound/soc/codecs/adau1701.c
sound/soc/codecs/adau1977.c
sound/soc/codecs/adav80x.c
sound/soc/codecs/ads117x.c
sound/soc/codecs/ak4104.c
sound/soc/codecs/ak4535.c
sound/soc/codecs/ak4554.c
sound/soc/codecs/ak4613.c
sound/soc/codecs/ak4641.c
sound/soc/codecs/ak4642.c
sound/soc/codecs/ak4671.c
sound/soc/codecs/ak5386.c
sound/soc/codecs/alc5623.c
sound/soc/codecs/arizona.c
sound/soc/codecs/bt-sco.c
sound/soc/codecs/cq93vc.c
sound/soc/codecs/cs35l33.c
sound/soc/codecs/cs35l34.c
sound/soc/codecs/cs35l35.c
sound/soc/codecs/cs4271.c
sound/soc/codecs/cs42l42.c
sound/soc/codecs/cs42l51.c
sound/soc/codecs/cs43130.c [new file with mode: 0644]
sound/soc/codecs/cs43130.h [new file with mode: 0644]
sound/soc/codecs/cs4349.c
sound/soc/codecs/cs47l24.c
sound/soc/codecs/cs53l30.c
sound/soc/codecs/cx20442.c
sound/soc/codecs/da7210.c
sound/soc/codecs/da7213.c
sound/soc/codecs/da7218.c
sound/soc/codecs/da7219.c
sound/soc/codecs/da732x.c
sound/soc/codecs/da9055.c
sound/soc/codecs/dmic.c
sound/soc/codecs/es7134.c
sound/soc/codecs/es8316.c
sound/soc/codecs/es8328.c
sound/soc/codecs/hdac_hdmi.c
sound/soc/codecs/hdmi-codec.c
sound/soc/codecs/ics43432.c
sound/soc/codecs/inno_rk3036.c
sound/soc/codecs/isabelle.c
sound/soc/codecs/jz4740.c
sound/soc/codecs/lm4857.c
sound/soc/codecs/lm49453.c
sound/soc/codecs/max9768.c
sound/soc/codecs/max98088.c
sound/soc/codecs/max98090.c
sound/soc/codecs/max98095.c
sound/soc/codecs/max98357a.c
sound/soc/codecs/max98371.c
sound/soc/codecs/max9850.c
sound/soc/codecs/max9860.c
sound/soc/codecs/max9867.c
sound/soc/codecs/max98926.c
sound/soc/codecs/max98927.c
sound/soc/codecs/mc13783.c
sound/soc/codecs/ml26124.c
sound/soc/codecs/msm8916-wcd-analog.c
sound/soc/codecs/msm8916-wcd-digital.c
sound/soc/codecs/nau8540.c
sound/soc/codecs/nau8810.c
sound/soc/codecs/nau8824.c
sound/soc/codecs/nau8825.c
sound/soc/codecs/pcm1681.c
sound/soc/codecs/pcm179x.c
sound/soc/codecs/pcm3008.c
sound/soc/codecs/pcm512x.c
sound/soc/codecs/rt274.c [new file with mode: 0644]
sound/soc/codecs/rt274.h [new file with mode: 0644]
sound/soc/codecs/rt286.c
sound/soc/codecs/rt298.c
sound/soc/codecs/rt5514-spi.c
sound/soc/codecs/rt5514-spi.h
sound/soc/codecs/rt5514.c
sound/soc/codecs/rt5514.h
sound/soc/codecs/rt5616.c
sound/soc/codecs/rt5631.c
sound/soc/codecs/rt5640.c
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5651.c
sound/soc/codecs/rt5659.c
sound/soc/codecs/rt5660.c
sound/soc/codecs/rt5663.c
sound/soc/codecs/rt5663.h
sound/soc/codecs/rt5665.c
sound/soc/codecs/rt5665.h
sound/soc/codecs/rt5670.c
sound/soc/codecs/rt5677.c
sound/soc/codecs/rt5677.h
sound/soc/codecs/sgtl5000.c
sound/soc/codecs/si476x.c
sound/soc/codecs/sirf-audio-codec.c
sound/soc/codecs/sn95031.c
sound/soc/codecs/spdif_receiver.c
sound/soc/codecs/spdif_transmitter.c
sound/soc/codecs/ssm2518.c
sound/soc/codecs/ssm2602.c
sound/soc/codecs/ssm4567.c
sound/soc/codecs/sta32x.c
sound/soc/codecs/stac9766.c
sound/soc/codecs/tas2552.c
sound/soc/codecs/tas5086.c
sound/soc/codecs/tas5720.c
sound/soc/codecs/tlv320aic23.c
sound/soc/codecs/tlv320aic26.c
sound/soc/codecs/tlv320aic31xx.c
sound/soc/codecs/tlv320aic32x4-i2c.c
sound/soc/codecs/tlv320aic32x4-spi.c
sound/soc/codecs/tlv320aic32x4.c
sound/soc/codecs/tlv320aic32x4.h
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320aic3x.h
sound/soc/codecs/tlv320dac33.c
sound/soc/codecs/twl4030.c
sound/soc/codecs/twl6040.c
sound/soc/codecs/uda134x.c
sound/soc/codecs/uda1380.c
sound/soc/codecs/wl1273.c
sound/soc/codecs/wm5102.c
sound/soc/codecs/wm5110.c
sound/soc/codecs/wm8523.c
sound/soc/codecs/wm8524.c [new file with mode: 0644]
sound/soc/codecs/wm8804.c
sound/soc/codecs/zx_aud96p22.c
sound/soc/davinci/davinci-mcasp.c
sound/soc/davinci/davinci-vcif.c
sound/soc/dwc/dwc-i2s.c
sound/soc/fsl/fsl-asoc-card.c
sound/soc/fsl/fsl_asrc.c
sound/soc/fsl/fsl_asrc_dma.c
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_spdif.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/imx-audmux.c
sound/soc/fsl/imx-es8328.c
sound/soc/fsl/imx-pcm-fiq.c
sound/soc/fsl/mpc5200_dma.c
sound/soc/generic/audio-graph-card.c
sound/soc/generic/audio-graph-scu-card.c
sound/soc/generic/simple-card-utils.c
sound/soc/generic/simple-card.c
sound/soc/generic/simple-scu-card.c
sound/soc/hisilicon/hi6210-i2s.c
sound/soc/img/img-i2s-in.c
sound/soc/img/img-i2s-out.c
sound/soc/img/img-parallel-out.c
sound/soc/img/img-spdif-in.c
sound/soc/img/img-spdif-out.c
sound/soc/intel/Kconfig
sound/soc/intel/atom/sst-mfld-platform-pcm.c
sound/soc/intel/atom/sst/sst_drv_interface.c
sound/soc/intel/atom/sst/sst_pci.c
sound/soc/intel/baytrail/sst-baytrail-pcm.c
sound/soc/intel/boards/bxt_rt298.c
sound/soc/intel/boards/byt-max98090.c
sound/soc/intel/boards/kbl_rt5663_max98927.c
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
sound/soc/intel/boards/mfld_machine.c
sound/soc/intel/haswell/sst-haswell-pcm.c
sound/soc/intel/skylake/Makefile
sound/soc/intel/skylake/bxt-sst.c
sound/soc/intel/skylake/cnl-sst-dsp.c [new file with mode: 0644]
sound/soc/intel/skylake/cnl-sst-dsp.h [new file with mode: 0644]
sound/soc/intel/skylake/cnl-sst.c [new file with mode: 0644]
sound/soc/intel/skylake/skl-messages.c
sound/soc/intel/skylake/skl-pcm.c
sound/soc/intel/skylake/skl-sst-dsp.c
sound/soc/intel/skylake/skl-sst-ipc.c
sound/soc/intel/skylake/skl-sst-ipc.h
sound/soc/intel/skylake/skl-sst-utils.c
sound/soc/intel/skylake/skl-sst.c
sound/soc/intel/skylake/skl-topology.c
sound/soc/intel/skylake/skl-topology.h
sound/soc/intel/skylake/skl.c
sound/soc/intel/skylake/skl.h
sound/soc/jz4740/jz4740-i2s.c
sound/soc/kirkwood/kirkwood-dma.c
sound/soc/kirkwood/kirkwood-i2s.c
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
sound/soc/mediatek/mt8173/mt8173-rt5650.c
sound/soc/mxs/mxs-saif.c
sound/soc/mxs/mxs-sgtl5000.c
sound/soc/nuc900/nuc900-pcm.c
sound/soc/omap/ams-delta.c
sound/soc/omap/omap-pcm.c
sound/soc/omap/omap-twl4030.c
sound/soc/omap/rx51.c
sound/soc/pxa/hx4700.c
sound/soc/pxa/mmp-pcm.c
sound/soc/pxa/mmp-sspa.c
sound/soc/pxa/pxa2xx-pcm.c
sound/soc/qcom/apq8016_sbc.c
sound/soc/qcom/lpass-platform.c
sound/soc/qcom/storm.c
sound/soc/rockchip/Kconfig
sound/soc/rockchip/rk3288_hdmi_analog.c
sound/soc/rockchip/rk3399_gru_sound.c
sound/soc/rockchip/rockchip_i2s.c
sound/soc/rockchip/rockchip_pdm.c
sound/soc/samsung/h1940_uda1380.c
sound/soc/samsung/i2s.c
sound/soc/samsung/idma.c
sound/soc/samsung/jive_wm8750.c
sound/soc/samsung/odroid.c
sound/soc/samsung/pcm.c
sound/soc/samsung/rx1950_uda1380.c
sound/soc/samsung/s3c-i2s-v2.c
sound/soc/samsung/s3c-i2s-v2.h
sound/soc/samsung/s3c2412-i2s.c
sound/soc/samsung/s3c24xx-i2s.c
sound/soc/samsung/s3c24xx_simtec.c
sound/soc/samsung/s3c24xx_uda134x.c
sound/soc/samsung/smartq_wm8987.c
sound/soc/samsung/smdk_spdif.c
sound/soc/samsung/spdif.c
sound/soc/samsung/tm2_wm5110.c
sound/soc/sh/dma-sh7760.c
sound/soc/sh/fsi.c
sound/soc/sh/migor.c
sound/soc/sh/rcar/adg.c
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/ctu.c
sound/soc/sh/rcar/dma.c
sound/soc/sh/rcar/dvc.c
sound/soc/sh/rcar/gen.c
sound/soc/sh/rcar/mix.c
sound/soc/sh/rcar/rsnd.h
sound/soc/sh/rcar/src.c
sound/soc/sh/rcar/ssi.c
sound/soc/sh/rcar/ssiu.c
sound/soc/sh/siu_dai.c
sound/soc/sh/siu_pcm.c
sound/soc/soc-compress.c
sound/soc/soc-core.c
sound/soc/soc-jack.c
sound/soc/soc-pcm.c
sound/soc/soc-utils.c
sound/soc/spear/spdif_in.c
sound/soc/spear/spdif_out.c
sound/soc/stm/stm32_i2s.c
sound/soc/stm/stm32_sai.c
sound/soc/stm/stm32_spdifrx.c
sound/soc/sunxi/sun4i-codec.c
sound/soc/sunxi/sun4i-i2s.c
sound/soc/sunxi/sun4i-spdif.c
sound/soc/sunxi/sun8i-codec.c
sound/soc/tegra/Kconfig
sound/soc/tegra/tegra30_ahub.c
sound/soc/tegra/tegra30_i2s.c
sound/soc/tegra/tegra_alc5632.c
sound/soc/tegra/tegra_max98090.c
sound/soc/tegra/tegra_rt5640.c
sound/soc/tegra/tegra_rt5677.c
sound/soc/tegra/tegra_sgtl5000.c
sound/soc/tegra/tegra_wm8753.c
sound/soc/tegra/tegra_wm8903.c
sound/soc/tegra/tegra_wm9712.c
sound/soc/tegra/trimslice.c
sound/soc/txx9/txx9aclc.c
sound/soc/ux500/mop500.c
sound/soc/ux500/ux500_msp_dai.c
sound/soc/zte/zx-i2s.c
sound/soc/zte/zx-spdif.c
sound/soc/zte/zx-tdm.c
sound/sparc/amd7930.c
sound/sparc/cs4231.c
sound/sparc/dbri.c
sound/spi/at73c213.c
sound/synth/emux/emux_seq.c
sound/usb/6fire/chip.c
sound/usb/6fire/pcm.c
sound/usb/bcd2000/bcd2000.c
sound/usb/caiaq/audio.c
sound/usb/caiaq/device.c
sound/usb/card.c
sound/usb/hiface/pcm.c
sound/usb/midi.c
sound/usb/misc/ua101.c
sound/usb/mixer.c
sound/usb/pcm.c
sound/usb/quirks.c
sound/usb/stream.c
sound/usb/usx2y/us122l.c
sound/usb/usx2y/usb_stream.c
sound/usb/usx2y/usbusx2y.c
sound/usb/usx2y/usbusx2yaudio.c
sound/usb/usx2y/usx2yhwdeppcm.c

diff --git a/Documentation/devicetree/bindings/sound/cs43130.txt b/Documentation/devicetree/bindings/sound/cs43130.txt
new file mode 100644 (file)
index 0000000..8b1dd5a
--- /dev/null
@@ -0,0 +1,67 @@
+CS43130 DAC
+
+Required properties:
+
+  - compatible : "cirrus,cs43130", "cirrus,cs4399", "cirrus,cs43131",
+                 "cirrus,cs43198"
+
+  - reg : the I2C address of the device for I2C
+
+  - VA-supply, VP-supply, VL-supply, VCP-supply, VD-supply:
+       power supplies for the device, as covered in
+       Documentation/devicetree/bindings/regulator/regulator.txt.
+
+
+Optional properties:
+
+  - reset-gpios : Active low GPIO used to reset the device
+
+  - cirrus,xtal-ibias:
+   When external MCLK is generated by external crystal
+   oscillator, CS43130 can be used to provide bias current
+   for external crystal.  Amount of bias current sent is
+   set as:
+   1 = 7.5uA
+   2 = 12.5uA
+   3 = 15uA
+
+  - cirrus,dc-measure:
+   Boolean, define to enable headphone DC impedance measurement.
+
+  - cirrus,ac-measure:
+   Boolean, define to enable headphone AC impedance measurement.
+   DC impedance must also be enabled for AC impedance measurement.
+
+  - cirrus,dc-threshold:
+   Define 2 DC impedance thresholds in ohms for HP output control.
+   Default values are 50 and 120 Ohms.
+
+  - cirrus,ac-freq:
+   Define the frequencies at which to measure HP AC impedance.
+   Only used if "cirrus,dc-measure" is defined.
+   Exactly 10 frequencies must be defined.
+   If this properties is undefined, by default,
+   following frequencies are used:
+   <24 43 93 200 431 928 2000 4309 9283 20000>
+   The above frequencies are logarithmically equally spaced.
+   Log base is 10.
+
+Example:
+
+cs43130: audio-codec@30 {
+   compatible = "cirrus,cs43130";
+   reg = <0x30>;
+   reset-gpios = <&axi_gpio 54 0>;
+   VA-supply = <&dummy_vreg>;
+   VP-supply = <&dummy_vreg>;
+   VL-supply = <&dummy_vreg>;
+   VCP-supply = <&dummy_vreg>;
+   VD-supply = <&dummy_vreg>;
+   cirrus,xtal-ibias = <2>;
+   interrupt-parent = <&gpio0>;
+   interrupts = <55 8>;
+   cirrus,dc-measure;
+   cirrus,ac-measure;
+   cirrus,dc-threshold = /bits/ 16 <20 100>;
+   cirrus,ac-freq = /bits/ 16 <24 43 93 200 431 928 2000 4309 9283 20000>;
+};
diff --git a/Documentation/devicetree/bindings/sound/dmic.txt b/Documentation/devicetree/bindings/sound/dmic.txt
new file mode 100644 (file)
index 0000000..54c8ef6
--- /dev/null
@@ -0,0 +1,16 @@
+Device-Tree bindings for Digital microphone (DMIC) codec
+
+This device support generic PDM digital microphone.
+
+Required properties:
+       - compatible: should be "dmic-codec".
+
+Optional properties:
+       - dmicen-gpios: GPIO specifier for dmic to control start and stop
+
+Example node:
+
+       dmic_codec: dmic@0 {
+               compatible = "dmic-codec";
+               dmicen-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
+       };
index 9800a560e0c20586e4c7ba4ccbcddab44575b437..77a57f84bed486204f0a7caa3780d6e18416544a 100644 (file)
@@ -3,7 +3,8 @@ Mediatek AFE PCM controller for mt2701
 Required properties:
 - compatible = "mediatek,mt2701-audio";
 - reg: register location and size
-- interrupts: Should contain AFE interrupt
+- interrupts: should contain AFE and ASYS interrupts
+- interrupt-names: should be "afe" and "asys"
 - power-domains: should define the power domain
 - clock-names: should have these clock names:
                "infra_sys_audio_clk",
@@ -59,6 +60,7 @@ Example:
                      <0 0x112A0000 0 0x20000>;
                interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>,
                             <GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>;
+               interrupt-names = "afe", "asys";
                power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
                clocks = <&infracfg CLK_INFRA_AUDIO>,
                         <&topckgen CLK_TOP_AUD_MUX1_SEL>,
index ccb401cfef9da31b13d4ffbaec7909357c137b22..551ecab67efe89ba4f5f0f0da6951a605598f289 100644 (file)
@@ -31,8 +31,22 @@ Required properties
  - vdd-cdc-io-supply: phandle to VDD_CDC_IO regulator DT node.
  - vdd-cdc-tx-rx-cx-supply: phandle to VDD_CDC_TX/RX/CX regulator DT node.
  - vdd-micbias-supply: phandle of VDD_MICBIAS supply's regulator DT node.
-
 Optional Properties:
+ - qcom,mbhc-vthreshold-low: Array of 5 threshold voltages in mV for 5 buttons
+                            detection on headset when the mbhc is powered up
+                            by internal current source, this is a low power.
+ - qcom,mbhc-vthreshold-high: Array of 5 thresold voltages in mV for 5 buttons
+                             detection on headset when mbhc is powered up
+                              from micbias.
+- qcom,micbias-lvl:  Voltage (mV) for Mic Bias
+- qcom,hphl-jack-type-normally-open: boolean, present if hphl pin on jack is a
+                                    NO (Normally Open). If not specified, then
+                                    its assumed that hphl pin on jack is NC
+                                    (Normally Closed).
+- qcom,gnd-jack-type-normally-open: boolean, present if gnd pin on jack is
+                                   NO (Normally Open). If not specified, then
+                                   its assumed that gnd pin on jack is NC
+                                   (Normally Closed).
 - qcom,micbias1-ext-cap: boolean, present if micbias1 has external capacitor
                         connected.
 - qcom,micbias2-ext-cap: boolean, present if micbias2 has external capacitor
@@ -48,6 +62,8 @@ spmi_bus {
                reg-names = "pmic-codec-core";
                clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
                clock-names = "mclk";
+               qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
+               qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
                interrupt-parent = <&spmi_bus>;
                interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>,
                             <0x1 0xf0 0x1 IRQ_TYPE_NONE>,
index 7246bb268bf9bab6a49c78af481455a8fb744e42..a1536fdc60e62c4921ef01869c1da9fe4b31d69c 100644 (file)
@@ -199,10 +199,10 @@ Ex)
        sound {
                compatible = "simple-scu-audio-card";
                ...
-               simple-audio-card,cpu@0 {
+               simple-audio-card,cpu-0 {
                        sound-dai = <&rcar_sound 0>;
                };
-               simple-audio-card,cpu@1 {
+               simple-audio-card,cpu-1 {
                        sound-dai = <&rcar_sound 1>;
                };
                simple-audio-card,codec {
@@ -441,79 +441,79 @@ rcar_sound: sound@ec500000 {
                        "clk_a", "clk_b", "clk_c", "clk_i";
 
        rcar_sound,dvc {
-               dvc0: dvc@0 {
+               dvc0: dvc-0 {
                        dmas = <&audma0 0xbc>;
                        dma-names = "tx";
                };
-               dvc1: dvc@1 {
+               dvc1: dvc-1 {
                        dmas = <&audma0 0xbe>;
                        dma-names = "tx";
                };
        };
 
        rcar_sound,mix {
-               mix0: mix@0 { };
-               mix1: mix@1 { };
+               mix0: mix-0 { };
+               mix1: mix-1 { };
        };
 
        rcar_sound,ctu {
-               ctu00: ctu@0 { };
-               ctu01: ctu@1 { };
-               ctu02: ctu@2 { };
-               ctu03: ctu@3 { };
-               ctu10: ctu@4 { };
-               ctu11: ctu@5 { };
-               ctu12: ctu@6 { };
-               ctu13: ctu@7 { };
+               ctu00: ctu-0 { };
+               ctu01: ctu-1 { };
+               ctu02: ctu-2 { };
+               ctu03: ctu-3 { };
+               ctu10: ctu-4 { };
+               ctu11: ctu-5 { };
+               ctu12: ctu-6 { };
+               ctu13: ctu-7 { };
        };
 
        rcar_sound,src {
-               src0: src@0 {
+               src0: src-0 {
                        interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x85>, <&audma1 0x9a>;
                        dma-names = "rx", "tx";
                };
-               src1: src@1 {
+               src1: src-1 {
                        interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x87>, <&audma1 0x9c>;
                        dma-names = "rx", "tx";
                };
-               src2: src@2 {
+               src2: src-2 {
                        interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x89>, <&audma1 0x9e>;
                        dma-names = "rx", "tx";
                };
-               src3: src@3 {
+               src3: src-3 {
                        interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x8b>, <&audma1 0xa0>;
                        dma-names = "rx", "tx";
                };
-               src4: src@4 {
+               src4: src-4 {
                        interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x8d>, <&audma1 0xb0>;
                        dma-names = "rx", "tx";
                };
-               src5: src@5 {
+               src5: src-5 {
                        interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x8f>, <&audma1 0xb2>;
                        dma-names = "rx", "tx";
                };
-               src6: src@6 {
+               src6: src-6 {
                        interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x91>, <&audma1 0xb4>;
                        dma-names = "rx", "tx";
                };
-               src7: src@7 {
+               src7: src-7 {
                        interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x93>, <&audma1 0xb6>;
                        dma-names = "rx", "tx";
                };
-               src8: src@8 {
+               src8: src-8 {
                        interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x95>, <&audma1 0xb8>;
                        dma-names = "rx", "tx";
                };
-               src9: src@9 {
+               src9: src-9 {
                        interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x97>, <&audma1 0xba>;
                        dma-names = "rx", "tx";
@@ -521,52 +521,52 @@ rcar_sound: sound@ec500000 {
        };
 
        rcar_sound,ssi {
-               ssi0: ssi@0 {
+               ssi0: ssi-0 {
                        interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi1: ssi@1 {
+               ssi1: ssi-1 {
                        interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi2: ssi@2 {
+               ssi2: ssi-2 {
                        interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi3: ssi@3 {
+               ssi3: ssi-3 {
                        interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi4: ssi@4 {
+               ssi4: ssi-4 {
                        interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi5: ssi@5 {
+               ssi5: ssi-5 {
                        interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi6: ssi@6 {
+               ssi6: ssi-6 {
                        interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi7: ssi@7 {
+               ssi7: ssi-7 {
                        interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi8: ssi@8 {
+               ssi8: ssi-8 {
                        interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
                        dma-names = "rx", "tx", "rxu", "txu";
                };
-               ssi9: ssi@9 {
+               ssi9: ssi-9 {
                        interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>;
                        dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
                        dma-names = "rx", "tx", "rxu", "txu";
index 921729de7346eb659f4bceba0a71f97d3922b577..2ad66f649a28fabed59c28e518a3b68f6d7c2973 100644 (file)
@@ -29,11 +29,14 @@ pdm: pdm@ff040000 {
        dma-names = "rx";
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&pdmm0_clk
-                    &pdmm0_fsync
                     &pdmm0_sdi0
                     &pdmm0_sdi1
                     &pdmm0_sdi2
                     &pdmm0_sdi3>;
-       pinctrl-1 = <&pdmm0_sleep>;
+       pinctrl-1 = <&pdmm0_clk_sleep
+                    &pdmm0_sdi0_sleep
+                    &pdmm0_sdi1_sleep
+                    &pdmm0_sdi2_sleep
+                    &pdmm0_sdi3_sleep>;
        status = "disabled";
 };
index eac91db07178891aff5bf2fb10102b9a6a9f24d0..72d3cf4c2606006ecaae21a126b6e2c2045a4ec0 100644 (file)
@@ -4,7 +4,7 @@ Required properties:
 - compatible: "rockchip,rk3399-gru-sound"
 - rockchip,cpu: The phandle of the Rockchip I2S controller that's
   connected to the codecs
-- rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs
+- rockchip,codec: The phandle of the audio codecs
 
 Optional properties:
 - dmic-wakeup-delay-ms : specify delay time (ms) for DMIC ready.
index 206aba1b34bb5a3f44e528d874a7520e5882c3fc..b208a752576c1173669d2d408b60101d05b361ac 100644 (file)
@@ -7,8 +7,12 @@ Required properties:
 
 - compatible: should be one of the following:
    - "rockchip,rk3066-i2s": for rk3066
+   - "rockchip,rk3036-i2s", "rockchip,rk3066-i2s": for rk3036
    - "rockchip,rk3188-i2s", "rockchip,rk3066-i2s": for rk3188
+   - "rockchip,rk3228-i2s", "rockchip,rk3066-i2s": for rk3228
    - "rockchip,rk3288-i2s", "rockchip,rk3066-i2s": for rk3288
+   - "rockchip,rk3328-i2s", "rockchip,rk3066-i2s": for rk3328
+   - "rockchip,rk3366-i2s", "rockchip,rk3066-i2s": for rk3366
    - "rockchip,rk3368-i2s", "rockchip,rk3066-i2s": for rk3368
    - "rockchip,rk3399-i2s", "rockchip,rk3066-i2s": for rk3399
 - reg: physical base address of the controller and length of memory mapped
diff --git a/Documentation/devicetree/bindings/sound/rt274.txt b/Documentation/devicetree/bindings/sound/rt274.txt
new file mode 100644 (file)
index 0000000..e9a6178
--- /dev/null
@@ -0,0 +1,33 @@
+RT274 audio CODEC
+
+This device supports I2C only.
+
+Required properties:
+
+- compatible : "realtek,rt274".
+
+- reg : The I2C address of the device.
+
+Optional properties:
+
+- interrupts : The CODEC's interrupt output.
+
+
+Pins on the device (for linking into audio routes) for RT274:
+
+  * DMIC1 Pin
+  * DMIC2 Pin
+  * MIC
+  * LINE1
+  * LINE2
+  * HPO Pin
+  * SPDIF
+  * LINE3
+
+Example:
+
+codec: rt274@1c {
+       compatible = "realtek,rt274";
+       reg = <0x1c>;
+       interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
+};
index 70eaeaed2b18c70675ad87cb9a2dfc397aad6916..ff381718c51755b5d3cb06ac7c0e3ae1a1c85f48 100644 (file)
@@ -12,6 +12,14 @@ Required properties:
 
 Optional properties:
 
+- "realtek,dc_offset_l_manual"
+- "realtek,dc_offset_r_manual"
+- "realtek,dc_offset_l_manual_mic"
+- "realtek,dc_offset_r_manual_mic"
+  Based on the different PCB layout, add the manual offset value to
+  compensate the DC offset for each L and R channel, and they are different
+  between headphone and headset.
+
 Pins on the device (for linking into audio routes) for RT5663:
 
   * IN1P
index c30934dd975bd0bc4090370311bcbc49566c0a39..625b1b18fd027b110f9bcef0ddae383c5e710925 100644 (file)
@@ -7,9 +7,6 @@ Required properties:
  - model - the user-visible name of this sound complex
  - clocks - should contain entries matching clock names in the clock-names
     property
- - clock-names - should contain following entries:
-    - "epll" - indicating the EPLL output clock
-    - "i2s_rclk" - indicating the RCLK (root) clock of the I2S0 controller
  - samsung,audio-widgets - this property specifies off-codec audio elements
    like headphones or speakers, for details see widgets.txt
  - samsung,audio-routing - a list of the connections between audio
@@ -46,9 +43,6 @@ sound {
                "IN1", "Mic Jack",
                "Mic Jack", "MICBIAS";
 
-       clocks = <&clock CLK_FOUT_EPLL>, <&i2s0 CLK_I2S_RCLK_SRC>;
-       clock-names = "epll", "sclk_i2s";
-
        cpu {
                sound-dai = <&i2s0 0>;
        };
index c7a93931fad27c7d88069925ae5125434f3e8f74..166f2290233b2f55f11dabe42ea9362e0697e30d 100644 (file)
@@ -86,6 +86,9 @@ Optional CPU/CODEC subnodes properties:
                                          in dai startup() and disabled with
                                          clk_disable_unprepare() in dai
                                          shutdown().
+- system-clock-direction-out           : specifies clock direction as 'out' on
+                                         initialization. It is useful for some aCPUs with
+                                         fixed clocks.
 
 Example 1 - single DAI link:
 
index 327d229a51b27e126fad58678a75dd2c803fed54..32f8dbce5241d4a9ad612c7c47e0890fc3438625 100644 (file)
@@ -24,6 +24,7 @@ Optional subnode properties:
 - simple-audio-card,convert-rate       : platform specified sampling rate convert
 - simple-audio-card,convert-channels   : platform specified converted channel size (2 - 8 ch)
 - simple-audio-card,prefix             : see routing
+- simple-audio-card,widgets            : Please refer to widgets.txt.
 - simple-audio-card,routing            : A list of the connections between audio components.
                                          Each entry is a pair of strings, the first being the connection's sink,
                                          the second being the connection's source. Valid names for sources.
index ee21da865771f303c9b21a288b5b1a293662aac7..fc5da6080759d26e0d65fc0c576f128c0bc70dfc 100644 (file)
@@ -8,6 +8,7 @@ Required properties:
 - compatible: should be one of the following:
    - "allwinner,sun4i-a10-i2s"
    - "allwinner,sun6i-a31-i2s"
+   - "allwinner,sun8i-h3-i2s"
 - reg: physical base address of the controller and length of memory mapped
   region.
 - interrupts: should contain the I2S interrupt.
@@ -22,6 +23,7 @@ Required properties:
 
 Required properties for the following compatibles:
        - "allwinner,sun6i-a31-i2s"
+       - "allwinner,sun8i-h3-i2s"
 - resets: phandle to the reset line for this codec
 
 Example:
index 5e2741af27be5f1b07dc775b35db88cdfe57522c..ca75890f0d0722b68a581eb660f1ddd3acf69f0c 100644 (file)
@@ -3,7 +3,9 @@ Texas Instruments - tlv320aic32x4 Codec module
 The tlv320aic32x4 serial control bus communicates through I2C protocols
 
 Required properties:
- - compatible: Should be "ti,tlv320aic32x4"
+ - compatible - "string" - One of:
+       "ti,tlv320aic32x4" TLV320AIC3204
+       "ti,tlv320aic32x6" TLV320AIC3206, TLV320AIC3256
  - reg: I2C slave address
  - supply-*: Required supply regulators are:
     "iov" - digital IO power supply
@@ -18,6 +20,8 @@ Optional properties:
  - reset-gpios: Reset-GPIO phandle with args as described in gpio/gpio.txt
  - clocks/clock-names: Clock named 'mclk' for the master clock of the codec.
    See clock/clock-bindings.txt for information about the detailed format.
+ - aic32x4-gpio-func - <array of 5 int>
+       - Types are defined in include/sound/tlv320aic32x4.h
 
 
 Example:
@@ -27,4 +31,11 @@ codec: tlv320aic32x4@18 {
        reg = <0x18>;
        clocks = <&clks 201>;
        clock-names = "mclk";
+       aic32x4-gpio-func= <
+                       0xff /* AIC32X4_MFPX_DEFAULT_VALUE */
+                       0xff /* AIC32X4_MFPX_DEFAULT_VALUE */
+                       0x04 /* MFP3 AIC32X4_MFP3_GPIO_ENABLED */
+                       0xff /* AIC32X4_MFPX_DEFAULT_VALUE */
+                       0x08 /* MFP5 AIC32X4_MFP5_GPIO_INPUT */
+               >;
 };
index 47a213c411ce922321e692ecca849390cbcd53e8..ba5b45c483f5da6c3b1ced1d3d43416fc0f1851e 100644 (file)
@@ -26,6 +26,11 @@ Optional properties:
        3 - MICBIAS output is connected to AVDD,
        If this node is not mentioned or if the value is incorrect, then MicBias
        is powered down.
+- ai3x-ocmv - Output Common-Mode Voltage selection:
+       0 - 1.35V,
+       1 - 1.5V,
+       2 - 1.65V,
+       3 - 1.8V
 - AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the
   device as covered in Documentation/devicetree/bindings/regulator/regulator.txt
 
diff --git a/Documentation/devicetree/bindings/sound/wm8524.txt b/Documentation/devicetree/bindings/sound/wm8524.txt
new file mode 100644 (file)
index 0000000..20c6200
--- /dev/null
@@ -0,0 +1,16 @@
+WM8524 audio CODEC
+
+This device does not use I2C or SPI but a simple Hardware Control Interface.
+
+Required properties:
+
+  - compatible : "wlf,wm8524"
+
+  - wlf,mute-gpios: a GPIO spec for the MUTE pin.
+
+Example:
+
+codec: wm8524@0 {
+       compatible = "wlf,wm8524";
+       wlf,mute-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
+};
diff --git a/include/sound/atmel-abdac.h b/include/sound/atmel-abdac.h
deleted file mode 100644 (file)
index a8f735d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Driver for the Atmel Audio Bitstream DAC (ABDAC)
- *
- * Copyright (C) 2009 Atmel Corporation
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-#ifndef __INCLUDE_SOUND_ATMEL_ABDAC_H
-#define __INCLUDE_SOUND_ATMEL_ABDAC_H
-
-#include <linux/platform_data/dma-dw.h>
-
-/**
- * struct atmel_abdac_pdata - board specific ABDAC configuration
- * @dws: DMA slave interface to use for sound playback.
- */
-struct atmel_abdac_pdata {
-       struct dw_dma_slave     dws;
-};
-
-#endif /* __INCLUDE_SOUND_ATMEL_ABDAC_H */
diff --git a/include/sound/atmel-ac97c.h b/include/sound/atmel-ac97c.h
deleted file mode 100644 (file)
index f2a1cdc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Driver for the Atmel AC97C controller
- *
- * Copyright (C) 2005-2009 Atmel Corporation
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-#ifndef __INCLUDE_SOUND_ATMEL_AC97C_H
-#define __INCLUDE_SOUND_ATMEL_AC97C_H
-
-#include <linux/platform_data/dma-dw.h>
-
-#define AC97C_CAPTURE  0x01
-#define AC97C_PLAYBACK 0x02
-#define AC97C_BOTH     (AC97C_CAPTURE | AC97C_PLAYBACK)
-
-/**
- * struct atmel_ac97c_pdata - board specific AC97C configuration
- * @rx_dws: DMA slave interface to use for sound capture.
- * @tx_dws: DMA slave interface to use for sound playback.
- * @reset_pin: GPIO pin wired to the reset input on the external AC97 codec,
- *             optional to use, set to -ENODEV if not in use. AC97 layer will
- *             try to do a software reset of the external codec anyway.
- *
- * If the user do not want to use a DMA channel for playback or capture, i.e.
- * only one feature is required on the board. The slave for playback or capture
- * can be set to NULL. The AC97C driver will take use of this when setting up
- * the sound streams.
- */
-struct ac97c_platform_data {
-       struct dw_dma_slave     rx_dws;
-       struct dw_dma_slave     tx_dws;
-       int                     reset_pin;
-};
-
-#endif /* __INCLUDE_SOUND_ATMEL_AC97C_H */
index 55385588eefa082e28811f6b61a1c3da56f32b0f..4104a9d1001fcb0f14709c0ad029561e6b03eefe 100644 (file)
@@ -118,8 +118,6 @@ struct snd_card {
        int user_ctl_count;             /* count of all user controls */
        struct list_head controls;      /* all controls for this card */
        struct list_head ctl_files;     /* active control files */
-       struct mutex user_ctl_lock;     /* protects user controls against
-                                          concurrent access */
 
        struct snd_info_entry *proc_root;       /* root for soundcard specific files */
        struct snd_info_entry *proc_id; /* the card id */
@@ -138,7 +136,6 @@ struct snd_card {
 
 #ifdef CONFIG_PM
        unsigned int power_state;       /* power state */
-       struct mutex power_lock;        /* power lock */
        wait_queue_head_t power_sleep;
 #endif
 
@@ -151,16 +148,6 @@ struct snd_card {
 #define dev_to_snd_card(p)     container_of(p, struct snd_card, card_dev)
 
 #ifdef CONFIG_PM
-static inline void snd_power_lock(struct snd_card *card)
-{
-       mutex_lock(&card->power_lock);
-}
-
-static inline void snd_power_unlock(struct snd_card *card)
-{
-       mutex_unlock(&card->power_lock);
-}
-
 static inline unsigned int snd_power_get_state(struct snd_card *card)
 {
        return card->power_state;
@@ -177,8 +164,6 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state);
 
 #else /* ! CONFIG_PM */
 
-#define snd_power_lock(card)           do { (void)(card); } while (0)
-#define snd_power_unlock(card)         do { (void)(card); } while (0)
 static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; }
 #define snd_power_get_state(card)      ({ (void)(card); SNDRV_CTL_POWER_D0; })
 #define snd_power_change_state(card, state)    do { (void)(card); } while (0)
diff --git a/include/sound/rt5663.h b/include/sound/rt5663.h
new file mode 100644 (file)
index 0000000..7d00e58
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * linux/sound/rt5663.h -- Platform data for RT5663
+ *
+ * Copyright 2017 Realtek Semiconductor Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_SND_RT5663_H
+#define __LINUX_SND_RT5663_H
+
+struct rt5663_platform_data {
+       unsigned int dc_offset_l_manual;
+       unsigned int dc_offset_r_manual;
+       unsigned int dc_offset_l_manual_mic;
+       unsigned int dc_offset_r_manual_mic;
+};
+
+#endif
+
diff --git a/include/sound/rt5677.h b/include/sound/rt5677.h
deleted file mode 100644 (file)
index a620704..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * linux/sound/rt5677.h -- Platform data for RT5677
- *
- * Copyright 2013 Realtek Semiconductor Corp.
- * Author: Oder Chiou <oder_chiou@realtek.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __LINUX_SND_RT5677_H
-#define __LINUX_SND_RT5677_H
-
-enum rt5677_dmic2_clk {
-       RT5677_DMIC_CLK1 = 0,
-       RT5677_DMIC_CLK2 = 1,
-};
-
-
-struct rt5677_platform_data {
-       /* IN1/IN2/LOUT1/LOUT2/LOUT3 can optionally be differential */
-       bool in1_diff;
-       bool in2_diff;
-       bool lout1_diff;
-       bool lout2_diff;
-       bool lout3_diff;
-       /* DMIC2 clock source selection */
-       enum rt5677_dmic2_clk dmic2_clk_pin;
-
-       /* configures GPIO, 0 - floating, 1 - pulldown, 2 - pullup */
-       u8 gpio_config[6];
-
-       /* jd1 can select 0 ~ 3 as OFF, GPIO1, GPIO2 and GPIO3 respectively */
-       unsigned int jd1_gpio;
-       /* jd2 and jd3 can select 0 ~ 3 as
-               OFF, GPIO4, GPIO5 and GPIO6 respectively */
-       unsigned int jd2_gpio;
-       unsigned int jd3_gpio;
-
-       /* Set MICBIAS1 VDD 1v8 or 3v3 */
-       bool micbias1_vdd_3v3;
-};
-
-#endif
index 42c6a6ac3ce60d6ab81fc4e726e6dfe0129804ff..7e25afce6566fe315496979c9da9f6176d3fae20 100644 (file)
@@ -15,6 +15,7 @@
 struct asoc_simple_dai {
        const char *name;
        unsigned int sysclk;
+       int clk_direction;
        int slots;
        int slot_width;
        unsigned int tx_slot_mask;
index c4a8b1947566bb659f47051f5987e01a1e2918f0..d22de9712c451d67a9ee068ab8001589f55901bd 100644 (file)
@@ -469,10 +469,10 @@ int snd_soc_register_codec(struct device *dev,
                struct snd_soc_dai_driver *dai_drv, int num_dai);
 void snd_soc_unregister_codec(struct device *dev);
 int snd_soc_register_component(struct device *dev,
-                        const struct snd_soc_component_driver *cmpnt_drv,
+                        const struct snd_soc_component_driver *component_driver,
                         struct snd_soc_dai_driver *dai_drv, int num_dai);
 int devm_snd_soc_register_component(struct device *dev,
-                        const struct snd_soc_component_driver *cmpnt_drv,
+                        const struct snd_soc_component_driver *component_driver,
                         struct snd_soc_dai_driver *dai_drv, int num_dai);
 void snd_soc_unregister_component(struct device *dev);
 int snd_soc_cache_init(struct snd_soc_codec *codec);
@@ -795,6 +795,14 @@ struct snd_soc_component_driver {
        int (*suspend)(struct snd_soc_component *);
        int (*resume)(struct snd_soc_component *);
 
+       /* component wide operations */
+       int (*set_sysclk)(struct snd_soc_component *component,
+                         int clk_id, int source, unsigned int freq, int dir);
+       int (*set_pll)(struct snd_soc_component *component, int pll_id,
+                      int source, unsigned int freq_in, unsigned int freq_out);
+       int (*set_jack)(struct snd_soc_component *component,
+                       struct snd_soc_jack *jack,  void *data);
+
        /* DT */
        int (*of_xlate_dai_name)(struct snd_soc_component *component,
                                 struct of_phandle_args *args,
@@ -858,12 +866,6 @@ struct snd_soc_component {
        /* Don't use these, use snd_soc_component_get_dapm() */
        struct snd_soc_dapm_context dapm;
 
-       const struct snd_kcontrol_new *controls;
-       unsigned int num_controls;
-       const struct snd_soc_dapm_widget *dapm_widgets;
-       unsigned int num_dapm_widgets;
-       const struct snd_soc_dapm_route *dapm_routes;
-       unsigned int num_dapm_routes;
        struct snd_soc_codec *codec;
 
        int (*probe)(struct snd_soc_component *);
@@ -871,6 +873,13 @@ struct snd_soc_component {
        int (*suspend)(struct snd_soc_component *);
        int (*resume)(struct snd_soc_component *);
 
+       int (*set_sysclk)(struct snd_soc_component *component,
+                         int clk_id, int source, unsigned int freq, int dir);
+       int (*set_pll)(struct snd_soc_component *component, int pll_id,
+                      int source, unsigned int freq_in, unsigned int freq_out);
+       int (*set_jack)(struct snd_soc_component *component,
+                       struct snd_soc_jack *jack,  void *data);
+
        /* machine specific init */
        int (*init)(struct snd_soc_component *component);
 
@@ -880,6 +889,18 @@ struct snd_soc_component {
 #endif
 };
 
+struct snd_soc_rtdcom_list {
+       struct snd_soc_component *component;
+       struct list_head list; /* rtd::component_list */
+};
+struct snd_soc_component*
+snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd,
+                      const char *driver_name);
+#define for_each_rtdcom(rtd, rtdcom) \
+       list_for_each_entry(rtdcom, &(rtd)->component_list, list)
+#define for_each_rtdcom_safe(rtd, rtdcom1, rtdcom2) \
+       list_for_each_entry_safe(rtdcom1, rtdcom2, &(rtd)->component_list, list)
+
 /* SoC Audio Codec device */
 struct snd_soc_codec {
        struct device *dev;
@@ -888,7 +909,6 @@ struct snd_soc_codec {
        struct list_head list;
 
        /* runtime */
-       unsigned int cache_bypass:1; /* Suppress access to the cache */
        unsigned int cache_init:1; /* codec cache has been initialized */
 
        /* codec IO */
@@ -898,10 +918,6 @@ struct snd_soc_codec {
 
        /* component */
        struct snd_soc_component component;
-
-#ifdef CONFIG_DEBUG_FS
-       struct dentry *debugfs_reg;
-#endif
 };
 
 /* codec driver */
@@ -1224,7 +1240,7 @@ struct snd_soc_pcm_runtime {
        struct snd_pcm *pcm;
        struct snd_compr *compr;
        struct snd_soc_codec *codec;
-       struct snd_soc_platform *platform;
+       struct snd_soc_platform *platform; /* will be removed */
        struct snd_soc_dai *codec_dai;
        struct snd_soc_dai *cpu_dai;
 
@@ -1234,11 +1250,11 @@ struct snd_soc_pcm_runtime {
        struct delayed_work delayed_work;
 #ifdef CONFIG_DEBUG_FS
        struct dentry *debugfs_dpcm_root;
-       struct dentry *debugfs_dpcm_state;
 #endif
 
        unsigned int num; /* 0-based and monotonic increasing */
        struct list_head list; /* rtd list of the soc card */
+       struct list_head component_list; /* list of connected components */
 
        /* bit field */
        unsigned int dev_registered:1;
@@ -1465,6 +1481,13 @@ void snd_soc_component_async_complete(struct snd_soc_component *component);
 int snd_soc_component_test_bits(struct snd_soc_component *component,
        unsigned int reg, unsigned int mask, unsigned int value);
 
+/* component wide operations */
+int snd_soc_component_set_sysclk(struct snd_soc_component *component,
+                       int clk_id, int source, unsigned int freq, int dir);
+int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id,
+                             int source, unsigned int freq_in,
+                             unsigned int freq_out);
+
 #ifdef CONFIG_REGMAP
 
 void snd_soc_component_init_regmap(struct snd_soc_component *component,
index 24e5d991f148be2d8b16cc309e1af7dca5f5f14b..22305c0ab31a9cfabeee28596bac9317af377c0f 100644 (file)
 #define AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K     0x00000001
 #define AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K     0x00000002
 
+/* GPIO API */
+#define AIC32X4_MFPX_DEFAULT_VALUE     0xff
+
+#define AIC32X4_MFP1_DIN_DISABLED      0
+#define AIC32X4_MFP1_DIN_ENABLED       0x2
+#define AIC32X4_MFP1_GPIO_IN           0x4
+
+#define AIC32X4_MFP2_GPIO_OUT_LOW      0x0
+#define AIC32X4_MFP2_GPIO_OUT_HIGH     0x1
+
+#define AIC32X4_MFP_GPIO_ENABLED       0x4
+
+#define AIC32X4_MFP5_GPIO_DISABLED     0x0
+#define AIC32X4_MFP5_GPIO_INPUT                0x8
+#define AIC32X4_MFP5_GPIO_OUTPUT       0xc
+#define AIC32X4_MFP5_GPIO_OUT_LOW      0x0
+#define AIC32X4_MFP5_GPIO_OUT_HIGH     0x1
+
+struct aic32x4_setup_data {
+       unsigned int gpio_func[5];
+};
+
 struct aic32x4_pdata {
+       struct aic32x4_setup_data *setup;
        u32 power_cfg;
        u32 micpga_routing;
        bool swapdacs;
index dedb2056160d03a76ca2b1238652ad3afa64926e..f691e421f5e8730ccb4f1c5a9a04f779d4c972e5 100644 (file)
  *
  * %SKL_TKN_U32_DMA_BUF_SIZE:  DMA buffer size in millisec
  *
+ * %SKL_TKN_U32_PIPE_DIR:       Specifies pipe direction. Can be
+ *                              playback/capture.
+ *
+ * %SKL_TKN_U32_NUM_CONFIGS:    Number of pipe configs
+ *
+ * %SKL_TKN_U32_PATH_MEM_PGS:   Size of memory (in pages) required for pipeline
+ *                              and its data
+ *
+ * %SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
+ *                              and PCM params supported by that pipe
+ *                              config. This is used as index to fill
+ *                              up the pipe config and module config
+ *                              structure.
+ *
+ * %SKL_TKN_U32_CFG_FREQ:
+ * %SKL_TKN_U8_CFG_CHAN:
+ * %SKL_TKN_U8_CFG_BPS:         PCM params (freq, channels, bits per sample)
+ *                              supported for each of the pipe configs.
+ *
+ * %SKL_TKN_CFG_MOD_RES_ID:     Module's resource index for each of the
+ *                              pipe config
+ *
+ * %SKL_TKN_CFG_MOD_FMT_ID:     Module's interface index for each of the
+ *                              pipe config
+ *
+ * %SKL_TKN_U8_NUM_MOD:         Number of modules in the manifest
+ *
+ * %SKL_TKN_MM_U8_MOD_IDX:      Current index of the module in the manifest
+ *
+ * %SKL_TKN_MM_U8_NUM_RES:      Number of resources for the module
+ *
+ * %SKL_TKN_MM_U8_NUM_INTF:     Number of interfaces for the module
+ *
+ * %SKL_TKN_MM_U32_RES_ID:      Resource index for the resource info to
+ *                              be filled into.
+ *                              A module can support multiple resource
+ *                              configuration and is represnted as a
+ *                              resource table. This index is used to
+ *                              fill information into appropriate index.
+ *
+ * %SKL_TKN_MM_U32_CPS:         DSP cycles per second
+ *
+ * %SKL_TKN_MM_U32_DMA_SIZE:    Allocated buffer size for gateway DMA
+ *
+ * %SKL_TKN_MM_U32_CPC:         DSP cycles allocated per frame
+ *
+ * %SKL_TKN_MM_U32_RES_PIN_ID:  Resource pin index in the module
+ *
+ * %SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
+ *
+ * %SKL_TKN_MM_U32_PIN_BUF:     Buffer size of the module pin
+ *
+ * %SKL_TKN_MM_U32_FMT_ID:      Format index for each of the interface/
+ *                              format information to be filled into.
+ *
+ * %SKL_TKN_MM_U32_NUM_IN_FMT:  Number of input formats
+ * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
+ *
  * module_id and loadable flags dont have tokens as these values will be
  * read from the DSP FW manifest
+ *
+ * Tokens defined can be used either in the manifest or widget private data.
+ *
+ * SKL_TKN_MM is used as a suffix for all tokens that represent
+ * module data in the manifest.
  */
 enum SKL_TKNS {
        SKL_TKN_UUID = 1,
@@ -218,7 +281,34 @@ enum SKL_TKNS {
        SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
        SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
        SKL_TKN_U32_DMA_BUF_SIZE,
-       SKL_TKN_MAX = SKL_TKN_U32_DMA_BUF_SIZE,
+
+       SKL_TKN_U32_PIPE_DIRECTION,
+       SKL_TKN_U32_PIPE_CONFIG_ID,
+       SKL_TKN_U32_NUM_CONFIGS,
+       SKL_TKN_U32_PATH_MEM_PGS,
+
+       SKL_TKN_U32_CFG_FREQ,
+       SKL_TKN_U8_CFG_CHAN,
+       SKL_TKN_U8_CFG_BPS,
+       SKL_TKN_CFG_MOD_RES_ID,
+       SKL_TKN_CFG_MOD_FMT_ID,
+       SKL_TKN_U8_NUM_MOD,
+
+       SKL_TKN_MM_U8_MOD_IDX,
+       SKL_TKN_MM_U8_NUM_RES,
+       SKL_TKN_MM_U8_NUM_INTF,
+       SKL_TKN_MM_U32_RES_ID,
+       SKL_TKN_MM_U32_CPS,
+       SKL_TKN_MM_U32_DMA_SIZE,
+       SKL_TKN_MM_U32_CPC,
+       SKL_TKN_MM_U32_RES_PIN_ID,
+       SKL_TKN_MM_U32_INTF_PIN_ID,
+       SKL_TKN_MM_U32_PIN_BUF,
+       SKL_TKN_MM_U32_FMT_ID,
+       SKL_TKN_MM_U32_NUM_IN_FMT,
+       SKL_TKN_MM_U32_NUM_OUT_FMT,
+
+       SKL_TKN_MAX = SKL_TKN_MM_U32_NUM_OUT_FMT,
 };
 
 #endif
index a04edff8b729ebf8fff761c8c3814f1ab66b4a80..d2d96ca082b71a204f3f18e7fa207e929564e4da 100644 (file)
@@ -167,7 +167,7 @@ static int onyx_snd_vol_put(struct snd_kcontrol *kcontrol,
        return 1;
 }
 
-static struct snd_kcontrol_new volume_control = {
+static const struct snd_kcontrol_new volume_control = {
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
        .name = "Master Playback Volume",
        .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -229,7 +229,7 @@ static int onyx_snd_inputgain_put(struct snd_kcontrol *kcontrol,
        return n != v;
 }
 
-static struct snd_kcontrol_new inputgain_control = {
+static const struct snd_kcontrol_new inputgain_control = {
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
        .name = "Master Capture Volume",
        .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -284,7 +284,7 @@ static int onyx_snd_capture_source_put(struct snd_kcontrol *kcontrol,
        return 1;
 }
 
-static struct snd_kcontrol_new capture_source_control = {
+static const struct snd_kcontrol_new capture_source_control = {
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
        /* If we name this 'Input Source', it properly shows up in
         * alsamixer as a selection, * but it's shown under the
@@ -348,7 +348,7 @@ static int onyx_snd_mute_put(struct snd_kcontrol *kcontrol,
        return !err ? (v != c) : err;
 }
 
-static struct snd_kcontrol_new mute_control = {
+static const struct snd_kcontrol_new mute_control = {
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
        .name = "Master Playback Switch",
        .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
@@ -476,7 +476,7 @@ static int onyx_spdif_mask_get(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
-static struct snd_kcontrol_new onyx_spdif_mask = {
+static const struct snd_kcontrol_new onyx_spdif_mask = {
        .access =       SNDRV_CTL_ELEM_ACCESS_READ,
        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
        .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
@@ -533,7 +533,7 @@ static int onyx_spdif_put(struct snd_kcontrol *kcontrol,
        return 1;
 }
 
-static struct snd_kcontrol_new onyx_spdif_ctrl = {
+static const struct snd_kcontrol_new onyx_spdif_ctrl = {
        .access =       SNDRV_CTL_ELEM_ACCESS_READWRITE,
        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
        .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
index 733b6365dad63af5cd8bf6edc43c44d850083289..15c05755d27005624f44e2dfe33734dd7b48dbb1 100644 (file)
@@ -905,8 +905,8 @@ static int tas_i2c_probe(struct i2c_client *client,
                goto fail;
        }
        printk(KERN_DEBUG
-              "snd-aoa-codec-tas: tas found, addr 0x%02x on %s\n",
-              (unsigned int)client->addr, node->full_name);
+              "snd-aoa-codec-tas: tas found, addr 0x%02x on %pOF\n",
+              (unsigned int)client->addr, node);
        return 0;
  fail:
        mutex_destroy(&tas->mtx);
index 053b09c79053e548c1c7c1d8deef5064e7780d29..e618531757e0d9817ebbbb426f5892937773930e 100644 (file)
@@ -778,7 +778,7 @@ static snd_pcm_uframes_t i2sbus_playback_pointer(struct snd_pcm_substream
        return i2sbus_pcm_pointer(i2sdev, 0);
 }
 
-static struct snd_pcm_ops i2sbus_playback_ops = {
+static const struct snd_pcm_ops i2sbus_playback_ops = {
        .open =         i2sbus_playback_open,
        .close =        i2sbus_playback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -848,7 +848,7 @@ static snd_pcm_uframes_t i2sbus_record_pointer(struct snd_pcm_substream
        return i2sbus_pcm_pointer(i2sdev, 1);
 }
 
-static struct snd_pcm_ops i2sbus_record_ops = {
+static const struct snd_pcm_ops i2sbus_record_ops = {
        .open =         i2sbus_record_open,
        .close =        i2sbus_record_close,
        .ioctl =        snd_pcm_lib_ioctl,
index 4140b1b950544bce0fc0360402d67f7fc5a031d4..0114ffed56dd4d2655d89e950774869dc2780d05 100644 (file)
@@ -348,7 +348,7 @@ static irqreturn_t aaci_irq(int irq, void *devid)
 /*
  * ALSA support.
  */
-static struct snd_pcm_hardware aaci_hw_info = {
+static const struct snd_pcm_hardware aaci_hw_info = {
        .info                   = SNDRV_PCM_INFO_MMAP |
                                  SNDRV_PCM_INFO_MMAP_VALID |
                                  SNDRV_PCM_INFO_INTERLEAVED |
@@ -635,7 +635,7 @@ static int aaci_pcm_playback_trigger(struct snd_pcm_substream *substream, int cm
        return ret;
 }
 
-static struct snd_pcm_ops aaci_playback_ops = {
+static const struct snd_pcm_ops aaci_playback_ops = {
        .open           = aaci_pcm_open,
        .close          = aaci_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
@@ -738,7 +738,7 @@ static int aaci_pcm_capture_prepare(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static struct snd_pcm_ops aaci_capture_ops = {
+static const struct snd_pcm_ops aaci_capture_ops = {
        .open           = aaci_pcm_open,
        .close          = aaci_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
@@ -786,7 +786,7 @@ static SIMPLE_DEV_PM_OPS(aaci_dev_pm_ops, aaci_suspend, aaci_resume);
 #endif
 
 
-static struct ac97_pcm ac97_defs[] = {
+static const struct ac97_pcm ac97_defs[] = {
        [0] = { /* Front PCM */
                .exclusive = 1,
                .r = {
index 83fcfac977396cd1d365289d70ca0857bb3127c4..1c6f4b436de31868af917a1767397c7daf1c7a84 100644 (file)
@@ -68,7 +68,7 @@ static int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
        return __pxa2xx_pcm_close(substream);
 }
 
-static struct snd_pcm_ops pxa2xx_pcm_ops = {
+static const struct snd_pcm_ops pxa2xx_pcm_ops = {
        .open           = pxa2xx_pcm_open,
        .close          = pxa2xx_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
index 9d2c9d9af688030d660b63badbefc3f88e553aa2..380025887aef61e2aa87a7845d12a7d1ba9b85ae 100644 (file)
 #include <linux/bitmap.h>
 #include <linux/device.h>
 #include <linux/atmel_pdc.h>
+#include <linux/gpio/consumer.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
-#include <linux/gpio.h>
 #include <linux/types.h>
 #include <linux/io.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/of_device.h>
 
 #include <sound/core.h>
@@ -29,7 +28,6 @@
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/ac97_codec.h>
-#include <sound/atmel-ac97c.h>
 #include <sound/memalloc.h>
 
 #include "ac97c.h"
@@ -56,7 +54,7 @@ struct atmel_ac97c {
        void __iomem                    *regs;
        int                             irq;
        int                             opened;
-       int                             reset_pin;
+       struct gpio_desc                *reset_pin;
 };
 
 #define get_chip(card) ((struct atmel_ac97c *)(card)->private_data)
@@ -66,7 +64,7 @@ struct atmel_ac97c {
 #define ac97c_readl(chip, reg)                         \
        __raw_readl((chip)->regs + AC97C_##reg)
 
-static struct snd_pcm_hardware atmel_ac97c_hw = {
+static const struct snd_pcm_hardware atmel_ac97c_hw = {
        .info                   = (SNDRV_PCM_INFO_MMAP
                                  | SNDRV_PCM_INFO_MMAP_VALID
                                  | SNDRV_PCM_INFO_INTERLEAVED
@@ -461,7 +459,7 @@ atmel_ac97c_capture_pointer(struct snd_pcm_substream *substream)
        return frames;
 }
 
-static struct snd_pcm_ops atmel_ac97_playback_ops = {
+static const struct snd_pcm_ops atmel_ac97_playback_ops = {
        .open           = atmel_ac97c_playback_open,
        .close          = atmel_ac97c_playback_close,
        .ioctl          = snd_pcm_lib_ioctl,
@@ -472,7 +470,7 @@ static struct snd_pcm_ops atmel_ac97_playback_ops = {
        .pointer        = atmel_ac97c_playback_pointer,
 };
 
-static struct snd_pcm_ops atmel_ac97_capture_ops = {
+static const struct snd_pcm_ops atmel_ac97_capture_ops = {
        .open           = atmel_ac97c_capture_open,
        .close          = atmel_ac97c_capture_close,
        .ioctl          = snd_pcm_lib_ioctl,
@@ -558,7 +556,7 @@ static irqreturn_t atmel_ac97c_interrupt(int irq, void *dev)
        return retval;
 }
 
-static struct ac97_pcm at91_ac97_pcm_defs[] = {
+static const struct ac97_pcm at91_ac97_pcm_defs[] = {
        /* Playback */
        {
                .exclusive = 1,
@@ -700,11 +698,11 @@ static void atmel_ac97c_reset(struct atmel_ac97c *chip)
        ac97c_writel(chip, CAMR, 0);
        ac97c_writel(chip, COMR, 0);
 
-       if (gpio_is_valid(chip->reset_pin)) {
-               gpio_set_value(chip->reset_pin, 0);
+       if (!IS_ERR(chip->reset_pin)) {
+               gpiod_set_value(chip->reset_pin, 0);
                /* AC97 v2.2 specifications says minimum 1 us. */
                udelay(2);
-               gpio_set_value(chip->reset_pin, 1);
+               gpiod_set_value(chip->reset_pin, 1);
        } else {
                ac97c_writel(chip, MR, AC97C_MR_WRST | AC97C_MR_ENA);
                udelay(2);
@@ -712,45 +710,18 @@ static void atmel_ac97c_reset(struct atmel_ac97c *chip)
        }
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id atmel_ac97c_dt_ids[] = {
        { .compatible = "atmel,at91sam9263-ac97c", },
        { }
 };
 MODULE_DEVICE_TABLE(of, atmel_ac97c_dt_ids);
 
-static struct ac97c_platform_data *atmel_ac97c_probe_dt(struct device *dev)
-{
-       struct ac97c_platform_data *pdata;
-       struct device_node *node = dev->of_node;
-
-       if (!node) {
-               dev_err(dev, "Device does not have associated DT data\n");
-               return ERR_PTR(-EINVAL);
-       }
-
-       pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
-       if (!pdata)
-               return ERR_PTR(-ENOMEM);
-
-       pdata->reset_pin = of_get_named_gpio(dev->of_node, "ac97-gpios", 2);
-
-       return pdata;
-}
-#else
-static struct ac97c_platform_data *atmel_ac97c_probe_dt(struct device *dev)
-{
-       dev_err(dev, "no platform data defined\n");
-       return ERR_PTR(-ENXIO);
-}
-#endif
-
 static int atmel_ac97c_probe(struct platform_device *pdev)
 {
+       struct device                   *dev = &pdev->dev;
        struct snd_card                 *card;
        struct atmel_ac97c              *chip;
        struct resource                 *regs;
-       struct ac97c_platform_data      *pdata;
        struct clk                      *pclk;
        static struct snd_ac97_bus_ops  ops = {
                .write  = atmel_ac97c_write,
@@ -765,13 +736,6 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
                return -ENXIO;
        }
 
-       pdata = dev_get_platdata(&pdev->dev);
-       if (!pdata) {
-               pdata = atmel_ac97c_probe_dt(&pdev->dev);
-               if (IS_ERR(pdata))
-                       return PTR_ERR(pdata);
-       }
-
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
                dev_dbg(&pdev->dev, "could not get irq: %d\n", irq);
@@ -783,7 +747,9 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
                dev_dbg(&pdev->dev, "no peripheral clock\n");
                return PTR_ERR(pclk);
        }
-       clk_prepare_enable(pclk);
+       retval = clk_prepare_enable(pclk);
+       if (retval)
+               goto err_prepare_enable;
 
        retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
                              SNDRV_DEFAULT_STR1, THIS_MODULE,
@@ -819,17 +785,9 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
                goto err_ioremap;
        }
 
-       if (gpio_is_valid(pdata->reset_pin)) {
-               if (gpio_request(pdata->reset_pin, "reset_pin")) {
-                       dev_dbg(&pdev->dev, "reset pin not available\n");
-                       chip->reset_pin = -ENODEV;
-               } else {
-                       gpio_direction_output(pdata->reset_pin, 1);
-                       chip->reset_pin = pdata->reset_pin;
-               }
-       } else {
-               chip->reset_pin = -EINVAL;
-       }
+       chip->reset_pin = devm_gpiod_get_index(dev, "ac97", 2, GPIOD_OUT_HIGH);
+       if (IS_ERR(chip->reset_pin))
+               dev_dbg(dev, "reset pin not available\n");
 
        atmel_ac97c_reset(chip);
 
@@ -869,9 +827,6 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
        return 0;
 
 err_ac97_bus:
-       if (gpio_is_valid(chip->reset_pin))
-               gpio_free(chip->reset_pin);
-
        iounmap(chip->regs);
 err_ioremap:
        free_irq(irq, chip);
@@ -879,6 +834,7 @@ err_request_irq:
        snd_card_free(card);
 err_snd_card_new:
        clk_disable_unprepare(pclk);
+err_prepare_enable:
        clk_put(pclk);
        return retval;
 }
@@ -897,9 +853,9 @@ static int atmel_ac97c_resume(struct device *pdev)
 {
        struct snd_card *card = dev_get_drvdata(pdev);
        struct atmel_ac97c *chip = card->private_data;
+       int ret = clk_prepare_enable(chip->pclk);
 
-       clk_prepare_enable(chip->pclk);
-       return 0;
+       return ret;
 }
 
 static SIMPLE_DEV_PM_OPS(atmel_ac97c_pm, atmel_ac97c_suspend, atmel_ac97c_resume);
@@ -913,9 +869,6 @@ static int atmel_ac97c_remove(struct platform_device *pdev)
        struct snd_card *card = platform_get_drvdata(pdev);
        struct atmel_ac97c *chip = get_chip(card);
 
-       if (gpio_is_valid(chip->reset_pin))
-               gpio_free(chip->reset_pin);
-
        ac97c_writel(chip, CAMR, 0);
        ac97c_writel(chip, COMR, 0);
        ac97c_writel(chip, MR,   0);
@@ -936,7 +889,7 @@ static struct platform_driver atmel_ac97c_driver = {
        .driver         = {
                .name   = "atmel_ac97c",
                .pm     = ATMEL_AC97C_PM_OPS,
-               .of_match_table = of_match_ptr(atmel_ac97c_dt_ids),
+               .of_match_table = atmel_ac97c_dt_ids,
        },
 };
 module_platform_driver(atmel_ac97c_driver);
index 4525e127afd904e62f34af00e26ccee52252b460..56b3e2d49c82321509e699217ee1085382c40ce4 100644 (file)
@@ -864,14 +864,14 @@ static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl,
 
        if (copy_from_user(&info, _info, sizeof(info)))
                return -EFAULT;
-       snd_power_lock(ctl->card);
        result = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0);
-       if (result >= 0)
-               result = snd_ctl_elem_info(ctl, &info);
-       snd_power_unlock(ctl->card);
-       if (result >= 0)
-               if (copy_to_user(_info, &info, sizeof(info)))
-                       return -EFAULT;
+       if (result < 0)
+               return result;
+       result = snd_ctl_elem_info(ctl, &info);
+       if (result < 0)
+               return result;
+       if (copy_to_user(_info, &info, sizeof(info)))
+               return -EFAULT;
        return result;
 }
 
@@ -881,24 +881,18 @@ static int snd_ctl_elem_read(struct snd_card *card,
        struct snd_kcontrol *kctl;
        struct snd_kcontrol_volatile *vd;
        unsigned int index_offset;
-       int result;
 
-       down_read(&card->controls_rwsem);
        kctl = snd_ctl_find_id(card, &control->id);
-       if (kctl == NULL) {
-               result = -ENOENT;
-       } else {
-               index_offset = snd_ctl_get_ioff(kctl, &control->id);
-               vd = &kctl->vd[index_offset];
-               if ((vd->access & SNDRV_CTL_ELEM_ACCESS_READ) &&
-                   kctl->get != NULL) {
-                       snd_ctl_build_ioff(&control->id, kctl, index_offset);
-                       result = kctl->get(kctl, control);
-               } else
-                       result = -EPERM;
-       }
-       up_read(&card->controls_rwsem);
-       return result;
+       if (kctl == NULL)
+               return -ENOENT;
+
+       index_offset = snd_ctl_get_ioff(kctl, &control->id);
+       vd = &kctl->vd[index_offset];
+       if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) && kctl->get == NULL)
+               return -EPERM;
+
+       snd_ctl_build_ioff(&control->id, kctl, index_offset);
+       return kctl->get(kctl, control);
 }
 
 static int snd_ctl_elem_read_user(struct snd_card *card,
@@ -911,14 +905,19 @@ static int snd_ctl_elem_read_user(struct snd_card *card,
        if (IS_ERR(control))
                return PTR_ERR(control);
 
-       snd_power_lock(card);
        result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
-       if (result >= 0)
-               result = snd_ctl_elem_read(card, control);
-       snd_power_unlock(card);
-       if (result >= 0)
-               if (copy_to_user(_control, control, sizeof(*control)))
-                       result = -EFAULT;
+       if (result < 0)
+               goto error;
+
+       down_read(&card->controls_rwsem);
+       result = snd_ctl_elem_read(card, control);
+       up_read(&card->controls_rwsem);
+       if (result < 0)
+               goto error;
+
+       if (copy_to_user(_control, control, sizeof(*control)))
+               result = -EFAULT;
+ error:
        kfree(control);
        return result;
 }
@@ -931,30 +930,28 @@ static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file,
        unsigned int index_offset;
        int result;
 
-       down_read(&card->controls_rwsem);
        kctl = snd_ctl_find_id(card, &control->id);
-       if (kctl == NULL) {
-               result = -ENOENT;
-       } else {
-               index_offset = snd_ctl_get_ioff(kctl, &control->id);
-               vd = &kctl->vd[index_offset];
-               if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE) ||
-                   kctl->put == NULL ||
-                   (file && vd->owner && vd->owner != file)) {
-                       result = -EPERM;
-               } else {
-                       snd_ctl_build_ioff(&control->id, kctl, index_offset);
-                       result = kctl->put(kctl, control);
-               }
-               if (result > 0) {
-                       struct snd_ctl_elem_id id = control->id;
-                       up_read(&card->controls_rwsem);
-                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &id);
-                       return 0;
-               }
+       if (kctl == NULL)
+               return -ENOENT;
+
+       index_offset = snd_ctl_get_ioff(kctl, &control->id);
+       vd = &kctl->vd[index_offset];
+       if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE) || kctl->put == NULL ||
+           (file && vd->owner && vd->owner != file)) {
+               return -EPERM;
        }
-       up_read(&card->controls_rwsem);
-       return result;
+
+       snd_ctl_build_ioff(&control->id, kctl, index_offset);
+       result = kctl->put(kctl, control);
+       if (result < 0)
+               return result;
+
+       if (result > 0) {
+               struct snd_ctl_elem_id id = control->id;
+               snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &id);
+       }
+
+       return 0;
 }
 
 static int snd_ctl_elem_write_user(struct snd_ctl_file *file,
@@ -969,14 +966,19 @@ static int snd_ctl_elem_write_user(struct snd_ctl_file *file,
                return PTR_ERR(control);
 
        card = file->card;
-       snd_power_lock(card);
        result = snd_power_wait(card, SNDRV_CTL_POWER_D0);
-       if (result >= 0)
-               result = snd_ctl_elem_write(card, file, control);
-       snd_power_unlock(card);
-       if (result >= 0)
-               if (copy_to_user(_control, control, sizeof(*control)))
-                       result = -EFAULT;
+       if (result < 0)
+               goto error;
+
+       down_write(&card->controls_rwsem);
+       result = snd_ctl_elem_write(card, file, control);
+       up_write(&card->controls_rwsem);
+       if (result < 0)
+               goto error;
+
+       if (copy_to_user(_control, control, sizeof(*control)))
+               result = -EFAULT;
+ error:
        kfree(control);
        return result;
 }
@@ -1095,9 +1097,7 @@ static int snd_ctl_elem_user_get(struct snd_kcontrol *kcontrol,
        char *src = ue->elem_data +
                        snd_ctl_get_ioff(kcontrol, &ucontrol->id) * size;
 
-       mutex_lock(&ue->card->user_ctl_lock);
        memcpy(&ucontrol->value, src, size);
-       mutex_unlock(&ue->card->user_ctl_lock);
        return 0;
 }
 
@@ -1110,60 +1110,83 @@ static int snd_ctl_elem_user_put(struct snd_kcontrol *kcontrol,
        char *dst = ue->elem_data +
                        snd_ctl_get_ioff(kcontrol, &ucontrol->id) * size;
 
-       mutex_lock(&ue->card->user_ctl_lock);
        change = memcmp(&ucontrol->value, dst, size) != 0;
        if (change)
                memcpy(dst, &ucontrol->value, size);
-       mutex_unlock(&ue->card->user_ctl_lock);
        return change;
 }
 
-static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol,
-                                int op_flag,
-                                unsigned int size,
-                                unsigned int __user *tlv)
+static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
+                           unsigned int size)
 {
-       struct user_element *ue = kcontrol->private_data;
-       int change = 0;
-       void *new_data;
+       struct user_element *ue = kctl->private_data;
+       unsigned int *container;
+       struct snd_ctl_elem_id id;
+       unsigned int mask = 0;
+       int i;
+       int change;
 
-       if (op_flag == SNDRV_CTL_TLV_OP_WRITE) {
-               if (size > 1024 * 128)  /* sane value */
-                       return -EINVAL;
+       if (size > 1024 * 128)  /* sane value */
+               return -EINVAL;
 
-               new_data = memdup_user(tlv, size);
-               if (IS_ERR(new_data))
-                       return PTR_ERR(new_data);
-               mutex_lock(&ue->card->user_ctl_lock);
-               change = ue->tlv_data_size != size;
-               if (!change)
-                       change = memcmp(ue->tlv_data, new_data, size) != 0;
-               kfree(ue->tlv_data);
-               ue->tlv_data = new_data;
-               ue->tlv_data_size = size;
-               mutex_unlock(&ue->card->user_ctl_lock);
-       } else {
-               int ret = 0;
+       container = memdup_user(buf, size);
+       if (IS_ERR(container))
+               return PTR_ERR(container);
 
-               mutex_lock(&ue->card->user_ctl_lock);
-               if (!ue->tlv_data_size || !ue->tlv_data) {
-                       ret = -ENXIO;
-                       goto err_unlock;
-               }
-               if (size < ue->tlv_data_size) {
-                       ret = -ENOSPC;
-                       goto err_unlock;
-               }
-               if (copy_to_user(tlv, ue->tlv_data, ue->tlv_data_size))
-                       ret = -EFAULT;
-err_unlock:
-               mutex_unlock(&ue->card->user_ctl_lock);
-               if (ret)
-                       return ret;
+       change = ue->tlv_data_size != size;
+       if (!change)
+               change = memcmp(ue->tlv_data, container, size) != 0;
+       if (!change) {
+               kfree(container);
+               return 0;
        }
+
+       if (ue->tlv_data == NULL) {
+               /* Now TLV data is available. */
+               for (i = 0; i < kctl->count; ++i)
+                       kctl->vd[i].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
+               mask = SNDRV_CTL_EVENT_MASK_INFO;
+       }
+
+       kfree(ue->tlv_data);
+       ue->tlv_data = container;
+       ue->tlv_data_size = size;
+
+       mask |= SNDRV_CTL_EVENT_MASK_TLV;
+       for (i = 0; i < kctl->count; ++i) {
+               snd_ctl_build_ioff(&id, kctl, i);
+               snd_ctl_notify(ue->card, mask, &id);
+       }
+
        return change;
 }
 
+static int read_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
+                        unsigned int size)
+{
+       struct user_element *ue = kctl->private_data;
+
+       if (ue->tlv_data_size == 0 || ue->tlv_data == NULL)
+               return -ENXIO;
+
+       if (size < ue->tlv_data_size)
+               return -ENOSPC;
+
+       if (copy_to_user(buf, ue->tlv_data, ue->tlv_data_size))
+               return -EFAULT;
+
+       return 0;
+}
+
+static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kctl, int op_flag,
+                                unsigned int size, unsigned int __user *buf)
+{
+       if (op_flag == SNDRV_CTL_TLV_OP_WRITE)
+               return replace_user_tlv(kctl, buf, size);
+       else
+               return read_user_tlv(kctl, buf, size);
+}
+
 static int snd_ctl_elem_init_enum_names(struct user_element *ue)
 {
        char *names, *p;
@@ -1267,8 +1290,10 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
                access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
        access &= (SNDRV_CTL_ELEM_ACCESS_READWRITE |
                   SNDRV_CTL_ELEM_ACCESS_INACTIVE |
-                  SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE);
-       if (access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)
+                  SNDRV_CTL_ELEM_ACCESS_TLV_WRITE);
+
+       /* In initial state, nothing is available as TLV container. */
+       if (access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
                access |= SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
        access |= SNDRV_CTL_ELEM_ACCESS_USER;
 
@@ -1331,7 +1356,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
                kctl->get = snd_ctl_elem_user_get;
        if (access & SNDRV_CTL_ELEM_ACCESS_WRITE)
                kctl->put = snd_ctl_elem_user_put;
-       if (access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE)
+       if (access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
                kctl->tlv.c = snd_ctl_elem_user_tlv;
 
        /* This function manage to free the instance on failure. */
@@ -1405,71 +1430,107 @@ static int snd_ctl_subscribe_events(struct snd_ctl_file *file, int __user *ptr)
        return 0;
 }
 
+static int call_tlv_handler(struct snd_ctl_file *file, int op_flag,
+                           struct snd_kcontrol *kctl,
+                           struct snd_ctl_elem_id *id,
+                           unsigned int __user *buf, unsigned int size)
+{
+       static const struct {
+               int op;
+               int perm;
+       } pairs[] = {
+               {SNDRV_CTL_TLV_OP_READ,  SNDRV_CTL_ELEM_ACCESS_TLV_READ},
+               {SNDRV_CTL_TLV_OP_WRITE, SNDRV_CTL_ELEM_ACCESS_TLV_WRITE},
+               {SNDRV_CTL_TLV_OP_CMD,   SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND},
+       };
+       struct snd_kcontrol_volatile *vd = &kctl->vd[snd_ctl_get_ioff(kctl, id)];
+       int i;
+
+       /* Check support of the request for this element. */
+       for (i = 0; i < ARRAY_SIZE(pairs); ++i) {
+               if (op_flag == pairs[i].op && (vd->access & pairs[i].perm))
+                       break;
+       }
+       if (i == ARRAY_SIZE(pairs))
+               return -ENXIO;
+
+       if (kctl->tlv.c == NULL)
+               return -ENXIO;
+
+       /* When locked, this is unavailable. */
+       if (vd->owner != NULL && vd->owner != file)
+               return -EPERM;
+
+       return kctl->tlv.c(kctl, op_flag, size, buf);
+}
+
+static int read_tlv_buf(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id,
+                       unsigned int __user *buf, unsigned int size)
+{
+       struct snd_kcontrol_volatile *vd = &kctl->vd[snd_ctl_get_ioff(kctl, id)];
+       unsigned int len;
+
+       if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ))
+               return -ENXIO;
+
+       if (kctl->tlv.p == NULL)
+               return -ENXIO;
+
+       len = sizeof(unsigned int) * 2 + kctl->tlv.p[1];
+       if (size < len)
+               return -ENOMEM;
+
+       if (copy_to_user(buf, kctl->tlv.p, len))
+               return -EFAULT;
+
+       return 0;
+}
+
 static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,
-                             struct snd_ctl_tlv __user *_tlv,
+                            struct snd_ctl_tlv __user *buf,
                              int op_flag)
 {
-       struct snd_card *card = file->card;
-       struct snd_ctl_tlv tlv;
+       struct snd_ctl_tlv header;
+       unsigned int *container;
+       unsigned int container_size;
        struct snd_kcontrol *kctl;
+       struct snd_ctl_elem_id id;
        struct snd_kcontrol_volatile *vd;
-       unsigned int len;
-       int err = 0;
 
-       if (copy_from_user(&tlv, _tlv, sizeof(tlv)))
+       if (copy_from_user(&header, buf, sizeof(header)))
                return -EFAULT;
-       if (tlv.length < sizeof(unsigned int) * 2)
+
+       /* In design of control core, numerical ID starts at 1. */
+       if (header.numid == 0)
                return -EINVAL;
-       if (!tlv.numid)
+
+       /* At least, container should include type and length fields.  */
+       if (header.length < sizeof(unsigned int) * 2)
                return -EINVAL;
-       down_read(&card->controls_rwsem);
-       kctl = snd_ctl_find_numid(card, tlv.numid);
-       if (kctl == NULL) {
-               err = -ENOENT;
-               goto __kctl_end;
-       }
-       if (kctl->tlv.p == NULL) {
-               err = -ENXIO;
-               goto __kctl_end;
-       }
-       vd = &kctl->vd[tlv.numid - kctl->id.numid];
-       if ((op_flag == SNDRV_CTL_TLV_OP_READ &&
-            (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) == 0) ||
-           (op_flag == SNDRV_CTL_TLV_OP_WRITE &&
-            (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) == 0) ||
-           (op_flag == SNDRV_CTL_TLV_OP_CMD &&
-            (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND) == 0)) {
-               err = -ENXIO;
-               goto __kctl_end;
-       }
+       container_size = header.length;
+       container = buf->tlv;
+
+       kctl = snd_ctl_find_numid(file->card, header.numid);
+       if (kctl == NULL)
+               return -ENOENT;
+
+       /* Calculate index of the element in this set. */
+       id = kctl->id;
+       snd_ctl_build_ioff(&id, kctl, header.numid - id.numid);
+       vd = &kctl->vd[snd_ctl_get_ioff(kctl, &id)];
+
        if (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {
-               if (vd->owner != NULL && vd->owner != file) {
-                       err = -EPERM;
-                       goto __kctl_end;
-               }
-               err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv);
-               if (err > 0) {
-                       struct snd_ctl_elem_id id = kctl->id;
-                       up_read(&card->controls_rwsem);
-                       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &id);
-                       return 0;
-               }
+               return call_tlv_handler(file, op_flag, kctl, &id, container,
+                                       container_size);
        } else {
-               if (op_flag != SNDRV_CTL_TLV_OP_READ) {
-                       err = -ENXIO;
-                       goto __kctl_end;
+               if (op_flag == SNDRV_CTL_TLV_OP_READ) {
+                       return read_tlv_buf(kctl, &id, container,
+                                           container_size);
                }
-               len = kctl->tlv.p[1] + 2 * sizeof(unsigned int);
-               if (tlv.length < len) {
-                       err = -ENOMEM;
-                       goto __kctl_end;
-               }
-               if (copy_to_user(_tlv->tlv, kctl->tlv.p, len))
-                       err = -EFAULT;
        }
-      __kctl_end:
-       up_read(&card->controls_rwsem);
-       return err;
+
+       /* Not supported. */
+       return -ENXIO;
 }
 
 static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
@@ -1511,11 +1572,20 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg
        case SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS:
                return snd_ctl_subscribe_events(ctl, ip);
        case SNDRV_CTL_IOCTL_TLV_READ:
-               return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_READ);
+               down_read(&ctl->card->controls_rwsem);
+               err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_READ);
+               up_read(&ctl->card->controls_rwsem);
+               return err;
        case SNDRV_CTL_IOCTL_TLV_WRITE:
-               return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_WRITE);
+               down_write(&ctl->card->controls_rwsem);
+               err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_WRITE);
+               up_write(&ctl->card->controls_rwsem);
+               return err;
        case SNDRV_CTL_IOCTL_TLV_COMMAND:
-               return snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_CMD);
+               down_write(&ctl->card->controls_rwsem);
+               err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_CMD);
+               up_write(&ctl->card->controls_rwsem);
+               return err;
        case SNDRV_CTL_IOCTL_POWER:
                return -ENOPROTOOPT;
        case SNDRV_CTL_IOCTL_POWER_STATE:
index 1fa70766ffabedea3cd5d3bf20779dfb7e3fcff8..a848836a5de0468534d5eecfd24adf4bc743f9f2 100644 (file)
@@ -111,12 +111,10 @@ static int snd_ctl_elem_info_compat(struct snd_ctl_file *ctl,
        if (get_user(data->value.enumerated.item, &data32->value.enumerated.item))
                goto error;
 
-       snd_power_lock(ctl->card);
        err = snd_power_wait(ctl->card, SNDRV_CTL_POWER_D0);
-       if (err >= 0)
-               err = snd_ctl_elem_info(ctl, data);
-       snd_power_unlock(ctl->card);
-
+       if (err < 0)
+               goto error;
+       err = snd_ctl_elem_info(ctl, data);
        if (err < 0)
                goto error;
        /* restore info to 32bit */
@@ -315,14 +313,13 @@ static int ctl_elem_read_user(struct snd_card *card,
        if (err < 0)
                goto error;
 
-       snd_power_lock(card);
        err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
-       if (err >= 0)
-               err = snd_ctl_elem_read(card, data);
-       snd_power_unlock(card);
-       if (err >= 0)
-               err = copy_ctl_value_to_user(userdata, valuep, data,
-                                            type, count);
+       if (err < 0)
+               goto error;
+       err = snd_ctl_elem_read(card, data);
+       if (err < 0)
+               goto error;
+       err = copy_ctl_value_to_user(userdata, valuep, data, type, count);
  error:
        kfree(data);
        return err;
@@ -344,14 +341,13 @@ static int ctl_elem_write_user(struct snd_ctl_file *file,
        if (err < 0)
                goto error;
 
-       snd_power_lock(card);
        err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
-       if (err >= 0)
-               err = snd_ctl_elem_write(card, file, data);
-       snd_power_unlock(card);
-       if (err >= 0)
-               err = copy_ctl_value_to_user(userdata, valuep, data,
-                                            type, count);
+       if (err < 0)
+               goto error;
+       err = snd_ctl_elem_write(card, file, data);
+       if (err < 0)
+               goto error;
+       err = copy_ctl_value_to_user(userdata, valuep, data, type, count);
  error:
        kfree(data);
        return err;
index b4365bcf28a7345028976e48f81080a2447cb0b4..32ebe2f6bc59667c63624710ecd16695e96d42b5 100644 (file)
@@ -248,13 +248,11 @@ int snd_card_new(struct device *parent, int idx, const char *xid,
        INIT_LIST_HEAD(&card->devices);
        init_rwsem(&card->controls_rwsem);
        rwlock_init(&card->ctl_files_rwlock);
-       mutex_init(&card->user_ctl_lock);
        INIT_LIST_HEAD(&card->controls);
        INIT_LIST_HEAD(&card->ctl_files);
        spin_lock_init(&card->files_lock);
        INIT_LIST_HEAD(&card->files_list);
 #ifdef CONFIG_PM
-       mutex_init(&card->power_lock);
        init_waitqueue_head(&card->power_sleep);
 #endif
 
@@ -979,8 +977,6 @@ EXPORT_SYMBOL(snd_card_file_remove);
  *  Waits until the power-state is changed.
  *
  *  Return: Zero if successful, or a negative error code.
- *
- *  Note: the power lock must be active before call.
  */
 int snd_power_wait(struct snd_card *card, unsigned int power_state)
 {
@@ -1000,9 +996,7 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state)
                if (snd_power_get_state(card) == power_state)
                        break;
                set_current_state(TASK_UNINTERRUPTIBLE);
-               snd_power_unlock(card);
                schedule_timeout(30 * HZ);
-               snd_power_lock(card);
        }
        remove_wait_queue(&card->power_sleep, &wait);
        return result;
index 89c7485519cbf2478d183428215618fb6f47d2ab..7eadb7fd807471666bfd6907934bcb2e5b0b6f6b 100644 (file)
@@ -523,7 +523,9 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
 
        sprintf(name, "pcm%i%c", pcm->device, 
                pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c');
-       if ((entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root)) == NULL)
+       entry = snd_info_create_card_entry(pcm->card, name,
+                                          pcm->card->proc_root);
+       if (!entry)
                return -ENOMEM;
        entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
        if (snd_info_register(entry) < 0) {
@@ -531,8 +533,8 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
                return -ENOMEM;
        }
        pstr->proc_root = entry;
-
-       if ((entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root)) != NULL) {
+       entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root);
+       if (entry) {
                snd_info_set_text_ops(entry, pstr, snd_pcm_stream_proc_info_read);
                if (snd_info_register(entry) < 0) {
                        snd_info_free_entry(entry);
@@ -542,8 +544,9 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
        pstr->proc_info_entry = entry;
 
 #ifdef CONFIG_SND_PCM_XRUN_DEBUG
-       if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug",
-                                               pstr->proc_root)) != NULL) {
+       entry = snd_info_create_card_entry(pcm->card, "xrun_debug",
+                                          pstr->proc_root);
+       if (entry) {
                entry->c.text.read = snd_pcm_xrun_debug_read;
                entry->c.text.write = snd_pcm_xrun_debug_write;
                entry->mode |= S_IWUSR;
@@ -580,7 +583,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
        card = substream->pcm->card;
 
        sprintf(name, "sub%i", substream->number);
-       if ((entry = snd_info_create_card_entry(card, name, substream->pstr->proc_root)) == NULL)
+       entry = snd_info_create_card_entry(card, name,
+                                          substream->pstr->proc_root);
+       if (!entry)
                return -ENOMEM;
        entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
        if (snd_info_register(entry) < 0) {
@@ -588,8 +593,8 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
                return -ENOMEM;
        }
        substream->proc_root = entry;
-
-       if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) {
+       entry = snd_info_create_card_entry(card, "info", substream->proc_root);
+       if (entry) {
                snd_info_set_text_ops(entry, substream,
                                      snd_pcm_substream_proc_info_read);
                if (snd_info_register(entry) < 0) {
@@ -598,8 +603,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
                }
        }
        substream->proc_info_entry = entry;
-
-       if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) {
+       entry = snd_info_create_card_entry(card, "hw_params",
+                                          substream->proc_root);
+       if (entry) {
                snd_info_set_text_ops(entry, substream,
                                      snd_pcm_substream_proc_hw_params_read);
                if (snd_info_register(entry) < 0) {
@@ -608,8 +614,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
                }
        }
        substream->proc_hw_params_entry = entry;
-
-       if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) {
+       entry = snd_info_create_card_entry(card, "sw_params",
+                                          substream->proc_root);
+       if (entry) {
                snd_info_set_text_ops(entry, substream,
                                      snd_pcm_substream_proc_sw_params_read);
                if (snd_info_register(entry) < 0) {
@@ -618,8 +625,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
                }
        }
        substream->proc_sw_params_entry = entry;
-
-       if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) {
+       entry = snd_info_create_card_entry(card, "status",
+                                          substream->proc_root);
+       if (entry) {
                snd_info_set_text_ops(entry, substream,
                                      snd_pcm_substream_proc_status_read);
                if (snd_info_register(entry) < 0) {
@@ -783,21 +791,27 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device,
        INIT_LIST_HEAD(&pcm->list);
        if (id)
                strlcpy(pcm->id, id, sizeof(pcm->id));
-       if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) {
-               snd_pcm_free(pcm);
-               return err;
-       }
-       if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_CAPTURE, capture_count)) < 0) {
-               snd_pcm_free(pcm);
-               return err;
-       }
-       if ((err = snd_device_new(card, SNDRV_DEV_PCM, pcm, &ops)) < 0) {
-               snd_pcm_free(pcm);
-               return err;
-       }
+
+       err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK,
+                                playback_count);
+       if (err < 0)
+               goto free_pcm;
+
+       err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_CAPTURE, capture_count);
+       if (err < 0)
+               goto free_pcm;
+
+       err = snd_device_new(card, SNDRV_DEV_PCM, pcm, &ops);
+       if (err < 0)
+               goto free_pcm;
+
        if (rpcm)
                *rpcm = pcm;
        return 0;
+
+free_pcm:
+       snd_pcm_free(pcm);
+       return err;
 }
 
 /**
@@ -1224,7 +1238,8 @@ static void snd_pcm_proc_init(void)
 {
        struct snd_info_entry *entry;
 
-       if ((entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL)) != NULL) {
+       entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL);
+       if (entry) {
                snd_info_set_text_ops(entry, NULL, snd_pcm_proc_read);
                if (snd_info_register(entry) < 0) {
                        snd_info_free_entry(entry);
index 10f537f4d73536f49cdea0b02447a497f7af7b03..3a1cc7b97e468bc19fad2fadfd9fb68053e6bc6d 100644 (file)
@@ -689,10 +689,7 @@ static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned l
        case SNDRV_PCM_IOCTL_XRUN:
        case SNDRV_PCM_IOCTL_LINK:
        case SNDRV_PCM_IOCTL_UNLINK:
-               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-                       return snd_pcm_playback_ioctl1(file, substream, cmd, argp);
-               else
-                       return snd_pcm_capture_ioctl1(file, substream, cmd, argp);
+               return snd_pcm_common_ioctl(file, substream, cmd, argp);
        case SNDRV_PCM_IOCTL_HW_REFINE32:
                return snd_pcm_ioctl_hw_params_compat(substream, 1, argp);
        case SNDRV_PCM_IOCTL_HW_PARAMS32:
index cf0433f8006772392061b0cf95514a266a44f948..2fec2feac387d3134833b02d8230f2e3a05ed114 100644 (file)
@@ -1830,7 +1830,6 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
                add_wait_queue(&to_check->sleep, &wait);
                snd_pcm_stream_unlock_irq(substream);
                up_read(&snd_pcm_link_rwsem);
-               snd_power_unlock(card);
                if (runtime->no_period_wakeup)
                        tout = MAX_SCHEDULE_TIMEOUT;
                else {
@@ -1842,7 +1841,6 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
                        tout = msecs_to_jiffies(tout * 1000);
                }
                tout = schedule_timeout_interruptible(tout);
-               snd_power_lock(card);
                down_read(&snd_pcm_link_rwsem);
                snd_pcm_stream_lock_irq(substream);
                remove_wait_queue(&to_check->sleep, &wait);
@@ -2763,12 +2761,106 @@ static int snd_pcm_tstamp(struct snd_pcm_substream *substream, int __user *_arg)
        runtime->tstamp_type = arg;
        return 0;
 }
-               
+
+static int snd_pcm_xferi_frames_ioctl(struct snd_pcm_substream *substream,
+                                     struct snd_xferi __user *_xferi)
+{
+       struct snd_xferi xferi;
+       struct snd_pcm_runtime *runtime = substream->runtime;
+       snd_pcm_sframes_t result;
+
+       if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
+               return -EBADFD;
+       if (put_user(0, &_xferi->result))
+               return -EFAULT;
+       if (copy_from_user(&xferi, _xferi, sizeof(xferi)))
+               return -EFAULT;
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               result = snd_pcm_lib_write(substream, xferi.buf, xferi.frames);
+       else
+               result = snd_pcm_lib_read(substream, xferi.buf, xferi.frames);
+       __put_user(result, &_xferi->result);
+       return result < 0 ? result : 0;
+}
+
+static int snd_pcm_xfern_frames_ioctl(struct snd_pcm_substream *substream,
+                                     struct snd_xfern __user *_xfern)
+{
+       struct snd_xfern xfern;
+       struct snd_pcm_runtime *runtime = substream->runtime;
+       void *bufs;
+       snd_pcm_sframes_t result;
+
+       if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
+               return -EBADFD;
+       if (runtime->channels > 128)
+               return -EINVAL;
+       if (put_user(0, &_xfern->result))
+               return -EFAULT;
+       if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
+               return -EFAULT;
+
+       bufs = memdup_user(xfern.bufs, sizeof(void *) * runtime->channels);
+       if (IS_ERR(bufs))
+               return PTR_ERR(bufs);
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               result = snd_pcm_lib_writev(substream, bufs, xfern.frames);
+       else
+               result = snd_pcm_lib_readv(substream, bufs, xfern.frames);
+       kfree(bufs);
+       __put_user(result, &_xfern->result);
+       return result < 0 ? result : 0;
+}
+
+static int snd_pcm_rewind_ioctl(struct snd_pcm_substream *substream,
+                               snd_pcm_uframes_t __user *_frames)
+{
+       snd_pcm_uframes_t frames;
+       snd_pcm_sframes_t result;
+
+       if (get_user(frames, _frames))
+               return -EFAULT;
+       if (put_user(0, _frames))
+               return -EFAULT;
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               result = snd_pcm_playback_rewind(substream, frames);
+       else
+               result = snd_pcm_capture_rewind(substream, frames);
+       __put_user(result, _frames);
+       return result < 0 ? result : 0;
+}
+
+static int snd_pcm_forward_ioctl(struct snd_pcm_substream *substream,
+                                snd_pcm_uframes_t __user *_frames)
+{
+       snd_pcm_uframes_t frames;
+       snd_pcm_sframes_t result;
+
+       if (get_user(frames, _frames))
+               return -EFAULT;
+       if (put_user(0, _frames))
+               return -EFAULT;
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               result = snd_pcm_playback_forward(substream, frames);
+       else
+               result = snd_pcm_capture_forward(substream, frames);
+       __put_user(result, _frames);
+       return result < 0 ? result : 0;
+}
+
 static int snd_pcm_common_ioctl(struct file *file,
                                 struct snd_pcm_substream *substream,
                                 unsigned int cmd, void __user *arg)
 {
        struct snd_pcm_file *pcm_file = file->private_data;
+       int res;
+
+       if (PCM_RUNTIME_CHECK(substream))
+               return -ENXIO;
+
+       res = snd_power_wait(substream->pcm->card, SNDRV_CTL_POWER_D0);
+       if (res < 0)
+               return res;
 
        switch (cmd) {
        case SNDRV_PCM_IOCTL_PVERSION:
@@ -2841,202 +2933,23 @@ static int snd_pcm_common_ioctl(struct file *file,
                return snd_pcm_action_lock_irq(&snd_pcm_action_pause,
                                               substream,
                                               (int)(unsigned long)arg);
-       }
-       pcm_dbg(substream->pcm, "unknown ioctl = 0x%x\n", cmd);
-       return -ENOTTY;
-}
-
-static int snd_pcm_common_ioctl1(struct file *file,
-                                struct snd_pcm_substream *substream,
-                                unsigned int cmd, void __user *arg)
-{
-       struct snd_card *card = substream->pcm->card;
-       int res;
-
-       snd_power_lock(card);
-       res = snd_power_wait(card, SNDRV_CTL_POWER_D0);
-       if (res >= 0)
-               res = snd_pcm_common_ioctl(file, substream, cmd, arg);
-       snd_power_unlock(card);
-       return res;
-}
-
-static int snd_pcm_playback_ioctl1(struct file *file,
-                                  struct snd_pcm_substream *substream,
-                                  unsigned int cmd, void __user *arg)
-{
-       if (PCM_RUNTIME_CHECK(substream))
-               return -ENXIO;
-       if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_PLAYBACK))
-               return -EINVAL;
-       switch (cmd) {
        case SNDRV_PCM_IOCTL_WRITEI_FRAMES:
-       {
-               struct snd_xferi xferi;
-               struct snd_xferi __user *_xferi = arg;
-               struct snd_pcm_runtime *runtime = substream->runtime;
-               snd_pcm_sframes_t result;
-               if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
-                       return -EBADFD;
-               if (put_user(0, &_xferi->result))
-                       return -EFAULT;
-               if (copy_from_user(&xferi, _xferi, sizeof(xferi)))
-                       return -EFAULT;
-               result = snd_pcm_lib_write(substream, xferi.buf, xferi.frames);
-               __put_user(result, &_xferi->result);
-               return result < 0 ? result : 0;
-       }
-       case SNDRV_PCM_IOCTL_WRITEN_FRAMES:
-       {
-               struct snd_xfern xfern;
-               struct snd_xfern __user *_xfern = arg;
-               struct snd_pcm_runtime *runtime = substream->runtime;
-               void __user **bufs;
-               snd_pcm_sframes_t result;
-               if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
-                       return -EBADFD;
-               if (runtime->channels > 128)
-                       return -EINVAL;
-               if (put_user(0, &_xfern->result))
-                       return -EFAULT;
-               if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
-                       return -EFAULT;
-
-               bufs = memdup_user(xfern.bufs,
-                                  sizeof(void *) * runtime->channels);
-               if (IS_ERR(bufs))
-                       return PTR_ERR(bufs);
-               result = snd_pcm_lib_writev(substream, bufs, xfern.frames);
-               kfree(bufs);
-               __put_user(result, &_xfern->result);
-               return result < 0 ? result : 0;
-       }
-       case SNDRV_PCM_IOCTL_REWIND:
-       {
-               snd_pcm_uframes_t frames;
-               snd_pcm_uframes_t __user *_frames = arg;
-               snd_pcm_sframes_t result;
-               if (get_user(frames, _frames))
-                       return -EFAULT;
-               if (put_user(0, _frames))
-                       return -EFAULT;
-               result = snd_pcm_playback_rewind(substream, frames);
-               __put_user(result, _frames);
-               return result < 0 ? result : 0;
-       }
-       case SNDRV_PCM_IOCTL_FORWARD:
-       {
-               snd_pcm_uframes_t frames;
-               snd_pcm_uframes_t __user *_frames = arg;
-               snd_pcm_sframes_t result;
-               if (get_user(frames, _frames))
-                       return -EFAULT;
-               if (put_user(0, _frames))
-                       return -EFAULT;
-               result = snd_pcm_playback_forward(substream, frames);
-               __put_user(result, _frames);
-               return result < 0 ? result : 0;
-       }
-       }
-       return snd_pcm_common_ioctl1(file, substream, cmd, arg);
-}
-
-static int snd_pcm_capture_ioctl1(struct file *file,
-                                 struct snd_pcm_substream *substream,
-                                 unsigned int cmd, void __user *arg)
-{
-       if (PCM_RUNTIME_CHECK(substream))
-               return -ENXIO;
-       if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_CAPTURE))
-               return -EINVAL;
-       switch (cmd) {
        case SNDRV_PCM_IOCTL_READI_FRAMES:
-       {
-               struct snd_xferi xferi;
-               struct snd_xferi __user *_xferi = arg;
-               struct snd_pcm_runtime *runtime = substream->runtime;
-               snd_pcm_sframes_t result;
-               if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
-                       return -EBADFD;
-               if (put_user(0, &_xferi->result))
-                       return -EFAULT;
-               if (copy_from_user(&xferi, _xferi, sizeof(xferi)))
-                       return -EFAULT;
-               result = snd_pcm_lib_read(substream, xferi.buf, xferi.frames);
-               __put_user(result, &_xferi->result);
-               return result < 0 ? result : 0;
-       }
+               return snd_pcm_xferi_frames_ioctl(substream, arg);
+       case SNDRV_PCM_IOCTL_WRITEN_FRAMES:
        case SNDRV_PCM_IOCTL_READN_FRAMES:
-       {
-               struct snd_xfern xfern;
-               struct snd_xfern __user *_xfern = arg;
-               struct snd_pcm_runtime *runtime = substream->runtime;
-               void *bufs;
-               snd_pcm_sframes_t result;
-               if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
-                       return -EBADFD;
-               if (runtime->channels > 128)
-                       return -EINVAL;
-               if (put_user(0, &_xfern->result))
-                       return -EFAULT;
-               if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
-                       return -EFAULT;
-
-               bufs = memdup_user(xfern.bufs,
-                                  sizeof(void *) * runtime->channels);
-               if (IS_ERR(bufs))
-                       return PTR_ERR(bufs);
-               result = snd_pcm_lib_readv(substream, bufs, xfern.frames);
-               kfree(bufs);
-               __put_user(result, &_xfern->result);
-               return result < 0 ? result : 0;
-       }
+               return snd_pcm_xfern_frames_ioctl(substream, arg);
        case SNDRV_PCM_IOCTL_REWIND:
-       {
-               snd_pcm_uframes_t frames;
-               snd_pcm_uframes_t __user *_frames = arg;
-               snd_pcm_sframes_t result;
-               if (get_user(frames, _frames))
-                       return -EFAULT;
-               if (put_user(0, _frames))
-                       return -EFAULT;
-               result = snd_pcm_capture_rewind(substream, frames);
-               __put_user(result, _frames);
-               return result < 0 ? result : 0;
-       }
+               return snd_pcm_rewind_ioctl(substream, arg);
        case SNDRV_PCM_IOCTL_FORWARD:
-       {
-               snd_pcm_uframes_t frames;
-               snd_pcm_uframes_t __user *_frames = arg;
-               snd_pcm_sframes_t result;
-               if (get_user(frames, _frames))
-                       return -EFAULT;
-               if (put_user(0, _frames))
-                       return -EFAULT;
-               result = snd_pcm_capture_forward(substream, frames);
-               __put_user(result, _frames);
-               return result < 0 ? result : 0;
+               return snd_pcm_forward_ioctl(substream, arg);
        }
-       }
-       return snd_pcm_common_ioctl1(file, substream, cmd, arg);
-}
-
-static long snd_pcm_playback_ioctl(struct file *file, unsigned int cmd,
-                                  unsigned long arg)
-{
-       struct snd_pcm_file *pcm_file;
-
-       pcm_file = file->private_data;
-
-       if (((cmd >> 8) & 0xff) != 'A')
-               return -ENOTTY;
-
-       return snd_pcm_playback_ioctl1(file, pcm_file->substream, cmd,
-                                      (void __user *)arg);
+       pcm_dbg(substream->pcm, "unknown ioctl = 0x%x\n", cmd);
+       return -ENOTTY;
 }
 
-static long snd_pcm_capture_ioctl(struct file *file, unsigned int cmd,
-                                 unsigned long arg)
+static long snd_pcm_ioctl(struct file *file, unsigned int cmd,
+                         unsigned long arg)
 {
        struct snd_pcm_file *pcm_file;
 
@@ -3045,8 +2958,8 @@ static long snd_pcm_capture_ioctl(struct file *file, unsigned int cmd,
        if (((cmd >> 8) & 0xff) != 'A')
                return -ENOTTY;
 
-       return snd_pcm_capture_ioctl1(file, pcm_file->substream, cmd,
-                                     (void __user *)arg);
+       return snd_pcm_common_ioctl(file, pcm_file->substream, cmd,
+                                    (void __user *)arg);
 }
 
 /**
@@ -3064,7 +2977,6 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
 {
        snd_pcm_uframes_t *frames = arg;
        snd_pcm_sframes_t result;
-       int err;
        
        switch (cmd) {
        case SNDRV_PCM_IOCTL_FORWARD:
@@ -3084,10 +2996,7 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
        case SNDRV_PCM_IOCTL_START:
                return snd_pcm_start_lock_irq(substream);
        case SNDRV_PCM_IOCTL_DRAIN:
-               snd_power_lock(substream->pcm->card);
-               err = snd_pcm_drain(substream, NULL);
-               snd_power_unlock(substream->pcm->card);
-               return err;
+               return snd_pcm_drain(substream, NULL);
        case SNDRV_PCM_IOCTL_DROP:
                return snd_pcm_drop(substream);
        case SNDRV_PCM_IOCTL_DELAY:
@@ -3791,7 +3700,7 @@ const struct file_operations snd_pcm_f_ops[2] = {
                .release =              snd_pcm_release,
                .llseek =               no_llseek,
                .poll =                 snd_pcm_playback_poll,
-               .unlocked_ioctl =       snd_pcm_playback_ioctl,
+               .unlocked_ioctl =       snd_pcm_ioctl,
                .compat_ioctl =         snd_pcm_ioctl_compat,
                .mmap =                 snd_pcm_mmap,
                .fasync =               snd_pcm_fasync,
@@ -3805,7 +3714,7 @@ const struct file_operations snd_pcm_f_ops[2] = {
                .release =              snd_pcm_release,
                .llseek =               no_llseek,
                .poll =                 snd_pcm_capture_poll,
-               .unlocked_ioctl =       snd_pcm_capture_ioctl,
+               .unlocked_ioctl =       snd_pcm_ioctl,
                .compat_ioctl =         snd_pcm_ioctl_compat,
                .mmap =                 snd_pcm_mmap,
                .fasync =               snd_pcm_fasync,
index a9b9a277e00c1bda4bd85038cc45842ac2425ee0..6cdd04a459626c86f185742d099ab16729b7d517 100644 (file)
@@ -393,7 +393,8 @@ unsigned long snd_timer_resolution(struct snd_timer_instance *timeri)
 
        if (timeri == NULL)
                return 0;
-       if ((timer = timeri->timer) != NULL) {
+       timer = timeri->timer;
+       if (timer) {
                if (timer->hw.c_resolution)
                        return timer->hw.c_resolution(timer);
                return timer->hw.resolution;
@@ -2096,8 +2097,7 @@ static int __init alsa_timer_init(void)
        err = snd_timer_register_system();
        if (err < 0) {
                pr_err("ALSA: unable to register system timer (%i)\n", err);
-               put_device(&timer_dev);
-               return err;
+               goto put_timer;
        }
 
        err = snd_register_device(SNDRV_DEVICE_TYPE_TIMER, NULL, 0,
@@ -2105,12 +2105,15 @@ static int __init alsa_timer_init(void)
        if (err < 0) {
                pr_err("ALSA: unable to register timer device (%i)\n", err);
                snd_timer_free_all();
-               put_device(&timer_dev);
-               return err;
+               goto put_timer;
        }
 
        snd_timer_proc_init();
        return 0;
+
+put_timer:
+       put_device(&timer_dev);
+       return err;
 }
 
 static void __exit alsa_timer_exit(void)
index 54f348a4fb7811b5c9e4f13f4ace902d0fb845da..135adb17703cc4992e127f9dc881db1b715206c4 100644 (file)
@@ -561,7 +561,7 @@ static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream)
        return bytes_to_frames(runtime, pos);
 }
 
-static struct snd_pcm_hardware loopback_pcm_hardware =
+static const struct snd_pcm_hardware loopback_pcm_hardware =
 {
        .info =         (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP |
                         SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
@@ -750,7 +750,7 @@ static int loopback_close(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static struct snd_pcm_ops loopback_playback_ops = {
+static const struct snd_pcm_ops loopback_playback_ops = {
        .open =         loopback_open,
        .close =        loopback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -763,7 +763,7 @@ static struct snd_pcm_ops loopback_playback_ops = {
        .mmap =         snd_pcm_lib_mmap_vmalloc,
 };
 
-static struct snd_pcm_ops loopback_capture_ops = {
+static const struct snd_pcm_ops loopback_capture_ops = {
        .open =         loopback_open,
        .close =        loopback_close,
        .ioctl =        snd_pcm_lib_ioctl,
index dd5ed037adf2bb3a6fbaeacff681aaa77b56c4b2..c0939a0164a6ff4c378ffe0863e5b7e265cf46c4 100644 (file)
@@ -520,7 +520,7 @@ static snd_pcm_uframes_t dummy_pcm_pointer(struct snd_pcm_substream *substream)
        return get_dummy_ops(substream)->pointer(substream);
 }
 
-static struct snd_pcm_hardware dummy_pcm_hardware = {
+static const struct snd_pcm_hardware dummy_pcm_hardware = {
        .info =                 (SNDRV_PCM_INFO_MMAP |
                                 SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_RESUME |
index bdcb5721393b1b326497e7a9e4fa43c60a2c3ee5..18fd12996cf70c2cb8480684429370c17cc80e3a 100644 (file)
@@ -373,7 +373,7 @@ struct snd_ml403_ac97cr {
        struct snd_pcm_indirect2 capture_ind2_rec;
 };
 
-static struct snd_pcm_hardware snd_ml403_ac97cr_playback = {
+static const struct snd_pcm_hardware snd_ml403_ac97cr_playback = {
        .info =             (SNDRV_PCM_INFO_MMAP |
                             SNDRV_PCM_INFO_INTERLEAVED |
                             SNDRV_PCM_INFO_MMAP_VALID),
@@ -392,7 +392,7 @@ static struct snd_pcm_hardware snd_ml403_ac97cr_playback = {
        .fifo_size =        0,
 };
 
-static struct snd_pcm_hardware snd_ml403_ac97cr_capture = {
+static const struct snd_pcm_hardware snd_ml403_ac97cr_capture = {
        .info =             (SNDRV_PCM_INFO_MMAP |
                             SNDRV_PCM_INFO_INTERLEAVED |
                             SNDRV_PCM_INFO_MMAP_VALID),
@@ -759,7 +759,7 @@ static int snd_ml403_ac97cr_capture_close(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static struct snd_pcm_ops snd_ml403_ac97cr_playback_ops = {
+static const struct snd_pcm_ops snd_ml403_ac97cr_playback_ops = {
        .open = snd_ml403_ac97cr_playback_open,
        .close = snd_ml403_ac97cr_playback_close,
        .ioctl = snd_pcm_lib_ioctl,
@@ -770,7 +770,7 @@ static struct snd_pcm_ops snd_ml403_ac97cr_playback_ops = {
        .pointer = snd_ml403_ac97cr_pcm_pointer,
 };
 
-static struct snd_pcm_ops snd_ml403_ac97cr_capture_ops = {
+static const struct snd_pcm_ops snd_ml403_ac97cr_capture_ops = {
        .open = snd_ml403_ac97cr_capture_open,
        .close = snd_ml403_ac97cr_capture_close,
        .ioctl = snd_pcm_lib_ioctl,
index 9b86e00d7d95ffada3ac89b52671be20a2d30d38..b6715764cd1c3a3e30536ac57d46d560d369849b 100644 (file)
@@ -148,7 +148,7 @@ static struct platform_driver snd_mpu401_driver = {
 
 #define IO_EXTENT 2
 
-static struct pnp_device_id snd_mpu401_pnpids[] = {
+static const struct pnp_device_id snd_mpu401_pnpids[] = {
        { .id = "PNPb006" },
        { .id = "" }
 };
index 3a7c317ae012ab18e1172d5cc795f64db7afb953..b997222274bd96c4ea88aa0fc83cd6b2cc8567f7 100644 (file)
@@ -136,7 +136,7 @@ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id)
 {
        struct snd_mpu401 *mpu = dev_id;
        
-       if (mpu == NULL)
+       if (!mpu)
                return IRQ_NONE;
        _snd_mpu401_uart_interrupt(mpu);
        return IRQ_HANDLED;
@@ -157,7 +157,7 @@ irqreturn_t snd_mpu401_uart_interrupt_tx(int irq, void *dev_id)
 {
        struct snd_mpu401 *mpu = dev_id;
        
-       if (mpu == NULL)
+       if (!mpu)
                return IRQ_NONE;
        uart_interrupt_tx(mpu);
        return IRQ_HANDLED;
@@ -544,10 +544,9 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
                                   out_enable, in_enable, &rmidi)) < 0)
                return err;
        mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
-       if (mpu == NULL) {
-               snd_printk(KERN_ERR "mpu401_uart: cannot allocate\n");
-               snd_device_free(card, rmidi);
-               return -ENOMEM;
+       if (!mpu) {
+               err = -ENOMEM;
+               goto free_device;
        }
        rmidi->private_data = mpu;
        rmidi->private_free = snd_mpu401_uart_free;
@@ -559,12 +558,12 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
        if (! (info_flags & MPU401_INFO_INTEGRATED)) {
                int res_size = hardware == MPU401_HW_PC98II ? 4 : 2;
                mpu->res = request_region(port, res_size, "MPU401 UART");
-               if (mpu->res == NULL) {
+               if (!mpu->res) {
                        snd_printk(KERN_ERR "mpu401_uart: "
                                   "unable to grab port 0x%lx size %d\n",
                                   port, res_size);
-                       snd_device_free(card, rmidi);
-                       return -EBUSY;
+                       err = -EBUSY;
+                       goto free_device;
                }
        }
        if (info_flags & MPU401_INFO_MMIO) {
@@ -584,8 +583,8 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
                                "MPU401 UART", (void *) mpu)) {
                        snd_printk(KERN_ERR "mpu401_uart: "
                                   "unable to grab IRQ %d\n", irq);
-                       snd_device_free(card, rmidi);
-                       return -EBUSY;
+                       err = -EBUSY;
+                       goto free_device;
                }
        }
        if (irq < 0 && !(info_flags & MPU401_INFO_IRQ_HOOK))
@@ -613,6 +612,9 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
        if (rrawmidi)
                *rrawmidi = rmidi;
        return 0;
+free_device:
+       snd_device_free(card, rmidi);
+       return err;
 }
 
 EXPORT_SYMBOL(snd_mpu401_uart_new);
index d5e5b4657b4ba966501fbf53e5d77f3f59fe53e2..588963d6be281daac008fdfe70cdfcc058c9df86 100644 (file)
@@ -355,10 +355,8 @@ int snd_opl3_new(struct snd_card *card,
 
        *ropl3 = NULL;
        opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL);
-       if (opl3 == NULL) {
-               snd_printk(KERN_ERR "opl3: cannot allocate\n");
+       if (!opl3)
                return -ENOMEM;
-       }
 
        opl3->card = card;
        opl3->hardware = hardware;
index 7821b07415a785c70982e03803ac34601770e3a9..13c0a7e1bc2b050c2d0a3e98bd1d08cbe5bf7f1a 100644 (file)
@@ -131,8 +131,8 @@ static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) {
 
        printk(KERN_DEBUG "time %.5i: %s [%.2i]: ", opl3->use_time, s, voice);
        for (i = 0; i < opl3->max_voices; i++)
-               printk("%c", *(str + opl3->voices[i].state + 1));
-       printk("\n");
+               printk(KERN_CONT "%c", *(str + opl3->voices[i].state + 1));
+       printk(KERN_CONT "\n");
 }
 #endif
 
index 72e2d0012084730498123aee36ca4d35bb3a2a7e..0dd3f46eb03e804da8f8af663d3e270a96dc6aa1 100644 (file)
@@ -108,22 +108,17 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)
                return err;
 
        err = snd_pcsp_create(card);
-       if (err < 0) {
-               snd_card_free(card);
-               return err;
-       }
+       if (err < 0)
+               goto free_card;
+
        if (!nopcm) {
                err = snd_pcsp_new_pcm(&pcsp_chip);
-               if (err < 0) {
-                       snd_card_free(card);
-                       return err;
-               }
+               if (err < 0)
+                       goto free_card;
        }
        err = snd_pcsp_new_mixer(&pcsp_chip, nopcm);
-       if (err < 0) {
-               snd_card_free(card);
-               return err;
-       }
+       if (err < 0)
+               goto free_card;
 
        strcpy(card->driver, "PC-Speaker");
        strcpy(card->shortname, "pcsp");
@@ -131,12 +126,14 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)
                pcsp_chip.port);
 
        err = snd_card_register(card);
-       if (err < 0) {
-               snd_card_free(card);
-               return err;
-       }
+       if (err < 0)
+               goto free_card;
 
        return 0;
+
+free_card:
+       snd_card_free(card);
+       return err;
 }
 
 static int alsa_card_pcsp_init(struct device *dev)
index 44b3632f6940c4713ed49f67612d21c3e52b2b43..2f5a35f38ce1b3b1c3426cecff3d714a9dae74de 100644 (file)
@@ -285,7 +285,7 @@ static snd_pcm_uframes_t snd_pcsp_playback_pointer(struct snd_pcm_substream
        return bytes_to_frames(substream->runtime, pos);
 }
 
-static struct snd_pcm_hardware snd_pcsp_playback = {
+static const struct snd_pcm_hardware snd_pcsp_playback = {
        .info = (SNDRV_PCM_INFO_INTERLEAVED |
                 SNDRV_PCM_INFO_HALF_DUPLEX |
                 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
index f684fffd1397552096fda2f74c45a97e173469d7..121357397a6d5388c00639514df1b64b7ebe9f18 100644 (file)
@@ -256,8 +256,8 @@ int vx_send_msg_nolock(struct vx_core *chip, struct vx_rmh *rmh)
        if (rmh->LgCmd > 1) {
                printk(KERN_DEBUG "  ");
                for (i = 1; i < rmh->LgCmd; i++)
-                       printk("0x%06x ", rmh->Cmd[i]);
-               printk("\n");
+                       printk(KERN_CONT "0x%06x ", rmh->Cmd[i]);
+               printk(KERN_CONT "\n");
        }
 #endif
        /* Check bit M is set according to length of the command */
index d318a33b6cfbf860985163e7bfac8933a3905fd5..380a028469c44ad033ccdb6cd65a38a562e9417e 100644 (file)
@@ -500,7 +500,7 @@ static int vx_stop_stream(struct vx_core *chip, struct vx_pipe *pipe)
  * playback hw information
  */
 
-static struct snd_pcm_hardware vx_pcm_playback_hw = {
+static const struct snd_pcm_hardware vx_pcm_playback_hw = {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/
                                 /*SNDRV_PCM_INFO_RESUME*/),
@@ -891,7 +891,7 @@ static const struct snd_pcm_ops vx_pcm_playback_ops = {
  * playback hw information
  */
 
-static struct snd_pcm_hardware vx_pcm_capture_hw = {
+static const struct snd_pcm_hardware vx_pcm_capture_hw = {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/
                                 /*SNDRV_PCM_INFO_RESUME*/),
index 17678d6ab5a2d9b93e7a318c382c4f58ec1805d5..df1b1e94c43c94b82044a55801a0846efac6c1b3 100644 (file)
@@ -58,7 +58,7 @@ enum snd_bebob_clock_type {
 struct snd_bebob_clock_spec {
        unsigned int num;
        const char *const *labels;
-       enum snd_bebob_clock_type *types;
+       const enum snd_bebob_clock_type *types;
        int (*get)(struct snd_bebob *bebob, unsigned int *id);
 };
 struct snd_bebob_rate_spec {
index f1109005794944cd759b90ede92a6fc601ab251e..52b8b61ecddd2d6a467992e7c5cc48b66df6ea21 100644 (file)
@@ -103,12 +103,12 @@ saffire_write_quad(struct snd_bebob *bebob, u64 offset, u32 value)
                                  &data, sizeof(__be32), 0);
 }
 
-static enum snd_bebob_clock_type saffirepro_10_clk_src_types[] = {
+static const enum snd_bebob_clock_type saffirepro_10_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* Word Clock */
 };
-static enum snd_bebob_clock_type saffirepro_26_clk_src_types[] = {
+static const enum snd_bebob_clock_type saffirepro_26_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* ADAT1 */
@@ -201,7 +201,7 @@ end:
 }
 
 const struct snd_bebob_spec saffire_le_spec;
-static enum snd_bebob_clock_type saffire_both_clk_src_types[] = {
+static const enum snd_bebob_clock_type saffire_both_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,
 };
index d10208f92edfa520ef68579f6961f5e36791bf5a..bd55620c6a479315f6787eb26de2c73bf4913eb6 100644 (file)
@@ -340,7 +340,7 @@ end:
 }
 
 /* Clock source control for special firmware */
-static enum snd_bebob_clock_type special_clk_types[] = {
+static const enum snd_bebob_clock_type special_clk_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,  /* With digital mute */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* SPDIF/ADAT */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* Word Clock */
index 2fdaf93e7a8d3d69d8fa28e91a611c8776b52e76..9770c2127a7a589d8497595f45c59bc4c5c195ee 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "./bebob.h"
 
-static enum snd_bebob_clock_type phase88_rack_clk_src_types[] = {
+static const enum snd_bebob_clock_type phase88_rack_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* Word Clock */
index a6be3e7138e0586cfac6c6ee2b9e67906894f4aa..8bd78fef3516251d17fb56a64b244dfed2b4daea 100644 (file)
@@ -31,7 +31,7 @@
  * Yamaha GO 44 and GO 46. Yamaha and Terratec had cooperated for these models.
  */
 
-static enum snd_bebob_clock_type clk_src_types[] = {
+static const enum snd_bebob_clock_type clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
 };
index 25e9f77275c4dd6ef6a39da8e9f77294f86f876c..4ddb4cdd054b860142da4356dc6abeef44b4c698 100644 (file)
@@ -26,7 +26,7 @@ MODULE_LICENSE("GPL v2");
  */
 static bool force_two_pcm_support(struct fw_unit *unit)
 {
-       const char *const models[] = {
+       static const char *const models[] = {
                /* TC Electronic models. */
                "StudioKonnekt48",
                /* Focusrite models. */
index d12a0e3a42194cb3d728a910e9592a79671bab39..e3c16308363d62ae135b379faf592166a15e8b85 100644 (file)
@@ -138,16 +138,12 @@ static int pcm_open(struct snd_pcm_substream *substream)
                return err;
 
        err = pcm_init_hw_params(ff, substream);
-       if (err < 0) {
-               snd_ff_stream_lock_release(ff);
-               return err;
-       }
+       if (err < 0)
+               goto release_lock;
 
        err = ff->spec->protocol->get_clock(ff, &rate, &src);
-       if (err < 0) {
-               snd_ff_stream_lock_release(ff);
-               return err;
-       }
+       if (err < 0)
+               goto release_lock;
 
        if (src != SND_FF_CLOCK_SRC_INTERNAL) {
                for (i = 0; i < CIP_SFC_COUNT; ++i) {
@@ -159,8 +155,8 @@ static int pcm_open(struct snd_pcm_substream *substream)
                 * streaming engine can't support.
                 */
                if (i >= CIP_SFC_COUNT) {
-                       snd_ff_stream_lock_release(ff);
-                       return -EIO;
+                       err = -EIO;
+                       goto release_lock;
                }
 
                substream->runtime->hw.rate_min = rate;
@@ -177,6 +173,10 @@ static int pcm_open(struct snd_pcm_substream *substream)
        snd_pcm_set_sync(substream);
 
        return 0;
+
+release_lock:
+       snd_ff_stream_lock_release(ff);
+       return err;
 }
 
 static int pcm_close(struct snd_pcm_substream *substream)
index fcec6de80eebc724e3f59c7761c783f6371aa804..12aa15df435d1cca2bf6f3cf42b60704b2340004 100644 (file)
@@ -356,7 +356,7 @@ static void ff400_dump_clock_config(struct snd_ff *ff,
        snd_iprintf(buffer, "Sync to clock source: %s\n", src);
 }
 
-struct snd_ff_protocol snd_ff_protocol_ff400 = {
+const struct snd_ff_protocol snd_ff_protocol_ff400 = {
        .get_clock              = ff400_get_clock,
        .begin_session          = ff400_begin_session,
        .finish_session         = ff400_finish_session,
index eee7c8eac7a61908b53dfa0862b0ca0b5e98ab2a..4974bc7980e9b476611d78cc79a48275259a12b9 100644 (file)
@@ -157,7 +157,7 @@ static void snd_ff_remove(struct fw_unit *unit)
        }
 }
 
-static struct snd_ff_spec spec_ff400 = {
+static const struct snd_ff_spec spec_ff400 = {
        .name = "Fireface400",
        .pcm_capture_channels = {18, 14, 10},
        .pcm_playback_channels = {18, 14, 10},
index 3cb812a500305eaa45d9cb3dcfad77a85eff2687..64df44beb95058ab42f51d195edc4f6497edea88 100644 (file)
@@ -47,7 +47,7 @@ struct snd_ff_spec {
        unsigned int midi_in_ports;
        unsigned int midi_out_ports;
 
-       struct snd_ff_protocol *protocol;
+       const struct snd_ff_protocol *protocol;
 };
 
 struct snd_ff {
@@ -112,7 +112,7 @@ struct snd_ff_protocol {
        u64 midi_rx_port_1_reg;
 };
 
-extern struct snd_ff_protocol snd_ff_protocol_ff400;
+extern const struct snd_ff_protocol snd_ff_protocol_ff400;
 
 int snd_ff_transaction_register(struct snd_ff *ff);
 int snd_ff_transaction_reregister(struct snd_ff *ff);
index beb0a0ffee57c4cfbb72845dd16a6f27b1c165ba..9c21f31b8b21c9f05ceaabcf0ce49cc86eb46681 100644 (file)
@@ -12,7 +12,7 @@
 static inline const char*
 get_phys_name(struct snd_efw_phys_grp *grp, bool input)
 {
-       const char *const ch_type[] = {
+       static const char *const ch_type[] = {
                "Analog", "S/PDIF", "ADAT", "S/PDIF or ADAT", "Mirroring",
                "Headphones", "I2S", "Guitar", "Pirzo Guitar", "Guitar String",
        };
index 48d6dca471c6bc5713cd7a6ee7bc466c008a1997..5826aa8362f10b319c5946054c73107fef5f963f 100644 (file)
@@ -444,7 +444,7 @@ static snd_pcm_uframes_t isight_pointer(struct snd_pcm_substream *substream)
 
 static int isight_create_pcm(struct isight *isight)
 {
-       static struct snd_pcm_ops ops = {
+       static const struct snd_pcm_ops ops = {
                .open      = isight_open,
                .close     = isight_close,
                .ioctl     = snd_pcm_lib_ioctl,
index e3acfcc53f4e3a02b4393dc3e8c97b46be3a68ef..e55cab6d79c7df91d72b6837def3a1bdb1b6bdca 100644 (file)
@@ -128,12 +128,12 @@ static void set_midi_substream_names(struct snd_motu *motu,
 
 int snd_motu_create_midi_devices(struct snd_motu *motu)
 {
-       static struct snd_rawmidi_ops capture_ops = {
+       static const struct snd_rawmidi_ops capture_ops = {
                .open           = midi_capture_open,
                .close          = midi_capture_close,
                .trigger        = midi_capture_trigger,
        };
-       static struct snd_rawmidi_ops playback_ops = {
+       static const struct snd_rawmidi_ops playback_ops = {
                .open           = midi_playback_open,
                .close          = midi_playback_close,
                .trigger        = midi_playback_trigger,
index a2b50df708743f4fce0f16303ac195a3e33ea512..4330220890e8a9b6080bd8bc30c318416215807b 100644 (file)
@@ -145,7 +145,7 @@ static int pcm_open(struct snd_pcm_substream *substream)
 
        mutex_lock(&motu->mutex);
 
-       err = protocol->cache_packet_formats(motu);
+       err = snd_motu_stream_cache_packet_formats(motu);
        if (err < 0)
                goto err_locked;
 
@@ -352,7 +352,7 @@ static int playback_ack(struct snd_pcm_substream *substream)
 
 int snd_motu_create_pcm_devices(struct snd_motu *motu)
 {
-       static struct snd_pcm_ops capture_ops = {
+       static const struct snd_pcm_ops capture_ops = {
                .open      = pcm_open,
                .close     = pcm_close,
                .ioctl     = snd_pcm_lib_ioctl,
@@ -365,7 +365,7 @@ int snd_motu_create_pcm_devices(struct snd_motu *motu)
                .page      = snd_pcm_lib_get_vmalloc_page,
                .mmap      = snd_pcm_lib_mmap_vmalloc,
        };
-       static struct snd_pcm_ops playback_ops = {
+       static const struct snd_pcm_ops playback_ops = {
                .open      = pcm_open,
                .close     = pcm_close,
                .ioctl     = snd_pcm_lib_ioctl,
index 05b5d287c2f3ddd3b1e0c8d9d0287fd05d7629f3..525b746330bebe2e5b878c229ad35e4931807458 100644 (file)
@@ -217,12 +217,7 @@ static int v2_cache_packet_formats(struct snd_motu *motu)
        calculate_differed_part(&motu->rx_packet_formats, motu->spec->flags,
                        data, V2_OPT_OUT_IFACE_MASK, V2_OPT_OUT_IFACE_SHIFT);
 
-       motu->tx_packet_formats.midi_flag_offset = 4;
-       motu->tx_packet_formats.midi_byte_offset = 6;
        motu->tx_packet_formats.pcm_byte_offset = 10;
-
-       motu->rx_packet_formats.midi_flag_offset = 4;
-       motu->rx_packet_formats.midi_byte_offset = 6;
        motu->rx_packet_formats.pcm_byte_offset = 10;
 
        return 0;
index ddb647254ed224b860f0ae75b372cc32f7f91383..c7cd9864dc4d23b686c2e55059da6d1b8551c7c2 100644 (file)
@@ -291,12 +291,7 @@ static int v3_cache_packet_formats(struct snd_motu *motu)
                        V3_ENABLE_OPT_OUT_IFACE_A, V3_NO_ADAT_OPT_OUT_IFACE_A,
                        V3_ENABLE_OPT_OUT_IFACE_B, V3_NO_ADAT_OPT_OUT_IFACE_B);
 
-       motu->tx_packet_formats.midi_flag_offset = 8;
-       motu->tx_packet_formats.midi_byte_offset = 7;
        motu->tx_packet_formats.pcm_byte_offset = 10;
-
-       motu->rx_packet_formats.midi_flag_offset = 8;
-       motu->rx_packet_formats.midi_byte_offset = 7;
        motu->rx_packet_formats.pcm_byte_offset = 10;
 
        return 0;
index bd458029099e35f1872af4a53f3759e188302226..dc5541c8b35927bb28875eef10d4c40989d9cf87 100644 (file)
@@ -33,7 +33,8 @@ static int start_both_streams(struct snd_motu *motu, unsigned int rate)
        u32 data;
        int err;
 
-       if (motu->spec->flags & SND_MOTU_SPEC_HAS_MIDI)
+       if ((motu->spec->flags & SND_MOTU_SPEC_RX_MIDI_2ND_Q) ||
+           (motu->spec->flags & SND_MOTU_SPEC_RX_MIDI_3RD_Q))
                midi_ports = 1;
 
        /* Set packet formation to our packet streaming engine. */
@@ -42,6 +43,12 @@ static int start_both_streams(struct snd_motu *motu, unsigned int rate)
        if (err < 0)
                return err;
 
+       if ((motu->spec->flags & SND_MOTU_SPEC_TX_MIDI_2ND_Q) ||
+           (motu->spec->flags & SND_MOTU_SPEC_TX_MIDI_3RD_Q))
+               midi_ports = 1;
+       else
+               midi_ports = 0;
+
        err = amdtp_motu_set_parameters(&motu->tx_stream, rate, midi_ports,
                                        &motu->tx_packet_formats);
        if (err < 0)
@@ -141,6 +148,33 @@ static void stop_isoc_ctx(struct snd_motu *motu, struct amdtp_stream *stream)
        fw_iso_resources_free(resources);
 }
 
+int snd_motu_stream_cache_packet_formats(struct snd_motu *motu)
+{
+       int err;
+
+       err = motu->spec->protocol->cache_packet_formats(motu);
+       if (err < 0)
+               return err;
+
+       if (motu->spec->flags & SND_MOTU_SPEC_TX_MIDI_2ND_Q) {
+               motu->tx_packet_formats.midi_flag_offset = 4;
+               motu->tx_packet_formats.midi_byte_offset = 6;
+       } else if (motu->spec->flags & SND_MOTU_SPEC_TX_MIDI_3RD_Q) {
+               motu->tx_packet_formats.midi_flag_offset = 8;
+               motu->tx_packet_formats.midi_byte_offset = 7;
+       }
+
+       if (motu->spec->flags & SND_MOTU_SPEC_RX_MIDI_2ND_Q) {
+               motu->rx_packet_formats.midi_flag_offset = 4;
+               motu->rx_packet_formats.midi_byte_offset = 6;
+       } else if (motu->spec->flags & SND_MOTU_SPEC_RX_MIDI_3RD_Q) {
+               motu->rx_packet_formats.midi_flag_offset = 8;
+               motu->rx_packet_formats.midi_byte_offset = 7;
+       }
+
+       return 0;
+}
+
 static int ensure_packet_formats(struct snd_motu *motu)
 {
        __be32 reg;
@@ -184,7 +218,7 @@ int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate)
                stop_both_streams(motu);
        }
 
-       err = protocol->cache_packet_formats(motu);
+       err = snd_motu_stream_cache_packet_formats(motu);
        if (err < 0)
                return err;
 
index 59a270406353d71563f2473ff1675116729acda9..0d6b526105ab08b8e905f2988548d3662ff37302 100644 (file)
@@ -103,7 +103,10 @@ static void do_registration(struct work_struct *work)
        if (err < 0)
                goto error;
 
-       if (motu->spec->flags & SND_MOTU_SPEC_HAS_MIDI) {
+       if ((motu->spec->flags & SND_MOTU_SPEC_RX_MIDI_2ND_Q) ||
+           (motu->spec->flags & SND_MOTU_SPEC_RX_MIDI_3RD_Q) ||
+           (motu->spec->flags & SND_MOTU_SPEC_TX_MIDI_2ND_Q) ||
+           (motu->spec->flags & SND_MOTU_SPEC_TX_MIDI_3RD_Q)) {
                err = snd_motu_create_midi_devices(motu);
                if (err < 0)
                        goto error;
@@ -191,20 +194,21 @@ static void motu_bus_update(struct fw_unit *unit)
        snd_motu_transaction_reregister(motu);
 }
 
-static struct snd_motu_spec motu_828mk2 = {
+static const struct snd_motu_spec motu_828mk2 = {
        .name = "828mk2",
        .protocol = &snd_motu_protocol_v2,
        .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
                 SND_MOTU_SPEC_TX_MICINST_CHUNK |
                 SND_MOTU_SPEC_TX_RETURN_CHUNK |
                 SND_MOTU_SPEC_HAS_OPT_IFACE_A |
-                SND_MOTU_SPEC_HAS_MIDI,
+                SND_MOTU_SPEC_RX_MIDI_2ND_Q |
+                SND_MOTU_SPEC_TX_MIDI_2ND_Q,
 
        .analog_in_ports = 8,
        .analog_out_ports = 8,
 };
 
-static struct snd_motu_spec motu_828mk3 = {
+static const struct snd_motu_spec motu_828mk3 = {
        .name = "828mk3",
        .protocol = &snd_motu_protocol_v3,
        .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
@@ -214,12 +218,25 @@ static struct snd_motu_spec motu_828mk3 = {
                 SND_MOTU_SPEC_TX_REVERB_CHUNK |
                 SND_MOTU_SPEC_HAS_OPT_IFACE_A |
                 SND_MOTU_SPEC_HAS_OPT_IFACE_B |
-                SND_MOTU_SPEC_HAS_MIDI,
+                SND_MOTU_SPEC_RX_MIDI_3RD_Q |
+                SND_MOTU_SPEC_TX_MIDI_3RD_Q,
 
        .analog_in_ports = 8,
        .analog_out_ports = 8,
 };
 
+static const struct snd_motu_spec motu_audio_express = {
+       .name = "AudioExpress",
+       .protocol = &snd_motu_protocol_v3,
+       .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
+                SND_MOTU_SPEC_TX_MICINST_CHUNK |
+                SND_MOTU_SPEC_TX_RETURN_CHUNK |
+                SND_MOTU_SPEC_RX_MIDI_2ND_Q |
+                SND_MOTU_SPEC_TX_MIDI_3RD_Q,
+       .analog_in_ports = 2,
+       .analog_out_ports = 4,
+};
+
 #define SND_MOTU_DEV_ENTRY(model, data)                        \
 {                                                      \
        .match_flags    = IEEE1394_MATCH_VENDOR_ID |    \
@@ -235,6 +252,7 @@ static const struct ieee1394_device_id motu_id_table[] = {
        SND_MOTU_DEV_ENTRY(0x101800, &motu_828mk2),
        SND_MOTU_DEV_ENTRY(0x106800, &motu_828mk3),     /* FireWire only. */
        SND_MOTU_DEV_ENTRY(0x100800, &motu_828mk3),     /* Hybrid. */
+       SND_MOTU_DEV_ENTRY(0x104800, &motu_audio_express),
        { }
 };
 MODULE_DEVICE_TABLE(ieee1394, motu_id_table);
index 8d6a4a3af9cc136056a380d39cbefbfcc397c4cc..4b23cf337c4bec535172f289186fefb295919697 100644 (file)
@@ -82,7 +82,10 @@ enum snd_motu_spec_flags {
        SND_MOTU_SPEC_TX_AESEBU_CHUNK   = 0x0020,
        SND_MOTU_SPEC_HAS_OPT_IFACE_A   = 0x0040,
        SND_MOTU_SPEC_HAS_OPT_IFACE_B   = 0x0080,
-       SND_MOTU_SPEC_HAS_MIDI          = 0x0100,
+       SND_MOTU_SPEC_RX_MIDI_2ND_Q     = 0x0100,
+       SND_MOTU_SPEC_RX_MIDI_3RD_Q     = 0x0200,
+       SND_MOTU_SPEC_TX_MIDI_2ND_Q     = 0x0400,
+       SND_MOTU_SPEC_TX_MIDI_3RD_Q     = 0x0800,
 };
 
 #define SND_MOTU_CLOCK_RATE_COUNT      6
@@ -146,6 +149,7 @@ void snd_motu_transaction_unregister(struct snd_motu *motu);
 
 int snd_motu_stream_init_duplex(struct snd_motu *motu);
 void snd_motu_stream_destroy_duplex(struct snd_motu *motu);
+int snd_motu_stream_cache_packet_formats(struct snd_motu *motu);
 int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate);
 void snd_motu_stream_stop_duplex(struct snd_motu *motu);
 int snd_motu_stream_lock_try(struct snd_motu *motu);
index 93209ebd91214ed514a43a42e729f31d68e21855..02d5956658987424fdb9ca4ff8b79d68f0b47051 100644 (file)
@@ -297,12 +297,6 @@ static void midi_capture_trigger(struct snd_rawmidi_substream *stream, int up)
        }
 }
 
-static const struct snd_rawmidi_ops midi_capture_ops = {
-       .open    = midi_capture_open,
-       .close   = midi_capture_close,
-       .trigger = midi_capture_trigger,
-};
-
 static int midi_playback_open(struct snd_rawmidi_substream *stream)
 {
        return 0;
@@ -363,6 +357,11 @@ void snd_oxfw_scs1x_update(struct snd_oxfw *oxfw)
 
 int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw)
 {
+       static const struct snd_rawmidi_ops midi_capture_ops = {
+               .open    = midi_capture_open,
+               .close   = midi_capture_close,
+               .trigger = midi_capture_trigger,
+       };
        static const struct snd_rawmidi_ops midi_playback_ops = {
                .open    = midi_playback_open,
                .close   = midi_playback_close,
index 9dc93a7eb9da420fb871d7b28007b67b4d37f261..44ad41fb7374070458de78e991330a744d3f0aff 100644 (file)
@@ -12,7 +12,7 @@ MODULE_DESCRIPTION("TASCAM FireWire series Driver");
 MODULE_AUTHOR("Takashi Sakamoto <o-takashi@sakamocchi.jp>");
 MODULE_LICENSE("GPL v2");
 
-static struct snd_tscm_spec model_specs[] = {
+static const struct snd_tscm_spec model_specs[] = {
        {
                .name = "FW-1884",
                .has_adat = true,
index 0659bf38948990cabfafdf0c3482dd38af2c3d11..038a180d3f8117a7455ca6914ed883173aed8863 100644 (file)
@@ -336,7 +336,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_i915_register_notifier);
 /* check whether intel graphics is present */
 static bool i915_gfx_present(void)
 {
-       static struct pci_device_id ids[] = {
+       static const struct pci_device_id ids[] = {
                { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_ANY_ID),
                  .class = PCI_BASE_CLASS_DISPLAY << 16,
                  .class_mask = 0xff << 16 },
index 769226515f0d6d43fa3f05f73c2db11c0385ba14..4be6c1245820530cc40c71d4e7e554221bbafc3e 100644 (file)
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(enable, "Enable ad1816a based soundcard.");
 module_param_array(clockfreq, int, NULL, 0444);
 MODULE_PARM_DESC(clockfreq, "Clock frequency for ad1816a driver (default = 0).");
 
-static struct pnp_card_device_id snd_ad1816a_pnpids[] = {
+static const struct pnp_card_device_id snd_ad1816a_pnpids[] = {
        /* Analog Devices AD1815 */
        { .id = "ADS7150", .devs = { { .id = "ADS7150" }, { .id = "ADS7151" } } },
        /* Analog Device AD1816? */
index 5c815f5fb044906f5e76cafe0c46e9107b2e0bd2..92320141446990bca894b58c23daf78c3a2284e2 100644 (file)
@@ -339,7 +339,7 @@ static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id)
 }
 
 
-static struct snd_pcm_hardware snd_ad1816a_playback = {
+static const struct snd_pcm_hardware snd_ad1816a_playback = {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
        .formats =              (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |
@@ -358,7 +358,7 @@ static struct snd_pcm_hardware snd_ad1816a_playback = {
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_ad1816a_capture = {
+static const struct snd_pcm_hardware snd_ad1816a_capture = {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
        .formats =              (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |
@@ -653,7 +653,7 @@ int snd_ad1816a_create(struct snd_card *card,
        return 0;
 }
 
-static struct snd_pcm_ops snd_ad1816a_playback_ops = {
+static const struct snd_pcm_ops snd_ad1816a_playback_ops = {
        .open =         snd_ad1816a_playback_open,
        .close =        snd_ad1816a_playback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -664,7 +664,7 @@ static struct snd_pcm_ops snd_ad1816a_playback_ops = {
        .pointer =      snd_ad1816a_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_ad1816a_capture_ops = {
+static const struct snd_pcm_ops snd_ad1816a_capture_ops = {
        .open =         snd_ad1816a_capture_open,
        .close =        snd_ad1816a_capture_close,
        .ioctl =        snd_pcm_lib_ioctl,
index e739b1c85c25b98c43127d1afc6270195974296b..7c8e92f62f3b925b6ac2f377e562f060e7f8362b 100644 (file)
@@ -110,13 +110,17 @@ static int snd_ad1848_probe(struct device *dev, unsigned int n)
        if (error < 0)
                goto out;
 
-       strcpy(card->driver, "AD1848");
-       strcpy(card->shortname, chip->pcm->name);
-
-       sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
-               chip->pcm->name, chip->port, irq[n], dma1[n]);
-       if (thinkpad[n])
-               strcat(card->longname, " [Thinkpad]");
+       strlcpy(card->driver, "AD1848", sizeof(card->driver));
+       strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
+
+       if (!thinkpad[n])
+               snprintf(card->longname, sizeof(card->longname),
+                        "%s at 0x%lx, irq %d, dma %d",
+                        chip->pcm->name, chip->port, irq[n], dma1[n]);
+       else
+               snprintf(card->longname, sizeof(card->longname),
+                        "%s at 0x%lx, irq %d, dma %d [Thinkpad]",
+                        chip->pcm->name, chip->port, irq[n], dma1[n]);
 
        error = snd_card_register(card);
        if (error < 0)
index bc9ea306ee02283275fb8f253b7a869cabde6c49..f63142ec287ebb094b85189cd398f1d9d66ed31b 100644 (file)
@@ -79,7 +79,7 @@ struct snd_card_als100 {
        struct snd_sb *chip;
 };
 
-static struct pnp_card_device_id snd_als100_pnpids[] = {
+static const struct pnp_card_device_id snd_als100_pnpids[] = {
        /* DT197A30 */
        { .id = "RWB1688",
          .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } },
@@ -222,15 +222,16 @@ static int snd_card_als100_probe(int dev,
        if (pid->driver_data == SB_HW_DT019X) {
                strcpy(card->driver, "DT-019X");
                strcpy(card->shortname, "Diamond Tech. DT-019X");
-               sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
-                       card->shortname, chip->name, chip->port,
-                       irq[dev], dma8[dev]);
+               snprintf(card->longname, sizeof(card->longname),
+                        "Diamond Tech. DT-019X, %s at 0x%lx, irq %d, dma %d",
+                        chip->name, chip->port, irq[dev], dma8[dev]);
        } else {
                strcpy(card->driver, "ALS100");
                strcpy(card->shortname, "Avance Logic ALS100");
-               sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d",
-                       card->shortname, chip->name, chip->port,
-                       irq[dev], dma8[dev], dma16[dev]);
+               snprintf(card->longname, sizeof(card->longname),
+                        "Avance Logic ALS100, %s at 0x%lx, irq %d, dma %d&%d",
+                        chip->name, chip->port, irq[dev], dma8[dev],
+                        dma16[dev]);
        }
 
        if ((error = snd_sb16dsp_pcm(chip, 0)) < 0) {
index fff186fa621ee94924ca79ad5e91d9104bc27fd6..4e6fad4f94d92557a3a8757399b603d43f43f4aa 100644 (file)
@@ -79,7 +79,7 @@ struct snd_card_azt2320 {
        struct snd_wss *chip;
 };
 
-static struct pnp_card_device_id snd_azt2320_pnpids[] = {
+static const struct pnp_card_device_id snd_azt2320_pnpids[] = {
        /* PRO16V */
        { .id = "AZT1008", .devs = { { "AZT1008" }, { "AZT2001" }, } },
        /* Aztech Sound Galaxy 16 */
index f64b29ab5cc7005eb4ea35bd76133e8a0a0d6d24..6b8c46942efb4b660b508c55ffe93d0d1bd76e0b 100644 (file)
@@ -182,7 +182,7 @@ struct snd_cmi8330 {
 
 #ifdef CONFIG_PNP
 
-static struct pnp_card_device_id snd_cmi8330_pnpids[] = {
+static const struct pnp_card_device_id snd_cmi8330_pnpids[] = {
        { .id = "CMI0001", .devs = { { "@X@0001" }, { "@@@0001" }, { "@H@0001" }, { "A@@0001" } } },
        { .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } } },
        { .id = "" }
index e8edd9017a2f22205b64a19b2adb68fe3f27beca..d90ab9558f7fd290904d7fbfedf38c47886d77dd 100644 (file)
@@ -109,13 +109,17 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n)
        if (error < 0)
                goto out;
 
-       strcpy(card->driver, "CS4231");
-       strcpy(card->shortname, chip->pcm->name);
-
-       sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
-               chip->pcm->name, chip->port, irq[n], dma1[n]);
-       if (dma2[n] >= 0)
-               sprintf(card->longname + strlen(card->longname), "&%d", dma2[n]);
+       strlcpy(card->driver, "CS4231", sizeof(card->driver));
+       strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
+
+       if (dma2[n] < 0)
+               snprintf(card->longname, sizeof(card->longname),
+                        "%s at 0x%lx, irq %d, dma %d",
+                        chip->pcm->name, chip->port, irq[n], dma1[n]);
+       else
+               snprintf(card->longname, sizeof(card->longname),
+                        "%s at 0x%lx, irq %d, dma %d&%d",
+                        chip->pcm->name, chip->port, irq[n], dma1[n], dma2[n]);
 
        error = snd_wss_mixer(chip);
        if (error < 0)
index 1f9a3b2be7a1f705e40e15e8358a46b93e50a0f9..70559e59d18f71385e7ed92644a3aeb041696b78 100644 (file)
@@ -149,7 +149,7 @@ static const struct pnp_device_id snd_cs423x_pnpbiosids[] = {
 MODULE_DEVICE_TABLE(pnp, snd_cs423x_pnpbiosids);
 
 #define CS423X_ISAPNP_DRIVER   "cs4232_isapnp"
-static struct pnp_card_device_id snd_cs423x_pnpids[] = {
+static const struct pnp_card_device_id snd_cs423x_pnpids[] = {
        /* Philips PCA70PS */
        { .id = "CSC0d32", .devs = { { "CSC0000" }, { "CSC0010" }, { "PNPb006" } } },
        /* TerraTec Maestro 32/96 (CS4232) */
@@ -419,15 +419,17 @@ static int snd_cs423x_probe(struct snd_card *card, int dev)
                if (err < 0)
                        return err;
        }
-       strcpy(card->driver, chip->pcm->name);
-       strcpy(card->shortname, chip->pcm->name);
-       sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i",
-               chip->pcm->name,
-               chip->port,
-               irq[dev],
-               dma1[dev]);
-       if (dma2[dev] >= 0)
-               sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]);
+       strlcpy(card->driver, chip->pcm->name, sizeof(card->driver));
+       strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
+       if (dma2[dev] < 0)
+               snprintf(card->longname, sizeof(card->longname),
+                        "%s at 0x%lx, irq %i, dma %i",
+                        chip->pcm->name, chip->port, irq[dev], dma1[dev]);
+       else
+               snprintf(card->longname, sizeof(card->longname),
+                        "%s at 0x%lx, irq %i, dma %i&%d",
+                        chip->pcm->name, chip->port, irq[dev], dma1[dev],
+                        dma2[dev]);
 
        err = snd_wss_timer(chip, 0);
        if (err < 0)
index 36320e7f278931719d7b8f8adcb935967ce2ecab..a826c138e7f555ec3a0e3345265f646bc3ff135e 100644 (file)
@@ -321,7 +321,7 @@ static int snd_es968_pnp_resume(struct pnp_card_link *pcard)
 }
 #endif
 
-static struct pnp_card_device_id snd_es968_pnpids[] = {
+static const struct pnp_card_device_id snd_es968_pnpids[] = {
        { .id = "ESS0968", .devs = { { "@@@0968" }, } },
        { .id = "ESS0968", .devs = { { "ESS0968" }, } },
        { .id = "", } /* end */
index 5d3df96c5e5bc8dc12908f41601af5e80bcc6279..f9c0662e9a2232915ef09cefacdfcd152759abea 100644 (file)
@@ -526,7 +526,7 @@ static snd_pcm_uframes_t snd_es1688_capture_pointer(struct snd_pcm_substream *su
 
  */
 
-static struct snd_pcm_hardware snd_es1688_playback =
+static const struct snd_pcm_hardware snd_es1688_playback =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
@@ -544,7 +544,7 @@ static struct snd_pcm_hardware snd_es1688_playback =
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_es1688_capture =
+static const struct snd_pcm_hardware snd_es1688_capture =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
@@ -706,7 +706,7 @@ exit:
        return err;
 }
 
-static struct snd_pcm_ops snd_es1688_playback_ops = {
+static const struct snd_pcm_ops snd_es1688_playback_ops = {
        .open =                 snd_es1688_playback_open,
        .close =                snd_es1688_playback_close,
        .ioctl =                snd_es1688_ioctl,
@@ -717,7 +717,7 @@ static struct snd_pcm_ops snd_es1688_playback_ops = {
        .pointer =              snd_es1688_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_es1688_capture_ops = {
+static const struct snd_pcm_ops snd_es1688_capture_ops = {
        .open =                 snd_es1688_capture_open,
        .close =                snd_es1688_capture_close,
        .ioctl =                snd_es1688_ioctl,
index ae17a65840616ac8f0de9fe29a894607ff24b283..2a6960c3e2a48fe21b00e500e2b8939bf60609ba 100644 (file)
@@ -838,7 +838,7 @@ static snd_pcm_uframes_t snd_es18xx_capture_pointer(struct snd_pcm_substream *su
        return pos >> chip->dma1_shift;
 }
 
-static struct snd_pcm_hardware snd_es18xx_playback =
+static const struct snd_pcm_hardware snd_es18xx_playback =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_RESUME |
@@ -858,7 +858,7 @@ static struct snd_pcm_hardware snd_es18xx_playback =
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_es18xx_capture =
+static const struct snd_pcm_hardware snd_es18xx_capture =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_RESUME |
@@ -1665,7 +1665,7 @@ static int snd_es18xx_probe(struct snd_es18xx *chip,
        return snd_es18xx_initialize(chip, mpu_port, fm_port);
 }
 
-static struct snd_pcm_ops snd_es18xx_playback_ops = {
+static const struct snd_pcm_ops snd_es18xx_playback_ops = {
        .open =         snd_es18xx_playback_open,
        .close =        snd_es18xx_playback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -1676,7 +1676,7 @@ static struct snd_pcm_ops snd_es18xx_playback_ops = {
        .pointer =      snd_es18xx_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_es18xx_capture_ops = {
+static const struct snd_pcm_ops snd_es18xx_capture_ops = {
        .open =         snd_es18xx_capture_open,
        .close =        snd_es18xx_capture_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -2017,7 +2017,7 @@ static int isa_registered;
 static int pnp_registered;
 static int pnpc_registered;
 
-static struct pnp_device_id snd_audiodrive_pnpbiosids[] = {
+static const struct pnp_device_id snd_audiodrive_pnpbiosids[] = {
        { .id = "ESS1869" },
        { .id = "ESS1879" },
        { .id = "" }            /* end */
@@ -2062,7 +2062,7 @@ static int snd_audiodrive_pnp(int dev, struct snd_es18xx *chip,
        return 0;
 }
 
-static struct pnp_card_device_id snd_audiodrive_pnpids[] = {
+static const struct pnp_card_device_id snd_audiodrive_pnpids[] = {
        /* ESS 1868 (integrated on Compaq dual P-Pro motherboard and Genius 18PnP 3D) */
        { .id = "ESS1868", .devs = { { "ESS1868" }, { "ESS0000" } } },
        /* ESS 1868 (integrated on Maxisound Cards) */
index 6b3da01a93b7b0c82e612671c30277f8fbea5ebf..131b28997e1d1e1c097122770e1562d8cb13c7a9 100644 (file)
@@ -650,7 +650,7 @@ static void snd_gf1_pcm_interrupt_dma_read(struct snd_gus_card * gus)
        }
 }
 
-static struct snd_pcm_hardware snd_gf1_pcm_playback =
+static const struct snd_pcm_hardware snd_gf1_pcm_playback =
 {
        .info =                 SNDRV_PCM_INFO_NONINTERLEAVED,
        .formats                = (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |
@@ -668,7 +668,7 @@ static struct snd_pcm_hardware snd_gf1_pcm_playback =
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_gf1_pcm_capture =
+static const struct snd_pcm_hardware snd_gf1_pcm_capture =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
@@ -842,7 +842,7 @@ static const struct snd_kcontrol_new snd_gf1_pcm_volume_control1 =
        .put = snd_gf1_pcm_volume_put
 };
 
-static struct snd_pcm_ops snd_gf1_pcm_playback_ops = {
+static const struct snd_pcm_ops snd_gf1_pcm_playback_ops = {
        .open =         snd_gf1_pcm_playback_open,
        .close =        snd_gf1_pcm_playback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -856,7 +856,7 @@ static struct snd_pcm_ops snd_gf1_pcm_playback_ops = {
        .fill_silence = snd_gf1_pcm_playback_silence,
 };
 
-static struct snd_pcm_ops snd_gf1_pcm_capture_ops = {
+static const struct snd_pcm_ops snd_gf1_pcm_capture_ops = {
        .open =         snd_gf1_pcm_capture_open,
        .close =        snd_gf1_pcm_capture_close,
        .ioctl =        snd_pcm_lib_ioctl,
index 0687b7ef3e53b5f6a6b45d7aa3ed2b7654ce735b..a6fc26bf0af21f9f9f89eb7514d9a4fe1395a1af 100644 (file)
@@ -136,7 +136,7 @@ struct snd_interwave {
 static int isa_registered;
 static int pnp_registered;
 
-static struct pnp_card_device_id snd_interwave_pnpids[] = {
+static const struct pnp_card_device_id snd_interwave_pnpids[] = {
 #ifndef SNDRV_STB
        /* Gravis UltraSound Plug & Play */
        { .id = "GRV0001", .devs = { { .id = "GRV0000" } } },
index 8109ab3d29d1be755edcab61a5856ed08bea5c13..569897f64fda260c6244b4817c9f31ee974e849c 100644 (file)
@@ -437,7 +437,7 @@ static void snd_msnd_capture_reset_queue(struct snd_msnd *chip,
        }
 }
 
-static struct snd_pcm_hardware snd_msnd_playback = {
+static const struct snd_pcm_hardware snd_msnd_playback = {
        .info =                 SNDRV_PCM_INFO_MMAP |
                                SNDRV_PCM_INFO_INTERLEAVED |
                                SNDRV_PCM_INFO_MMAP_VALID |
@@ -456,7 +456,7 @@ static struct snd_pcm_hardware snd_msnd_playback = {
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_msnd_capture = {
+static const struct snd_pcm_hardware snd_msnd_capture = {
        .info =                 SNDRV_PCM_INFO_MMAP |
                                SNDRV_PCM_INFO_INTERLEAVED |
                                SNDRV_PCM_INFO_MMAP_VALID |
@@ -572,7 +572,7 @@ snd_msnd_playback_pointer(struct snd_pcm_substream *substream)
 }
 
 
-static struct snd_pcm_ops snd_msnd_playback_ops = {
+static const struct snd_pcm_ops snd_msnd_playback_ops = {
        .open =         snd_msnd_playback_open,
        .close =        snd_msnd_playback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -669,7 +669,7 @@ static int snd_msnd_capture_hw_params(struct snd_pcm_substream *substream,
 }
 
 
-static struct snd_pcm_ops snd_msnd_capture_ops = {
+static const struct snd_pcm_ops snd_msnd_capture_ops = {
        .open =         snd_msnd_capture_open,
        .close =        snd_msnd_capture_close,
        .ioctl =        snd_pcm_lib_ioctl,
index fc4fb1904aef83284ab165508a7e7b430a45d07c..45e561c425bfbdc02b89a090961b333facad898f 100644 (file)
@@ -1192,7 +1192,7 @@ static void snd_msnd_pnp_remove(struct pnp_card_link *pcard)
 static int isa_registered;
 static int pnp_registered;
 
-static struct pnp_card_device_id msnd_pnpids[] = {
+static const struct pnp_card_device_id msnd_pnpids[] = {
        /* Pinnacle PnP */
        { .id = "BVJ0440", .devs = { { "TBS0000" }, { "TBS0001" } } },
        { .id = "" }    /* end */
index 4098e3e0353d8f6d7e57428d70d491301585ac3e..7cce4cd4a23b620ae617723614243c1285fc4bf1 100644 (file)
@@ -141,7 +141,7 @@ struct snd_opl3sa2 {
 
 #ifdef CONFIG_PNP
 
-static struct pnp_device_id snd_opl3sa2_pnpbiosids[] = {
+static const struct pnp_device_id snd_opl3sa2_pnpbiosids[] = {
        { .id = "YMH0021" },
        { .id = "NMX2210" },    /* Gateway Solo 2500 */
        { .id = "" }            /* end */
@@ -149,7 +149,7 @@ static struct pnp_device_id snd_opl3sa2_pnpbiosids[] = {
 
 MODULE_DEVICE_TABLE(pnp, snd_opl3sa2_pnpbiosids);
 
-static struct pnp_card_device_id snd_opl3sa2_pnpids[] = {
+static const struct pnp_card_device_id snd_opl3sa2_pnpids[] = {
        /* Yamaha YMF719E-S (Genius Sound Maker 3DX) */
        { .id = "YMH0020", .devs = { { "YMH0021" } } },
        /* Yamaha OPL3-SA3 (integrated on Intel's Pentium II AL440LX motherboard) */
index bcbff56f060d04e3e55b0400b0c4be79f119b0cb..8894c7c18ad673c8bcebc698f5839e336b68d30d 100644 (file)
@@ -143,7 +143,7 @@ static int snd_miro_pnp_is_probed;
 
 #ifdef CONFIG_PNP
 
-static struct pnp_card_device_id snd_miro_pnpids[] = {
+static const struct pnp_card_device_id snd_miro_pnpids[] = {
        /* PCM20 and PCM12 in PnP mode */
        { .id = "MIR0924",
          .devs = { { "MIR0000" }, { "MIR0002" }, { "MIR0005" } }, },
@@ -1353,9 +1353,10 @@ static int snd_miro_probe(struct snd_card *card)
        }
 
        strcpy(card->driver, "miro");
-       sprintf(card->longname, "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
-               card->shortname, miro->name, codec->pcm->name,
-               miro->wss_base + 4, miro->irq, miro->dma1, miro->dma2);
+       snprintf(card->longname, sizeof(card->longname),
+                "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
+                card->shortname, miro->name, codec->pcm->name,
+                miro->wss_base + 4, miro->irq, miro->dma1, miro->dma2);
 
        if (mpu_port <= 0 || mpu_port == SNDRV_AUTO_PORT)
                rmidi = NULL;
index ceddb392b1e336b1bb7db83d9c8823ec1d4571a9..505cd81e19fa5a40be7d5a9302bb1c0c7a867d00 100644 (file)
@@ -151,7 +151,7 @@ static int snd_opti9xx_pnp_is_probed;
 
 #ifdef CONFIG_PNP
 
-static struct pnp_card_device_id snd_opti9xx_pnpids[] = {
+static const struct pnp_card_device_id snd_opti9xx_pnpids[] = {
 #ifndef OPTi93X
        /* OPTi 82C924 */
        { .id = "OPT0924",
@@ -879,13 +879,15 @@ static int snd_opti9xx_probe(struct snd_card *card)
        strcpy(card->driver, chip->name);
        sprintf(card->shortname, "OPTi %s", card->driver);
 #if defined(CS4231) || defined(OPTi93X)
-       sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d",
-               card->shortname, codec->pcm->name,
-               chip->wss_base + 4, irq, dma1, xdma2);
+       snprintf(card->longname, sizeof(card->longname),
+                "%s, %s at 0x%lx, irq %d, dma %d&%d",
+                card->shortname, codec->pcm->name,
+                chip->wss_base + 4, irq, dma1, xdma2);
 #else
-       sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
-               card->shortname, codec->pcm->name, chip->wss_base + 4, irq,
-               dma1);
+       snprintf(card->longname, sizeof(card->longname),
+                "%s, %s at 0x%lx, irq %d, dma %d",
+                card->shortname, codec->pcm->name, chip->wss_base + 4, irq,
+                dma1);
 #endif /* CS4231 || OPTi93X */
 
        if (mpu_port <= 0 || mpu_port == SNDRV_AUTO_PORT)
index d28d712f99f4266367960814e91cdfab74c3b342..5a485504f607d774a46b8091aebc042bb493f75e 100644 (file)
@@ -62,7 +62,7 @@ static void snd_emu8000_tweak_voice(struct snd_emu8000 *emu, int ch);
 /*
  * set up operators
  */
-static struct snd_emux_operators emu8000_ops = {
+static const struct snd_emux_operators emu8000_ops = {
        .owner =        THIS_MODULE,
        .get_voice =    get_voice,
        .prepare =      start_voice,
index 2ee8d67871ec49111c2afe5a6883e73dba8eacb2..8f34551abd8d497a37da7d1ec514f76d48d4914c 100644 (file)
@@ -157,7 +157,7 @@ static int calc_rate_offset(int hz)
 /*
  */
 
-static struct snd_pcm_hardware emu8k_pcm_hw = {
+static const struct snd_pcm_hardware emu8k_pcm_hw = {
 #ifdef USE_NONINTERLEAVE
        .info =                 SNDRV_PCM_INFO_NONINTERLEAVED,
 #else
@@ -670,7 +670,7 @@ static snd_pcm_uframes_t emu8k_pcm_pointer(struct snd_pcm_substream *subs)
 }
 
 
-static struct snd_pcm_ops emu8k_pcm_ops = {
+static const struct snd_pcm_ops emu8k_pcm_ops = {
        .open =         emu8k_pcm_open,
        .close =        emu8k_pcm_close,
        .ioctl =        snd_pcm_lib_ioctl,
index 917a93d696c3ac835de5ac32ed2e7142b9303ec2..8f9ebeb998f6df3416917124e6effc706416eccf 100644 (file)
@@ -145,7 +145,7 @@ struct snd_card_sb16 {
 
 #ifdef CONFIG_PNP
 
-static struct pnp_card_device_id snd_sb16_pnpids[] = {
+static const struct pnp_card_device_id snd_sb16_pnpids[] = {
 #ifndef SNDRV_SBAWE
        /* Sound Blaster 16 PnP */
        { .id = "CTL0024", .devs = { { "CTL0031" } } },
index 4be1350f664910f8aa30ed7ea70503262eaeb68b..3e39ba220c396efde2a4dd98dfa84f00b38fc3a1 100644 (file)
@@ -473,7 +473,7 @@ static snd_pcm_uframes_t snd_sb16_capture_pointer(struct snd_pcm_substream *subs
 
  */
 
-static struct snd_pcm_hardware snd_sb16_playback =
+static const struct snd_pcm_hardware snd_sb16_playback =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
@@ -491,7 +491,7 @@ static struct snd_pcm_hardware snd_sb16_playback =
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_sb16_capture =
+static const struct snd_pcm_hardware snd_sb16_capture =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
@@ -838,7 +838,7 @@ int snd_sb16dsp_configure(struct snd_sb * chip)
        return 0;
 }
 
-static struct snd_pcm_ops snd_sb16_playback_ops = {
+static const struct snd_pcm_ops snd_sb16_playback_ops = {
        .open =         snd_sb16_playback_open,
        .close =        snd_sb16_playback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -849,7 +849,7 @@ static struct snd_pcm_ops snd_sb16_playback_ops = {
        .pointer =      snd_sb16_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_sb16_capture_ops = {
+static const struct snd_pcm_ops snd_sb16_capture_ops = {
        .open =         snd_sb16_capture_open,
        .close =        snd_sb16_capture_close,
        .ioctl =        snd_pcm_lib_ioctl,
index 0f302be4fb6df73b0e482310296b31df80e1bbe1..d45df5c544234d9006c0297c939d4891ab19d64d 100644 (file)
@@ -447,7 +447,7 @@ static snd_pcm_uframes_t snd_sb8_capture_pointer(struct snd_pcm_substream *subst
 
  */
 
-static struct snd_pcm_hardware snd_sb8_playback =
+static const struct snd_pcm_hardware snd_sb8_playback =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
@@ -466,7 +466,7 @@ static struct snd_pcm_hardware snd_sb8_playback =
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_sb8_capture =
+static const struct snd_pcm_hardware snd_sb8_capture =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID),
@@ -572,7 +572,7 @@ static int snd_sb8_close(struct snd_pcm_substream *substream)
  *  Initialization part
  */
  
-static struct snd_pcm_ops snd_sb8_playback_ops = {
+static const struct snd_pcm_ops snd_sb8_playback_ops = {
        .open =                 snd_sb8_open,
        .close =                snd_sb8_close,
        .ioctl =                snd_pcm_lib_ioctl,
@@ -583,7 +583,7 @@ static struct snd_pcm_ops snd_sb8_playback_ops = {
        .pointer =              snd_sb8_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_sb8_capture_ops = {
+static const struct snd_pcm_ops snd_sb8_capture_ops = {
        .open =                 snd_sb8_open,
        .close =                snd_sb8_close,
        .ioctl =                snd_pcm_lib_ioctl,
index 1cd2908e4f12cf1f59b895e8b2f2142edfb10e2e..733adee5afbf94915b2460a82723e8cf9a1dcf19 100644 (file)
@@ -88,7 +88,7 @@ MODULE_PARM_DESC(joystick, "Enable gameport.");
 static int isa_registered;
 static int pnp_registered;
 
-static struct pnp_card_device_id sscape_pnpids[] = {
+static const struct pnp_card_device_id sscape_pnpids[] = {
        { .id = "ENS3081", .devs = { { "ENS0000" } } }, /* Soundscape PnP */
        { .id = "ENS4081", .devs = { { "ENS1011" } } }, /* VIVO90 */
        { .id = "" }    /* end */
index da4e9a85f0afe98402f8d12494d197d8660344ea..b1989facd73275ad1896153b521689d09a4e67be 100644 (file)
@@ -88,7 +88,7 @@ MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly lo
 static int isa_registered;
 static int pnp_registered;
 
-static struct pnp_card_device_id snd_wavefront_pnpids[] = {
+static const struct pnp_card_device_id snd_wavefront_pnpids[] = {
        /* Tropez */
        { .id = "CSC7532", .devs = { { "CSC0000" }, { "CSC0010" }, { "PnPb006" }, { "CSC0004" } } },
        /* Tropez+ */
index 9f4e2e34cbe1d5645f703f97d6b191f8f567d834..8a852042a066a1a1354102e968cceb69b1f9b50b 100644 (file)
@@ -1452,7 +1452,7 @@ static int snd_wss_probe(struct snd_wss *chip)
 
  */
 
-static struct snd_pcm_hardware snd_wss_playback =
+static const struct snd_pcm_hardware snd_wss_playback =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID |
@@ -1472,7 +1472,7 @@ static struct snd_pcm_hardware snd_wss_playback =
        .fifo_size =            0,
 };
 
-static struct snd_pcm_hardware snd_wss_capture =
+static const struct snd_pcm_hardware snd_wss_capture =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_MMAP_VALID |
@@ -1901,7 +1901,7 @@ int snd_wss_create(struct snd_card *card,
 }
 EXPORT_SYMBOL(snd_wss_create);
 
-static struct snd_pcm_ops snd_wss_playback_ops = {
+static const struct snd_pcm_ops snd_wss_playback_ops = {
        .open =         snd_wss_playback_open,
        .close =        snd_wss_playback_close,
        .ioctl =        snd_pcm_lib_ioctl,
@@ -1912,7 +1912,7 @@ static struct snd_pcm_ops snd_wss_playback_ops = {
        .pointer =      snd_wss_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_wss_capture_ops = {
+static const struct snd_pcm_ops snd_wss_capture_ops = {
        .open =         snd_wss_capture_open,
        .close =        snd_wss_capture_close,
        .ioctl =        snd_pcm_lib_ioctl,
index 3318c15e324a81176886bc8996cd91b96a05dcfb..37d378a26a506c860320dc08d3642a32a9c0564b 100644 (file)
@@ -496,7 +496,7 @@ static void hal2_free_dmabuf(struct hal2_codec *codec)
                       DMA_ATTR_NON_CONSISTENT);
 }
 
-static struct snd_pcm_hardware hal2_pcm_hw = {
+static const struct snd_pcm_hardware hal2_pcm_hw = {
        .info = (SNDRV_PCM_INFO_MMAP |
                 SNDRV_PCM_INFO_MMAP_VALID |
             &nbs