Merge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Mar 2012 20:00:13 +0000 (13:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Mar 2012 20:00:13 +0000 (13:00 -0700)
Pull updates of sound stuff from Takashi Iwai:
 "Here is the first big update chunk of sound stuff for 3.4-rc1.

  In the common sound infrastructure, there are a few changes for
  dynamic PCM support (used in ASoC) and a few clean-ups.  Majority of
  changes are found, as usual, in HD-audio and ASoC.

  Some highlights of HD-audio changes:

   - All the long-standing static quirk codes for Realtek codec were
     finally removed by fixing and extending the Realtek auto-parser.

   - The mute-LED control is standardized over all HD-audio codec
     drivers using the extended vmaster hook.

   - The vmaster slave mixer elements are initialized to 0dB as default
     so that the user won't be annoyed by the silent output after
     updates, e.g.  due to the additions of new elements.

   - Other many fix-ups for the misc HD-audio devices.

  In the ASoC side, this is a very active release, including a quite a
  few framework enhancements.  Some highlights:

   - Support for widgets not associated with a CODEC, an important part
     of the dynamic PCM framework.

   - A library factoring out the common code shared by dmaengine based
     DMA drivers contributed by Lars-Peter Clausen.  This will save a
     lot of code and make it much easier to deploy enhancements to
     dmaengine.

   - Support for binary controls, used for providing runtime
     configuration of algorithm coefficients.

   - A new DAPM widget type for regulator supplies allowing drivers for
     devices that can power down unused supplies while active to do
     without any per-driver code.

   - DAPM widgets for DAIs, initially giving a speed boost for playback
     startup and shutdown and also the basis for CODEC<->CODEC DAI link
     support.

   - Support for specifying the number of significant bits on audio
     interfaces, useful for allowing applications to know how much
     effort to put into generating data for a larger sample format.

   - Conversion of the FSI driver used on some SH processors to
     DMAEngine.

   - Conversion of EP93xx drivers to DMAEngine.

   - New CODEC drivers for Maxim MAX9768 and Wolfson Microelectronics
     WM2200.

   - Move audmux driver from arc/arm to sound/soc

   - McBSP move from arch/ to sound/ and updates

  Also, a few small updates and fixes for other drivers like au88x0,
  ymfpci, USB 6fire, USB usx2yaudio are included."

* tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (446 commits)
  ASoC: wm8994: Provide VMID mode control and fix default sequence
  ASoC: wm8994: Add missing break in resume
  ASoC: wm_hubs: Don't actively manage LINEOUT_VMID_BUF
  ASoC: pxa-ssp: atomically set stream active masks
  ASoC: fsl: p1022ds: tell the WM8776 codec driver that it's the master
  ASoC: Samsung: Added to support mono recording
  ALSA: hda - Fix build with CONFIG_PM=n
  ALSA: au88x0 - Avoid possible Oops at unbinding
  ALSA: usb-audio - Fix build error by consitification of rate list
  ASoC: core: Fix obscure leak of runtime array
  ALSA: pcm - Avoid GFP_ATOMIC in snd_pcm_link()
  ALSA: pcm: Constify the list in snd_pcm_hw_constraint_list
  ASoC: wm8996: Add 44.1kHz support
  ALSA: hda - Fix build of patch_sigmatel.c without CONFIG_SND_HDA_POWER_SAVE
  ASoC: mx27vis-aic32x4: Convert it to platform driver
  ALSA: hda - fix printing of high HDMI sample rates
  ALSA: ymfpci - Fix legacy registers on S3/S4 resume
  ALSA: control - Fixe a trailing white space error
  ALSA: hda - Add expose_enum_ctl flag to snd_hda_add_vmaster_hook()
  ALSA: hda - Add "Mute-LED Mode" enum control
  ...

291 files changed:
Documentation/devicetree/bindings/sound/alc5632.txt [new file with mode: 0644]
Documentation/devicetree/bindings/sound/imx-audmux.txt [new file with mode: 0644]
Documentation/devicetree/bindings/sound/sgtl5000.txt [new file with mode: 0644]
Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt [deleted file]
Documentation/devicetree/bindings/sound/tegra-audio-alc5632.txt [new file with mode: 0644]
Documentation/devicetree/bindings/vendor-prefixes.txt
Documentation/sound/alsa/ALSA-Configuration.txt
Documentation/sound/alsa/HD-Audio-Models.txt
Documentation/sound/alsa/HD-Audio.txt
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/include/mach/platform.h
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
arch/arm/mach-imx/mach-pca100.c
arch/arm/mach-imx/mach-pcm043.c
arch/arm/mach-imx/mm-imx21.c
arch/arm/mach-imx/mm-imx25.c
arch/arm/mach-imx/mm-imx27.c
arch/arm/mach-imx/mm-imx3.c
arch/arm/mach-imx/mm-imx5.c
arch/arm/mach-kirkwood/openrd-setup.c
arch/arm/mach-kirkwood/t5325-setup.c
arch/arm/mach-omap1/Kconfig
arch/arm/mach-omap1/Makefile
arch/arm/mach-omap1/devices.c
arch/arm/mach-omap1/mcbsp.c
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/mcbsp.c
arch/arm/mach-s3c64xx/mach-crag6410-module.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/plat-mxc/Kconfig
arch/arm/plat-mxc/Makefile
arch/arm/plat-mxc/audmux-v1.c [deleted file]
arch/arm/plat-mxc/audmux-v2.c [deleted file]
arch/arm/plat-mxc/include/mach/audmux.h [deleted file]
arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/include/plat/mcbsp.h
arch/arm/plat-omap/mcbsp.c [deleted file]
arch/mips/jz4740/board-qi_lb60.c
arch/sh/boards/mach-ecovec24/setup.c
arch/sh/boards/mach-se/7724/setup.c
drivers/base/regmap/internal.h
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap.c
include/linux/mfd/wm8994/pdata.h
include/linux/platform_data/omap-abe-twl6040.h [new file with mode: 0644]
include/linux/regmap.h
include/sound/control.h
include/sound/dmaengine_pcm.h [new file with mode: 0644]
include/sound/jack.h
include/sound/max9768.h [new file with mode: 0644]
include/sound/pcm.h
include/sound/sh_fsi.h
include/sound/soc-dai.h
include/sound/soc-dapm.h
include/sound/soc.h
include/sound/version.h
include/sound/wm2200.h [new file with mode: 0644]
include/sound/wm8962.h
include/sound/ymfpci.h
sound/aoa/codecs/onyx.c
sound/aoa/codecs/tas.c
sound/core/control.c
sound/core/init.c
sound/core/jack.c
sound/core/misc.c
sound/core/pcm.c
sound/core/pcm_lib.c
sound/core/pcm_native.c
sound/core/vmaster.c
sound/pci/au88x0/au88x0.h
sound/pci/au88x0/au88x0_core.c
sound/pci/au88x0/au88x0_pcm.c
sound/pci/ctxfi/ctvmem.c
sound/pci/hda/alc260_quirks.c [deleted file]
sound/pci/hda/alc880_quirks.c [deleted file]
sound/pci/hda/alc882_quirks.c [deleted file]
sound/pci/hda/alc_quirks.c [deleted file]
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_eld.c
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_jack.c
sound/pci/hda/hda_jack.h
sound/pci/hda/hda_local.h
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_via.c
sound/pci/ice1712/ice1724.c
sound/pci/ymfpci/ymfpci_main.c
sound/soc/Kconfig
sound/soc/Makefile
sound/soc/atmel/atmel-pcm.c
sound/soc/atmel/snd-soc-afeb9260.c
sound/soc/blackfin/bf5xx-ad1836.c
sound/soc/blackfin/bf5xx-ad193x.c
sound/soc/blackfin/bf5xx-ad73311.c
sound/soc/blackfin/bf5xx-ssm2602.c
sound/soc/blackfin/bfin-eval-adau1373.c
sound/soc/blackfin/bfin-eval-adau1701.c
sound/soc/blackfin/bfin-eval-adav80x.c
sound/soc/codecs/Kconfig
sound/soc/codecs/Makefile
sound/soc/codecs/ad1836.c
sound/soc/codecs/ad1980.c
sound/soc/codecs/adau1373.c
sound/soc/codecs/adau1701.c
sound/soc/codecs/ak4104.c
sound/soc/codecs/ak4535.c
sound/soc/codecs/ak4535.h
sound/soc/codecs/ak4642.c
sound/soc/codecs/ak4671.c
sound/soc/codecs/alc5623.c
sound/soc/codecs/alc5632.c
sound/soc/codecs/alc5632.h
sound/soc/codecs/cq93vc.c
sound/soc/codecs/cs4270.c
sound/soc/codecs/cs4271.c
sound/soc/codecs/da7210.c
sound/soc/codecs/lm4857.c
sound/soc/codecs/max9768.c [new file with mode: 0644]
sound/soc/codecs/max98088.c
sound/soc/codecs/max98095.c
sound/soc/codecs/max9877.c
sound/soc/codecs/sgtl5000.c
sound/soc/codecs/sn95031.c
sound/soc/codecs/ssm2602.c
sound/soc/codecs/stac9766.c
sound/soc/codecs/tlv320aic23.c
sound/soc/codecs/tlv320aic26.c
sound/soc/codecs/tlv320aic32x4.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320aic3x.h
sound/soc/codecs/tlv320dac33.c
sound/soc/codecs/tpa6130a2.c
sound/soc/codecs/twl4030.c
sound/soc/codecs/twl6040.c
sound/soc/codecs/twl6040.h
sound/soc/codecs/uda134x.c
sound/soc/codecs/wl1273.c
sound/soc/codecs/wm2200.c [new file with mode: 0644]
sound/soc/codecs/wm2200.h [new file with mode: 0644]
sound/soc/codecs/wm5100.c
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8737.c
sound/soc/codecs/wm8753.c
sound/soc/codecs/wm8770.c
sound/soc/codecs/wm8776.c
sound/soc/codecs/wm8804.c
sound/soc/codecs/wm8904.c
sound/soc/codecs/wm8904.h
sound/soc/codecs/wm8940.c
sound/soc/codecs/wm8955.c
sound/soc/codecs/wm8958-dsp2.c
sound/soc/codecs/wm8960.c
sound/soc/codecs/wm8961.c
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm8971.c
sound/soc/codecs/wm8974.c
sound/soc/codecs/wm8978.c
sound/soc/codecs/wm8978.h
sound/soc/codecs/wm8983.c
sound/soc/codecs/wm8985.c
sound/soc/codecs/wm8988.c
sound/soc/codecs/wm8990.c
sound/soc/codecs/wm8991.c
sound/soc/codecs/wm8993.c
sound/soc/codecs/wm8993.h
sound/soc/codecs/wm8994.c
sound/soc/codecs/wm8994.h
sound/soc/codecs/wm8995.c
sound/soc/codecs/wm8996.c
sound/soc/codecs/wm9081.c
sound/soc/codecs/wm9090.c
sound/soc/codecs/wm9705.c
sound/soc/codecs/wm9712.c
sound/soc/codecs/wm9713.c
sound/soc/codecs/wm_hubs.c
sound/soc/codecs/wm_hubs.h
sound/soc/davinci/davinci-pcm.c
sound/soc/ep93xx/Kconfig
sound/soc/ep93xx/edb93xx.c
sound/soc/ep93xx/ep93xx-pcm.c
sound/soc/ep93xx/snappercl15.c
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/mpc5200_dma.c
sound/soc/fsl/mpc8610_hpcd.c
sound/soc/fsl/p1022_ds.c
sound/soc/imx/Kconfig
sound/soc/imx/Makefile
sound/soc/imx/eukrea-tlv320.c
sound/soc/imx/imx-audmux.c [new file with mode: 0644]
sound/soc/imx/imx-audmux.h [new file with mode: 0644]
sound/soc/imx/imx-pcm-dma-mx2.c
sound/soc/imx/imx-pcm.c [new file with mode: 0644]
sound/soc/imx/imx-pcm.h [new file with mode: 0644]
sound/soc/imx/imx-ssi.c
sound/soc/imx/imx-ssi.h
sound/soc/imx/mx27vis-aic32x4.c
sound/soc/imx/phycore-ac97.c
sound/soc/imx/wm1133-ev1.c
sound/soc/jz4740/qi_lb60.c
sound/soc/kirkwood/kirkwood-dma.c
sound/soc/kirkwood/kirkwood-openrd.c
sound/soc/kirkwood/kirkwood-t5325.c
sound/soc/mid-x86/mfld_machine.c
sound/soc/mxs/Kconfig
sound/soc/mxs/mxs-pcm.c
sound/soc/mxs/mxs-pcm.h
sound/soc/mxs/mxs-saif.c
sound/soc/omap/Kconfig
sound/soc/omap/Makefile
sound/soc/omap/am3517evm.c
sound/soc/omap/ams-delta.c
sound/soc/omap/igep0020.c
sound/soc/omap/mcbsp.c [new file with mode: 0644]
sound/soc/omap/mcbsp.h [new file with mode: 0644]
sound/soc/omap/n810.c
sound/soc/omap/omap-abe-twl6040.c [new file with mode: 0644]
sound/soc/omap/omap-dmic.c
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-mcbsp.h
sound/soc/omap/omap-mcpdm.c
sound/soc/omap/omap-pcm.h
sound/soc/omap/omap3beagle.c
sound/soc/omap/omap3evm.c
sound/soc/omap/omap3pandora.c
sound/soc/omap/osk5912.c
sound/soc/omap/overo.c
sound/soc/omap/rx51.c
sound/soc/omap/sdp3430.c
sound/soc/omap/sdp4430.c [deleted file]
sound/soc/omap/zoom2.c
sound/soc/pxa/corgi.c
sound/soc/pxa/magician.c
sound/soc/pxa/poodle.c
sound/soc/pxa/pxa-ssp.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/raumfeld.c
sound/soc/pxa/spitz.c
sound/soc/pxa/tosa.c
sound/soc/s6000/s6000-pcm.c
sound/soc/samsung/ac97.c
sound/soc/samsung/dma.c
sound/soc/samsung/i2s.c
sound/soc/samsung/i2s.h
sound/soc/samsung/littlemill.c
sound/soc/samsung/neo1973_wm8753.c
sound/soc/samsung/pcm.c
sound/soc/samsung/s3c24xx_simtec.c
sound/soc/samsung/smdk_wm8580.c
sound/soc/samsung/smdk_wm9713.c
sound/soc/sh/fsi.c
sound/soc/soc-core.c
sound/soc/soc-dapm.c
sound/soc/soc-dmaengine-pcm.c [new file with mode: 0644]
sound/soc/soc-io.c
sound/soc/soc-pcm.c
sound/soc/soc-utils.c
sound/soc/tegra/tegra_alc5632.c
sound/soc/tegra/tegra_pcm.c
sound/spi/at73c213.c
sound/usb/6fire/chip.c
sound/usb/6fire/chip.h
sound/usb/6fire/comm.c
sound/usb/6fire/comm.h
sound/usb/6fire/common.h
sound/usb/6fire/control.c
sound/usb/6fire/control.h
sound/usb/6fire/firmware.c
sound/usb/6fire/midi.c
sound/usb/6fire/midi.h
sound/usb/6fire/pcm.c
sound/usb/6fire/pcm.h
sound/usb/Kconfig
sound/usb/pcm.c
sound/usb/usx2y/usbusx2yaudio.c
sound/usb/usx2y/usx2yhwdeppcm.c

diff --git a/Documentation/devicetree/bindings/sound/alc5632.txt b/Documentation/devicetree/bindings/sound/alc5632.txt
new file mode 100644 (file)
index 0000000..8608f74
--- /dev/null
@@ -0,0 +1,24 @@
+ALC5632 audio CODEC
+
+This device supports I2C only.
+
+Required properties:
+
+  - compatible : "realtek,alc5632"
+
+  - reg : the I2C address of the device.
+
+  - gpio-controller : Indicates this device is a GPIO controller.
+
+  - #gpio-cells : Should be two. The first cell is the pin number and the
+    second cell is used to specify optional parameters (currently unused).
+
+Example:
+
+alc5632: alc5632@1e {
+       compatible = "realtek,alc5632";
+       reg = <0x1a>;
+
+       gpio-controller;
+       #gpio-cells = <2>;
+};
diff --git a/Documentation/devicetree/bindings/sound/imx-audmux.txt b/Documentation/devicetree/bindings/sound/imx-audmux.txt
new file mode 100644 (file)
index 0000000..215aa98
--- /dev/null
@@ -0,0 +1,13 @@
+Freescale Digital Audio Mux (AUDMUX) device
+
+Required properties:
+- compatible : "fsl,imx21-audmux" for AUDMUX version firstly used on i.MX21,
+  or "fsl,imx31-audmux" for the version firstly used on i.MX31.
+- reg : Should contain AUDMUX registers location and length
+
+Example:
+
+audmux@021d8000 {
+       compatible = "fsl,imx6q-audmux", "fsl,imx31-audmux";
+       reg = <0x021d8000 0x4000>;
+};
diff --git a/Documentation/devicetree/bindings/sound/sgtl5000.txt b/Documentation/devicetree/bindings/sound/sgtl5000.txt
new file mode 100644 (file)
index 0000000..2c3cd41
--- /dev/null
@@ -0,0 +1,11 @@
+* Freescale SGTL5000 Stereo Codec
+
+Required properties:
+- compatible : "fsl,sgtl5000".
+
+Example:
+
+codec: sgtl5000@0a {
+       compatible = "fsl,sgtl5000";
+       reg = <0x0a>;
+};
diff --git a/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt
deleted file mode 100644 (file)
index 2c3cd41..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-* Freescale SGTL5000 Stereo Codec
-
-Required properties:
-- compatible : "fsl,sgtl5000".
-
-Example:
-
-codec: sgtl5000@0a {
-       compatible = "fsl,sgtl5000";
-       reg = <0x0a>;
-};
diff --git a/Documentation/devicetree/bindings/sound/tegra-audio-alc5632.txt b/Documentation/devicetree/bindings/sound/tegra-audio-alc5632.txt
new file mode 100644 (file)
index 0000000..b77a97c
--- /dev/null
@@ -0,0 +1,59 @@
+NVIDIA Tegra audio complex
+
+Required properties:
+- compatible : "nvidia,tegra-audio-alc5632"
+- nvidia,model : The user-visible name of this sound complex.
+- nvidia,audio-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 and
+  sinks are the ALC5632's pins:
+
+  ALC5632 pins:
+
+  * SPK_OUTP
+  * SPK_OUTN
+  * HP_OUT_L
+  * HP_OUT_R
+  * AUX_OUT_P
+  * AUX_OUT_N
+  * LINE_IN_L
+  * LINE_IN_R
+  * PHONE_P
+  * PHONE_N
+  * MIC1_P
+  * MIC1_N
+  * MIC2_P
+  * MIC2_N
+  * MICBIAS1
+  * DMICDAT
+
+  Board connectors:
+
+  * Headset Stereophone
+  * Int Spk
+  * Headset Mic
+  * Digital Mic
+
+- nvidia,i2s-controller : The phandle of the Tegra I2S controller
+- nvidia,audio-codec : The phandle of the ALC5632 audio codec
+
+Example:
+
+sound {
+       compatible = "nvidia,tegra-audio-alc5632-paz00",
+                                "nvidia,tegra-audio-alc5632";
+
+       nvidia,model = "Compal PAZ00";
+
+       nvidia,audio-routing =
+                               "Int Spk", "SPK_OUTP",
+                               "Int Spk", "SPK_OUTN",
+                               "Headset Mic","MICBIAS1",
+                               "MIC1_N", "Headset Mic",
+                               "MIC1_P", "Headset Mic",
+                               "Headset Stereophone", "HP_OUT_R",
+                               "Headset Stereophone", "HP_OUT_L";
+
+       nvidia,i2s-controller = <&tegra_i2s1>;
+       nvidia,audio-codec = <&alc5632>;
+};
index a20008ab319a9d5acba2f57bdaff0a5338a1d547..82ac057a24a948797af5575fd97d46e8161557e4 100644 (file)
@@ -34,6 +34,7 @@ picochip      Picochip Ltd
 powervr        Imagination Technologies
 qcom   Qualcomm, Inc.
 ramtron        Ramtron International
+realtek Realtek Semiconductor Corp.
 samsung        Samsung Semiconductor
 sbs    Smart Battery System
 schindler      Schindler
index 12e3a0fb9bec3f9a358f42be1cd8ce2cb8195435..6f75ba3b8a391f634de7bd77ea2cae1392763571 100644 (file)
@@ -860,7 +860,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 
     [Multiple options for each card instance]
     model      - force the model name
-    position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF)
+    position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF,
+                  3 = VIACOMBO, 4 = COMBO)
     probe_mask  - Bitmask to probe codecs (default = -1, meaning all slots)
                  When the bit 8 (0x100) is set, the lower 8 bits are used
                  as the "fixed" codec slots; i.e. the driver probes the
@@ -925,6 +926,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
            (Usually SD_LPIB register is more accurate than the
            position buffer.)
 
+           position_fix=3 is specific to VIA devices.  The position
+           of the capture stream is checked from both LPIB and POSBUF
+           values.  position_fix=4 is a combination mode, using LPIB
+           for playback and POSBUF for capture.
+
     NB: If you get many "azx_get_response timeout" messages at
     loading, it's likely a problem of interrupts (e.g. ACPI irq
     routing).  Try to boot with options like "pci=noacpi".  Also, you
index c8c54544abc5c757e27c32c322b812fabf598769..d97d992ced14f97a5d423f79f1ae9b9f230fc55e 100644 (file)
@@ -8,37 +8,10 @@ ALC880
   5stack-digout        5-jack in back, 2-jack in front, a SPDIF out
   6stack       6-jack in back, 2-jack in front
   6stack-digout        6-jack with a SPDIF out
-  w810         3-jack
-  z71v         3-jack (HP shared SPDIF)
-  asus         3-jack (ASUS Mobo)
-  asus-w1v     ASUS W1V
-  asus-dig     ASUS with SPDIF out
-  asus-dig2    ASUS with SPDIF out (using GPIO2)
-  uniwill      3-jack
-  fujitsu      Fujitsu Laptops (Pi1536)
-  F1734                2-jack
-  lg           LG laptop (m1 express dual)
-  lg-lw                LG LW20/LW25 laptop
-  tcl          TCL S700
-  clevo                Clevo laptops (m520G, m665n)
-  medion       Medion Rim 2150
-  test         for testing/debugging purpose, almost all controls can be
-               adjusted.  Appearing only when compiled with
-               $CONFIG_SND_DEBUG=y
-  auto         auto-config reading BIOS (default)
 
 ALC260
 ======
-  fujitsu      Fujitsu S7020
-  acer         Acer TravelMate
-  will         Will laptops (PB V7900)
-  replacer     Replacer 672V
-  favorit100   Maxdata Favorit 100XS
-  basic                fixed pin assignment (old default model)
-  test         for testing/debugging purpose, almost all controls can
-               adjusted.  Appearing only when compiled with
-               $CONFIG_SND_DEBUG=y
-  auto         auto-config reading BIOS (default)
+  N/A
 
 ALC262
 ======
@@ -70,55 +43,7 @@ ALC680
 
 ALC882/883/885/888/889
 ======================
-  3stack-dig   3-jack with SPDIF I/O
-  6stack-dig   6-jack digital with SPDIF I/O
-  arima                Arima W820Di1
-  targa                Targa T8, MSI-1049 T8
-  asus-a7j     ASUS A7J
-  asus-a7m     ASUS A7M
-  macpro       MacPro support
-  mb5          Macbook 5,1
-  macmini3     Macmini 3,1
-  mba21                Macbook Air 2,1
-  mbp3         Macbook Pro rev3
-  imac24       iMac 24'' with jack detection
-  imac91       iMac 9,1
-  w2jc         ASUS W2JC
-  3stack-2ch-dig       3-jack with SPDIF I/O (ALC883)
-  alc883-6stack-dig    6-jack digital with SPDIF I/O (ALC883)
-  3stack-6ch    3-jack 6-channel
-  3stack-6ch-dig 3-jack 6-channel with SPDIF I/O
-  6stack-dig-demo  6-jack digital for Intel demo board
-  acer         Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc)
-  acer-aspire  Acer Aspire 9810
-  acer-aspire-4930g Acer Aspire 4930G
-  acer-aspire-6530g Acer Aspire 6530G
-  acer-aspire-7730g Acer Aspire 7730G
-  acer-aspire-8930g Acer Aspire 8930G
-  medion       Medion Laptops
-  targa-dig    Targa/MSI
-  targa-2ch-dig        Targa/MSI with 2-channel
-  targa-8ch-dig Targa/MSI with 8-channel (MSI GX620)
-  laptop-eapd   3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE)
-  lenovo-101e  Lenovo 101E
-  lenovo-nb0763        Lenovo NB0763
-  lenovo-ms7195-dig Lenovo MS7195
-  lenovo-sky   Lenovo Sky
-  haier-w66    Haier W66
-  3stack-hp    HP machines with 3stack (Lucknow, Samba boards)
-  6stack-dell  Dell machines with 6stack (Inspiron 530)
-  mitac                Mitac 8252D
-  clevo-m540r  Clevo M540R (6ch + digital)
-  clevo-m720   Clevo M720 laptop series
-  fujitsu-pi2515 Fujitsu AMILO Pi2515
-  fujitsu-xa3530 Fujitsu AMILO XA3530
-  3stack-6ch-intel Intel DG33* boards
-  intel-alc889a        Intel IbexPeak with ALC889A
-  intel-x58    Intel DX58 with ALC889
-  asus-p5q     ASUS P5Q-EM boards
-  mb31         MacBook 3,1
-  sony-vaio-tt  Sony VAIO TT
-  auto         auto-config reading BIOS (default)
+  N/A
 
 ALC861/660
 ==========
index 91fee3b45fb80f75ac406dfbba093f1f49a418c1..7813c06a5c71d70a353862a6fec6713d3d73da3b 100644 (file)
@@ -59,7 +59,12 @@ a case, you can change the default method via `position_fix` option.
 `position_fix=1` means to use LPIB method explicitly.
 `position_fix=2` means to use the position-buffer.
 `position_fix=3` means to use a combination of both methods, needed
-for some VIA and ATI controllers.  0 is the default value for all other
+for some VIA controllers.  The capture stream position is corrected
+by comparing both LPIB and position-buffer values.
+`position_fix=4` is another combination available for all controllers,
+and uses LPIB for the playback and the position-buffer for the capture
+streams.
+0 is the default value for all other
 controllers, the automatic check and fallback to LPIB as described in
 the above.  If you get a problem of repeated sounds, this option might
 help.
index 24203f9a67967df314a6d3776d6ac581a8d22fb3..b5c1dae8327fd87ccf945913a185397142135ca5 100644 (file)
@@ -817,23 +817,12 @@ void __init ep93xx_register_i2s(void)
 #define EP93XX_I2SCLKDIV_MASK          (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \
                                         EP93XX_SYSCON_I2SCLKDIV_SPOL)
 
-int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
+int ep93xx_i2s_acquire(void)
 {
        unsigned val;
 
-       /* Sanity check */
-       if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK)
-               return -EINVAL;
-       if (i2s_config & ~EP93XX_I2SCLKDIV_MASK)
-               return -EINVAL;
-
-       /* Must have only one of I2SONSSP/I2SONAC97 set */
-       if ((i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONSSP) ==
-           (i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONAC97))
-               return -EINVAL;
-
-       ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2S_MASK);
-       ep93xx_devcfg_set_bits(i2s_pins);
+       ep93xx_devcfg_set_clear(EP93XX_SYSCON_DEVCFG_I2SONAC97,
+                       EP93XX_SYSCON_DEVCFG_I2S_MASK);
 
        /*
         * This is potentially racy with the clock api for i2s_mclk, sclk and 
@@ -843,7 +832,7 @@ int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
         */
        val = __raw_readl(EP93XX_SYSCON_I2SCLKDIV);
        val &= ~EP93XX_I2SCLKDIV_MASK;
-       val |= i2s_config;
+       val |= EP93XX_SYSCON_I2SCLKDIV_ORIDE | EP93XX_SYSCON_I2SCLKDIV_SPOL;
        ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV);
 
        return 0;
index d4c934931f9d4cbf85c580355a0115f154ca241e..ad63d4be693fbfeca164a080a73e871118df2425 100644 (file)
@@ -59,7 +59,7 @@ void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data);
 int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
 void ep93xx_keypad_release_gpio(struct platform_device *pdev);
 void ep93xx_register_i2s(void);
-int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config);
+int ep93xx_i2s_acquire(void);
 void ep93xx_i2s_release(void);
 void ep93xx_register_ac97(void);
 
index 4defb97bbfc866400fe57fe4c5178a778c30a91f..3919fba52ac80c30196eb1abe5bc152b7edd0f0b 100644 (file)
@@ -46,7 +46,6 @@ config SOC_IMX21
        bool
        select MACH_MX21
        select CPU_ARM926T
-       select ARCH_MXC_AUDMUX_V1
        select IMX_HAVE_DMA_V1
        select IMX_HAVE_IOMUX_V1
        select MXC_AVIC
@@ -55,7 +54,6 @@ config SOC_IMX25
        bool
        select ARCH_MX25
        select CPU_ARM926T
-       select ARCH_MXC_AUDMUX_V2
        select ARCH_MXC_IOMUX_V3
        select MXC_AVIC
 
@@ -63,7 +61,6 @@ config SOC_IMX27
        bool
        select MACH_MX27
        select CPU_ARM926T
-       select ARCH_MXC_AUDMUX_V1
        select IMX_HAVE_DMA_V1
        select IMX_HAVE_IOMUX_V1
        select MXC_AVIC
@@ -72,7 +69,6 @@ config SOC_IMX31
        bool
        select CPU_V6
        select IMX_HAVE_PLATFORM_MXC_RNGA
-       select ARCH_MXC_AUDMUX_V2
        select MXC_AVIC
        select SMP_ON_UP if SMP
 
@@ -80,7 +76,6 @@ config SOC_IMX35
        bool
        select CPU_V6
        select ARCH_MXC_IOMUX_V3
-       select ARCH_MXC_AUDMUX_V2
        select HAVE_EPIT
        select MXC_AVIC
        select SMP_ON_UP if SMP
@@ -89,7 +84,6 @@ config SOC_IMX5
        select CPU_V7
        select MXC_TZIC
        select ARCH_MXC_IOMUX_V3
-       select ARCH_MXC_AUDMUX_V2
        select ARCH_HAS_CPUFREQ
        select ARCH_MX5
        bool
index 5db3e1463af7714bff06e8b17f526804148e89b0..5f2f91d1798b6470e2ef9ab5fd88ca22deadafcd 100644 (file)
@@ -32,7 +32,6 @@
 #include <mach/common.h>
 #include <mach/iomux-mx27.h>
 #include <mach/hardware.h>
-#include <mach/audmux.h>
 
 #include "devices-imx27.h"
 
@@ -306,25 +305,6 @@ void __init eukrea_mbimx27_baseboard_init(void)
        mxc_gpio_setup_multiple_pins(eukrea_mbimx27_pins,
                ARRAY_SIZE(eukrea_mbimx27_pins), "MBIMX27");
 
-#if defined(CONFIG_SND_SOC_EUKREA_TLV320) \
-       || defined(CONFIG_SND_SOC_EUKREA_TLV320_MODULE)
-       /* SSI unit master I2S codec connected to SSI_PINS_4*/
-       mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
-                       MXC_AUDMUX_V1_PCR_SYN |
-                       MXC_AUDMUX_V1_PCR_TFSDIR |
-                       MXC_AUDMUX_V1_PCR_TCLKDIR |
-                       MXC_AUDMUX_V1_PCR_RFSDIR |
-                       MXC_AUDMUX_V1_PCR_RCLKDIR |
-                       MXC_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4) |
-                       MXC_AUDMUX_V1_PCR_RFCSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4) |
-                       MXC_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4)
-       );
-       mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR3_SSI_PINS_4,
-                       MXC_AUDMUX_V1_PCR_SYN |
-                       MXC_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0)
-       );
-#endif
-
        imx27_add_imx_uart1(&uart_pdata);
        imx27_add_imx_uart2(&uart_pdata);
 #if !defined(MACH_EUKREA_CPUIMX27_USEUART4)
index d817fc80b986c8231da7df66dea5231f6211f4b5..aaa592fdb9ce38b84e70985a9e1496cae0c9496b 100644 (file)
@@ -37,7 +37,6 @@
 #include <mach/hardware.h>
 #include <mach/common.h>
 #include <mach/iomux-mx51.h>
-#include <mach/audmux.h>
 
 #include "devices-imx51.h"
 
index 66e8726253faa5370dd23443110b472b7671ba13..2cf603e11c4f36786f06299b00cc8ffd9e7f4125 100644 (file)
@@ -31,7 +31,6 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/mx25.h>
-#include <mach/audmux.h>
 
 #include "devices-imx25.h"
 
@@ -241,22 +240,6 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
                        ARRAY_SIZE(eukrea_mbimxsd_pads)))
                printk(KERN_ERR "error setting mbimxsd pads !\n");
 
-#if defined(CONFIG_SND_SOC_EUKREA_TLV320)
-       /* SSI unit master I2S codec connected to SSI_AUD5*/
-       mxc_audmux_v2_configure_port(0,
-                       MXC_AUDMUX_V2_PTCR_SYN |
-                       MXC_AUDMUX_V2_PTCR_TFSDIR |
-                       MXC_AUDMUX_V2_PTCR_TFSEL(4) |
-                       MXC_AUDMUX_V2_PTCR_TCLKDIR |
-                       MXC_AUDMUX_V2_PTCR_TCSEL(4),
-                       MXC_AUDMUX_V2_PDCR_RXDSEL(4)
-       );
-       mxc_audmux_v2_configure_port(4,
-                       MXC_AUDMUX_V2_PTCR_SYN,
-                       MXC_AUDMUX_V2_PDCR_RXDSEL(0)
-       );
-#endif
-
        imx25_add_imx_uart1(&uart_pdata);
        imx25_add_imx_fb(&eukrea_mximxsd_fb_pdata);
        imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
index 0f0af02b31821528185ff69401784a76c9e0efe6..fd8bf8a425a7a49c0daa7f90bb185c22f2ba2e7c 100644 (file)
@@ -38,7 +38,6 @@
 #include <mach/hardware.h>
 #include <mach/common.h>
 #include <mach/iomux-mx35.h>
-#include <mach/audmux.h>
 
 #include "devices-imx35.h"
 
@@ -252,22 +251,6 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
                        ARRAY_SIZE(eukrea_mbimxsd_pads)))
                printk(KERN_ERR "error setting mbimxsd pads !\n");
 
-#if defined(CONFIG_SND_SOC_EUKREA_TLV320)
-       /* SSI unit master I2S codec connected to SSI_AUD4 */
-       mxc_audmux_v2_configure_port(0,
-                       MXC_AUDMUX_V2_PTCR_SYN |
-                       MXC_AUDMUX_V2_PTCR_TFSDIR |
-                       MXC_AUDMUX_V2_PTCR_TFSEL(3) |
-                       MXC_AUDMUX_V2_PTCR_TCLKDIR |
-                       MXC_AUDMUX_V2_PTCR_TCSEL(3),
-                       MXC_AUDMUX_V2_PDCR_RXDSEL(3)
-       );
-       mxc_audmux_v2_configure_port(3,
-                       MXC_AUDMUX_V2_PTCR_SYN,
-                       MXC_AUDMUX_V2_PDCR_RXDSEL(0)
-       );
-#endif
-
        imx35_add_imx_uart1(&uart_pdata);
        imx35_add_ipu_core(&mx3_ipu_data);
        imx35_add_mx3_sdc_fb(&mx3fb_pdata);
index c2766ae02b4f049f6bfa6ecf79a312226e35a909..428459fbca4b5351701be89b1a136074bf9a4db6 100644 (file)
@@ -263,6 +263,7 @@ static void __init visstrim_m10_board_init(void)
        imx27_add_fec(NULL);
        imx_add_gpio_keys(&visstrim_gpio_keys_platform_data);
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+       imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0);
 }
 
 static void __init visstrim_m10_timer_init(void)
index d3b9c6b5edde091d56f3196be79a5cf245410137..541152e450c420bbf2cd65ca6061bee935957191 100644 (file)
@@ -36,7 +36,6 @@
 #include <mach/hardware.h>
 #include <mach/iomux-mx27.h>
 #include <asm/mach/time.h>
-#include <mach/audmux.h>
 #include <mach/irqs.h>
 #include <mach/ulpi.h>
 
@@ -359,18 +358,6 @@ static void __init pca100_init(void)
 
        imx27_soc_init();
 
-       /* SSI unit */
-       mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
-                                 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
-                                 MXC_AUDMUX_V1_PCR_TFCSEL(3) |
-                                 MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */
-                                 MXC_AUDMUX_V1_PCR_RXDSEL(3));
-       mxc_audmux_v1_configure_port(3,
-                                 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
-                                 MXC_AUDMUX_V1_PCR_TFCSEL(0) |
-                                 MXC_AUDMUX_V1_PCR_TFSDIR |
-                                 MXC_AUDMUX_V1_PCR_RXDSEL(0));
-
        ret = mxc_gpio_setup_multiple_pins(pca100_pins,
                        ARRAY_SIZE(pca100_pins), "PCA100");
        if (ret)
index 06dc106519aec6f8826b1589b3c765cad148bfc5..237474fcca23eb352bacc211d1173fd7f21d0ac7 100644 (file)
@@ -37,7 +37,6 @@
 #include <mach/common.h>
 #include <mach/iomux-mx35.h>
 #include <mach/ulpi.h>
-#include <mach/audmux.h>
 
 #include "devices-imx35.h"
 
@@ -362,18 +361,6 @@ static void __init pcm043_init(void)
 
        mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
 
-       mxc_audmux_v2_configure_port(3,
-                       MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
-                       MXC_AUDMUX_V2_PTCR_TFSEL(0) |
-                       MXC_AUDMUX_V2_PTCR_TFSDIR,
-                       MXC_AUDMUX_V2_PDCR_RXDSEL(0));
-
-       mxc_audmux_v2_configure_port(0,
-                       MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
-                       MXC_AUDMUX_V2_PTCR_TCSEL(3) |
-                       MXC_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */
-                       MXC_AUDMUX_V2_PDCR_RXDSEL(3));
-
        imx35_add_fec(NULL);
        platform_add_devices(devices, ARRAY_SIZE(devices));
        imx35_add_imx2_wdt(NULL);
index 3f05dfebacc9f7c2bb7df18c0646b7a775100097..14d540edfd1e6d9817ecf0f624de8d710b6dfa4d 100644 (file)
@@ -75,6 +75,10 @@ void __init mx21_init_irq(void)
        mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR));
 }
 
+static const struct resource imx21_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX21_AUDMUX_BASE_ADDR, SZ_4K),
+};
+
 void __init imx21_soc_init(void)
 {
        mxc_register_gpio("imx21-gpio", 0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
@@ -85,4 +89,6 @@ void __init imx21_soc_init(void)
        mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
 
        imx_add_imx_dma();
+       platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
+                                       ARRAY_SIZE(imx21_audmux_res));
 }
index cc4d152bd9bd9342d1c0ff53e6b9cfd0a52c9a90..153b457acdc02db153b520540093860dd768df14 100644 (file)
@@ -83,6 +83,10 @@ static struct sdma_platform_data imx25_sdma_pdata __initdata = {
        .script_addrs = &imx25_sdma_script,
 };
 
+static const struct resource imx25_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX25_AUDMUX_BASE_ADDR, SZ_16K),
+};
+
 void __init imx25_soc_init(void)
 {
        /* i.mx25 has the i.mx31 type gpio */
@@ -93,4 +97,7 @@ void __init imx25_soc_init(void)
 
        /* i.mx25 has the i.mx35 type sdma */
        imx_add_imx_sdma("imx35-sdma", MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata);
+       /* i.mx25 has the i.mx31 type audmux */
+       platform_device_register_simple("imx31-audmux", 0, imx25_audmux_res,
+                                       ARRAY_SIZE(imx25_audmux_res));
 }
index 96dd1f5ea7bddc32d8745b7447b56cf20402640e..8cb3f5e3e56901b04228408407f2d7ecb34bee7d 100644 (file)
@@ -75,6 +75,10 @@ void __init mx27_init_irq(void)
        mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR));
 }
 
+static const struct resource imx27_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX27_AUDMUX_BASE_ADDR, SZ_4K),
+};
+
 void __init imx27_soc_init(void)
 {
        /* i.mx27 has the i.mx21 type gpio */
@@ -86,4 +90,7 @@ void __init imx27_soc_init(void)
        mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
 
        imx_add_imx_dma();
+       /* imx27 has the imx21 type audmux */
+       platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
+                                       ARRAY_SIZE(imx27_audmux_res));
 }
index 31807d2a8b7bf1a65d57c8f4cb748bb9e6697934..2530c151b7b3d5aa50a1731c9ceaf1a3cc949ab8 100644 (file)
@@ -158,6 +158,10 @@ static struct sdma_platform_data imx31_sdma_pdata __initdata = {
        .script_addrs = &imx31_to2_sdma_script,
 };
 
+static const struct resource imx31_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX31_AUDMUX_BASE_ADDR, SZ_16K),
+};
+
 void __init imx31_soc_init(void)
 {
        int to_version = mx31_revision() >> 4;
@@ -175,6 +179,8 @@ void __init imx31_soc_init(void)
        }
 
        imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
+       platform_device_register_simple("imx31-audmux", 0, imx31_audmux_res,
+                                       ARRAY_SIZE(imx31_audmux_res));
 }
 #endif /* ifdef CONFIG_SOC_IMX31 */
 
@@ -241,6 +247,10 @@ static struct sdma_platform_data imx35_sdma_pdata __initdata = {
        .script_addrs = &imx35_to2_sdma_script,
 };
 
+static const struct resource imx35_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX35_AUDMUX_BASE_ADDR, SZ_16K),
+};
+
 void __init imx35_soc_init(void)
 {
        int to_version = mx35_revision() >> 4;
@@ -259,5 +269,8 @@ void __init imx35_soc_init(void)
        }
 
        imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
+       /* i.mx35 has the i.mx31 type audmux */
+       platform_device_register_simple("imx31-audmux", 0, imx35_audmux_res,
+                                       ARRAY_SIZE(imx35_audmux_res));
 }
 #endif /* ifdef CONFIG_SOC_IMX35 */
index bc17dfea38170872c24216165715e8af60144feb..90d7880bb372a95a7ae5b0f57f897311215dbaf8 100644 (file)
@@ -170,6 +170,18 @@ static struct sdma_platform_data imx53_sdma_pdata __initdata = {
        .script_addrs = &imx53_sdma_script,
 };
 
+static const struct resource imx50_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX50_AUDMUX_BASE_ADDR, SZ_16K),
+};
+
+static const struct resource imx51_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX51_AUDMUX_BASE_ADDR, SZ_16K),
+};
+
+static const struct resource imx53_audmux_res[] __initconst = {
+       DEFINE_RES_MEM(MX53_AUDMUX_BASE_ADDR, SZ_16K),
+};
+
 void __init imx50_soc_init(void)
 {
        /* i.mx50 has the i.mx31 type gpio */
@@ -179,6 +191,10 @@ void __init imx50_soc_init(void)
        mxc_register_gpio("imx31-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
        mxc_register_gpio("imx31-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
        mxc_register_gpio("imx31-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
+
+       /* i.mx50 has the i.mx31 type audmux */
+       platform_device_register_simple("imx31-audmux", 0, imx50_audmux_res,
+                                       ARRAY_SIZE(imx50_audmux_res));
 }
 
 void __init imx51_soc_init(void)
@@ -191,6 +207,9 @@ void __init imx51_soc_init(void)
 
        /* i.mx51 has the i.mx35 type sdma */
        imx_add_imx_sdma("imx35-sdma", MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
+       /* i.mx51 has the i.mx31 type audmux */
+       platform_device_register_simple("imx31-audmux", 0, imx51_audmux_res,
+                                       ARRAY_SIZE(imx51_audmux_res));
 }
 
 void __init imx53_soc_init(void)
@@ -206,4 +225,7 @@ void __init imx53_soc_init(void)
 
        /* i.mx53 has the i.mx35 type sdma */
        imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
+       /* i.mx53 has the i.mx31 type audmux */
+       platform_device_register_simple("imx31-audmux", 0, imx53_audmux_res,
+                                       ARRAY_SIZE(imx53_audmux_res));
 }
index 01f8c8992880450d1a69d861d718d63434133977..7e99c3f340fc5e61c85e7023afc9e345a5a130d8 100644 (file)
@@ -83,6 +83,11 @@ static struct i2c_board_info i2c_board_info[] __initdata = {
        },
 };
 
+static struct platform_device openrd_client_audio_device = {
+       .name           = "openrd-client-audio",
+       .id             = -1,
+};
+
 static int __initdata uart1;
 
 static int __init sd_uart_selection(char *str)
@@ -172,6 +177,7 @@ static void __init openrd_init(void)
        kirkwood_i2c_init();
 
        if (machine_is_openrd_client() || machine_is_openrd_ultimate()) {
+               platform_device_register(&openrd_client_audio_device);
                i2c_register_board_info(0, i2c_board_info,
                        ARRAY_SIZE(i2c_board_info));
                kirkwood_audio_init();
index 966b2b3bb8136a6e0ecb4b1a41190f10f379ba19..f9d2a11b7f9649468c26a882323df785e27783a0 100644 (file)
@@ -106,6 +106,11 @@ static struct platform_device hp_t5325_button_device = {
        }
 };
 
+static struct platform_device hp_t5325_audio_device = {
+       .name           = "t5325-audio",
+       .id             = -1,
+};
+
 static unsigned int hp_t5325_mpp_config[] __initdata = {
        MPP0_NF_IO2,
        MPP1_SPI_MOSI,
@@ -179,6 +184,7 @@ static void __init hp_t5325_init(void)
        kirkwood_sata_init(&hp_t5325_sata_data);
        kirkwood_ehci_init();
        platform_device_register(&hp_t5325_button_device);
+       platform_device_register(&hp_t5325_audio_device);
 
        i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
        kirkwood_audio_init();
index 4f8d66f044e7b90ef64fc40e27441f063ac1afa9..922ab0dc2bcd339ef888e23c1839d5cb25efe6f2 100644 (file)
@@ -37,7 +37,6 @@ comment "OMAP Board Type"
 config MACH_OMAP_INNOVATOR
        bool "TI Innovator"
        depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX)
-       select OMAP_MCBSP
        help
           TI OMAP 1510 or 1610 Innovator board support. Say Y here if you
           have such a board.
@@ -45,7 +44,6 @@ config MACH_OMAP_INNOVATOR
 config MACH_OMAP_H2
        bool "TI H2 Support"
        depends on ARCH_OMAP1 && ARCH_OMAP16XX
-       select OMAP_MCBSP
        help
          TI OMAP 1610/1611B H2 board support. Say Y here if you have such
          a board.
@@ -72,7 +70,6 @@ config MACH_HERALD
 config MACH_OMAP_OSK
        bool "TI OSK Support"
        depends on ARCH_OMAP1 && ARCH_OMAP16XX
-       select OMAP_MCBSP
        help
          TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here
           if you have such a board.
index 11c85cd2731a10115e43c6bd4d95aaf956d28198..9923f92b5450e4f74701d560a31c9ba04782748f 100644 (file)
@@ -6,7 +6,9 @@
 obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o
 obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o
 
-obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
+ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
+obj-y += mcbsp.o
+endif
 
 obj-$(CONFIG_OMAP_32K_TIMER)   += timer32k.o
 
index 1d76a63c098362742773ac89298c1a8cf0980e6f..187b2fe132e98c08d0fd822532e8d7dfb2ac99c1 100644 (file)
@@ -28,7 +28,6 @@
 #include <plat/mux.h>
 #include <plat/mmc.h>
 #include <plat/omap7xx.h>
-#include <plat/mcbsp.h>
 
 #include "clock.h"
 
@@ -250,16 +249,8 @@ static struct platform_device omap_pcm = {
        .id     = -1,
 };
 
-OMAP_MCBSP_PLATFORM_DEVICE(1);
-OMAP_MCBSP_PLATFORM_DEVICE(2);
-OMAP_MCBSP_PLATFORM_DEVICE(3);
-
 static void omap_init_audio(void)
 {
-       platform_device_register(&omap_mcbsp1);
-       platform_device_register(&omap_mcbsp2);
-       if (!cpu_is_omap7xx())
-               platform_device_register(&omap_mcbsp3);
        platform_device_register(&omap_pcm);
 }
 
index 91f9abbd3250bf981faa1e583de43d4d1f9c3490..3e8410a999903cec5a24d11510b1cd67c7f3c303 100644 (file)
@@ -419,18 +419,6 @@ static int __init omap1_mcbsp_init(void)
        if (!cpu_class_is_omap1())
                return -ENODEV;
 
-       if (cpu_is_omap7xx())
-               omap_mcbsp_count = OMAP7XX_MCBSP_COUNT;
-       else if (cpu_is_omap15xx())
-               omap_mcbsp_count = OMAP15XX_MCBSP_COUNT;
-       else if (cpu_is_omap16xx())
-               omap_mcbsp_count = OMAP16XX_MCBSP_COUNT;
-
-       mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
-                                                               GFP_KERNEL);
-       if (!mcbsp_ptr)
-               return -ENOMEM;
-
        if (cpu_is_omap7xx())
                omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res_0,
                                        OMAP7XX_MCBSP_RES_SZ,
@@ -449,7 +437,7 @@ static int __init omap1_mcbsp_init(void)
                                        omap16xx_mcbsp_pdata,
                                        OMAP16XX_MCBSP_COUNT);
 
-       return omap_mcbsp_init();
+       return 0;
 }
 
 arch_initcall(omap1_mcbsp_init);
index bd76394ccaf8c90de32b824dc5dc65675a73fb18..06326a6e460d0bcf539977fa3f3951718d6de8a8 100644 (file)
@@ -17,7 +17,9 @@ obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
 obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
 
-obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
+ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
+obj-y += mcbsp.o
+endif
 
 obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
 
index 4e9071589bfb60ac3bfb5a222eefcfebc700bd03..90c76d340fb3b6b7a4119822504279e9211b5228 100644 (file)
@@ -41,6 +41,7 @@
 #include <video/omap-panel-nokia-dsi.h>
 #include <video/omap-panel-picodlp.h>
 #include <linux/wl12xx.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 
 #include "mux.h"
 #include "hsmmc.h"
@@ -378,12 +379,40 @@ static struct platform_device sdp4430_dmic_codec = {
        .id     = -1,
 };
 
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
+       .card_name = "SDP4430",
+       .has_hs         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       .has_hf         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       .has_ep         = 1,
+       .has_aux        = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       .has_vibra      = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+       .has_dmic       = 1,
+       .has_hsmic      = 1,
+       .has_mainmic    = 1,
+       .has_submic     = 1,
+       .has_afm        = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+       .jack_detection = 1,
+       /* MCLK input is 38.4MHz */
+       .mclk_freq      = 38400000,
+};
+
+static struct platform_device sdp4430_abe_audio = {
+       .name           = "omap-abe-twl6040",
+       .id             = -1,
+       .dev = {
+               .platform_data = &sdp4430_abe_audio_data,
+       },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
        &sdp4430_gpio_keys_device,
        &sdp4430_leds_gpio,
        &sdp4430_leds_pwm,
        &sdp4430_vbat,
        &sdp4430_dmic_codec,
+       &sdp4430_abe_audio,
 };
 
 static struct omap_musb_board_data musb_board_data = {
index 28fc271f70316510b5268c2a212adcac3718fce1..e4415917693f3d04cfa096283c031d8780b56321 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
 #include <linux/wl12xx.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 
 #include <mach/hardware.h>
 #include <asm/hardware/gic.h>
@@ -91,9 +92,34 @@ static struct platform_device leds_gpio = {
        },
 };
 
+static struct omap_abe_twl6040_data panda_abe_audio_data = {
+       /* Audio out */
+       .has_hs         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       /* HandsFree through expasion connector */
+       .has_hf         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
+       .has_aux        = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       /* PandaBoard: FM RX, PandaBoardES: audio in */
+       .has_afm        = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       /* No jack detection. */
+       .jack_detection = 0,
+       /* MCLK input is 38.4MHz */
+       .mclk_freq      = 38400000,
+
+};
+
+static struct platform_device panda_abe_audio = {
+       .name           = "omap-abe-twl6040",
+       .id             = -1,
+       .dev = {
+               .platform_data = &panda_abe_audio_data,
+       },
+};
+
 static struct platform_device *panda_devices[] __initdata = {
        &leds_gpio,
        &wl1271_device,
+       &panda_abe_audio,
 };
 
 static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
@@ -252,8 +278,25 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
        return 0;
 }
 
+static struct twl4030_codec_data twl6040_codec = {
+       /* single-step ramp for headset and handsfree */
+       .hs_left_step   = 0x0f,
+       .hs_right_step  = 0x0f,
+       .hf_left_step   = 0x1d,
+       .hf_right_step  = 0x1d,
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+       .codec          = &twl6040_codec,
+       .audpwron_gpio  = 127,
+       .naudint_irq    = OMAP44XX_IRQ_SYS_2N,
+       .irq_base       = TWL6040_CODEC_IRQ_BASE,
+};
+
 /* Panda board uses the common PMIC configuration */
-static struct twl4030_platform_data omap4_panda_twldata;
+static struct twl4030_platform_data omap4_panda_twldata = {
+       .audio          = &twl6040_audio,
+};
 
 /*
  * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -485,6 +528,20 @@ void omap4_panda_display_init(void)
        omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
 }
 
+static void omap4_panda_init_rev(void)
+{
+       if (cpu_is_omap443x()) {
+               /* PandaBoard 4430 */
+               /* ASoC audio configuration */
+               panda_abe_audio_data.card_name = "PandaBoard";
+               panda_abe_audio_data.has_hsmic = 1;
+       } else {
+               /* PandaBoard ES */
+               /* ASoC audio configuration */
+               panda_abe_audio_data.card_name = "PandaBoardES";
+       }
+}
+
 static void __init omap4_panda_init(void)
 {
        int package = OMAP_PACKAGE_CBS;
@@ -498,6 +555,7 @@ static void __init omap4_panda_init(void)
        if (ret)
                pr_err("error setting wl12xx data: %d\n", ret);
 
+       omap4_panda_init_rev();
        omap4_panda_i2c_init();
        platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
        platform_device_register(&omap_vwlan_device);
index 283d11eae693115b42d2bbcca9176f019274960c..e9fae652cd048f02ff7768367f7b3c64bbc04a8d 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <plat/tc.h>
 #include <plat/board.h>
-#include <plat/mcbsp.h>
 #include <plat/mmc.h>
 #include <plat/dma.h>
 #include <plat/omap_hwmod.h>
@@ -304,29 +303,8 @@ static struct platform_device omap_pcm = {
        .id     = -1,
 };
 
-/*
- * OMAP2420 has 2 McBSP ports
- * OMAP2430 has 5 McBSP ports
- * OMAP3 has 5 McBSP ports
- * OMAP4 has 4 McBSP ports
- */
-OMAP_MCBSP_PLATFORM_DEVICE(1);
-OMAP_MCBSP_PLATFORM_DEVICE(2);
-OMAP_MCBSP_PLATFORM_DEVICE(3);
-OMAP_MCBSP_PLATFORM_DEVICE(4);
-OMAP_MCBSP_PLATFORM_DEVICE(5);
-
 static void omap_init_audio(void)
 {
-       platform_device_register(&omap_mcbsp1);
-       platform_device_register(&omap_mcbsp2);
-       if (cpu_is_omap243x() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
-               platform_device_register(&omap_mcbsp3);
-               platform_device_register(&omap_mcbsp4);
-       }
-       if (cpu_is_omap243x() || cpu_is_omap34xx())
-               platform_device_register(&omap_mcbsp5);
-
        platform_device_register(&omap_pcm);
 }
 
index fb4bcf81a183311c9a0baf95ed7a92af61ae01ff..ecc039e794db4cdc8b3f284292f0a59f1445fe8e 100644 (file)
@@ -34,7 +34,7 @@
 #include "cm2xxx_3xxx.h"
 #include "cm-regbits-34xx.h"
 
-/* McBSP internal signal muxing function */
+/* McBSP1 internal signal muxing function for OMAP2/3 */
 static int omap2_mcbsp1_mux_rx_clk(struct device *dev, const char *signal,
                                   const char *src)
 {
@@ -65,6 +65,42 @@ static int omap2_mcbsp1_mux_rx_clk(struct device *dev, const char *signal,
        return 0;
 }
 
+/* McBSP4 internal signal muxing function for OMAP4 */
+#define OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX    (1 << 31)
+#define OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX   (1 << 30)
+static int omap4_mcbsp4_mux_rx_clk(struct device *dev, const char *signal,
+                                  const char *src)
+{
+       u32 v;
+
+       /*
+        * In CONTROL_MCBSPLP register only bit 30 (CLKR mux), and bit 31 (FSR
+        * mux) is used */
+       v = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MCBSPLP);
+
+       if (!strcmp(signal, "clkr")) {
+               if (!strcmp(src, "clkr"))
+                       v &= ~OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX;
+               else if (!strcmp(src, "clkx"))
+                       v |= OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX;
+               else
+                       return -EINVAL;
+       } else if (!strcmp(signal, "fsr")) {
+               if (!strcmp(src, "fsr"))
+                       v &= ~OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX;
+               else if (!strcmp(src, "fsx"))
+                       v |= OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX;
+               else
+                       return -EINVAL;
+       } else {
+               return -EINVAL;
+       }
+
+       omap4_ctrl_pad_writel(v, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MCBSPLP);
+
+       return 0;
+}
+
 /* McBSP CLKS source switching function */
 static int omap2_mcbsp_set_clk_src(struct device *dev, struct clk *clk,
                                   const char *src)
@@ -146,9 +182,15 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
                pdata->has_ccr = true;
        }
        pdata->set_clk_src = omap2_mcbsp_set_clk_src;
-       if (id == 1)
+
+       /* On OMAP2/3 the McBSP1 port has 6 pin configuration */
+       if (id == 1 && oh->class->rev < MCBSP_CONFIG_TYPE4)
                pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
 
+       /* On OMAP4 the McBSP4 port has 6 pin configuration */
+       if (id == 4 && oh->class->rev == MCBSP_CONFIG_TYPE4)
+               pdata->mux_signal = omap4_mcbsp4_mux_rx_clk;
+
        if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
                if (id == 2)
                        /* The FIFO has 1024 + 256 locations */
@@ -180,7 +222,6 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
                                        name, oh->name);
                return PTR_ERR(pdev);
        }
-       omap_mcbsp_count++;
        return 0;
 }
 
@@ -188,11 +229,6 @@ static int __init omap2_mcbsp_init(void)
 {
        omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL);
 
-       mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
-                                                               GFP_KERNEL);
-       if (!mcbsp_ptr)
-               return -ENOMEM;
-
-       return omap_mcbsp_init();
+       return 0;
 }
 arch_initcall(omap2_mcbsp_init);
index cd3c97e2ee75045afb4a855f7adf03066bca478b..32a30f38ba0ce65d243a7d3f6cbeaa70bf08dbec 100644 (file)
@@ -102,6 +102,7 @@ static struct wm8962_pdata wm8962_pdata __initdata = {
                0x8000 | WM8962_GPIO_FN_DMICDAT,
                WM8962_GPIO_FN_IRQ,    /* Open drain mode */
        },
+       .in4_dc_measure = true,
 };
 
 static struct wm9081_pdata wm9081_pdata __initdata = {
index b4718b00e827b90e73edf01b252379cca75e4bcc..8f6da7f134b35a2a1e73228c6e25b8d481116850 100644 (file)
@@ -737,26 +737,18 @@ fsi_set_rate_end:
        return ret;
 }
 
-static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
-{
-       int ret;
-
-       if (is_porta)
-               ret = fsi_ak4642_set_rate(dev, rate, enable);
-       else
-               ret = fsi_hdmi_set_rate(dev, rate, enable);
-
-       return ret;
-}
-
 static struct sh_fsi_platform_info fsi_info = {
-       .porta_flags = SH_FSI_BRS_INV,
-
-       .portb_flags = SH_FSI_BRS_INV |
-                      SH_FSI_BRM_INV |
-                      SH_FSI_LRS_INV |
-                      SH_FSI_FMT_SPDIF,
-       .set_rate = fsi_set_rate,
+       .port_a = {
+               .flags          = SH_FSI_BRS_INV,
+               .set_rate       = fsi_ak4642_set_rate,
+       },
+       .port_b = {
+               .flags          = SH_FSI_BRS_INV |
+                                 SH_FSI_BRM_INV |
+                                 SH_FSI_LRS_INV |
+                                 SH_FSI_FMT_SPDIF,
+               .set_rate       = fsi_hdmi_set_rate,
+       },
 };
 
 static struct resource fsi_resources[] = {
index 7b53cda418513a63f69d34a90e903aa4d7b76f1c..d99e780dffca664e8d1b86e97a7a12cf4386526d 100644 (file)
@@ -860,7 +860,7 @@ static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
        return clk_enable(clk);
 }
 
-static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
+static int fsi_b_set_rate(struct device *dev, int rate, int enable)
 {
        struct clk *fsib_clk;
        struct clk *fdiv_clk = &sh7372_fsidivb_clk;
@@ -869,10 +869,6 @@ static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
        int ackmd_bpfmd;
        int ret;
 
-       /* FSIA is slave mode. nothing to do here */
-       if (is_porta)
-               return 0;
-
        /* clock start */
        switch (rate) {
        case 44100:
@@ -916,14 +912,16 @@ fsi_set_rate_end:
 }
 
 static struct sh_fsi_platform_info fsi_info = {
-       .porta_flags =  SH_FSI_BRS_INV,
-
-       .portb_flags =  SH_FSI_BRS_INV  |
+       .port_a = {
+               .flags = SH_FSI_BRS_INV,
+       },
+       .port_b = {
+               .flags = SH_FSI_BRS_INV |
                        SH_FSI_BRM_INV  |
                        SH_FSI_LRS_INV  |
                        SH_FSI_FMT_SPDIF,
-
-       .set_rate = fsi_set_rate,
+               .set_rate = fsi_b_set_rate,
+       }
 };
 
 static struct resource fsi_resources[] = {
index dcebb1230f7fd3cd6f6e492c97507a483dcef3b8..c722f9ce691827e8924674119b75708ba7ea6428 100644 (file)
@@ -88,12 +88,6 @@ config IMX_HAVE_IOMUX_V1
 config ARCH_MXC_IOMUX_V3
        bool
 
-config ARCH_MXC_AUDMUX_V1
-       bool
-
-config ARCH_MXC_AUDMUX_V2
-       bool
-
 config IRAM_ALLOC
        bool
        select GENERIC_ALLOCATOR
index 076db84f3e3183a47096cded0ac90abf50aa23b4..e81290c27c655bdf4ab5f4d58a61ee41cc8013e9 100644 (file)
@@ -14,8 +14,6 @@ obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
 obj-$(CONFIG_MXC_PWM)  += pwm.o
 obj-$(CONFIG_MXC_ULPI) += ulpi.o
 obj-$(CONFIG_MXC_USE_EPIT) += epit.o
-obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o
-obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
 obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
 obj-$(CONFIG_CPU_FREQ_IMX)    += cpufreq.o
 ifdef CONFIG_SND_IMX_SOC
diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
deleted file mode 100644 (file)
index 1180bef..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * Initial development of this code was funded by
- * Phytec Messtechnik GmbH, http://www.phytec.de
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/module.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <mach/audmux.h>
-#include <mach/hardware.h>
-
-static void __iomem *audmux_base;
-
-static unsigned char port_mapping[] = {
-       0x0, 0x4, 0x8, 0x10, 0x14, 0x1c,
-};
-
-int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
-{
-       if (!audmux_base) {
-               printk("%s: not configured\n", __func__);
-               return -ENOSYS;
-       }
-
-       if (port >= ARRAY_SIZE(port_mapping))
-               return -EINVAL;
-
-       writel(pcr, audmux_base + port_mapping[port]);
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(mxc_audmux_v1_configure_port);
-
-static int mxc_audmux_v1_init(void)
-{
-#ifdef CONFIG_MACH_MX21
-       if (cpu_is_mx21())
-               audmux_base = MX21_IO_ADDRESS(MX21_AUDMUX_BASE_ADDR);
-       else
-#endif
-#ifdef CONFIG_MACH_MX27
-       if (cpu_is_mx27())
-               audmux_base = MX27_IO_ADDRESS(MX27_AUDMUX_BASE_ADDR);
-       else
-#endif
-               (void)0;
-       
-       return 0;
-}
-
-postcore_initcall(mxc_audmux_v1_init);
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
deleted file mode 100644 (file)
index 8cced35..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * Initial development of this code was funded by
- * Phytec Messtechnik GmbH, http://www.phytec.de
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/module.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/debugfs.h>
-#include <linux/slab.h>
-#include <mach/audmux.h>
-#include <mach/hardware.h>
-
-static struct clk *audmux_clk;
-static void __iomem *audmux_base;
-
-#define MXC_AUDMUX_V2_PTCR(x)          ((x) * 8)
-#define MXC_AUDMUX_V2_PDCR(x)          ((x) * 8 + 4)
-
-#ifdef CONFIG_DEBUG_FS
-static struct dentry *audmux_debugfs_root;
-
-static int audmux_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
-/* There is an annoying discontinuity in the SSI numbering with regard
- * to the Linux number of the devices */
-static const char *audmux_port_string(int port)
-{
-       switch (port) {
-       case MX31_AUDMUX_PORT1_SSI0:
-               return "imx-ssi.0";
-       case MX31_AUDMUX_PORT2_SSI1:
-               return "imx-ssi.1";
-       case MX31_AUDMUX_PORT3_SSI_PINS_3:
-               return "SSI3";
-       case MX31_AUDMUX_PORT4_SSI_PINS_4:
-               return "SSI4";
-       case MX31_AUDMUX_PORT5_SSI_PINS_5:
-               return "SSI5";
-       case MX31_AUDMUX_PORT6_SSI_PINS_6:
-               return "SSI6";
-       default:
-               return "UNKNOWN";
-       }
-}
-
-static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
-                               size_t count, loff_t *ppos)
-{
-       ssize_t ret;
-       char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-       int port = (int)file->private_data;
-       u32 pdcr, ptcr;
-
-       if (!buf)
-               return -ENOMEM;
-
-       if (audmux_clk)
-               clk_enable(audmux_clk);
-
-       ptcr = readl(audmux_base + MXC_AUDMUX_V2_PTCR(port));
-       pdcr = readl(audmux_base + MXC_AUDMUX_V2_PDCR(port));
-
-       if (audmux_clk)
-               clk_disable(audmux_clk);
-
-       ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
-                      pdcr, ptcr);
-
-       if (ptcr & MXC_AUDMUX_V2_PTCR_TFSDIR)
-               ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                               "TxFS output from %s, ",
-                               audmux_port_string((ptcr >> 27) & 0x7));
-       else
-               ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                               "TxFS input, ");
-
-       if (ptcr & MXC_AUDMUX_V2_PTCR_TCLKDIR)
-               ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                               "TxClk output from %s",
-                               audmux_port_string((ptcr >> 22) & 0x7));
-       else
-               ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                               "TxClk input");
-
-       ret += snprintf(buf + ret, PAGE_SIZE - ret, "\n");
-
-       if (ptcr & MXC_AUDMUX_V2_PTCR_SYN) {
-               ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                               "Port is symmetric");
-       } else {
-               if (ptcr & MXC_AUDMUX_V2_PTCR_RFSDIR)
-                       ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                                       "RxFS output from %s, ",
-                                       audmux_port_string((ptcr >> 17) & 0x7));
-               else
-                       ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                                       "RxFS input, ");
-
-               if (ptcr & MXC_AUDMUX_V2_PTCR_RCLKDIR)
-                       ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                                       "RxClk output from %s",
-                                       audmux_port_string((ptcr >> 12) & 0x7));
-               else
-                       ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                                       "RxClk input");
-       }
-
-       ret += snprintf(buf + ret, PAGE_SIZE - ret,
-                       "\nData received from %s\n",
-                       audmux_port_string((pdcr >> 13) & 0x7));
-
-       ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
-
-       kfree(buf);
-
-       return ret;
-}
-
-static const struct file_operations audmux_debugfs_fops = {
-       .open = audmux_open_file,
-       .read = audmux_read_file,
-       .llseek = default_llseek,
-};
-
-static void audmux_debugfs_init(void)
-{
-       int i;
-       char buf[20];
-
-       audmux_debugfs_root = debugfs_create_dir("audmux", NULL);
-       if (!audmux_debugfs_root) {
-               pr_warning("Failed to create AUDMUX debugfs root\n");
-               return;
-       }
-
-       for (i = 1; i < 8; i++) {
-               snprintf(buf, sizeof(buf), "ssi%d", i);
-               if (!debugfs_create_file(buf, 0444, audmux_debugfs_root,
-                                        (void *)i, &audmux_debugfs_fops))
-                       pr_warning("Failed to create AUDMUX port %d debugfs file\n",
-                                  i);
-       }
-}
-#else
-static inline void audmux_debugfs_init(void)
-{
-}
-#endif
-
-int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
-               unsigned int pdcr)
-{
-       if (!audmux_base)
-               return -ENOSYS;
-
-       if (audmux_clk)
-               clk_enable(audmux_clk);
-
-       writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port));
-       writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port));
-
-       if (audmux_clk)
-               clk_disable(audmux_clk);
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(mxc_audmux_v2_configure_port);
-
-static int mxc_audmux_v2_init(void)
-{
-       int ret;
-       if (cpu_is_mx51()) {
-               audmux_base = MX51_IO_ADDRESS(MX51_AUDMUX_BASE_ADDR);
-       } else if (cpu_is_mx31()) {
-               audmux_base = MX31_IO_ADDRESS(MX31_AUDMUX_BASE_ADDR);
-       } else if (cpu_is_mx35()) {
-               audmux_clk = clk_get(NULL, "audmux");
-               if (IS_ERR(audmux_clk)) {
-                       ret = PTR_ERR(audmux_clk);
-                       printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
-                                       ret);
-                       return ret;
-               }
-               audmux_base = MX35_IO_ADDRESS(MX35_AUDMUX_BASE_ADDR);
-       } else if (cpu_is_mx25()) {
-               audmux_clk = clk_get(NULL, "audmux");
-               if (IS_ERR(audmux_clk)) {
-                       ret = PTR_ERR(audmux_clk);
-                       printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
-                                       ret);
-                       return ret;
-               }
-               audmux_base = MX25_IO_ADDRESS(MX25_AUDMUX_BASE_ADDR);
-       }
-
-       audmux_debugfs_init();
-
-       return 0;
-}
-
-postcore_initcall(mxc_audmux_v2_init);
diff --git a/arch/arm/plat-mxc/include/mach/audmux.h b/arch/arm/plat-mxc/include/mach/audmux.h
deleted file mode 100644 (file)
index 6fda788..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef __MACH_AUDMUX_H
-#define __MACH_AUDMUX_H
-
-#define MX27_AUDMUX_HPCR1_SSI0         0
-#define MX27_AUDMUX_HPCR2_SSI1         1
-#define MX27_AUDMUX_HPCR3_SSI_PINS_4   2
-#define MX27_AUDMUX_PPCR1_SSI_PINS_1   3
-#define MX27_AUDMUX_PPCR2_SSI_PINS_2   4
-#define MX27_AUDMUX_PPCR3_SSI_PINS_3   5
-
-#define MX31_AUDMUX_PORT1_SSI0         0
-#define MX31_AUDMUX_PORT2_SSI1         1
-#define MX31_AUDMUX_PORT3_SSI_PINS_3   2
-#define MX31_AUDMUX_PORT4_SSI_PINS_4   3
-#define MX31_AUDMUX_PORT5_SSI_PINS_5   4
-#define MX31_AUDMUX_PORT6_SSI_PINS_6   5
-
-#define MX51_AUDMUX_PORT1_SSI0         0
-#define MX51_AUDMUX_PORT2_SSI1         1
-#define MX51_AUDMUX_PORT3              2
-#define MX51_AUDMUX_PORT4              3
-#define MX51_AUDMUX_PORT5              4
-#define MX51_AUDMUX_PORT6              5
-#define MX51_AUDMUX_PORT7              6
-
-/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
-#define MXC_AUDMUX_V1_PCR_INMMASK(x)   ((x) & 0xff)
-#define MXC_AUDMUX_V1_PCR_INMEN                (1 << 8)
-#define MXC_AUDMUX_V1_PCR_TXRXEN       (1 << 10)
-#define MXC_AUDMUX_V1_PCR_SYN          (1 << 12)
-#define MXC_AUDMUX_V1_PCR_RXDSEL(x)    (((x) & 0x7) << 13)
-#define MXC_AUDMUX_V1_PCR_RFCSEL(x)    (((x) & 0xf) << 20)
-#define MXC_AUDMUX_V1_PCR_RCLKDIR      (1 << 24)
-#define MXC_AUDMUX_V1_PCR_RFSDIR       (1 << 25)
-#define MXC_AUDMUX_V1_PCR_TFCSEL(x)    (((x) & 0xf) << 26)
-#define MXC_AUDMUX_V1_PCR_TCLKDIR      (1 << 30)
-#define MXC_AUDMUX_V1_PCR_TFSDIR       (1 << 31)
-
-/* Register definitions for the i.MX25/31/35/51 Digital Audio Multiplexer */
-#define MXC_AUDMUX_V2_PTCR_TFSDIR      (1 << 31)
-#define MXC_AUDMUX_V2_PTCR_TFSEL(x)    (((x) & 0xf) << 27)
-#define MXC_AUDMUX_V2_PTCR_TCLKDIR     (1 << 26)
-#define MXC_AUDMUX_V2_PTCR_TCSEL(x)    (((x) & 0xf) << 22)
-#define MXC_AUDMUX_V2_PTCR_RFSDIR      (1 << 21)
-#define MXC_AUDMUX_V2_PTCR_RFSEL(x)    (((x) & 0xf) << 17)
-#define MXC_AUDMUX_V2_PTCR_RCLKDIR     (1 << 16)
-#define MXC_AUDMUX_V2_PTCR_RCSEL(x)    (((x) & 0xf) << 12)
-#define MXC_AUDMUX_V2_PTCR_SYN         (1 << 11)
-
-#define MXC_AUDMUX_V2_PDCR_RXDSEL(x)   (((x) & 0x7) << 13)
-#define MXC_AUDMUX_V2_PDCR_TXRXEN      (1 << 12)
-#define MXC_AUDMUX_V2_PDCR_MODE(x)     (((x) & 0x3) << 8)
-#define MXC_AUDMUX_V2_PDCR_INMMASK(x)  ((x) & 0xff)
-
-int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr);
-
-int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
-               unsigned int pdcr);
-
-#endif /* __MACH_AUDMUX_H */
index aa59f4247dc53bba585fa7f93e050c10902a0708..8f81503a4df77ee6cb1c0c9ad52d723db9aa3f89 100644 (file)
@@ -110,14 +110,6 @@ config OMAP_MUX_WARNINGS
          to change the pin multiplexing setup.  When there are no warnings
          printed, it's safe to deselect OMAP_MUX for your product.
 
-config OMAP_MCBSP
-       bool "McBSP support"
-       depends on ARCH_OMAP
-       default y
-       help
-         Say Y here if you want support for the OMAP Multichannel
-         Buffered Serial Port.
-
 config OMAP_MBOX_FWK
        tristate "Mailbox framework support"
        depends on ARCH_OMAP
index 9a584614e7e66feb051ddde13f61545f94632290..c0fe2757b695e74f098edbdca4125541d842d4a1 100644 (file)
@@ -17,8 +17,6 @@ obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
 obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
 obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
 
-obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
-
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
index 8fa74e2c9d6ec6898968774a62b1c1ac65c15bfe..18814127809aa031d3d5abc1ff64c5000ba1cd49 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/clk.h>
 
-/* macro for building platform_device for McBSP ports */
-#define OMAP_MCBSP_PLATFORM_DEVICE(port_nr)            \
-static struct platform_device omap_mcbsp##port_nr = {  \
-       .name   = "omap-mcbsp-dai",                     \
-       .id     = port_nr - 1,                  \
-}
-
 #define MCBSP_CONFIG_TYPE2     0x2
 #define MCBSP_CONFIG_TYPE3     0x3
 #define MCBSP_CONFIG_TYPE4     0x4
 
-/* McBSP register numbers. Register address offset = num * reg_step */
-enum {
-       /* Common registers */
-       OMAP_MCBSP_REG_SPCR2 = 4,
-       OMAP_MCBSP_REG_SPCR1,
-       OMAP_MCBSP_REG_RCR2,
-       OMAP_MCBSP_REG_RCR1,
-       OMAP_MCBSP_REG_XCR2,
-       OMAP_MCBSP_REG_XCR1,
-       OMAP_MCBSP_REG_SRGR2,
-       OMAP_MCBSP_REG_SRGR1,
-       OMAP_MCBSP_REG_MCR2,
-       OMAP_MCBSP_REG_MCR1,
-       OMAP_MCBSP_REG_RCERA,
-       OMAP_MCBSP_REG_RCERB,
-       OMAP_MCBSP_REG_XCERA,
-       OMAP_MCBSP_REG_XCERB,
-       OMAP_MCBSP_REG_PCR0,
-       OMAP_MCBSP_REG_RCERC,
-       OMAP_MCBSP_REG_RCERD,
-       OMAP_MCBSP_REG_XCERC,
-       OMAP_MCBSP_REG_XCERD,
-       OMAP_MCBSP_REG_RCERE,
-       OMAP_MCBSP_REG_RCERF,
-       OMAP_MCBSP_REG_XCERE,
-       OMAP_MCBSP_REG_XCERF,
-       OMAP_MCBSP_REG_RCERG,
-       OMAP_MCBSP_REG_RCERH,
-       OMAP_MCBSP_REG_XCERG,
-       OMAP_MCBSP_REG_XCERH,
-
-       /* OMAP1-OMAP2420 registers */
-       OMAP_MCBSP_REG_DRR2 = 0,
-       OMAP_MCBSP_REG_DRR1,
-       OMAP_MCBSP_REG_DXR2,
-       OMAP_MCBSP_REG_DXR1,
-
-       /* OMAP2430 and onwards */
-       OMAP_MCBSP_REG_DRR = 0,
-       OMAP_MCBSP_REG_DXR = 2,
-       OMAP_MCBSP_REG_SYSCON = 35,
-       OMAP_MCBSP_REG_THRSH2,
-       OMAP_MCBSP_REG_THRSH1,
-       OMAP_MCBSP_REG_IRQST = 40,
-       OMAP_MCBSP_REG_IRQEN,
-       OMAP_MCBSP_REG_WAKEUPEN,
-       OMAP_MCBSP_REG_XCCR,
-       OMAP_MCBSP_REG_RCCR,
-       OMAP_MCBSP_REG_XBUFFSTAT,
-       OMAP_MCBSP_REG_RBUFFSTAT,
-       OMAP_MCBSP_REG_SSELCR,
-};
-
-/* OMAP3 sidetone control registers */
-#define OMAP_ST_REG_REV                0x00
-#define OMAP_ST_REG_SYSCONFIG  0x10
-#define OMAP_ST_REG_IRQSTATUS  0x18
-#define OMAP_ST_REG_IRQENABLE  0x1C
-#define OMAP_ST_REG_SGAINCR    0x24
-#define OMAP_ST_REG_SFIRCR     0x28
-#define OMAP_ST_REG_SSELCR     0x2C
-
-/************************** McBSP SPCR1 bit definitions ***********************/
-#define RRST                   0x0001
-#define RRDY                   0x0002
-#define RFULL                  0x0004
-#define RSYNC_ERR              0x0008
-#define RINTM(value)           ((value)<<4)    /* bits 4:5 */
-#define ABIS                   0x0040
-#define DXENA                  0x0080
-#define CLKSTP(value)          ((value)<<11)   /* bits 11:12 */
-#define RJUST(value)           ((value)<<13)   /* bits 13:14 */
-#define ALB                    0x8000
-#define DLB                    0x8000
-
-/************************** McBSP SPCR2 bit definitions ***********************/
-#define XRST           0x0001
-#define XRDY           0x0002
-#define XEMPTY         0x0004
-#define XSYNC_ERR      0x0008
-#define XINTM(value)   ((value)<<4)            /* bits 4:5 */
-#define GRST           0x0040
-#define FRST           0x0080
-#define SOFT           0x0100
-#define FREE           0x0200
-
-/************************** McBSP PCR bit definitions *************************/
-#define CLKRP          0x0001
-#define CLKXP          0x0002
-#define FSRP           0x0004
-#define FSXP           0x0008
-#define DR_STAT                0x0010
-#define DX_STAT                0x0020
-#define CLKS_STAT      0x0040
-#define SCLKME         0x0080
-#define CLKRM          0x0100
-#define CLKXM          0x0200
-#define FSRM           0x0400
-#define FSXM           0x0800
-#define RIOEN          0x1000
-#define XIOEN          0x2000
-#define IDLE_EN                0x4000
-
-/************************** McBSP RCR1 bit definitions ************************/
-#define RWDLEN1(value)         ((value)<<5)    /* Bits 5:7 */
-#define RFRLEN1(value)         ((value)<<8)    /* Bits 8:14 */
-
-/************************** McBSP XCR1 bit definitions ************************/
-#define XWDLEN1(value)         ((value)<<5)    /* Bits 5:7 */
-#define XFRLEN1(value)         ((value)<<8)    /* Bits 8:14 */
-
-/*************************** McBSP RCR2 bit definitions ***********************/
-#define RDATDLY(value)         (value)         /* Bits 0:1 */
-#define RFIG                   0x0004
-#define RCOMPAND(value)                ((value)<<3)    /* Bits 3:4 */
-#define RWDLEN2(value)         ((value)<<5)    /* Bits 5:7 */
-#define RFRLEN2(value)         ((value)<<8)    /* Bits 8:14 */
-#define RPHASE                 0x8000
-
-/*************************** McBSP XCR2 bit definitions ***********************/
-#define XDATDLY(value)         (value)         /* Bits 0:1 */
-#define XFIG                   0x0004
-#define XCOMPAND(value)                ((value)<<3)    /* Bits 3:4 */
-#define XWDLEN2(value)         ((value)<<5)    /* Bits 5:7 */
-#define XFRLEN2(value)         ((value)<<8)    /* Bits 8:14 */
-#define XPHASE                 0x8000
-
-/************************* McBSP SRGR1 bit definitions ************************/
-#define CLKGDV(value)          (value)         /* Bits 0:7 */
-#define FWID(value)            ((value)<<8)    /* Bits 8:15 */
-
-/************************* McBSP SRGR2 bit definitions ************************/
-#define FPER(value)            (value)         /* Bits 0:11 */
-#define FSGM                   0x1000
-#define CLKSM                  0x2000
-#define CLKSP                  0x4000
-#define GSYNC                  0x8000
-
-/************************* McBSP MCR1 bit definitions *************************/
-#define RMCM                   0x0001
-#define RCBLK(value)           ((value)<<2)    /* Bits 2:4 */
-#define RPABLK(value)          ((value)<<5)    /* Bits 5:6 */
-#define RPBBLK(value)          ((value)<<7)    /* Bits 7:8 */
-
-/************************* McBSP MCR2 bit definitions *************************/
-#define XMCM(value)            (value)         /* Bits 0:1 */
-#define XCBLK(value)           ((value)<<2)    /* Bits 2:4 */
-#define XPABLK(value)          ((value)<<5)    /* Bits 5:6 */
-#define XPBBLK(value)          ((value)<<7)    /* Bits 7:8 */
-
-/*********************** McBSP XCCR bit definitions *************************/
-#define EXTCLKGATE             0x8000
-#define PPCONNECT              0x4000
-#define DXENDLY(value)         ((value)<<12)   /* Bits 12:13 */
-#define XFULL_CYCLE            0x0800
-#define DILB                   0x0020
-#define XDMAEN                 0x0008
-#define XDISABLE               0x0001
-
-/********************** McBSP RCCR bit definitions *************************/
-#define RFULL_CYCLE            0x0800
-#define RDMAEN                 0x0008
-#define RDISABLE               0x0001
-
-/********************** McBSP SYSCONFIG bit definitions ********************/
-#define CLOCKACTIVITY(value)   ((value)<<8)
-#define SIDLEMODE(value)       ((value)<<3)
-#define ENAWAKEUP              0x0004
-#define SOFTRST                        0x0002
-
-/********************** McBSP SSELCR bit definitions ***********************/
-#define SIDETONEEN             0x0400
-
-/********************** McBSP Sidetone SYSCONFIG bit definitions ***********/
-#define ST_AUTOIDLE            0x0001
-
-/********************** McBSP Sidetone SGAINCR bit definitions *************/
-#define ST_CH1GAIN(value)      ((value<<16))   /* Bits 16:31 */
-#define ST_CH0GAIN(value)      (value)         /* Bits 0:15 */
-
-/********************** McBSP Sidetone SFIRCR bit definitions **************/
-#define ST_FIRCOEFF(value)     (value)         /* Bits 0:15 */
-
-/********************** McBSP Sidetone SSELCR bit definitions **************/
-#define ST_COEFFWRDONE         0x0004
-#define ST_COEFFWREN           0x0002
-#define ST_SIDETONEEN          0x0001
-
-/********************** McBSP DMA operating modes **************************/
-#define MCBSP_DMA_MODE_ELEMENT         0
-#define MCBSP_DMA_MODE_THRESHOLD       1
-#define MCBSP_DMA_MODE_FRAME           2
-
-/********************** McBSP WAKEUPEN bit definitions *********************/
-#define XEMPTYEOFEN            0x4000
-#define XRDYEN                 0x0400
-#define XEOFEN                 0x0200
-#define XFSXEN                 0x0100
-#define XSYNCERREN             0x0080
-#define RRDYEN                 0x0008
-#define REOFEN                 0x0004
-#define RFSREN                 0x0002
-#define RSYNCERREN             0x0001
-
-/* CLKR signal muxing options */
-#define CLKR_SRC_CLKR          0
-#define CLKR_SRC_CLKX          1
-
-/* FSR signal muxing options */
-#define FSR_SRC_FSR            0
-#define FSR_SRC_FSX            1
-
-/* McBSP functional clock sources */
-#define MCBSP_CLKS_PRCM_SRC    0
-#define MCBSP_CLKS_PAD_SRC     1
-
-/* we don't do multichannel for now */
-struct omap_mcbsp_reg_cfg {
-       u16 spcr2;
-       u16 spcr1;
-       u16 rcr2;
-       u16 rcr1;
-       u16 xcr2;
-       u16 xcr1;
-       u16 srgr2;
-       u16 srgr1;
-       u16 mcr2;
-       u16 mcr1;
-       u16 pcr0;
-       u16 rcerc;
-       u16 rcerd;
-       u16 xcerc;
-       u16 xcerd;
-       u16 rcere;
-       u16 rcerf;
-       u16 xcere;
-       u16 xcerf;
-       u16 rcerg;
-       u16 rcerh;
-       u16 xcerg;
-       u16 xcerh;
-       u16 xccr;
-       u16 rccr;
-};
-
-typedef enum {
-       OMAP_MCBSP_WORD_8 = 0,
-       OMAP_MCBSP_WORD_12,
-       OMAP_MCBSP_WORD_16,
-       OMAP_MCBSP_WORD_20,
-       OMAP_MCBSP_WORD_24,
-       OMAP_MCBSP_WORD_32,
-} omap_mcbsp_word_length;
-
 /* Platform specific configuration */
 struct omap_mcbsp_ops {
        void (*request)(unsigned int);
@@ -312,43 +51,6 @@ struct omap_mcbsp_platform_data {
        int (*mux_signal)(struct device *dev, const char *signal, const char *src);
 };
 
-struct omap_mcbsp_st_data {
-       void __iomem *io_base_st;
-       bool running;
-       bool enabled;
-       s16 taps[128];  /* Sidetone filter coefficients */
-       int nr_taps;    /* Number of filter coefficients in use */
-       s16 ch0gain;
-       s16 ch1gain;
-};
-
-struct omap_mcbsp {
-       struct device *dev;
-       unsigned long phys_base;
-       unsigned long phys_dma_base;
-       void __iomem *io_base;
-       u8 id;
-       u8 free;
-
-       int rx_irq;
-       int tx_irq;
-
-       /* DMA stuff */
-       u8 dma_rx_sync;
-       u8 dma_tx_sync;
-
-       /* Protect the field .free, while checking if the mcbsp is in use */
-       spinlock_t lock;
-       struct omap_mcbsp_platform_data *pdata;
-       struct clk *fclk;
-       struct omap_mcbsp_st_data *st_data;
-       int dma_op_mode;
-       u16 max_tx_thres;
-       u16 max_rx_thres;
-       void *reg_cache;
-       int reg_cache_size;
-};
-
 /**
  * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod
  * @sidetone: name of the sidetone device
@@ -357,39 +59,4 @@ struct omap_mcbsp_dev_attr {
        const char *sidetone;
 };
 
-extern struct omap_mcbsp **mcbsp_ptr;
-extern int omap_mcbsp_count;
-
-int omap_mcbsp_init(void);
-void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config);
-void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);
-void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold);
-u16 omap_mcbsp_get_max_tx_threshold(unsigned int id);
-u16 omap_mcbsp_get_max_rx_threshold(unsigned int id);
-u16 omap_mcbsp_get_fifo_size(unsigned int id);
-u16 omap_mcbsp_get_tx_delay(unsigned int id);
-u16 omap_mcbsp_get_rx_delay(unsigned int id);
-int omap_mcbsp_get_dma_op_mode(unsigned int id);
-int omap_mcbsp_request(unsigned int id);
-void omap_mcbsp_free(unsigned int id);
-void omap_mcbsp_start(unsigned int id, int tx, int rx);
-void omap_mcbsp_stop(unsigned int id, int tx, int rx);
-
-/* McBSP functional clock source changing function */
-extern int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id);
-
-/* McBSP signal muxing API */
-void omap2_mcbsp1_mux_clkr_src(u8 mux);
-void omap2_mcbsp1_mux_fsr_src(u8 mux);
-
-int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream);
-int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream);
-
-/* Sidetone specific API */
-int omap_st_set_chgain(unsigned int id, int channel, s16 chgain);
-int omap_st_get_chgain(unsigned int id, int channel, s16 *chgain);
-int omap_st_enable(unsigned int id);
-int omap_st_disable(unsigned int id);
-int omap_st_is_enabled(unsigned int id);
-
 #endif
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
deleted file mode 100644 (file)
index 4b15cd7..0000000
+++ /dev/null
@@ -1,1361 +0,0 @@
-/*
- * linux/arch/arm/plat-omap/mcbsp.c
- *
- * Copyright (C) 2004 Nokia Corporation
- * Author: Samuel Ortiz <samuel.ortiz@nokia.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.
- *
- * Multichannel mode not supported.
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/err.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-
-#include <plat/mcbsp.h>
-#include <linux/pm_runtime.h>
-
-struct omap_mcbsp **mcbsp_ptr;
-int omap_mcbsp_count;
-
-#define omap_mcbsp_check_valid_id(id)  (id < omap_mcbsp_count)
-#define id_to_mcbsp_ptr(id)            mcbsp_ptr[id];
-
-static void omap_mcbsp_write(struct omap_mcbsp *mcbsp, u16 reg, u32 val)
-{
-       void __iomem *addr = mcbsp->io_base + reg * mcbsp->pdata->reg_step;
-
-       if (mcbsp->pdata->reg_size == 2) {
-               ((u16 *)mcbsp->reg_cache)[reg] = (u16)val;
-               __raw_writew((u16)val, addr);
-       } else {
-               ((u32 *)mcbsp->reg_cache)[reg] = val;
-               __raw_writel(val, addr);
-       }
-}
-
-static int omap_mcbsp_read(struct omap_mcbsp *mcbsp, u16 reg, bool from_cache)
-{
-       void __iomem *addr = mcbsp->io_base + reg * mcbsp->pdata->reg_step;
-
-       if (mcbsp->pdata->reg_size == 2) {
-               return !from_cache ? __raw_readw(addr) :
-                                    ((u16 *)mcbsp->reg_cache)[reg];
-       } else {
-               return !from_cache ? __raw_readl(addr) :
-                                    ((u32 *)mcbsp->reg_cache)[reg];
-       }
-}
-
-static void omap_mcbsp_st_write(struct omap_mcbsp *mcbsp, u16 reg, u32 val)
-{
-       __raw_writel(val, mcbsp->st_data->io_base_st + reg);
-}
-
-static int omap_mcbsp_st_read(struct omap_mcbsp *mcbsp, u16 reg)
-{
-       return __raw_readl(mcbsp->st_data->io_base_st + reg);
-}
-
-#define MCBSP_READ(mcbsp, reg) \
-               omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 0)
-#define MCBSP_WRITE(mcbsp, reg, val) \
-               omap_mcbsp_write(mcbsp, OMAP_MCBSP_REG_##reg, val)
-#define MCBSP_READ_CACHE(mcbsp, reg) \
-               omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 1)
-
-#define MCBSP_ST_READ(mcbsp, reg) \
-                       omap_mcbsp_st_read(mcbsp, OMAP_ST_REG_##reg)
-#define MCBSP_ST_WRITE(mcbsp, reg, val) \
-                       omap_mcbsp_st_write(mcbsp, OMAP_ST_REG_##reg, val)
-
-static void omap_mcbsp_dump_reg(u8 id)
-{
-       struct omap_mcbsp *mcbsp = id_to_mcbsp_ptr(id);
-
-       dev_dbg(mcbsp->dev, "**** McBSP%d regs ****\n", mcbsp->id);
-       dev_dbg(mcbsp->dev, "DRR2:  0x%04x\n",
-                       MCBSP_READ(mcbsp, DRR2));
-       dev_dbg(mcbsp->dev, "DRR1:  0x%04x\n",
-                       MCBSP_READ(mcbsp, DRR1));
-       dev_dbg(mcbsp->dev, "DXR2:  0x%04x\n",
-                       MCBSP_READ(mcbsp, DXR2));
-       dev_dbg(mcbsp->dev, "DXR1:  0x%04x\n",
-                       MCBSP_READ(mcbsp, DXR1));
-       dev_dbg(mcbsp->dev, "SPCR2: 0x%04x\n",
-                       MCBSP_READ(mcbsp, SPCR2));
-       dev_dbg(mcbsp->dev, "SPCR1: 0x%04x\n",
-                       MCBSP_READ(mcbsp, SPCR1));
-       dev_dbg(mcbsp->dev, "RCR2:  0x%04x\n",
-                       MCBSP_READ(mcbsp, RCR2));
-       dev_dbg(mcbsp->dev, "RCR1:  0x%04x\n",
-                       MCBSP_READ(mcbsp, RCR1));
-       dev_dbg(mcbsp->dev, "XCR2:  0x%04x\n",
-                       MCBSP_READ(mcbsp, XCR2));
-       dev_dbg(mcbsp->dev, "XCR1:  0x%04x\n",
-                       MCBSP_READ(mcbsp, XCR1));
-       dev_dbg(mcbsp->dev, "SRGR2: 0x%04x\n",
-                       MCBSP_READ(mcbsp, SRGR2));
-       dev_dbg(mcbsp->dev, "SRGR1: 0x%04x\n",
-                       MCBSP_READ(mcbsp, SRGR1));
-       dev_dbg(mcbsp->dev, "PCR0:  0x%04x\n",
-                       MCBSP_READ(mcbsp, PCR0));
-       dev_dbg(mcbsp->dev, "***********************\n");
-}
-
-static irqreturn_t omap_mcbsp_tx_irq_handler(int irq, void *dev_id)
-{
-       struct omap_mcbsp *mcbsp_tx = dev_id;
-       u16 irqst_spcr2;
-
-       irqst_spcr2 = MCBSP_READ(mcbsp_tx, SPCR2);
-       dev_dbg(mcbsp_tx->dev, "TX IRQ callback : 0x%x\n", irqst_spcr2);
-
-       if (irqst_spcr2 & XSYNC_ERR) {
-               dev_err(mcbsp_tx->dev, "TX Frame Sync Error! : 0x%x\n",
-                       irqst_spcr2);
-               /* Writing zero to XSYNC_ERR clears the IRQ */
-               MCBSP_WRITE(mcbsp_tx, SPCR2, MCBSP_READ_CACHE(mcbsp_tx, SPCR2));
-       }
-
-       return IRQ_HANDLED;
-}
-
-static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id)
-{
-       struct omap_mcbsp *mcbsp_rx = dev_id;
-       u16 irqst_spcr1;
-
-       irqst_spcr1 = MCBSP_READ(mcbsp_rx, SPCR1);
-       dev_dbg(mcbsp_rx->dev, "RX IRQ callback : 0x%x\n", irqst_spcr1);
-
-       if (irqst_spcr1 & RSYNC_ERR) {
-               dev_err(mcbsp_rx->dev, "RX Frame Sync Error! : 0x%x\n",
-                       irqst_spcr1);
-               /* Writing zero to RSYNC_ERR clears the IRQ */
-               MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1));
-       }
-
-       return IRQ_HANDLED;
-}
-
-/*
- * omap_mcbsp_config simply write a config to the
- * appropriate McBSP.
- * You either call this function or set the McBSP registers
- * by yourself before calling omap_mcbsp_start().
- */
-void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
-{
-       struct omap_mcbsp *mcbsp;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       dev_dbg(mcbsp->dev, "Configuring McBSP%d  phys_base: 0x%08lx\n",
-                       mcbsp->id, mcbsp->phys_base);
-
-       /* We write the given config */
-       MCBSP_WRITE(mcbsp, SPCR2, config->spcr2);
-       MCBSP_WRITE(mcbsp, SPCR1, config->spcr1);
-       MCBSP_WRITE(mcbsp, RCR2, config->rcr2);
-       MCBSP_WRITE(mcbsp, RCR1, config->rcr1);
-       MCBSP_WRITE(mcbsp, XCR2, config->xcr2);
-       MCBSP_WRITE(mcbsp, XCR1, config->xcr1);
-       MCBSP_WRITE(mcbsp, SRGR2, config->srgr2);
-       MCBSP_WRITE(mcbsp, SRGR1, config->srgr1);
-       MCBSP_WRITE(mcbsp, MCR2, config->mcr2);
-       MCBSP_WRITE(mcbsp, MCR1, config->mcr1);
-       MCBSP_WRITE(mcbsp, PCR0, config->pcr0);
-       if (mcbsp->pdata->has_ccr) {
-               MCBSP_WRITE(mcbsp, XCCR, config->xccr);
-               MCBSP_WRITE(mcbsp, RCCR, config->rccr);
-       }
-}
-EXPORT_SYMBOL(omap_mcbsp_config);
-
-/**
- * omap_mcbsp_dma_params - returns the dma channel number
- * @id - mcbsp id
- * @stream - indicates the direction of data flow (rx or tx)
- *
- * Returns the dma channel number for the rx channel or tx channel
- * based on the value of @stream for the requested mcbsp given by @id
- */
-int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream)
-{
-       struct omap_mcbsp *mcbsp;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       if (stream)
-               return mcbsp->dma_rx_sync;
-       else
-               return mcbsp->dma_tx_sync;
-}
-EXPORT_SYMBOL(omap_mcbsp_dma_ch_params);
-
-/**
- * omap_mcbsp_dma_reg_params - returns the address of mcbsp data register
- * @id - mcbsp id
- * @stream - indicates the direction of data flow (rx or tx)
- *
- * Returns the address of mcbsp data transmit register or data receive register
- * to be used by DMA for transferring/receiving data based on the value of
- * @stream for the requested mcbsp given by @id
- */
-int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream)
-{
-       struct omap_mcbsp *mcbsp;
-       int data_reg;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       if (mcbsp->pdata->reg_size == 2) {
-               if (stream)
-                       data_reg = OMAP_MCBSP_REG_DRR1;
-               else
-                       data_reg = OMAP_MCBSP_REG_DXR1;
-       } else {
-               if (stream)
-                       data_reg = OMAP_MCBSP_REG_DRR;
-               else
-                       data_reg = OMAP_MCBSP_REG_DXR;
-       }
-
-       return mcbsp->phys_dma_base + data_reg * mcbsp->pdata->reg_step;
-}
-EXPORT_SYMBOL(omap_mcbsp_dma_reg_params);
-
-static void omap_st_on(struct omap_mcbsp *mcbsp)
-{
-       unsigned int w;
-
-       if (mcbsp->pdata->enable_st_clock)
-               mcbsp->pdata->enable_st_clock(mcbsp->id, 1);
-
-       /* Enable McBSP Sidetone */
-       w = MCBSP_READ(mcbsp, SSELCR);
-       MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN);
-
-       /* Enable Sidetone from Sidetone Core */
-       w = MCBSP_ST_READ(mcbsp, SSELCR);
-       MCBSP_ST_WRITE(mcbsp, SSELCR, w | ST_SIDETONEEN);
-}
-
-static void omap_st_off(struct omap_mcbsp *mcbsp)
-{
-       unsigned int w;
-
-       w = MCBSP_ST_READ(mcbsp, SSELCR);
-       MCBSP_ST_WRITE(mcbsp, SSELCR, w & ~(ST_SIDETONEEN));
-
-       w = MCBSP_READ(mcbsp, SSELCR);
-       MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
-
-       if (mcbsp->pdata->enable_st_clock)
-               mcbsp->pdata->enable_st_clock(mcbsp->id, 0);
-}
-
-static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
-{
-       u16 val, i;
-
-       val = MCBSP_ST_READ(mcbsp, SSELCR);
-
-       if (val & ST_COEFFWREN)
-               MCBSP_ST_WRITE(mcbsp, SSELCR, val & ~(ST_COEFFWREN));
-
-       MCBSP_ST_WRITE(mcbsp, SSELCR, val | ST_COEFFWREN);
-
-       for (i = 0; i < 128; i++)
-               MCBSP_ST_WRITE(mcbsp, SFIRCR, fir[i]);
-
-       i = 0;
-
-       val = MCBSP_ST_READ(mcbsp, SSELCR);
-       while (!(val & ST_COEFFWRDONE) && (++i < 1000))
-               val = MCBSP_ST_READ(mcbsp, SSELCR);
-
-       MCBSP_ST_WRITE(mcbsp, SSELCR, val & ~(ST_COEFFWREN));
-
-       if (i == 1000)
-               dev_err(mcbsp->dev, "McBSP FIR load error!\n");
-}
-
-static void omap_st_chgain(struct omap_mcbsp *mcbsp)
-{
-       u16 w;
-       struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
-
-       w = MCBSP_ST_READ(mcbsp, SSELCR);
-
-       MCBSP_ST_WRITE(mcbsp, SGAINCR, ST_CH0GAIN(st_data->ch0gain) | \
-                     ST_CH1GAIN(st_data->ch1gain));
-}
-
-int omap_st_set_chgain(unsigned int id, int channel, s16 chgain)
-{
-       struct omap_mcbsp *mcbsp;
-       struct omap_mcbsp_st_data *st_data;
-       int ret = 0;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-
-       mcbsp = id_to_mcbsp_ptr(id);
-       st_data = mcbsp->st_data;
-
-       if (!st_data)
-               return -ENOENT;
-
-       spin_lock_irq(&mcbsp->lock);
-       if (channel == 0)
-               st_data->ch0gain = chgain;
-       else if (channel == 1)
-               st_data->ch1gain = chgain;
-       else
-               ret = -EINVAL;
-
-       if (st_data->enabled)
-               omap_st_chgain(mcbsp);
-       spin_unlock_irq(&mcbsp->lock);
-
-       return ret;
-}
-EXPORT_SYMBOL(omap_st_set_chgain);
-
-int omap_st_get_chgain(unsigned int id, int channel, s16 *chgain)
-{
-       struct omap_mcbsp *mcbsp;
-       struct omap_mcbsp_st_data *st_data;
-       int ret = 0;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-
-       mcbsp = id_to_mcbsp_ptr(id);
-       st_data = mcbsp->st_data;
-
-       if (!st_data)
-               return -ENOENT;
-
-       spin_lock_irq(&mcbsp->lock);
-       if (channel == 0)
-               *chgain = st_data->ch0gain;
-       else if (channel == 1)
-               *chgain = st_data->ch1gain;
-       else
-               ret = -EINVAL;
-       spin_unlock_irq(&mcbsp->lock);
-
-       return ret;
-}
-EXPORT_SYMBOL(omap_st_get_chgain);
-
-static int omap_st_start(struct omap_mcbsp *mcbsp)
-{
-       struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
-
-       if (st_data && st_data->enabled && !st_data->running) {
-               omap_st_fir_write(mcbsp, st_data->taps);
-               omap_st_chgain(mcbsp);
-
-               if (!mcbsp->free) {
-                       omap_st_on(mcbsp);
-                       st_data->running = 1;
-               }
-       }
-
-       return 0;
-}
-
-int omap_st_enable(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       struct omap_mcbsp_st_data *st_data;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-
-       mcbsp = id_to_mcbsp_ptr(id);
-       st_data = mcbsp->st_data;
-
-       if (!st_data)
-               return -ENODEV;
-
-       spin_lock_irq(&mcbsp->lock);
-       st_data->enabled = 1;
-       omap_st_start(mcbsp);
-       spin_unlock_irq(&mcbsp->lock);
-
-       return 0;
-}
-EXPORT_SYMBOL(omap_st_enable);
-
-static int omap_st_stop(struct omap_mcbsp *mcbsp)
-{
-       struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
-
-       if (st_data && st_data->running) {
-               if (!mcbsp->free) {
-                       omap_st_off(mcbsp);
-                       st_data->running = 0;
-               }
-       }
-
-       return 0;
-}
-
-int omap_st_disable(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       struct omap_mcbsp_st_data *st_data;
-       int ret = 0;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-
-       mcbsp = id_to_mcbsp_ptr(id);
-       st_data = mcbsp->st_data;
-
-       if (!st_data)
-               return -ENODEV;
-
-       spin_lock_irq(&mcbsp->lock);
-       omap_st_stop(mcbsp);
-       st_data->enabled = 0;
-       spin_unlock_irq(&mcbsp->lock);
-
-       return ret;
-}
-EXPORT_SYMBOL(omap_st_disable);
-
-int omap_st_is_enabled(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       struct omap_mcbsp_st_data *st_data;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-
-       mcbsp = id_to_mcbsp_ptr(id);
-       st_data = mcbsp->st_data;
-
-       if (!st_data)
-               return -ENODEV;
-
-
-       return st_data->enabled;
-}
-EXPORT_SYMBOL(omap_st_is_enabled);
-
-/*
- * omap_mcbsp_set_rx_threshold configures the transmit threshold in words.
- * The threshold parameter is 1 based, and it is converted (threshold - 1)
- * for the THRSH2 register.
- */
-void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)
-{
-       struct omap_mcbsp *mcbsp;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-       if (mcbsp->pdata->buffer_size == 0)
-               return;
-
-       if (threshold && threshold <= mcbsp->max_tx_thres)
-               MCBSP_WRITE(mcbsp, THRSH2, threshold - 1);
-}
-EXPORT_SYMBOL(omap_mcbsp_set_tx_threshold);
-
-/*
- * omap_mcbsp_set_rx_threshold configures the receive threshold in words.
- * The threshold parameter is 1 based, and it is converted (threshold - 1)
- * for the THRSH1 register.
- */
-void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)
-{
-       struct omap_mcbsp *mcbsp;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-       if (mcbsp->pdata->buffer_size == 0)
-               return;
-
-       if (threshold && threshold <= mcbsp->max_rx_thres)
-               MCBSP_WRITE(mcbsp, THRSH1, threshold - 1);
-}
-EXPORT_SYMBOL(omap_mcbsp_set_rx_threshold);
-
-/*
- * omap_mcbsp_get_max_tx_thres just return the current configured
- * maximum threshold for transmission
- */
-u16 omap_mcbsp_get_max_tx_threshold(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       return mcbsp->max_tx_thres;
-}
-EXPORT_SYMBOL(omap_mcbsp_get_max_tx_threshold);
-
-/*
- * omap_mcbsp_get_max_rx_thres just return the current configured
- * maximum threshold for reception
- */
-u16 omap_mcbsp_get_max_rx_threshold(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       return mcbsp->max_rx_thres;
-}
-EXPORT_SYMBOL(omap_mcbsp_get_max_rx_threshold);
-
-u16 omap_mcbsp_get_fifo_size(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       return mcbsp->pdata->buffer_size;
-}
-EXPORT_SYMBOL(omap_mcbsp_get_fifo_size);
-
-/*
- * omap_mcbsp_get_tx_delay returns the number of used slots in the McBSP FIFO
- */
-u16 omap_mcbsp_get_tx_delay(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       u16 buffstat;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-       if (mcbsp->pdata->buffer_size == 0)
-               return 0;
-
-       /* Returns the number of free locations in the buffer */
-       buffstat = MCBSP_READ(mcbsp, XBUFFSTAT);
-
-       /* Number of slots are different in McBSP ports */
-       return mcbsp->pdata->buffer_size - buffstat;
-}
-EXPORT_SYMBOL(omap_mcbsp_get_tx_delay);
-
-/*
- * omap_mcbsp_get_rx_delay returns the number of free slots in the McBSP FIFO
- * to reach the threshold value (when the DMA will be triggered to read it)
- */
-u16 omap_mcbsp_get_rx_delay(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       u16 buffstat, threshold;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-       if (mcbsp->pdata->buffer_size == 0)
-               return 0;
-
-       /* Returns the number of used locations in the buffer */
-       buffstat = MCBSP_READ(mcbsp, RBUFFSTAT);
-       /* RX threshold */
-       threshold = MCBSP_READ(mcbsp, THRSH1);
-
-       /* Return the number of location till we reach the threshold limit */
-       if (threshold <= buffstat)
-               return 0;
-       else
-               return threshold - buffstat;
-}
-EXPORT_SYMBOL(omap_mcbsp_get_rx_delay);
-
-/*
- * omap_mcbsp_get_dma_op_mode just return the current configured
- * operating mode for the mcbsp channel
- */
-int omap_mcbsp_get_dma_op_mode(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       int dma_op_mode;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%u)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       dma_op_mode = mcbsp->dma_op_mode;
-
-       return dma_op_mode;
-}
-EXPORT_SYMBOL(omap_mcbsp_get_dma_op_mode);
-
-int omap_mcbsp_request(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       void *reg_cache;
-       int err;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return -ENODEV;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       reg_cache = kzalloc(mcbsp->reg_cache_size, GFP_KERNEL);
-       if (!reg_cache) {
-               return -ENOMEM;
-       }
-
-       spin_lock(&mcbsp->lock);
-       if (!mcbsp->free) {
-               dev_err(mcbsp->dev, "McBSP%d is currently in use\n",
-                       mcbsp->id);
-               err = -EBUSY;
-               goto err_kfree;
-       }
-
-       mcbsp->free = false;
-       mcbsp->reg_cache = reg_cache;
-       spin_unlock(&mcbsp->lock);
-
-       if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request)
-               mcbsp->pdata->ops->request(id);
-
-       pm_runtime_get_sync(mcbsp->dev);
-
-       /* Enable wakeup behavior */
-       if (mcbsp->pdata->has_wakeup)
-               MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN);
-
-       /*
-        * Make sure that transmitter, receiver and sample-rate generator are
-        * not running before activating IRQs.
-        */
-       MCBSP_WRITE(mcbsp, SPCR1, 0);
-       MCBSP_WRITE(mcbsp, SPCR2, 0);
-
-       err = request_irq(mcbsp->tx_irq, omap_mcbsp_tx_irq_handler,
-                               0, "McBSP", (void *)mcbsp);
-       if (err != 0) {
-               dev_err(mcbsp->dev, "Unable to request TX IRQ %d "
-                               "for McBSP%d\n", mcbsp->tx_irq,
-                               mcbsp->id);
-               goto err_clk_disable;
-       }
-
-       if (mcbsp->rx_irq) {
-               err = request_irq(mcbsp->rx_irq,
-                               omap_mcbsp_rx_irq_handler,
-                               0, "McBSP", (void *)mcbsp);
-               if (err != 0) {
-                       dev_err(mcbsp->dev, "Unable to request RX IRQ %d "
-                                       "for McBSP%d\n", mcbsp->rx_irq,
-                                       mcbsp->id);
-                       goto err_free_irq;
-               }
-       }
-
-       return 0;
-err_free_irq:
-       free_irq(mcbsp->tx_irq, (void *)mcbsp);
-err_clk_disable:
-       if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free)
-               mcbsp->pdata->ops->free(id);
-
-       /* Disable wakeup behavior */
-       if (mcbsp->pdata->has_wakeup)
-               MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
-
-       pm_runtime_put_sync(mcbsp->dev);
-
-       spin_lock(&mcbsp->lock);
-       mcbsp->free = true;
-       mcbsp->reg_cache = NULL;
-err_kfree:
-       spin_unlock(&mcbsp->lock);
-       kfree(reg_cache);
-
-       return err;
-}
-EXPORT_SYMBOL(omap_mcbsp_request);
-
-void omap_mcbsp_free(unsigned int id)
-{
-       struct omap_mcbsp *mcbsp;
-       void *reg_cache;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free)
-               mcbsp->pdata->ops->free(id);
-
-       /* Disable wakeup behavior */
-       if (mcbsp->pdata->has_wakeup)
-               MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
-
-       pm_runtime_put_sync(mcbsp->dev);
-
-       if (mcbsp->rx_irq)
-               free_irq(mcbsp->rx_irq, (void *)mcbsp);
-       free_irq(mcbsp->tx_irq, (void *)mcbsp);
-
-       reg_cache = mcbsp->reg_cache;
-
-       spin_lock(&mcbsp->lock);
-       if (mcbsp->free)
-               dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);
-       else
-               mcbsp->free = true;
-       mcbsp->reg_cache = NULL;
-       spin_unlock(&mcbsp->lock);
-
-       if (reg_cache)
-               kfree(reg_cache);
-}
-EXPORT_SYMBOL(omap_mcbsp_free);
-
-/*
- * Here we start the McBSP, by enabling transmitter, receiver or both.
- * If no transmitter or receiver is active prior calling, then sample-rate
- * generator and frame sync are started.
- */
-void omap_mcbsp_start(unsigned int id, int tx, int rx)
-{
-       struct omap_mcbsp *mcbsp;
-       int enable_srg = 0;
-       u16 w;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       if (mcbsp->st_data)
-               omap_st_start(mcbsp);
-
-       /* Only enable SRG, if McBSP is master */
-       w = MCBSP_READ_CACHE(mcbsp, PCR0);
-       if (w & (FSXM | FSRM | CLKXM | CLKRM))
-               enable_srg = !((MCBSP_READ_CACHE(mcbsp, SPCR2) |
-                               MCBSP_READ_CACHE(mcbsp, SPCR1)) & 1);
-
-       if (enable_srg) {
-               /* Start the sample generator */
-               w = MCBSP_READ_CACHE(mcbsp, SPCR2);
-               MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 6));
-       }
-
-       /* Enable transmitter and receiver */
-       tx &= 1;
-       w = MCBSP_READ_CACHE(mcbsp, SPCR2);
-       MCBSP_WRITE(mcbsp, SPCR2, w | tx);
-
-       rx &= 1;
-       w = MCBSP_READ_CACHE(mcbsp, SPCR1);
-       MCBSP_WRITE(mcbsp, SPCR1, w | rx);
-
-       /*
-        * Worst case: CLKSRG*2 = 8000khz: (1/8000) * 2 * 2 usec
-        * REVISIT: 100us may give enough time for two CLKSRG, however
-        * due to some unknown PM related, clock gating etc. reason it
-        * is now at 500us.
-        */
-       udelay(500);
-
-       if (enable_srg) {
-               /* Start frame sync */
-               w = MCBSP_READ_CACHE(mcbsp, SPCR2);
-               MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 7));
-       }
-
-       if (mcbsp->pdata->has_ccr) {
-               /* Release the transmitter and receiver */
-               w = MCBSP_READ_CACHE(mcbsp, XCCR);
-               w &= ~(tx ? XDISABLE : 0);
-               MCBSP_WRITE(mcbsp, XCCR, w);
-               w = MCBSP_READ_CACHE(mcbsp, RCCR);
-               w &= ~(rx ? RDISABLE : 0);
-               MCBSP_WRITE(mcbsp, RCCR, w);
-       }
-
-       /* Dump McBSP Regs */
-       omap_mcbsp_dump_reg(id);
-}
-EXPORT_SYMBOL(omap_mcbsp_start);
-
-void omap_mcbsp_stop(unsigned int id, int tx, int rx)
-{
-       struct omap_mcbsp *mcbsp;
-       int idle;
-       u16 w;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
-               return;
-       }
-
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       /* Reset transmitter */
-       tx &= 1;
-       if (mcbsp->pdata->has_ccr) {
-               w = MCBSP_READ_CACHE(mcbsp, XCCR);
-               w |= (tx ? XDISABLE : 0);
-               MCBSP_WRITE(mcbsp, XCCR, w);
-       }
-       w = MCBSP_READ_CACHE(mcbsp, SPCR2);
-       MCBSP_WRITE(mcbsp, SPCR2, w & ~tx);
-
-       /* Reset receiver */
-       rx &= 1;
-       if (mcbsp->pdata->has_ccr) {
-               w = MCBSP_READ_CACHE(mcbsp, RCCR);
-               w |= (rx ? RDISABLE : 0);
-               MCBSP_WRITE(mcbsp, RCCR, w);
-       }
-       w = MCBSP_READ_CACHE(mcbsp, SPCR1);
-       MCBSP_WRITE(mcbsp, SPCR1, w & ~rx);
-
-       idle = !((MCBSP_READ_CACHE(mcbsp, SPCR2) |
-                       MCBSP_READ_CACHE(mcbsp, SPCR1)) & 1);
-
-       if (idle) {
-               /* Reset the sample rate generator */
-               w = MCBSP_READ_CACHE(mcbsp, SPCR2);
-               MCBSP_WRITE(mcbsp, SPCR2, w & ~(1 << 6));
-       }
-
-       if (mcbsp->st_data)
-               omap_st_stop(mcbsp);
-}
-EXPORT_SYMBOL(omap_mcbsp_stop);
-
-int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
-{
-       struct omap_mcbsp *mcbsp;
-       const char *src;
-
-       if (!omap_mcbsp_check_valid_id(id)) {
-               pr_err("%s: Invalid id (%d)\n", __func__, id + 1);
-               return -EINVAL;
-       }
-       mcbsp = id_to_mcbsp_ptr(id);
-
-       if (fck_src_id == MCBSP_CLKS_PAD_SRC)
-               src = "clks_ext";
-       else if (fck_src_id == MCBSP_CLKS_PRCM_SRC)
-               src = "clks_fclk";
-       else
-               return -EINVAL;
-
-       if (mcbsp->pdata->set_clk_src)
-               return mcbsp->pdata->set_clk_src(mcbsp->dev, mcbsp->fclk, src);
-       else
-               return -EINVAL;
-}
-EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
-
-void omap2_mcbsp1_mux_clkr_src(u8 mux)
-{
-       struct omap_mcbsp *mcbsp;
-       const char *src;
-
-       if (mux == CLKR_SRC_CLKR)
-               src = "clkr";
-       else if (mux == CLKR_SRC_CLKX)
-               src = "clkx";
-       else
-               return;
-
-       mcbsp = id_to_mcbsp_ptr(0);
-       if (mcbsp->pdata->mux_signal)
-               mcbsp->pdata->mux_signal(mcbsp->dev, "clkr", src);
-}
-EXPORT_SYMBOL(omap2_mcbsp1_mux_clkr_src);
-
-void omap2_mcbsp1_mux_fsr_src(u8 mux)
-{
-       struct omap_mcbsp *mcbsp;
-       const char *src;
-
-       if (mux == FSR_SRC_FSR)
-               src = "fsr";
-       else if (mux == FSR_SRC_FSX)
-               src = "fsx";
-       else
-               return;
-
-       mcbsp = id_to_mcbsp_ptr(0);
-       if (mcbsp->pdata->mux_signal)
-               mcbsp->pdata->mux_signal(mcbsp->dev, "fsr", src);
-}
-EXPORT_SYMBOL(omap2_mcbsp1_mux_fsr_src);
-
-#define max_thres(m)                   (mcbsp->pdata->buffer_size)
-#define valid_threshold(m, val)                ((val) <= max_thres(m))
-#define THRESHOLD_PROP_BUILDER(prop)                                   \
-static ssize_t prop##_show(struct device *dev,                         \
-                       struct device_attribute *attr, char *buf)       \
-{                                                                      \
-       struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);                \
-                                                                       \
-       return sprintf(buf, "%u\n", mcbsp->prop);                       \
-}                                                                      \
-                                                                       \
-static ssize_t prop##_store(struct device *dev,                                \
-                               struct device_attribute *attr,          \
-                               const char *buf, size_t size)           \
-{                                                                      \
-       struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);                \
-       unsigned long val;                                              \
-       int status;                                                     \
-                                                                       \
-       status = strict_strtoul(buf, 0, &val);                          \
-       if (status)                                                     \
-               return status;                                          \
-                                                                       \
-       if (!valid_threshold(mcbsp, val))                               \
-               return -EDOM;                                           \
-                                                                       \
-       mcbsp->prop = val;                                              \
-       return size;                                                    \
-}                                                                      \
-                                                                       \
-static DEVICE_ATTR(prop, 0644, prop##_show, prop##_store);
-
-THRESHOLD_PROP_BUILDER(max_tx_thres);
-THRESHOLD_PROP_BUILDER(max_rx_thres);
-
-static const char *dma_op_modes[] = {
-       "element", "threshold", "frame",
-};
-
-static ssize_t dma_op_mode_show(struct device *dev,
-                       struct device_attribute *attr, char *buf)
-{
-       struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);
-       int dma_op_mode, i = 0;
-       ssize_t len = 0;
-       const char * const *s;
-
-       dma_op_mode = mcbsp->dma_op_mode;
-
-       for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++) {
-               if (dma_op_mode == i)
-                       len += sprintf(buf + len, "[%s] ", *s);
-               else
-                       len += sprintf(buf + len, "%s ", *s);
-       }
-       len += sprintf(buf + len, "\n");
-
-       return len;
-}
-
-static ssize_t dma_op_mode_store(struct device *dev,
-                               struct device_attribute *attr,
-                               const char *buf, size_t size)
-{
-       struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);
-       const char * const *s;
-       int i = 0;
-
-       for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++)
-               if (sysfs_streq(buf, *s))
-                       break;
-
-       if (i == ARRAY_SIZE(dma_op_modes))
-               return -EINVAL;
-
-       spin_lock_irq(&mcbsp->lock);
-       if (!mcbsp->free) {
-               size = -EBUSY;
-               goto unlock;
-       }
-       mcbsp->dma_op_mode = i;
-
-unlock:
-       spin_unlock_irq(&mcbsp->lock);
-
-       return size;
-}
-
-static DEVICE_ATTR(dma_op_mode, 0644, dma_op_mode_show, dma_op_mode_store);
-
-static const struct attribute *additional_attrs[] = {
-       &dev_attr_max_tx_thres.attr,
-       &dev_attr_max_rx_thres.attr,
-       &dev_attr_dma_op_mode.attr,
-       NULL,
-};
-
-static const struct attribute_group additional_attr_group = {
-       .attrs = (struct attribute **)additional_attrs,
-};
-
-static ssize_t st_taps_show(struct device *dev,
-                           struct device_attribute *attr, char *buf)
-{
-       struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);
-       struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
-       ssize_t status = 0;
-       int i;
-
-       spin_lock_irq(&mcbsp->lock);
-       for (i = 0; i < st_data->nr_taps; i++)
-               status += sprintf(&buf[status], (i ? ", %d" : "%d"),
-                                 st_data->taps[i]);
-       if (i)
-               status += sprintf(&buf[status], "\n");
-       spin_unlock_irq(&mcbsp->lock);
-
-       return status;
-}
-
-static ssize_t st_taps_store(struct device *dev,
-                            struct device_attribute *attr,
-                            const char *buf, size_t size)
-{
-       struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);
-       struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
-       int val, tmp, status, i = 0;
-
-       spin_lock_irq(&mcbsp->lock);
-       memset(st_data->taps, 0, sizeof(st_data->taps));
-       st_data->nr_taps = 0;
-
-       do {
-               status = sscanf(buf, "%d%n", &val, &tmp);
-               if (status < 0 || status == 0) {
-                       size = -EINVAL;
-                       goto out;
-               }
-               if (val < -32768 || val > 32767) {
-                       size = -EINVAL;
-                       goto out;
-               }
-               st_data->taps[i++] = val;
-               buf += tmp;
-               if (*buf != ',')
-                       break;
-               buf++;
-       } while (1);
-
-       st_data->nr_taps = i;
-
-out:
-       spin_unlock_irq(&mcbsp->lock);
-
-       return size;
-}
-
-static DEVICE_ATTR(st_taps, 0644, st_taps_show, st_taps_store);
-
-static const struct attribute *sidetone_attrs[] = {
-       &dev_attr_st_taps.attr,
-       NULL,
-};
-
-static const struct attribute_group sidetone_attr_group = {
-       .attrs = (struct attribute **)sidetone_attrs,
-};
-
-static int __devinit omap_st_add(struct omap_mcbsp *mcbsp,
-                                struct resource *res)
-{
-       struct omap_mcbsp_st_data *st_data;
-       int err;
-
-       st_data = kzalloc(sizeof(*mcbsp->st_data), GFP_KERNEL);
-       if (!st_data) {
-               err = -ENOMEM;
-               goto err1;
-       }
-
-       st_data->io_base_st = ioremap(res->start, resource_size(res));
-       if (!st_data->io_base_st) {
-               err = -ENOMEM;
-               goto err2;
-       }
-
-       err = sysfs_create_group(&mcbsp->dev->kobj, &sidetone_attr_group);
-       if (err)
-               goto err3;
-
-       mcbsp->st_data = st_data;
-       return 0;
-
-err3:
-       iounmap(st_data->io_base_st);
-err2:
-       kfree(st_data);
-err1:
-       return err;
-
-}
-
-static void __devexit omap_st_remove(struct omap_mcbsp *mcbsp)
-{
-       struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
-
-       sysfs_remove_group(&mcbsp->dev->kobj, &sidetone_attr_group);
-       iounmap(st_data->io_base_st);
-       kfree(st_data);
-}
-
-/*
- * McBSP1 and McBSP3 are directly mapped on 1610 and 1510.
- * 730 has only 2 McBSP, and both of them are MPU peripherals.
- */
-static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
-{
-       struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data;
-       struct omap_mcbsp *mcbsp;
-       int id = pdev->id - 1;
-       struct resource *res;
-       int ret = 0;
-
-       if (!pdata) {
-               dev_err(&pdev->dev, "McBSP device initialized without"
-                               "platform data\n");
-               ret = -EINVAL;
-               goto exit;
-       }
-
-       dev_dbg(&pdev->dev, "Initializing OMAP McBSP (%d).\n", pdev->id);
-
-       if (id >= omap_mcbsp_count) {
-               dev_err(&pdev->dev, "Invalid McBSP device id (%d)\n", id);
-               ret = -EINVAL;
-               goto exit;
-       }
-
-       mcbsp = kzalloc(sizeof(struct omap_mcbsp), GFP_KERNEL);
-       if (!mcbsp) {
-               ret = -ENOMEM;
-               goto exit;
-       }
-
-       spin_lock_init(&mcbsp->lock);
-       mcbsp->id = id + 1;
-       mcbsp->free = true;
-
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
-       if (!res) {
-               res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-               if (!res) {
-                       dev_err(&pdev->dev, "%s:mcbsp%d has invalid memory"
-                                       "resource\n", __func__, pdev->id);
-                       ret = -ENOMEM;
-                       goto exit;
-               }
-       }
-       mcbsp->phys_base = res->start;
-       mcbsp->reg_cache_size = resource_size(res);
-       mcbsp->io_base = ioremap(res->start, resource_size(res));
-       if (!mcbsp->io_base) {
-               ret = -ENOMEM;
-               goto err_ioremap;
-       }
-
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
-       if (!res)
-               mcbsp->phys_dma_base = mcbsp->phys_base;
-       else
-               mcbsp->phys_dma_base = res->start;
-
-       mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx");
-       mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx");
-
-       /* From OMAP4 there will be a single irq line */
-       if (mcbsp->tx_irq == -ENXIO)
-               mcbsp->tx_irq = platform_get_irq(pdev, 0);
-
-       res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
-       if (!res) {
-               dev_err(&pdev->dev, "%s:mcbsp%d has invalid rx DMA channel\n",
-                                       __func__, pdev->id);
-               ret = -ENODEV;
-               goto err_res;
-       }
-       mcbsp->dma_rx_sync = res->start;
-
-       res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
-       if (!res) {
-               dev_err(&pdev->dev, "%s:mcbsp%d has invalid tx DMA channel\n",
-                                       __func__, pdev->id);
-               ret = -ENODEV;
-               goto err_res;
-       }
-       mcbsp->dma_tx_sync = res->start;
-
-       mcbsp->fclk = clk_get(&pdev->dev, "fck");
-       if (IS_ERR(mcbsp->fclk)) {
-               ret = PTR_ERR(mcbsp->fclk);
-               dev_err(&pdev->dev, "unable to get fck: %d\n", ret);
-               goto err_res;
-       }
-
-       mcbsp->pdata = pdata;
-       mcbsp->dev = &pdev->dev;
-       mcbsp_ptr[id] = mcbsp;
-       platform_set_drvdata(pdev, mcbsp);
-       pm_runtime_enable(mcbsp->dev);
-
-       mcbsp->dma_op_mode = MCBSP_DMA_MODE_ELEMENT;
-       if (mcbsp->pdata->buffer_size) {
-               /*
-                * Initially configure the maximum thresholds to a safe value.
-                * The McBSP FIFO usage with these values should not go under
-                * 16 locations.
-                * If the whole FIFO without safety buffer is used, than there
-                * is a possibility that the DMA will be not able to push the
-                * new data on time, causing channel shifts in runtime.
-                */
-               mcbsp->max_tx_thres = max_thres(mcbsp) - 0x10;
-               mcbsp->max_rx_thres = max_thres(mcbsp) - 0x10;
-
-               ret = sysfs_create_group(&mcbsp->dev->kobj,
-                                        &additional_attr_group);
-               if (ret) {
-                       dev_err(mcbsp->dev,
-                               "Unable to create additional controls\n");
-                       goto err_thres;
-               }
-       } else {
-               mcbsp->max_tx_thres = -EINVAL;
-               mcbsp->max_rx_thres = -EINVAL;
-       }
-
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sidetone");
-       if (res) {
-               ret = omap_st_add(mcbsp, res);
-               if (ret) {
-                       dev_err(mcbsp->dev,
-                               "Unable to create sidetone controls\n");
-                       goto err_st;
-               }
-       }
-
-       return 0;
-
-err_st:
-       if (mcbsp->pdata->buffer_size)
-               sysfs_remove_group(&mcbsp->dev->kobj,
-                                  &additional_attr_group);
-err_thres:
-       clk_put(mcbsp->fclk);
-err_res:
-       iounmap(mcbsp->io_base);
-err_ioremap:
-       kfree(mcbsp);
-exit:
-       return ret;
-}
-
-static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
-{
-       struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
-
-       platform_set_drvdata(pdev, NULL);
-       if (mcbsp) {
-
-               if (mcbsp->pdata && mcbsp->pdata->ops &&
-                               mcbsp->pdata->ops->free)
-                       mcbsp->pdata->ops->free(mcbsp->id);
-
-               if (mcbsp->pdata->buffer_size)
-                       sysfs_remove_group(&mcbsp->dev->kobj,
-                                          &additional_attr_group);
-
-               if (mcbsp->st_data)
-                       omap_st_remove(mcbsp);
-
-               clk_put(mcbsp->fclk);
-
-               iounmap(mcbsp->io_base);
-               kfree(mcbsp);
-       }
-
-       return 0;
-}
-
-static struct platform_driver omap_mcbsp_driver = {
-       .probe          = omap_mcbsp_probe,
-       .remove         = __devexit_p(omap_mcbsp_remove),
-       .driver         = {
-               .name   = "omap-mcbsp",
-       },
-};
-
-int __init omap_mcbsp_init(void)
-{
-       /* Register the McBSP driver */
-       return platform_driver_register(&omap_mcbsp_driver);
-}
index 639e3ce6c264d4f8af8137efffff5fdf280992cf..9a91fe9de69675ff1d74140bc658257637356090 100644 (file)
@@ -418,6 +418,11 @@ static struct platform_device qi_lb60_charger_device = {
        },
 };
 
+/* audio */
+static struct platform_device qi_lb60_audio_device = {
+       .name = "qi-lb60-audio",
+       .id = -1,
+};
 
 static struct platform_device *jz_platform_devices[] __initdata = {
        &jz4740_udc_device,
@@ -434,6 +439,7 @@ static struct platform_device *jz_platform_devices[] __initdata = {
        &qi_lb60_gpio_keys,
        &qi_lb60_pwm_beeper,
        &qi_lb60_charger_device,
+       &qi_lb60_audio_device,
 };
 
 static void __init board_gpio_setup(void)
index cde7c0085cedf4b239e79cddaee05d5dcc9e81b7..59daae2f29db6514b47612e840ea2d0913d8ff4b 100644 (file)
@@ -769,7 +769,9 @@ static struct platform_device camera_devices[] = {
 
 /* FSI */
 static struct sh_fsi_platform_info fsi_info = {
-       .portb_flags = SH_FSI_BRS_INV,
+       .port_b = {
+               .flags = SH_FSI_BRS_INV,
+       },
 };
 
 static struct resource fsi_resources[] = {
index 2b07fc0169500aab4405b18e9e2a6f024def3f3f..59f4db829e91be6b745acd0f7cccc525d8ef60b0 100644 (file)
@@ -278,7 +278,9 @@ static struct platform_device ceu1_device = {
 /* FSI */
 /* change J20, J21, J22 pin to 1-2 connection to use slave mode */
 static struct sh_fsi_platform_info fsi_info = {
-       .porta_flags = SH_FSI_BRS_INV,
+       .port_a = {
+               .flags = SH_FSI_BRS_INV,
+       },
 };
 
 static struct resource fsi_resources[] = {
index 1a02b7537c8bbac9d59d21ee51c1361dd03c01c0..d141b80479b5257d9fff00b9be47e47029e0f163 100644 (file)
@@ -75,6 +75,9 @@ struct regmap {
        const void *reg_defaults_raw;
        void *cache;
        bool cache_dirty;
+
+       struct reg_default *patch;
+       int patch_regs;
 };
 
 struct regcache_ops {
index d1daa5e9fadf322b4a6e4d9e7f5d60e71eea0e40..5cd2a37e7688a3d7fec59d9a9a6d9f181107a6d3 100644 (file)
@@ -268,6 +268,17 @@ int regcache_sync(struct regmap *map)
                map->cache_ops->name);
        name = map->cache_ops->name;
        trace_regcache_sync(map->dev, name, "start");
+
+       /* Apply any patch first */
+       for (i = 0; i < map->patch_regs; i++) {
+               ret = _regmap_write(map, map->patch[i].reg, map->patch[i].def);
+               if (ret != 0) {
+                       dev_err(map->dev, "Failed to write %x = %x: %d\n",
+                               map->patch[i].reg, map->patch[i].def, ret);
+                       goto out;
+               }
+       }
+
        if (!map->cache_dirty)
                goto out;
        if (map->cache_ops->sync) {
index 65558034318f3f295abde2fe7a599c4971e7d7ec..7ac234f0b1c59a1db2e5e76772d5d934545c32c7 100644 (file)
@@ -672,6 +672,79 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg,
 }
 EXPORT_SYMBOL_GPL(regmap_update_bits_check);
 
+/**
+ * regmap_register_patch: Register and apply register updates to be applied
+ *                        on device initialistion
+ *
+ * @map: Register map to apply updates to.
+ * @regs: Values to update.
+ * @num_regs: Number of entries in regs.
+ *
+ * Register a set of register updates to be applied to the device
+ * whenever the device registers are synchronised with the cache and
+ * apply them immediately.  Typically this is used to apply
+ * corrections to be applied to the device defaults on startup, such
+ * as the updates some vendors provide to undocumented registers.
+ */
+int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
+                         int num_regs)
+{
+       int i, ret;
+       bool bypass;
+
+       /* If needed the implementation can be extended to support this */
+       if (map->patch)
+               return -EBUSY;
+
+       mutex_lock(&map->lock);
+
+       bypass = map->cache_bypass;
+
+       map->cache_bypass = true;
+
+       /* Write out first; it's useful to apply even if we fail later. */
+       for (i = 0; i < num_regs; i++) {
+               ret = _regmap_write(map, regs[i].reg, regs[i].def);
+               if (ret != 0) {
+                       dev_err(map->dev, "Failed to write %x = %x: %d\n",
+                               regs[i].reg, regs[i].def, ret);
+                       goto out;
+               }
+       }
+
+       map->patch = kcalloc(sizeof(struct reg_default), num_regs, GFP_KERNEL);
+       if (map->patch != NULL) {
+               memcpy(map->patch, regs,
+                      num_regs * sizeof(struct reg_default));
+               map->patch_regs = num_regs;
+       } else {
+               ret = -ENOMEM;
+       }
+
+out:
+       map->cache_bypass = bypass;
+
+       mutex_unlock(&map->lock);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(regmap_register_patch);
+
+/*
+ * regmap_get_val_bytes(): Report the size of a register value
+ *
+ * Report the size of a register value, mainly intended to for use by
+ * generic infrastructure built on top of regmap.
+ */
+int regmap_get_val_bytes(struct regmap *map)
+{
+       if (map->format.format_write)
+               return -EINVAL;
+
+       return map->format.val_bytes;
+}
+EXPORT_SYMBOL_GPL(regmap_get_val_bytes);
+
 static int __init regmap_initcall(void)
 {
        regmap_debugfs_initcall();
index 3fb1f407d5e6e36cf0c9cff31d222bff0258b91f..dc3e050116898457e410b4cbc0c14f2cb6c81171 100644 (file)
@@ -185,6 +185,9 @@ struct wm8994_pdata {
         unsigned int jd_scthr:2;
         unsigned int jd_thr:2;
 
+       /* Configure WM1811 jack detection for use with external capacitor */
+       unsigned int jd_ext_cap:1;
+
        /* WM8958 microphone bias configuration */
        int micbias[2];
 
diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h
new file mode 100644 (file)
index 0000000..5d298ac
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+ * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Author: Peter Ujfalusi <peter.ujfalusi@ti.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.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _OMAP_ABE_TWL6040_H_
+#define _OMAP_ABE_TWL6040_H_
+
+/* To select if only one channel is connected in a stereo port */
+#define ABE_TWL6040_LEFT       (1 << 0)
+#define ABE_TWL6040_RIGHT      (1 << 1)
+
+struct omap_abe_twl6040_data {
+       char *card_name;
+       /* Feature flags for connected audio pins */
+       u8      has_hs;
+       u8      has_hf;
+       bool    has_ep;
+       u8      has_aux;
+       u8      has_vibra;
+       bool    has_dmic;
+       bool    has_hsmic;
+       bool    has_mainmic;
+       bool    has_submic;
+       u8      has_afm;
+       /* Other features */
+       bool    jack_detection; /* board can detect jack events */
+       int     mclk_freq;      /* MCLK frequency speed for twl6040 */
+};
+
+#endif /* _OMAP_ABE_TWL6040_H_ */
index eb93921cdd30252b1c960cf6872585e308c9e9fc..c47898d47c8a8993b27ccea60e57ac9e8def71c3 100644 (file)
@@ -143,12 +143,16 @@ int regmap_update_bits(struct regmap *map, unsigned int reg,
 int regmap_update_bits_check(struct regmap *map, unsigned int reg,
                             unsigned int mask, unsigned int val,
                             bool *change);
+int regmap_get_val_bytes(struct regmap *map);
 
 int regcache_sync(struct regmap *map);
 void regcache_cache_only(struct regmap *map, bool enable);
 void regcache_cache_bypass(struct regmap *map, bool enable);
 void regcache_mark_dirty(struct regmap *map);
 
+int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
+                         int num_regs);
+
 /**
  * Description of an IRQ for the generic regmap irq_chip.
  *
index b2796e83c7acf3d1b4dd5bfacd76966a4c3eff4e..8332e865c7592c6a3eb48406bc319195c3efd193 100644 (file)
@@ -40,7 +40,7 @@ struct snd_kcontrol_new {
        snd_ctl_elem_iface_t iface;     /* interface identifier */
        unsigned int device;            /* device/client number */
        unsigned int subdevice;         /* subdevice (substream) number */
-       unsigned char *name;            /* ASCII name of item */
+       const unsigned char *name;      /* ASCII name of item */
        unsigned int index;             /* index of item */
        unsigned int access;            /* access rights */
        unsigned int count;             /* count of same elements */
@@ -227,6 +227,11 @@ snd_ctl_add_slave_uncached(struct snd_kcontrol *master,
        return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE);
 }
 
+int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kctl,
+                            void (*hook)(void *private_data, int),
+                            void *private_data);
+void snd_ctl_sync_vmaster_hook(struct snd_kcontrol *kctl);
+
 /*
  * Helper functions for jack-detection controls
  */
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
new file mode 100644 (file)
index 0000000..a8fcaa6
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  Copyright (C) 2012, Analog Devices Inc.
+ *     Author: Lars-Peter Clausen <lars@metafoo.de>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under  the terms of the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the License, or (at your
+ *  option) any later version.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+#ifndef __SOUND_DMAENGINE_PCM_H__
+#define __SOUND_DMAENGINE_PCM_H__
+
+#include <sound/pcm.h>
+#include <linux/dmaengine.h>
+
+/**
+ * snd_pcm_substream_to_dma_direction - Get dma_transfer_direction for a PCM
+ *   substream
+ * @substream: PCM substream
+ */
+static inline enum dma_transfer_direction
+snd_pcm_substream_to_dma_direction(const struct snd_pcm_substream *substream)
+{
+       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+               return DMA_MEM_TO_DEV;
+       else
+               return DMA_DEV_TO_MEM;
+}
+
+void snd_dmaengine_pcm_set_data(struct snd_pcm_substream *substream, void *data);
+void *snd_dmaengine_pcm_get_data(struct snd_pcm_substream *substream);
+
+int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream,
+       const struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config);
+int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
+snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream);
+
+int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
+       dma_filter_fn filter_fn, void *filter_data);
+int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
+
+struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream);
+
+#endif
index 63c790742db47be586cd995cda581bfae9c33b80..58916573db582eab1d19a6d751ebe516c194b834 100644 (file)
@@ -53,6 +53,9 @@ enum snd_jack_types {
        SND_JACK_BTN_5          = 0x0200,
 };
 
+/* Keep in sync with definitions above */
+#define SND_JACK_SWITCH_TYPES 6
+
 struct snd_jack {
        struct input_dev *input_dev;
        int registered;
diff --git a/include/sound/max9768.h b/include/sound/max9768.h
new file mode 100644 (file)
index 0000000..0f78b41
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Platform data for MAX9768
+ * Copyright (C) 2011, 2012 by Wolfram Sang, Pengutronix e.K.
+ * same licence as the driver
+ */
+
+#ifndef __SOUND_MAX9768_PDATA_H__
+#define __SOUND_MAX9768_PDATA_H__
+
+/**
+ * struct max9768_pdata - optional platform specific MAX9768 configuration
+ * @shdn_gpio: GPIO to SHDN pin. If not valid, pin must be hardwired HIGH
+ * @mute_gpio: GPIO to MUTE pin. If not valid, control for mute won't be added
+ * @flags: configuration flags, e.g. set classic PWM mode (check datasheet
+ *         regarding "filterless modulation" which is default).
+ */
+struct max9768_pdata {
+       int shdn_gpio;
+       int mute_gpio;
+       unsigned flags;
+#define MAX9768_FLAG_CLASSIC_PWM       (1 << 0)
+};
+
+#endif /* __SOUND_MAX9768_PDATA_H__*/
index 0cf91b2f08caaf4f9a8a70cee07a25cacc108986..0d1112815be3be6ea96a5ec1768382bb70aea571 100644 (file)
@@ -264,7 +264,7 @@ struct snd_pcm_hw_constraint_ratdens {
 
 struct snd_pcm_hw_constraint_list {
        unsigned int count;
-       unsigned int *list;
+       const unsigned int *list;
        unsigned int mask;
 };
 
@@ -454,6 +454,7 @@ struct snd_pcm {
        void *private_data;
        void (*private_free) (struct snd_pcm *pcm);
        struct device *dev; /* actual hw device this belongs to */
+       bool internal; /* pcm is for internal use only */
 #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
        struct snd_pcm_oss oss;
 #endif
@@ -475,6 +476,9 @@ extern const struct file_operations snd_pcm_f_ops[2];
 int snd_pcm_new(struct snd_card *card, const char *id, int device,
                int playback_count, int capture_count,
                struct snd_pcm **rpcm);
+int snd_pcm_new_internal(struct snd_card *card, const char *id, int device,
+               int playback_count, int capture_count,
+               struct snd_pcm **rpcm);
 int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count);
 
 int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree);
@@ -781,7 +785,8 @@ void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interva
                          unsigned int k, struct snd_interval *c);
 void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
                          const struct snd_interval *b, struct snd_interval *c);
-int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask);
+int snd_interval_list(struct snd_interval *i, unsigned int count,
+                     const unsigned int *list, unsigned int mask);
 int snd_interval_ratnum(struct snd_interval *i,
                        unsigned int rats_count, struct snd_ratnum *rats,
                        unsigned int *nump, unsigned int *denp);
index 9b1aacaa82fedd0fcb63365fae33237627c496c9..b457e87fbd0849efd51fd22445cb76606c8f6d70 100644 (file)
 #define SH_FSI_BPFMD_32                (5 << 4)
 #define SH_FSI_BPFMD_16                (6 << 4)
 
+struct sh_fsi_port_info {
+       unsigned long flags;
+       int tx_id;
+       int rx_id;
+       int (*set_rate)(struct device *dev, int rate, int enable);
+};
+
 struct sh_fsi_platform_info {
-       unsigned long porta_flags;
-       unsigned long portb_flags;
-       int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
+       struct sh_fsi_port_info port_a;
+       struct sh_fsi_port_info port_b;
 };
 
 /*
index 2413acc54883aad471cf0256b3fc2f8fc6d7ae11..c429f248cf4e995a6a8aa20eaa1ec8af71ddfe74 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/list.h>
 
 struct snd_pcm_substream;
+struct snd_soc_dapm_widget;
 
 /*
  * DAI hardware audio formats.
@@ -238,6 +239,9 @@ struct snd_soc_dai {
        unsigned char pop_wait:1;
        unsigned char probed:1;
 
+       struct snd_soc_dapm_widget *playback_widget;
+       struct snd_soc_dapm_widget *capture_widget;
+
        /* DAI DMA data */
        void *playback_dma_data;
        void *capture_dma_data;
@@ -246,10 +250,9 @@ struct snd_soc_dai {
        unsigned int rate;
 
        /* parent platform/codec */
-       union {
-               struct snd_soc_platform *platform;
-               struct snd_soc_codec *codec;
-       };
+       struct snd_soc_platform *platform;
+       struct snd_soc_codec *codec;
+
        struct snd_soc_card *card;
 
        struct list_head list;
index d26a9b784772d797e88a529f199342f277e32390..e46107fffeb48b8c5832eea797bb7ec2b69c92a0 100644 (file)
 {      .id = snd_soc_dapm_supply, .name = wname, .reg = wreg,  \
        .shift = wshift, .invert = winvert, .event = wevent, \
        .event_flags = wflags}
+#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay) \
+{      .id = snd_soc_dapm_regulator_supply, .name = wname, \
+       .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \
+       .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD }
 
 /* dapm kcontrol types */
 #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \
@@ -322,6 +326,8 @@ struct snd_soc_dapm_context;
 
 int dapm_reg_event(struct snd_soc_dapm_widget *w,
                   struct snd_kcontrol *kcontrol, int event);
+int dapm_regulator_event(struct snd_soc_dapm_widget *w,
+                        struct snd_kcontrol *kcontrol, int event);
 
 /* dapm controls */
 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
@@ -346,11 +352,12 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *uncontrol);
 int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *uncontrol);
-int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
-       const struct snd_soc_dapm_widget *widget);
 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
        const struct snd_soc_dapm_widget *widget,
        int num);
+int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
+                                struct snd_soc_dai *dai);
+int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
 
 /* dapm path setup */
 int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
@@ -361,10 +368,16 @@ int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
                             const struct snd_soc_dapm_route *route, int num);
 
 /* dapm events */
-int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
-       const char *stream, int event);
+int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
+                             struct snd_soc_dai *dai, int event);
 void snd_soc_dapm_shutdown(struct snd_soc_card *card);
 
+/* external DAPM widget events */
+int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
+               struct snd_kcontrol *kcontrol, int connect);
+int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
+                                struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e);
+
 /* dapm sys fs - used by the core */
 int snd_soc_dapm_sys_add(struct device *dev);
 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
@@ -411,9 +424,11 @@ enum snd_soc_dapm_type {
        snd_soc_dapm_pre,                       /* machine specific pre widget - exec first */
        snd_soc_dapm_post,                      /* machine specific post widget - exec last */
        snd_soc_dapm_supply,            /* power/clock supply */
+       snd_soc_dapm_regulator_supply,  /* external regulator */
        snd_soc_dapm_aif_in,            /* audio interface input */
        snd_soc_dapm_aif_out,           /* audio interface output */
        snd_soc_dapm_siggen,            /* signal generator */
+       snd_soc_dapm_dai,               /* link to DAI structure */
 };
 
 /*
@@ -434,8 +449,8 @@ struct snd_soc_dapm_route {
 
 /* dapm audio path between two widgets */
 struct snd_soc_dapm_path {
-       char *name;
-       char *long_name;
+       const char *name;
+       const char *long_name;
 
        /* source (input) and sink (output) widgets */
        struct snd_soc_dapm_widget *source;
@@ -458,13 +473,15 @@ struct snd_soc_dapm_path {
 /* dapm widget */
 struct snd_soc_dapm_widget {
        enum snd_soc_dapm_type id;
-       char *name;             /* widget name */
-       char *sname;    /* stream name */
+       const char *name;               /* widget name */
+       const char *sname;      /* stream name */
        struct snd_soc_codec *codec;
        struct snd_soc_platform *platform;
        struct list_head list;
        struct snd_soc_dapm_context *dapm;
 
+       void *priv;                             /* widget specific data */
+
        /* dapm control */
        short reg;                                              /* negative reg = no direct dapm */
        unsigned char shift;                    /* bits to shift */
index 0992dff559593d7015fcef0e5a58dd42134539d6..2ebf7877c148ae717727269a1bb91cab8124b2e9 100644 (file)
                 .rreg = xreg_right, .shift = xshift, \
                 .min = xmin, .max = xmax} }
 
+#define SND_SOC_BYTES(xname, xbase, xregs)                   \
+{      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,   \
+       .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
+       .put = snd_soc_bytes_put, .private_value =            \
+               ((unsigned long)&(struct soc_bytes)           \
+               {.base = xbase, .num_regs = xregs }) }
+
+#define SND_SOC_BYTES_MASK(xname, xbase, xregs, xmask)       \
+{      .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,   \
+       .info = snd_soc_bytes_info, .get = snd_soc_bytes_get, \
+       .put = snd_soc_bytes_put, .private_value =            \
+               ((unsigned long)&(struct soc_bytes)           \
+               {.base = xbase, .num_regs = xregs,            \
+                .mask = xmask }) }
 
 /*
  * Simplified versions of above macros, declaring a struct and calculating
@@ -366,12 +380,16 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
  *Controls
  */
 struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
-                                 void *data, char *long_name,
+                                 void *data, const char *long_name,
                                  const char *prefix);
-int snd_soc_add_controls(struct snd_soc_codec *codec,
+int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
        const struct snd_kcontrol_new *controls, int num_controls);
 int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
        const struct snd_kcontrol_new *controls, int num_controls);
+int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
+       const struct snd_kcontrol_new *controls, int num_controls);
+int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
+       const struct snd_kcontrol_new *controls, int num_controls);
 int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_info *uinfo);
 int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
@@ -409,6 +427,13 @@ int snd_soc_get_volsw_2r_sx(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol);
 int snd_soc_put_volsw_2r_sx(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol);
+int snd_soc_bytes_info(struct snd_kcontrol *kcontrol,
+                      struct snd_ctl_elem_info *uinfo);
+int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
+                     struct snd_ctl_elem_value *ucontrol);
+int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
+                     struct snd_ctl_elem_value *ucontrol);
+
 
 /**
  * struct snd_soc_reg_access - Describes whether a given register is
@@ -505,6 +530,7 @@ struct snd_soc_pcm_stream {
        unsigned int rate_max;          /* max rate */
        unsigned int channels_min;      /* min channels */
        unsigned int channels_max;      /* max channels */
+       unsigned int sig_bits;          /* number of bits of content */
 };
 
 /* SoC audio ops */
@@ -559,6 +585,7 @@ struct snd_soc_codec {
        unsigned int ac97_created:1; /* Codec has been created by SoC */
        unsigned int sysfs_registered:1; /* codec has been sysfs registered */
        unsigned int cache_init:1; /* codec cache has been initialized */
+       unsigned int using_regmap:1; /* using regmap access */
        u32 cache_only;  /* Suppress writes to hardware */
        u32 cache_sync; /* Cache needs to be synced to hardware */
 
@@ -637,6 +664,8 @@ struct snd_soc_codec_driver {
        /* codec stream completion event */
        int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
 
+       bool ignore_pmdown_time;  /* Doesn't benefit from pmdown delay */
+
        /* probe ordering - for components with runtime dependencies */
        int probe_order;
        int remove_order;
@@ -689,6 +718,7 @@ struct snd_soc_platform {
        int id;
        struct device *dev;
        struct snd_soc_platform_driver *driver;
+       struct mutex mutex;
 
        unsigned int suspended:1; /* platform is suspended */
        unsigned int probed:1;
@@ -698,6 +728,11 @@ struct snd_soc_platform {
        struct list_head card_list;
 
        struct snd_soc_dapm_context dapm;
+
+#ifdef CONFIG_DEBUG_FS
+       struct dentry *debugfs_platform_root;
+       struct dentry *debugfs_dapm;
+#endif
 };
 
 struct snd_soc_dai_link {
@@ -875,6 +910,12 @@ struct soc_mixer_control {
        unsigned int reg, rreg, shift, rshift, invert;
 };
 
+struct soc_bytes {
+       int base;
+       int num_regs;
+       u32 mask;
+};
+
 /* enumerated kcontrol */
 struct soc_enum {
        unsigned short reg;
index 8fc5321e1ecc739fa7bd0cdb30c7e63ac0fc1e43..cc75024c10895c651d8771f525517080de16de70 100644 (file)
@@ -1,3 +1,3 @@
 /* include/version.h */
-#define CONFIG_SND_VERSION "1.0.24"
+#define CONFIG_SND_VERSION "1.0.25"
 #define CONFIG_SND_DATE ""
diff --git a/include/sound/wm2200.h b/include/sound/wm2200.h
new file mode 100644 (file)
index 0000000..79bf55b
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * linux/sound/wm2200.h -- Platform data for WM2200
+ *
+ * Copyright 2012 Wolfson Microelectronics. PLC.
+ *
+ * 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_WM2200_H
+#define __LINUX_SND_WM2200_H
+
+#define WM2200_GPIO_SET 0x10000
+
+enum wm2200_in_mode {
+       WM2200_IN_SE = 0,
+       WM2200_IN_DIFF = 1,
+       WM2200_IN_DMIC = 2,
+};
+
+enum wm2200_dmic_sup {
+       WM2200_DMIC_SUP_MICVDD = 0,
+       WM2200_DMIC_SUP_MICBIAS1 = 1,
+       WM2200_DMIC_SUP_MICBIAS2 = 2,
+};
+
+struct wm2200_pdata {
+       int reset;      /** GPIO controlling /RESET, if any */
+       int ldo_ena;    /** GPIO controlling LODENA, if any */
+       int irq_flags;
+
+       int gpio_defaults[4];
+
+       enum wm2200_in_mode in_mode[3];
+       enum wm2200_dmic_sup dmic_sup[3];
+
+       int micbias_cfg[2];  /** Register value to configure MICBIAS */
+};
+
+#endif
index 1750bed7c2f6ed66d92152c089e810e0332b1251..79e6d427b8582b3f9460c25b5fc4fe4bcc086580 100644 (file)
@@ -49,6 +49,12 @@ struct wm8962_pdata {
        bool irq_active_low;
 
        bool spk_mono;   /* Speaker outputs tied together as mono */
+
+       /**
+        * This flag should be set if one or both IN4 inputs is wired
+        * in a DC measurement configuration.
+        */
+       bool in4_dc_measure;
 };
 
 #endif
index 444cd6ba0ba70645c8652089d39250e58d30f8cf..41199664666bb4a96d98b5336f6433b333ef12db 100644 (file)
@@ -366,6 +366,8 @@ struct snd_ymfpci {
 #ifdef CONFIG_PM
        u32 *saved_regs;
        u32 saved_ydsxgr_mode;
+       u16 saved_dsxg_legacy;
+       u16 saved_dsxg_elegacy;
 #endif
 };
 
index 762af68c8996fbb83a822638f76f2c29a7d63f9a..270790d384e20f06a38f369cf5aa9c980aac4ed6 100644 (file)
@@ -1132,15 +1132,4 @@ static struct i2c_driver onyx_driver = {
        .id_table = onyx_i2c_id,
 };
 
-static int __init onyx_init(void)
-{
-       return i2c_add_driver(&onyx_driver);
-}
-
-static void __exit onyx_exit(void)
-{
-       i2c_del_driver(&onyx_driver);
-}
-
-module_init(onyx_init);
-module_exit(onyx_exit);
+module_i2c_driver(onyx_driver);
index fd2188c3df2b4c436c9a6112cbc577c309d2898e..8e63d1f35ce1228cc1f6abb76cb39e1d421ea43a 100644 (file)
@@ -1026,15 +1026,4 @@ static struct i2c_driver tas_driver = {
        .id_table = tas_i2c_id,
 };
 
-static int __init tas_init(void)
-{
-       return i2c_add_driver(&tas_driver);
-}
-
-static void __exit tas_exit(void)
-{
-       i2c_del_driver(&tas_driver);
-}
-
-module_init(tas_init);
-module_exit(tas_exit);
+module_i2c_driver(tas_driver);
index 819a5c579a3975f129b2b35e67be0ad12d2780bd..2487a6bb1c545a3338aa19fbd244c952724f1058 100644 (file)
@@ -1313,7 +1313,7 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,
                        err = -EPERM;
                        goto __kctl_end;
                }
-               err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv); 
+               err = kctl->tlv.c(kctl, op_flag, tlv.length, _tlv->tlv);
                if (err > 0) {
                        up_read(&card->controls_rwsem);
                        snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_TLV, &kctl->id);
index 3ac49b1b7cb82ac4c6c6632691efb9d3178cb09e..068cf08d3ffb82360e3e6ee4c24b78be3abde545 100644 (file)
@@ -480,74 +480,104 @@ int snd_card_free(struct snd_card *card)
 
 EXPORT_SYMBOL(snd_card_free);
 
-static void snd_card_set_id_no_lock(struct snd_card *card, const char *nid)
+/* retrieve the last word of shortname or longname */
+static const char *retrieve_id_from_card_name(const char *name)
 {
-       int i, len, idx_flag = 0, loops = SNDRV_CARDS;
-       const char *spos, *src;
-       char *id;
-       
-       if (nid == NULL) {
-               id = card->shortname;
-               spos = src = id;
-               while (*id != '\0') {
-                       if (*id == ' ')
-                               spos = id + 1;
-                       id++;
-               }
-       } else {
-               spos = src = nid;
+       const char *spos = name;
+
+       while (*name) {
+               if (isspace(*name) && isalnum(name[1]))
+                       spos = name + 1;
+               name++;
        }
-       id = card->id;
-       while (*spos != '\0' && !isalnum(*spos))
-               spos++;
-       if (isdigit(*spos))
-               *id++ = isalpha(src[0]) ? src[0] : 'D';
-       while (*spos != '\0' && (size_t)(id - card->id) < sizeof(card->id) - 1) {
-               if (isalnum(*spos))
-                       *id++ = *spos;
-               spos++;
+       return spos;
+}
+
+/* return true if the given id string doesn't conflict any other card ids */
+static bool card_id_ok(struct snd_card *card, const char *id)
+{
+       int i;
+       if (!snd_info_check_reserved_words(id))
+               return false;
+       for (i = 0; i < snd_ecards_limit; i++) {
+               if (snd_cards[i] && snd_cards[i] != card &&
+                   !strcmp(snd_cards[i]->id, id))
+                       return false;
        }
-       *id = '\0';
+       return true;
+}
 
-       id = card->id;
+/* copy to card->id only with valid letters from nid */
+static void copy_valid_id_string(struct snd_card *card, const char *src,
+                                const char *nid)
+{
+       char *id = card->id;
+
+       while (*nid && !isalnum(*nid))
+               nid++;
+       if (isdigit(*nid))
+               *id++ = isalpha(*src) ? *src : 'D';
+       while (*nid && (size_t)(id - card->id) < sizeof(card->id) - 1) {
+               if (isalnum(*nid))
+                       *id++ = *nid;
+               nid++;
+       }
+       *id = 0;
+}
+
+/* Set card->id from the given string
+ * If the string conflicts with other ids, add a suffix to make it unique.
+ */
+static void snd_card_set_id_no_lock(struct snd_card *card, const char *src,
+                                   const char *nid)
+{
+       int len, loops;
+       bool with_suffix;
+       bool is_default = false;
+       char *id;
        
-       if (*id == '\0')
+       copy_valid_id_string(card, src, nid);
+       id = card->id;
+
+ again:
+       /* use "Default" for obviously invalid strings
+        * ("card" conflicts with proc directories)
+        */
+       if (!*id || !strncmp(id, "card", 4)) {
                strcpy(id, "Default");
+               is_default = true;
+       }
 
-       while (1) {
-               if (loops-- == 0) {
-                       snd_printk(KERN_ERR "unable to set card id (%s)\n", id);
-                       strcpy(card->id, card->proc_root->name);
-                       return;
-               }
-               if (!snd_info_check_reserved_words(id))
-                       goto __change;
-               for (i = 0; i < snd_ecards_limit; i++) {
-                       if (snd_cards[i] && !strcmp(snd_cards[i]->id, id))
-                               goto __change;
-               }
-               break;
+       with_suffix = false;
+       for (loops = 0; loops < SNDRV_CARDS; loops++) {
+               if (card_id_ok(card, id))
+                       return; /* OK */
 
-             __change:
                len = strlen(id);
-               if (idx_flag) {
-                       if (id[len-1] != '9')
-                               id[len-1]++;
-                       else
-                               id[len-1] = 'A';
-               } else if ((size_t)len <= sizeof(card->id) - 3) {
-                       strcat(id, "_1");
-                       idx_flag++;
+               if (!with_suffix) {
+                       /* add the "_X" suffix */
+                       char *spos = id + len;
+                       if (len >  sizeof(card->id) - 3)
+                               spos = id + sizeof(card->id) - 3;
+                       strcpy(spos, "_1");
+                       with_suffix = true;
                } else {
-                       spos = id + len - 2;
-                       if ((size_t)len <= sizeof(card->id) - 2)
-                               spos++;
-                       *(char *)spos++ = '_';
-                       *(char *)spos++ = '1';
-                       *(char *)spos++ = '\0';
-                       idx_flag++;
+                       /* modify the existing suffix */
+                       if (id[len - 1] != '9')
+                               id[len - 1]++;
+                       else
+                               id[len - 1] = 'A';
                }
        }
+       /* fallback to the default id */
+       if (!is_default) {
+               *id = 0;
+               goto again;
+       }
+       /* last resort... */
+       snd_printk(KERN_ERR "unable to set card id (%s)\n", id);
+       if (card->proc_root->name)
+               strcpy(card->id, card->proc_root->name);
 }
 
 /**
@@ -564,7 +594,7 @@ void snd_card_set_id(struct snd_card *card, const char *nid)
        if (card->id[0] != '\0')
                return;
        mutex_lock(&snd_card_mutex);
-       snd_card_set_id_no_lock(card, nid);
+       snd_card_set_id_no_lock(card, nid, nid);
        mutex_unlock(&snd_card_mutex);
 }
 EXPORT_SYMBOL(snd_card_set_id);
@@ -596,22 +626,12 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr,
        memcpy(buf1, buf, copy);
        buf1[copy] = '\0';
        mutex_lock(&snd_card_mutex);
-       if (!snd_info_check_reserved_words(buf1)) {
-            __exist:
+       if (!card_id_ok(NULL, buf1)) {
                mutex_unlock(&snd_card_mutex);
                return -EEXIST;
        }
-       for (idx = 0; idx < snd_ecards_limit; idx++) {
-               if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) {
-                       if (card == snd_cards[idx])
-                               goto __ok;
-                       else
-                               goto __exist;
-               }
-       }
        strcpy(card->id, buf1);
        snd_info_card_id_change(card);
-__ok:
        mutex_unlock(&snd_card_mutex);
 
        return count;
@@ -665,7 +685,18 @@ int snd_card_register(struct snd_card *card)
                mutex_unlock(&snd_card_mutex);
                return 0;
        }
-       snd_card_set_id_no_lock(card, card->id[0] == '\0' ? NULL : card->id);
+       if (*card->id) {
+               /* make a unique id name from the given string */
+               char tmpid[sizeof(card->id)];
+               memcpy(tmpid, card->id, sizeof(card->id));
+               snd_card_set_id_no_lock(card, tmpid, tmpid);
+       } else {
+               /* create an id from either shortname or longname */
+               const char *src;
+               src = *card->shortname ? card->shortname : card->longname;
+               snd_card_set_id_no_lock(card, src,
+                                       retrieve_id_from_card_name(src));
+       }
        snd_cards[card->number] = card;
        mutex_unlock(&snd_card_mutex);
        init_info_for_card(card);
index 26edf63b265f439ba7bf5636ffa0c0928cac8db7..471e1e3b0a996da3fec0d21c82a55b87f3460469 100644 (file)
@@ -25,7 +25,7 @@
 #include <sound/jack.h>
 #include <sound/core.h>
 
-static int jack_switch_types[] = {
+static int jack_switch_types[SND_JACK_SWITCH_TYPES] = {
        SW_HEADPHONE_INSERT,
        SW_MICROPHONE_INSERT,
        SW_LINEOUT_INSERT,
@@ -128,7 +128,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
 
        jack->type = type;
 
-       for (i = 0; i < ARRAY_SIZE(jack_switch_types); i++)
+       for (i = 0; i < SND_JACK_SWITCH_TYPES; i++)
                if (type & (1 << i))
                        input_set_capability(jack->input_dev, EV_SW,
                                             jack_switch_types[i]);
index 465f0ce772cb594dabe34e3d835c5766ec6d873b..768167925409ecb9be45b3c2ac82c885685da9bc 100644 (file)
@@ -72,7 +72,7 @@ void __snd_printk(unsigned int level, const char *path, int line,
        char verbose_fmt[] = KERN_DEFAULT "ALSA %s:%d %pV";
 #endif
 
-#ifdef CONFIG_SND_DEBUG        
+#ifdef CONFIG_SND_DEBUG
        if (debug < level)
                return;
 #endif
index 8928ca871c223f17da58f086a75e3b52d1edcf11..6e4bfcc14254cda1c38eb294b9cfce564de76ada 100644 (file)
@@ -650,7 +650,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
        pstr->stream = stream;
        pstr->pcm = pcm;
        pstr->substream_count = substream_count;
-       if (substream_count > 0) {
+       if (substream_count > 0 && !pcm->internal) {
                err = snd_pcm_stream_proc_init(pstr);
                if (err < 0) {
                        snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n");
@@ -674,15 +674,18 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
                        pstr->substream = substream;
                else
                        prev->next = substream;
-               err = snd_pcm_substream_proc_init(substream);
-               if (err < 0) {
-                       snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n");
-                       if (prev == NULL)
-                               pstr->substream = NULL;
-                       else
-                               prev->next = NULL;
-                       kfree(substream);
-                       return err;
+
+               if (!pcm->internal) {
+                       err = snd_pcm_substream_proc_init(substream);
+                       if (err < 0) {
+                               snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n");
+                               if (prev == NULL)
+                                       pstr->substream = NULL;
+                               else
+                                       prev->next = NULL;
+                               kfree(substream);
+                               return err;
+                       }
                }
                substream->group = &substream->self_group;
                spin_lock_init(&substream->self_group.lock);
@@ -696,25 +699,9 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
 
 EXPORT_SYMBOL(snd_pcm_new_stream);
 
-/**
- * snd_pcm_new - create a new PCM instance
- * @card: the card instance
- * @id: the id string
- * @device: the device index (zero based)
- * @playback_count: the number of substreams for playback
- * @capture_count: the number of substreams for capture
- * @rpcm: the pointer to store the new pcm instance
- *
- * Creates a new PCM instance.
- *
- * The pcm operators have to be set afterwards to the new instance
- * via snd_pcm_set_ops().
- *
- * Returns zero if successful, or a negative error code on failure.
- */
-int snd_pcm_new(struct snd_card *card, const char *id, int device,
-               int playback_count, int capture_count,
-               struct snd_pcm ** rpcm)
+static int _snd_pcm_new(struct snd_card *card, const char *id, int device,
+               int playback_count, int capture_count, bool internal,
+               struct snd_pcm **rpcm)
 {
        struct snd_pcm *pcm;
        int err;
@@ -735,6 +722,7 @@ int snd_pcm_new(struct snd_card *card, const char *id, int device,
        }
        pcm->card = card;
        pcm->device = device;
+       pcm->internal = internal;
        if (id)
                strlcpy(pcm->id, id, sizeof(pcm->id));
        if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) {
@@ -756,8 +744,59 @@ int snd_pcm_new(struct snd_card *card, const char *id, int device,
        return 0;
 }
 
+/**
+ * snd_pcm_new - create a new PCM instance
+ * @card: the card instance
+ * @id: the id string
+ * @device: the device index (zero based)
+ * @playback_count: the number of substreams for playback
+ * @capture_count: the number of substreams for capture
+ * @rpcm: the pointer to store the new pcm instance
+ *
+ * Creates a new PCM instance.
+ *
+ * The pcm operators have to be set afterwards to the new instance
+ * via snd_pcm_set_ops().
+ *
+ * Returns zero if successful, or a negative error code on failure.
+ */
+int snd_pcm_new(struct snd_card *card, const char *id, int device,
+               int playback_count, int capture_count, struct snd_pcm **rpcm)
+{
+       return _snd_pcm_new(card, id, device, playback_count, capture_count,
+                       false, rpcm);
+}
 EXPORT_SYMBOL(snd_pcm_new);
 
+/**
+ * snd_pcm_new_internal - create a new internal PCM instance
+ * @card: the card instance
+ * @id: the id string
+ * @device: the device index (zero based - shared with normal PCMs)
+ * @playback_count: the number of substreams for playback
+ * @capture_count: the number of substreams for capture
+ * @rpcm: the pointer to store the new pcm instance
+ *
+ * Creates a new internal PCM instance with no userspace device or procfs
+ * entries. This is used by ASoC Back End PCMs in order to create a PCM that
+ * will only be used internally by kernel drivers. i.e. it cannot be opened
+ * by userspace. It provides existing ASoC components drivers with a substream
+ * and access to any private data.
+ *
+ * The pcm operators have to be set afterwards to the new instance
+ * via snd_pcm_set_ops().
+ *
+ * Returns zero if successful, or a negative error code on failure.
+ */
+int snd_pcm_new_internal(struct snd_card *card, const char *id, int device,
+       int playback_count, int capture_count,
+       struct snd_pcm **rpcm)
+{
+       return _snd_pcm_new(card, id, device, playback_count, capture_count,
+                       true, rpcm);
+}
+EXPORT_SYMBOL(snd_pcm_new_internal);
+
 static void snd_pcm_free_stream(struct snd_pcm_str * pstr)
 {
        struct snd_pcm_substream *substream, *substream_next;
@@ -994,7 +1033,7 @@ static int snd_pcm_dev_register(struct snd_device *device)
        }
        for (cidx = 0; cidx < 2; cidx++) {
                int devtype = -1;
-               if (pcm->streams[cidx].substream == NULL)
+               if (pcm->streams[cidx].substream == NULL || pcm->internal)
                        continue;
                switch (cidx) {
                case SNDRV_PCM_STREAM_PLAYBACK:
index 3420bd3da5d70ffec570e058d84b20f39aab49b8..4d18941178e6e933cb0f80f969c4d705c4777caf 100644 (file)
@@ -1029,7 +1029,8 @@ static int snd_interval_ratden(struct snd_interval *i,
  *
  * Returns non-zero if the value is changed, zero if not changed.
  */
-int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask)
+int snd_interval_list(struct snd_interval *i, unsigned int count,
+                     const unsigned int *list, unsigned int mask)
 {
         unsigned int k;
        struct snd_interval list_range;
index 25ed9fe41b89ceaf245278438c7113bc89ddc0f3..3fe99e644eb838a34913f8c6870742e67c227a31 100644 (file)
@@ -1586,12 +1586,18 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
        struct file *file;
        struct snd_pcm_file *pcm_file;
        struct snd_pcm_substream *substream1;
+       struct snd_pcm_group *group;
 
        file = snd_pcm_file_fd(fd);
        if (!file)
                return -EBADFD;
        pcm_file = file->private_data;
        substream1 = pcm_file->substream;
+       group = kmalloc(sizeof(*group), GFP_KERNEL);
+       if (!group) {
+               res = -ENOMEM;
+               goto _nolock;
+       }
        down_write(&snd_pcm_link_rwsem);
        write_lock_irq(&snd_pcm_link_rwlock);
        if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN ||
@@ -1604,11 +1610,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
                goto _end;
        }
        if (!snd_pcm_stream_linked(substream)) {
-               substream->group = kmalloc(sizeof(struct snd_pcm_group), GFP_ATOMIC);
-               if (substream->group == NULL) {
-                       res = -ENOMEM;
-                       goto _end;
-               }
+               substream->group = group;
                spin_lock_init(&substream->group->lock);
                INIT_LIST_HEAD(&substream->group->substreams);
                list_add_tail(&substream->link_list, &substream->group->substreams);
@@ -1620,7 +1622,10 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
  _end:
        write_unlock_irq(&snd_pcm_link_rwlock);
        up_write(&snd_pcm_link_rwsem);
+ _nolock:
        fput(file);
+       if (res < 0)
+               kfree(group);
        return res;
 }
 
index 130cfe677d60a1ef8bf996c0a61bc0dea35a9da6..14a286a7bf2b01686e450b2a3bc258df59f24e21 100644 (file)
@@ -37,6 +37,8 @@ struct link_master {
        struct link_ctl_info info;
        int val;                /* the master value */
        unsigned int tlv[4];
+       void (*hook)(void *private_data, int);
+       void *hook_private_data;
 };
 
 /*
@@ -126,7 +128,9 @@ static int master_init(struct link_master *master)
                master->info.count = 1; /* always mono */
                /* set full volume as default (= no attenuation) */
                master->val = master->info.max_val;
-               return 0;
+               if (master->hook)
+                       master->hook(master->hook_private_data, master->val);
+               return 1;
        }
        return -ENOENT;
 }
@@ -329,6 +333,8 @@ static int master_put(struct snd_kcontrol *kcontrol,
                slave_put_val(slave, uval);
        }
        kfree(uval);
+       if (master->hook && !err)
+               master->hook(master->hook_private_data, master->val);
        return 1;
 }
 
@@ -408,3 +414,41 @@ struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
        return kctl;
 }
 EXPORT_SYMBOL(snd_ctl_make_virtual_master);
+
+/**
+ * snd_ctl_add_vmaster_hook - Add a hook to a vmaster control
+ * @kcontrol: vmaster kctl element
+ * @hook: the hook function
+ *
+ * Adds the given hook to the vmaster control element so that it's called
+ * at each time when the value is changed.
+ */
+int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kcontrol,
+                            void (*hook)(void *private_data, int),
+                            void *private_data)
+{
+       struct link_master *master = snd_kcontrol_chip(kcontrol);
+       master->hook = hook;
+       master->hook_private_data = private_data;
+       return 0;
+}
+EXPORT_SYMBOL_GPL(snd_ctl_add_vmaster_hook);
+
+/**
+ * snd_ctl_sync_vmaster_hook - Sync the vmaster hook
+ * @kcontrol: vmaster kctl element
+ *
+ * Call the hook function to synchronize with the current value of the given
+ * vmaster element.  NOP when NULL is passed to @kcontrol or the hook doesn't
+ * exist.
+ */
+void snd_ctl_sync_vmaster_hook(struct snd_kcontrol *kcontrol)
+{
+       struct link_master *master;
+       if (!kcontrol)
+               return;
+       master = snd_kcontrol_chip(kcontrol);
+       if (master->hook)
+               master->hook(master->hook_private_data, master->val);
+}
+EXPORT_SYMBOL_GPL(snd_ctl_sync_vmaster_hook);
index bb938153a964811b41f471f064fbd293fb660e77..466a5c8e8354f2c7eb3b08cda3130405968db759 100644 (file)
@@ -26,7 +26,7 @@
 #include <sound/mpu401.h>
 #include <sound/hwdep.h>
 #include <sound/ac97_codec.h>
-
+#include <sound/tlv.h>
 #endif
 
 #ifndef CHIP_AU8820
 #define NR_WTPB 0x20           /* WT channels per each bank. */
 #define NR_PCM 0x10
 
+struct pcm_vol {
+       struct snd_kcontrol *kctl;
+       int active;
+       int dma;
+       int mixin[4];
+       int vol[4];
+};
+
 /* Structs */
 typedef struct {
        //int this_08;          /* Still unknown */
@@ -168,6 +176,7 @@ struct snd_vortex {
        /* Xtalk canceler */
        int xt_mode;            /* 1: speakers, 0:headphones. */
 #endif
+       struct pcm_vol pcm_vol[NR_PCM];
 
        int isquad;             /* cache of extended ID codec flag. */
 
@@ -239,7 +248,7 @@ static int vortex_alsafmt_aspfmt(int alsafmt);
 /* Connection  stuff. */
 static void vortex_connect_default(vortex_t * vortex, int en);
 static int vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch,
-                                int dir, int type);
+                                int dir, int type, int subdev);
 static char vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out,
                                  int restype);
 #ifndef CHIP_AU8810
index 6933a27a5d76279e1c98b59953200dbd52b84e08..525f881f04096bd25cec390d0a2a26443a93aa0c 100644 (file)
@@ -2050,8 +2050,6 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
 }
 
 /* Default Connections  */
-static int
-vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type);
 
 static void vortex_connect_default(vortex_t * vortex, int en)
 {
@@ -2111,15 +2109,13 @@ static void vortex_connect_default(vortex_t * vortex, int en)
   Return: Return allocated DMA or same DMA passed as "dma" when dma >= 0.
 */
 static int
-vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
+vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
+                       int type, int subdev)
 {
        stream_t *stream;
        int i, en;
+       struct pcm_vol *p;
        
-       if ((nr_ch == 3)
-           || ((dir == SNDRV_PCM_STREAM_CAPTURE) && (nr_ch > 2)))
-               return -EBUSY;
-
        if (dma >= 0) {
                en = 0;
                vortex_adb_checkinout(vortex,
@@ -2250,6 +2246,14 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
                                                              MIX_DEFIGAIN);
 #endif
                        }
+                       if (stream->type == VORTEX_PCM_ADB && en) {
+                               p = &vortex->pcm_vol[subdev];
+                               p->dma = dma;
+                               for (i = 0; i < nr_ch; i++)
+                                       p->mixin[i] = mix[i];
+                               for (i = 0; i < ch_top; i++)
+                                       p->vol[i] = 0;
+                       }
                }
 #ifndef CHIP_AU8820
                else {
@@ -2473,7 +2477,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
                hwread(vortex->mmio, VORTEX_IRQ_STAT);
                handled = 1;
        }
-       if (source & IRQ_MIDI) {
+       if ((source & IRQ_MIDI) && vortex->rmidi) {
                snd_mpu401_uart_interrupt(vortex->irq,
                                          vortex->rmidi->private_data);
                handled = 1;
index 0ef2f97122080f206699a01e32b7f1f1ce7b6825..e59f120742a48e4140a54d80c63f6592c325c220 100644 (file)
@@ -122,6 +122,18 @@ static struct snd_pcm_hw_constraint_list hw_constraints_au8830_channels = {
        .mask = 0,
 };
 #endif
+
+static void vortex_notify_pcm_vol_change(struct snd_card *card,
+                       struct snd_kcontrol *kctl, int activate)
+{
+       if (activate)
+               kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
+       else
+               kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
+       snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE |
+                               SNDRV_CTL_EVENT_MASK_INFO, &(kctl->id));
+}
+
 /* open callback */
 static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
 {
@@ -230,12 +242,14 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
                if (stream != NULL)
                        vortex_adb_allocroute(chip, stream->dma,
                                              stream->nr_ch, stream->dir,
-                                             stream->type);
+                                             stream->type,
+                                             substream->number);
                /* Alloc routes. */
                dma =
                    vortex_adb_allocroute(chip, -1,
                                          params_channels(hw_params),
-                                         substream->stream, type);
+                                         substream->stream, type,
+                                         substream->number);
                if (dma < 0) {
                        spin_unlock_irq(&chip->lock);
                        return dma;
@@ -246,6 +260,11 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
                vortex_adbdma_setbuffers(chip, dma,
                                         params_period_bytes(hw_params),
                                         params_periods(hw_params));
+               if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
+                       chip->pcm_vol[substream->number].active = 1;
+                       vortex_notify_pcm_vol_change(chip->card,
+                               chip->pcm_vol[substream->number].kctl, 1);
+               }
        }
 #ifndef CHIP_AU8810
        else {
@@ -275,10 +294,18 @@ static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream)
        spin_lock_irq(&chip->lock);
        // Delete audio routes.
        if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
-               if (stream != NULL)
+               if (stream != NULL) {
+                       if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
+                               chip->pcm_vol[substream->number].active = 0;
+                               vortex_notify_pcm_vol_change(chip->card,
+                                       chip->pcm_vol[substream->number].kctl,
+                                       0);
+                       }
                        vortex_adb_allocroute(chip, stream->dma,
                                              stream->nr_ch, stream->dir,
-                                             stream->type);
+                                             stream->type,
+                                             substream->number);
+               }
        }
 #ifndef CHIP_AU8810
        else {
@@ -506,6 +533,83 @@ static struct snd_kcontrol_new snd_vortex_mixer_spdif[] __devinitdata = {
        },
 };
 
+/* subdevice PCM Volume control */
+
+static int snd_vortex_pcm_vol_info(struct snd_kcontrol *kcontrol,
+                               struct snd_ctl_elem_info *uinfo)
+{
+       vortex_t *vortex = snd_kcontrol_chip(kcontrol);
+       uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
+       uinfo->count = (VORTEX_IS_QUAD(vortex) ? 4 : 2);
+       uinfo->value.integer.min = -128;
+       uinfo->value.integer.max = 32;
+       return 0;
+}
+
+static int snd_vortex_pcm_vol_get(struct snd_kcontrol *kcontrol,
+                               struct snd_ctl_elem_value *ucontrol)
+{
+       int i;
+       vortex_t *vortex = snd_kcontrol_chip(kcontrol);
+       int subdev = kcontrol->id.subdevice;
+       struct pcm_vol *p = &vortex->pcm_vol[subdev];
+       int max_chn = (VORTEX_IS_QUAD(vortex) ? 4 : 2);
+       for (i = 0; i < max_chn; i++)
+               ucontrol->value.integer.value[i] = p->vol[i];
+       return 0;
+}
+
+static int snd_vortex_pcm_vol_put(struct snd_kcontrol *kcontrol,
+                               struct snd_ctl_elem_value *ucontrol)
+{
+       int i;
+       int changed = 0;
+       int mixin;
+       unsigned char vol;
+       vortex_t *vortex = snd_kcontrol_chip(kcontrol);
+       int subdev = kcontrol->id.subdevice;
+       struct pcm_vol *p = &vortex->pcm_vol[subdev];
+       int max_chn = (VORTEX_IS_QUAD(vortex) ? 4 : 2);
+       for (i = 0; i < max_chn; i++) {
+               if (p->vol[i] != ucontrol->value.integer.value[i]) {
+                       p->vol[i] = ucontrol->value.integer.value[i];
+                       if (p->active) {
+                               switch (vortex->dma_adb[p->dma].nr_ch) {
+                               case 1:
+                                       mixin = p->mixin[0];
+                                       break;
+                               case 2:
+                               default:
+                                       mixin = p->mixin[(i < 2) ? i : (i - 2)];
+                                       break;
+                               case 4:
+                                       mixin = p->mixin[i];
+                                       break;
+                               };
+                               vol = p->vol[i];
+                               vortex_mix_setinputvolumebyte(vortex,
+                                       vortex->mixplayb[i], mixin, vol);
+                       }
+                       changed = 1;
+               }
+       }
+       return changed;
+}
+
+static const DECLARE_TLV_DB_MINMAX(vortex_pcm_vol_db_scale, -9600, 2400);
+
+static struct snd_kcontrol_new snd_vortex_pcm_vol __devinitdata = {
+       .iface = SNDRV_CTL_ELEM_IFACE_PCM,
+       .name = "PCM Playback Volume",
+       .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
+               SNDRV_CTL_ELEM_ACCESS_TLV_READ |
+               SNDRV_CTL_ELEM_ACCESS_INACTIVE,
+       .info = snd_vortex_pcm_vol_info,
+       .get = snd_vortex_pcm_vol_get,
+       .put = snd_vortex_pcm_vol_put,
+       .tlv = { .p = vortex_pcm_vol_db_scale },
+};
+
 /* create a pcm device */
 static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
 {
@@ -555,5 +659,20 @@ static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
                                return err;
                }
        }
+       if (VORTEX_PCM_TYPE(pcm) == VORTEX_PCM_ADB) {
+               for (i = 0; i < NR_PCM; i++) {
+                       chip->pcm_vol[i].active = 0;
+                       chip->pcm_vol[i].dma = -1;
+                       kctl = snd_ctl_new1(&snd_vortex_pcm_vol, chip);
+                       if (!kctl)
+                               return -ENOMEM;
+                       chip->pcm_vol[i].kctl = kctl;
+                       kctl->id.device = 0;
+                       kctl->id.subdevice = i;
+                       err = snd_ctl_add(chip->card, kctl);
+                       if (err < 0)
+                               return err;
+               }
+       }
        return 0;
 }
index b78f3fc3c33caabd26d49a5b41ed4bfda861d39d..6109490b83e83294373f36956a5a8a01dd923e20 100644 (file)
@@ -36,7 +36,7 @@ get_vm_block(struct ct_vm *vm, unsigned int size)
 
        size = CT_PAGE_ALIGN(size);
        if (size > vm->size) {
-               printk(KERN_ERR "ctxfi: Fail! No sufficient device virtural "
+               printk(KERN_ERR "ctxfi: Fail! No sufficient device virtual "
                                  "memory space available!\n");
                return NULL;
        }
diff --git a/sound/pci/hda/alc260_quirks.c b/sound/pci/hda/alc260_quirks.c
deleted file mode 100644 (file)
index 3b5170b..0000000
+++ /dev/null
@@ -1,968 +0,0 @@
-/*
- * ALC260 quirk models
- * included by patch_realtek.c
- */
-
-/* ALC260 models */
-enum {
-       ALC260_AUTO,
-       ALC260_BASIC,
-       ALC260_FUJITSU_S702X,
-       ALC260_ACER,
-       ALC260_WILL,
-       ALC260_REPLACER_672V,
-       ALC260_FAVORIT100,
-#ifdef CONFIG_SND_DEBUG
-       ALC260_TEST,
-#endif
-       ALC260_MODEL_LAST /* last tag */
-};
-
-static const hda_nid_t alc260_dac_nids[1] = {
-       /* front */
-       0x02,
-};
-
-static const hda_nid_t alc260_adc_nids[1] = {
-       /* ADC0 */
-       0x04,
-};
-
-static const hda_nid_t alc260_adc_nids_alt[1] = {
-       /* ADC1 */
-       0x05,
-};
-
-/* NIDs used when simultaneous access to both ADCs makes sense.  Note that
- * alc260_capture_mixer assumes ADC0 (nid 0x04) is the first ADC.
- */
-static const hda_nid_t alc260_dual_adc_nids[2] = {
-       /* ADC0, ADC1 */
-       0x04, 0x05
-};
-
-#define ALC260_DIGOUT_NID      0x03
-#define ALC260_DIGIN_NID       0x06
-
-static const struct hda_input_mux alc260_capture_source = {
-       .num_items = 4,
-       .items = {
-               { "Mic", 0x0 },
-               { "Front Mic", 0x1 },
-               { "Line", 0x2 },
-               { "CD", 0x4 },
-       },
-};
-
-/* On Fujitsu S702x laptops capture only makes sense from Mic/LineIn jack,
- * headphone jack and the internal CD lines since these are the only pins at
- * which audio can appear.  For flexibility, also allow the option of
- * recording the mixer output on the second ADC (ADC0 doesn't have a
- * connection to the mixer output).
- */
-static const struct hda_input_mux alc260_fujitsu_capture_sources[2] = {
-       {
-               .num_items = 3,
-               .items = {
-                       { "Mic/Line", 0x0 },
-                       { "CD", 0x4 },
-                       { "Headphone", 0x2 },
-               },
-       },
-       {
-               .num_items = 4,
-               .items = {
-                       { "Mic/Line", 0x0 },
-                       { "CD", 0x4 },
-                       { "Headphone", 0x2 },
-                       { "Mixer", 0x5 },
-               },
-       },
-
-};
-
-/* Acer TravelMate(/Extensa/Aspire) notebooks have similar configuration to
- * the Fujitsu S702x, but jacks are marked differently.
- */
-static const struct hda_input_mux alc260_acer_capture_sources[2] = {
-       {
-               .num_items = 4,
-               .items = {
-                       { "Mic", 0x0 },
-                       { "Line", 0x2 },
-                       { "CD", 0x4 },
-                       { "Headphone", 0x5 },
-               },
-       },
-       {
-               .num_items = 5,
-               .items = {
-                       { "Mic", 0x0 },
-                       { "Line", 0x2 },
-                       { "CD", 0x4 },
-                       { "Headphone", 0x6 },
-                       { "Mixer", 0x5 },
-               },
-       },
-};
-
-/* Maxdata Favorit 100XS */
-static const struct hda_input_mux alc260_favorit100_capture_sources[2] = {
-       {
-               .num_items = 2,
-               .items = {
-                       { "Line/Mic", 0x0 },
-                       { "CD", 0x4 },
-               },
-       },
-       {
-               .num_items = 3,
-               .items = {
-                       { "Line/Mic", 0x0 },
-                       { "CD", 0x4 },
-                       { "Mixer", 0x5 },
-               },
-       },
-};
-
-/*
- * This is just place-holder, so there's something for alc_build_pcms to look
- * at when it calculates the maximum number of channels. ALC260 has no mixer
- * element which allows changing the channel mode, so the verb list is
- * never used.
- */
-static const struct hda_channel_mode alc260_modes[1] = {
-       { 2, NULL },
-};
-
-
-/* Mixer combinations
- *
- * basic: base_output + input + pc_beep + capture
- * fujitsu: fujitsu + capture
- * acer: acer + capture
- */
-
-static const struct snd_kcontrol_new alc260_base_output_mixer[] = {
-       HDA_CODEC_VOLUME("Front Playback Volume", 0x08, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Front Playback Switch", 0x08, 2, HDA_INPUT),
-       HDA_CODEC_VOLUME("Headphone Playback Volume", 0x09, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Headphone Playback Switch", 0x09, 2, HDA_INPUT),
-       HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT),
-       { } /* end */
-};
-
-static const struct snd_kcontrol_new alc260_input_mixer[] = {
-       HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
-       HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
-       HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x07, 0x01, HDA_INPUT),
-       HDA_CODEC_MUTE("Front Mic Playback Switch", 0x07, 0x01, HDA_INPUT),
-       { } /* end */
-};
-
-/* Fujitsu S702x series laptops.  ALC260 pin usage: Mic/Line jack = 0x12,
- * HP jack = 0x14, CD audio =  0x16, internal speaker = 0x10.
- */
-static const struct snd_kcontrol_new alc260_fujitsu_mixer[] = {
-       HDA_CODEC_VOLUME("Headphone Playback Volume", 0x08, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Headphone Playback Switch", 0x08, 2, HDA_INPUT),
-       ALC_PIN_MODE("Headphone Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
-       HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_VOLUME("Mic/Line Playback Volume", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_MUTE("Mic/Line Playback Switch", 0x07, 0x0, HDA_INPUT),
-       ALC_PIN_MODE("Mic/Line Jack Mode", 0x12, ALC_PIN_DIR_IN),
-       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x09, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Speaker Playback Switch", 0x09, 2, HDA_INPUT),
-       { } /* end */
-};
-
-/* Mixer for Acer TravelMate(/Extensa/Aspire) notebooks.  Note that current
- * versions of the ALC260 don't act on requests to enable mic bias from NID
- * 0x0f (used to drive the headphone jack in these laptops).  The ALC260
- * datasheet doesn't mention this restriction.  At this stage it's not clear
- * whether this behaviour is intentional or is a hardware bug in chip
- * revisions available in early 2006.  Therefore for now allow the
- * "Headphone Jack Mode" control to span all choices, but if it turns out
- * that the lack of mic bias for this NID is intentional we could change the
- * mode from ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
- *
- * In addition, Acer TravelMate(/Extensa/Aspire) notebooks in early 2006
- * don't appear to make the mic bias available from the "line" jack, even
- * though the NID used for this jack (0x14) can supply it.  The theory is
- * that perhaps Acer have included blocking capacitors between the ALC260
- * and the output jack.  If this turns out to be the case for all such
- * models the "Line Jack Mode" mode could be changed from ALC_PIN_DIR_INOUT
- * to ALC_PIN_DIR_INOUT_NOMICBIAS.
- *
- * The C20x Tablet series have a mono internal speaker which is controlled
- * via the chip's Mono sum widget and pin complex, so include the necessary
- * controls for such models.  On models without a "mono speaker" the control
- * won't do anything.
- */
-static const struct snd_kcontrol_new alc260_acer_mixer[] = {
-       HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT),
-       ALC_PIN_MODE("Headphone Jack Mode", 0x0f, ALC_PIN_DIR_INOUT),
-       HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0a, 1, 0x0,
-                             HDA_OUTPUT),
-       HDA_BIND_MUTE_MONO("Speaker Playback Switch", 0x0a, 1, 2,
-                          HDA_INPUT),
-       HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
-       ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
-       HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
-       HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
-       ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
-       { } /* end */
-};
-
-/* Maxdata Favorit 100XS: one output and one input (0x12) jack
- */
-static const struct snd_kcontrol_new alc260_favorit100_mixer[] = {
-       HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Master Playback Switch", 0x08, 2, HDA_INPUT),
-       ALC_PIN_MODE("Output Jack Mode", 0x0f, ALC_PIN_DIR_INOUT),
-       HDA_CODEC_VOLUME("Line/Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_MUTE("Line/Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
-       ALC_PIN_MODE("Line/Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
-       { } /* end */
-};
-
-/* Packard bell V7900  ALC260 pin usage: HP = 0x0f, Mic jack = 0x12,
- * Line In jack = 0x14, CD audio =  0x16, pc beep = 0x17.
- */
-static const struct snd_kcontrol_new alc260_will_mixer[] = {
-       HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT),
-       HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
-       ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
-       HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
-       HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
-       ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
-       HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
-       { } /* end */
-};
-
-/* Replacer 672V ALC260 pin usage: Mic jack = 0x12,
- * Line In jack = 0x14, ATAPI Mic = 0x13, speaker = 0x0f.
- */
-static const struct snd_kcontrol_new alc260_replacer_672v_mixer[] = {
-       HDA_CODEC_VOLUME("Master Playback Volume", 0x08, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("Master Playback Switch", 0x08, 0x2, HDA_INPUT),
-       HDA_CODEC_VOLUME("Mic Playback Volume", 0x07, 0x0, HDA_INPUT),
-       HDA_CODEC_MUTE("Mic Playback Switch", 0x07, 0x0, HDA_INPUT),
-       ALC_PIN_MODE("Mic Jack Mode", 0x12, ALC_PIN_DIR_IN),
-       HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x07, 0x1, HDA_INPUT),
-       HDA_CODEC_MUTE("ATATI Mic Playback Switch", 0x07, 0x1, HDA_INPUT),
-       HDA_CODEC_VOLUME("Line Playback Volume", 0x07, 0x02, HDA_INPUT),
-       HDA_CODEC_MUTE("Line Playback Switch", 0x07, 0x02, HDA_INPUT),
-       ALC_PIN_MODE("Line Jack Mode", 0x14, ALC_PIN_DIR_INOUT),
-       { } /* end */
-};
-
-/*
- * initialization verbs
- */
-static const struct hda_verb alc260_init_verbs[] = {
-       /* Line In pin widget for input */
-       {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
-       /* CD pin widget for input */
-       {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
-       /* Mic1 (rear panel) pin widget for input and vref at 80% */
-       {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
-       /* Mic2 (front panel) pin widget for input and vref at 80% */
-       {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
-       /* LINE-2 is used for line-out in rear */
-       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       /* select line-out */
-       {0x0e, AC_VERB_SET_CONNECT_SEL, 0x00},
-       /* LINE-OUT pin */
-       {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       /* enable HP */
-       {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
-       /* enable Mono */
-       {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       /* mute capture amp left and right */
-       {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       /* set connection select to line in (default select for this ADC) */
-       {0x04, AC_VERB_SET_CONNECT_SEL, 0x02},
-       /* mute capture amp left and right */
-       {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       /* set connection select to line in (default select for this ADC) */
-       {0x05, AC_VERB_SET_CONNECT_SEL, 0x02},
-       /* set vol=0 Line-Out mixer amp left and right */
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       /* unmute pin widget amp left and right (no gain on this amp) */
-       {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* set vol=0 HP mixer amp left and right */
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       /* unmute pin widget amp left and right (no gain on this amp) */
-       {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* set vol=0 Mono mixer amp left and right */
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       /* unmute pin widget amp left and right (no gain on this amp) */
-       {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* unmute LINE-2 out pin */
-       {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 &
-        * Line In 2 = 0x03
-        */
-       /* mute analog inputs */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
-       /* Amp Indexes: DAC = 0x01 & mixer = 0x00 */
-       /* mute Front out path */
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       /* mute Headphone out path */
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       /* mute Mono out path */
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       { }
-};
-
-/* Initialisation sequence for ALC260 as configured in Fujitsu S702x
- * laptops.  ALC260 pin usage: Mic/Line jack = 0x12, HP jack = 0x14, CD
- * audio = 0x16, internal speaker = 0x10.
- */
-static const struct hda_verb alc260_fujitsu_init_verbs[] = {
-       /* Disable all GPIOs */
-       {0x01, AC_VERB_SET_GPIO_MASK, 0},
-       /* Internal speaker is connected to headphone pin */
-       {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
-       /* Headphone/Line-out jack connects to Line1 pin; make it an output */
-       {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       /* Mic/Line-in jack is connected to mic1 pin, so make it an input */
-       {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
-       /* Ensure all other unused pins are disabled and muted. */
-       {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-
-       /* Disable digital (SPDIF) pins */
-       {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
-       {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
-
-       /* Ensure Line1 pin widget takes its input from the OUT1 sum bus
-        * when acting as an output.
-        */
-       {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
-
-       /* Start with output sum widgets muted and their output gains at min */
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-
-       /* Unmute HP pin widget amp left and right (no equiv mixer ctrl) */
-       {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* Unmute Line1 pin widget output buffer since it starts as an output.
-        * If the pin mode is changed by the user the pin mode control will
-        * take care of enabling the pin's input/output buffers as needed.
-        * Therefore there's no need to enable the input buffer at this
-        * stage.
-        */
-       {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* Unmute input buffer of pin widget used for Line-in (no equiv
-        * mixer ctrl)
-        */
-       {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-
-       /* Mute capture amp left and right */
-       {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       /* Set ADC connection select to match default mixer setting - line
-        * in (on mic1 pin)
-        */
-       {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Do the same for the second ADC: mute capture input amp and
-        * set ADC connection to line in (on mic1 pin)
-        */
-       {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Mute all inputs to mixer widget (even unconnected ones) */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
-
-       { }
-};
-
-/* Initialisation sequence for ALC260 as configured in Acer TravelMate and
- * similar laptops (adapted from Fujitsu init verbs).
- */
-static const struct hda_verb alc260_acer_init_verbs[] = {
-       /* On TravelMate laptops, GPIO 0 enables the internal speaker and
-        * the headphone jack.  Turn this on and rely on the standard mute
-        * methods whenever the user wants to turn these outputs off.
-        */
-       {0x01, AC_VERB_SET_GPIO_MASK, 0x01},
-       {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
-       {0x01, AC_VERB_SET_GPIO_DATA, 0x01},
-       /* Internal speaker/Headphone jack is connected to Line-out pin */
-       {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
-       /* Internal microphone/Mic jack is connected to Mic1 pin */
-       {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
-       /* Line In jack is connected to Line1 pin */
-       {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
-       /* Some Acers (eg: C20x Tablets) use Mono pin for internal speaker */
-       {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
-       /* Ensure all other unused pins are disabled and muted. */
-       {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       /* Disable digital (SPDIF) pins */
-       {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
-       {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
-
-       /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
-        * bus when acting as outputs.
-        */
-       {0x0b, AC_VERB_SET_CONNECT_SEL, 0},
-       {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
-
-       /* Start with output sum widgets muted and their output gains at min */
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-
-       /* Unmute Line-out pin widget amp left and right
-        * (no equiv mixer ctrl)
-        */
-       {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* Unmute mono pin widget amp output (no equiv mixer ctrl) */
-       {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* Unmute Mic1 and Line1 pin widget input buffers since they start as
-        * inputs. If the pin mode is changed by the user the pin mode control
-        * will take care of enabling the pin's input/output buffers as needed.
-        * Therefore there's no need to enable the input buffer at this
-        * stage.
-        */
-       {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-       {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-
-       /* Mute capture amp left and right */
-       {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       /* Set ADC connection select to match default mixer setting - mic
-        * (on mic1 pin)
-        */
-       {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Do similar with the second ADC: mute capture input amp and
-        * set ADC connection to mic to match ALSA's default state.
-        */
-       {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Mute all inputs to mixer widget (even unconnected ones) */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
-
-       { }
-};
-
-/* Initialisation sequence for Maxdata Favorit 100XS
- * (adapted from Acer init verbs).
- */
-static const struct hda_verb alc260_favorit100_init_verbs[] = {
-       /* GPIO 0 enables the output jack.
-        * Turn this on and rely on the standard mute
-        * methods whenever the user wants to turn these outputs off.
-        */
-       {0x01, AC_VERB_SET_GPIO_MASK, 0x01},
-       {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
-       {0x01, AC_VERB_SET_GPIO_DATA, 0x01},
-       /* Line/Mic input jack is connected to Mic1 pin */
-       {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
-       /* Ensure all other unused pins are disabled and muted. */
-       {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
-       {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       /* Disable digital (SPDIF) pins */
-       {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
-       {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
-
-       /* Ensure Mic1 and Line1 pin widgets take input from the OUT1 sum
-        * bus when acting as outputs.
-        */
-       {0x0b, AC_VERB_SET_CONNECT_SEL, 0},
-       {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
-
-       /* Start with output sum widgets muted and their output gains at min */
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-
-       /* Unmute Line-out pin widget amp left and right
-        * (no equiv mixer ctrl)
-        */
-       {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* Unmute Mic1 and Line1 pin widget input buffers since they start as
-        * inputs. If the pin mode is changed by the user the pin mode control
-        * will take care of enabling the pin's input/output buffers as needed.
-        * Therefore there's no need to enable the input buffer at this
-        * stage.
-        */
-       {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
-
-       /* Mute capture amp left and right */
-       {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       /* Set ADC connection select to match default mixer setting - mic
-        * (on mic1 pin)
-        */
-       {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Do similar with the second ADC: mute capture input amp and
-        * set ADC connection to mic to match ALSA's default state.
-        */
-       {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Mute all inputs to mixer widget (even unconnected ones) */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
-
-       { }
-};
-
-static const struct hda_verb alc260_will_verbs[] = {
-       {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
-       {0x0b, AC_VERB_SET_CONNECT_SEL, 0x00},
-       {0x0d, AC_VERB_SET_CONNECT_SEL, 0x00},
-       {0x0f, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
-       {0x1a, AC_VERB_SET_COEF_INDEX, 0x07},
-       {0x1a, AC_VERB_SET_PROC_COEF, 0x3040},
-       {}
-};
-
-static const struct hda_verb alc260_replacer_672v_verbs[] = {
-       {0x0f, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
-       {0x1a, AC_VERB_SET_COEF_INDEX, 0x07},
-       {0x1a, AC_VERB_SET_PROC_COEF, 0x3050},
-
-       {0x01, AC_VERB_SET_GPIO_MASK, 0x01},
-       {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
-       {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
-
-       {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
-       {}
-};
-
-/* toggle speaker-output according to the hp-jack state */
-static void alc260_replacer_672v_automute(struct hda_codec *codec)
-{
-        unsigned int present;
-
-       /* speaker --> GPIO Data 0, hp or spdif --> GPIO data 1 */
-       present = snd_hda_jack_detect(codec, 0x0f);
-       if (present) {
-               snd_hda_codec_write_cache(codec, 0x01, 0,
-                                         AC_VERB_SET_GPIO_DATA, 1);
-               snd_hda_codec_write_cache(codec, 0x0f, 0,
-                                         AC_VERB_SET_PIN_WIDGET_CONTROL,
-                                         PIN_HP);
-       } else {
-               snd_hda_codec_write_cache(codec, 0x01, 0,
-                                         AC_VERB_SET_GPIO_DATA, 0);
-               snd_hda_codec_write_cache(codec, 0x0f, 0,
-                                         AC_VERB_SET_PIN_WIDGET_CONTROL,
-                                         PIN_OUT);
-       }
-}
-
-static void alc260_replacer_672v_unsol_event(struct hda_codec *codec,
-                                       unsigned int res)
-{
-        if ((res >> 26) == ALC_HP_EVENT)
-                alc260_replacer_672v_automute(codec);
-}
-
-static const struct hda_verb alc260_hp_dc7600_verbs[] = {
-       {0x05, AC_VERB_SET_CONNECT_SEL, 0x01},
-       {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
-       {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
-       {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
-       {0x10, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
-       {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
-       {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
-       {}
-};
-
-/* Test configuration for debugging, modelled after the ALC880 test
- * configuration.
- */
-#ifdef CONFIG_SND_DEBUG
-static const hda_nid_t alc260_test_dac_nids[1] = {
-       0x02,
-};
-static const hda_nid_t alc260_test_adc_nids[2] = {
-       0x04, 0x05,
-};
-/* For testing the ALC260, each input MUX needs its own definition since
- * the signal assignments are different.  This assumes that the first ADC
- * is NID 0x04.
- */
-static const struct hda_input_mux alc260_test_capture_sources[2] = {
-       {
-               .num_items = 7,
-               .items = {
-                       { "MIC1 pin", 0x0 },
-                       { "MIC2 pin", 0x1 },
-                       { "LINE1 pin", 0x2 },
-                       { "LINE2 pin", 0x3 },
-                       { "CD pin", 0x4 },
-                       { "LINE-OUT pin", 0x5 },
-                       { "HP-OUT pin", 0x6 },
-               },
-        },
-       {
-               .num_items = 8,
-               .items = {
-                       { "MIC1 pin", 0x0 },
-                       { "MIC2 pin", 0x1 },
-                       { "LINE1 pin", 0x2 },
-                       { "LINE2 pin", 0x3 },
-                       { "CD pin", 0x4 },
-                       { "Mixer", 0x5 },
-                       { "LINE-OUT pin", 0x6 },
-                       { "HP-OUT pin", 0x7 },
-               },
-        },
-};
-static const struct snd_kcontrol_new alc260_test_mixer[] = {
-       /* Output driver widgets */
-       HDA_CODEC_VOLUME_MONO("Mono Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE_MONO("Mono Playback Switch", 0x0a, 1, 2, HDA_INPUT),
-       HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x09, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("LOUT2 Playback Switch", 0x09, 2, HDA_INPUT),
-       HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x08, 0x0, HDA_OUTPUT),
-       HDA_BIND_MUTE("LOUT1 Playback Switch", 0x08, 2, HDA_INPUT),
-
-       /* Modes for retasking pin widgets
-        * Note: the ALC260 doesn't seem to act on requests to enable mic
-         * bias from NIDs 0x0f and 0x10.  The ALC260 datasheet doesn't
-         * mention this restriction.  At this stage it's not clear whether
-         * this behaviour is intentional or is a hardware bug in chip
-         * revisions available at least up until early 2006.  Therefore for
-         * now allow the "HP-OUT" and "LINE-OUT" Mode controls to span all
-         * choices, but if it turns out that the lack of mic bias for these
-         * NIDs is intentional we could change their modes from
-         * ALC_PIN_DIR_INOUT to ALC_PIN_DIR_INOUT_NOMICBIAS.
-        */
-       ALC_PIN_MODE("HP-OUT pin mode", 0x10, ALC_PIN_DIR_INOUT),
-       ALC_PIN_MODE("LINE-OUT pin mode", 0x0f, ALC_PIN_DIR_INOUT),
-       ALC_PIN_MODE("LINE2 pin mode", 0x15, ALC_PIN_DIR_INOUT),
-       ALC_PIN_MODE("LINE1 pin mode", 0x14, ALC_PIN_DIR_INOUT),
-       ALC_PIN_MODE("MIC2 pin mode", 0x13, ALC_PIN_DIR_INOUT),
-       ALC_PIN_MODE("MIC1 pin mode", 0x12, ALC_PIN_DIR_INOUT),
-
-       /* Loopback mixer controls */
-       HDA_CODEC_VOLUME("MIC1 Playback Volume", 0x07, 0x00, HDA_INPUT),
-       HDA_CODEC_MUTE("MIC1 Playback Switch", 0x07, 0x00, HDA_INPUT),
-       HDA_CODEC_VOLUME("MIC2 Playback Volume", 0x07, 0x01, HDA_INPUT),
-       HDA_CODEC_MUTE("MIC2 Playback Switch", 0x07, 0x01, HDA_INPUT),
-       HDA_CODEC_VOLUME("LINE1 Playback Volume", 0x07, 0x02, HDA_INPUT),
-       HDA_CODEC_MUTE("LINE1 Playback Switch", 0x07, 0x02, HDA_INPUT),
-       HDA_CODEC_VOLUME("LINE2 Playback Volume", 0x07, 0x03, HDA_INPUT),
-       HDA_CODEC_MUTE("LINE2 Playback Switch", 0x07, 0x03, HDA_INPUT),
-       HDA_CODEC_VOLUME("CD Playback Volume", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_MUTE("CD Playback Switch", 0x07, 0x04, HDA_INPUT),
-       HDA_CODEC_VOLUME("LINE-OUT loopback Playback Volume", 0x07, 0x06, HDA_INPUT),
-       HDA_CODEC_MUTE("LINE-OUT loopback Playback Switch", 0x07, 0x06, HDA_INPUT),
-       HDA_CODEC_VOLUME("HP-OUT loopback Playback Volume", 0x07, 0x7, HDA_INPUT),
-       HDA_CODEC_MUTE("HP-OUT loopback Playback Switch", 0x07, 0x7, HDA_INPUT),
-
-       /* Controls for GPIO pins, assuming they are configured as outputs */
-       ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
-       ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
-       ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
-       ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
-
-       /* Switches to allow the digital IO pins to be enabled.  The datasheet
-        * is ambigious as to which NID is which; testing on laptops which
-        * make this output available should provide clarification.
-        */
-       ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x03, 0x01),
-       ALC_SPDIF_CTRL_SWITCH("SPDIF Capture Switch", 0x06, 0x01),
-
-       /* A switch allowing EAPD to be enabled.  Some laptops seem to use
-        * this output to turn on an external amplifier.
-        */
-       ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
-       ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
-
-       { } /* end */
-};
-static const struct hda_verb alc260_test_init_verbs[] = {
-       /* Enable all GPIOs as outputs with an initial value of 0 */
-       {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0f},
-       {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
-       {0x01, AC_VERB_SET_GPIO_MASK, 0x0f},
-
-       /* Enable retasking pins as output, initially without power amp */
-       {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-       {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-
-       /* Disable digital (SPDIF) pins initially, but users can enable
-        * them via a mixer switch.  In the case of SPDIF-out, this initverb
-        * payload also sets the generation to 0, output to be in "consumer"
-        * PCM format, copyright asserted, no pre-emphasis and no validity
-        * control.
-        */
-       {0x03, AC_VERB_SET_DIGI_CONVERT_1, 0},
-       {0x06, AC_VERB_SET_DIGI_CONVERT_1, 0},
-
-       /* Ensure mic1, mic2, line1 and line2 pin widgets take input from the
-        * OUT1 sum bus when acting as an output.
-        */
-       {0x0b, AC_VERB_SET_CONNECT_SEL, 0},
-       {0x0c, AC_VERB_SET_CONNECT_SEL, 0},
-       {0x0d, AC_VERB_SET_CONNECT_SEL, 0},
-       {0x0e, AC_VERB_SET_CONNECT_SEL, 0},
-
-       /* Start with output sum widgets muted and their output gains at min */
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
-       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-
-       /* Unmute retasking pin widget output buffers since the default
-        * state appears to be output.  As the pin mode is changed by the
-        * user the pin mode control will take care of enabling the pin's
-        * input/output buffers as needed.
-        */
-       {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       {0x13, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-       /* Also unmute the mono-out pin widget */
-       {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-
-       /* Mute capture amp left and right */
-       {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       /* Set ADC connection select to match default mixer setting (mic1
-        * pin)
-        */
-       {0x04, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Do the same for the second ADC: mute capture input amp and
-        * set ADC connection to mic1 pin
-        */
-       {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
-       {0x05, AC_VERB_SET_CONNECT_SEL, 0x00},
-
-       /* Mute all inputs to mixer widget (even unconnected ones) */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, /* mic1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, /* mic2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, /* line1 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, /* line2 pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* CD pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(5)}, /* Beep-gen pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)}, /* Line-out pin */
-       {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)}, /* HP-pin pin */
-
-       { }
-};
-#endif
-
-/*
- * ALC260 configurations
- */
-static const char * const alc260_models[ALC260_MODEL_LAST] = {
-       [ALC260_BASIC]          = "basic",
-       [ALC260_FUJITSU_S702X]  = "fujitsu",
-       [ALC260_ACER]           = "acer",
-       [ALC260_WILL]           = "will",
-       [ALC260_REPLACER_672V]  = "replacer",
-       [ALC260_FAVORIT100]     = "favorit100",
-#ifdef CONFIG_SND_DEBUG
-       [ALC260_TEST]           = "test",
-#endif
-       [ALC260_AUTO]           = "auto",
-};
-
-static const struct snd_pci_quirk alc260_cfg_tbl[] = {
-       SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER),
-       SND_PCI_QUIRK(0x1025, 0x007f, "Acer", ALC260_WILL),
-       SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
-       SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100),
-       SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_BASIC),
-       SND_PCI_QUIRK(0x104d, 0x81cc, "Sony VAIO", ALC260_BASIC),
-       SND_PCI_QUIRK(0x104d, 0x81cd, "Sony VAIO", ALC260_BASIC),
-       SND_PCI_QUIRK(0x10cf, 0x1326, "Fujitsu S702X", ALC260_FUJITSU_S702X),
-       SND_PCI_QUIRK(0x152d, 0x0729, "CTL U553W", ALC260_BASIC),
-       SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_REPLACER_672V),
-       SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_WILL),
-       {}
-};
-
-static const struct alc_config_preset alc260_presets[] = {
-       [ALC260_BASIC] = {
-               .mixers = { alc260_base_output_mixer,
-                           alc260_input_mixer },
-               .init_verbs = { alc260_init_verbs },
-               .num_dacs = ARRAY_SIZE(alc260_dac_nids),
-               .dac_nids = alc260_dac_nids,
-               .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
-               .adc_nids = alc260_dual_adc_nids,
-               .num_channel_mode = ARRAY_SIZE(alc260_modes),
-               .channel_mode = alc260_modes,
-               .input_mux = &alc260_capture_source,
-       },
-       [ALC260_FUJITSU_S702X] = {
-               .mixers = { alc260_fujitsu_mixer },
-               .init_verbs = { alc260_fujitsu_init_verbs },
-               .num_dacs = ARRAY_SIZE(alc260_dac_nids),
-               .dac_nids = alc260_dac_nids,
-               .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
-               .adc_nids = alc260_dual_adc_nids,
-               .num_channel_mode = ARRAY_SIZE(alc260_modes),
-               .channel_mode = alc260_modes,
-               .num_mux_defs = ARRAY_SIZE(alc260_fujitsu_capture_sources),
-               .input_mux = alc260_fujitsu_capture_sources,
-       },
-       [ALC260_ACER] = {
-               .mixers = { alc260_acer_mixer },
-               .init_verbs = { alc260_acer_init_verbs },
-               .num_dacs = ARRAY_SIZE(alc260_dac_nids),
-               .dac_nids = alc260_dac_nids,
-               .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
-               .adc_nids = alc260_dual_adc_nids,
-               .num_channel_mode = ARRAY_SIZE(alc260_modes),
-               .channel_mode = alc260_modes,
-               .num_mux_defs = ARRAY_SIZE(alc260_acer_capture_sources),
-               .input_mux = alc260_acer_capture_sources,
-       },
-       [ALC260_FAVORIT100] = {
-               .mixers = { alc260_favorit100_mixer },
-               .init_verbs = { alc260_favorit100_init_verbs },
-               .num_dacs = ARRAY_SIZE(alc260_dac_nids),
-               .dac_nids = alc260_dac_nids,
-               .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
-               .adc_nids = alc260_dual_adc_nids,
-               .num_channel_mode = ARRAY_SIZE(alc260_modes),
-               .channel_mode = alc260_modes,
-               .num_mux_defs = ARRAY_SIZE(alc260_favorit100_capture_sources),
-               .input_mux = alc260_favorit100_capture_sources,
-       },
-       [ALC260_WILL] = {
-