Commit Graph

4146 Commits

Author SHA1 Message Date
Mark Brown 5b6247abc9 ASoC: Remove needless unlikely()
There's no point in adding unlikely() annotations outside of hot paths
and on systems using these features the annotation will always be wrong
(as opposed to being something that only comes up once in a while) so
the annotation may even be harmful.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-04 17:19:40 +00:00
Linus Torvalds b2409fb6a4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits)
  ALSA: hda/realtek - Skip invalid digital out pins
  ALSA: hda/sigmatel - Automatically retrieve digital I/O widgets
  ALSA: hda - Remove unused variables
  ALSA: hda/realtek - Don't create alt-stream for capture when unnecessary
  ALSA: hda - Add support for 92HD65 / 92HD66 family of codecs
  ALSA: hda - Disable power-widget control for IDT 92HD83/93 as default
  ALSA: hda - Check NO_PRESENCE pincfg default bit
  ASoC: Ensure we always delay for WM8962 FLL when starting from SYSCLK
  ASoC: Ensure the WM8962 oscillator and PLLs start up disabled
  ASoC: Ensure WM8962 PLL registers are reset
  ALSA: intel8x0 - Fix inclusion of kvm_para.h
  ALSA: hda_hwdep: Fix possible buffer overflow
  ASoC: Fix return value of wm5100_gpio_direction_out()
  ASoC: WM8904: Set `invert' bit for Capture Switch
  ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt
  ASoC: wm8711: Fix wrong mask for setting input audio data bit length select
  ALSA: intel8x0: Improve performance in virtual environment
  ALSA: hdspm - Enable all firmware ranges for PCI MADI/AES cards
  ALSA: hdsp - Correct HDSP_VERSION_BIT constant, thus partly fixing RPM detection
  ALSA: hdspm - Fix MADI channel format in the status ioctl
  ...
2011-11-04 07:51:43 -07:00
Linus Torvalds d6748066ad Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (37 commits)
  MIPS: O32: Provide definition of registers ta0 .. ta3.
  MIPS: perf: Add Octeon support for hardware perf.
  MIPS: perf: Add support for 64-bit perf counters.
  MIPS: perf: Reorganize contents of perf support files.
  MIPS: perf: Cleanup formatting in arch/mips/kernel/perf_event.c
  MIPS: Add accessor macros for 64-bit performance counter registers.
  MIPS: Add probes for more Octeon II CPUs.
  MIPS: Add more CPU identifiers for Octeon II CPUs.
  MIPS: XLR, XLS: Add comment for smp setup
  MIPS: JZ4740: GPIO: Check correct IRQ in demux handler
  MIPS: JZ4740: GPIO: Simplify IRQ demuxer
  MIPS: JZ4740: Use generic irq chip
  MIPS: Alchemy: remove all CONFIG_SOC_AU1??? defines
  MIPS: Alchemy: kill au1xxx.h header
  MIPS: Alchemy: clean DMA code of CONFIG_SOC_AU1??? defines
  MIPS, IDE: Alchem, au1xxx-ide: Remove pb1200/db1200 header dep
  MIPS: Alchemy: Redo PCI as platform driver
  MIPS: Alchemy: more base address cleanup
  MIPS: Alchemy: rewrite USB platform setup.
  MIPS: Alchemy: abstract USB block control register access
  ...

Fix up trivial conflicts in:
	arch/mips/alchemy/devboards/db1x00/platform.c
	drivers/ide/Kconfig
	drivers/mmc/host/au1xmmc.c
	drivers/video/Kconfig
	sound/mips/Kconfig
2011-11-03 13:28:14 -07:00
Takashi Iwai 6bcbf64ace Merge branch 'fix/asoc' into for-linus 2011-11-03 18:20:53 +01:00
Mark Brown 98dd932b6a ASoC: Fix sort of jz4740 in Makefile
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-02 13:31:13 +00:00
Mark Brown 8aafc43556 ASoC: Sort LM4857 with the CODECs in the Makefile
Having a separate list for amps is a little confusing now the official
driver model for them is the same as for other CODECs so let's sort them
into the CODEC list, but only do this for those that are actual CODEC
drivers so it's easier to remember which ones need updating.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-02 13:31:11 +00:00
Mark Brown 00ae3b8691 ASoC: Disable MICBIAS and SYSCLK when stopping WM8962 accessory detection
They aren't needed any more. If machines need them for other purposes then
further changes will be required.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-01 18:56:55 +00:00
Mark Brown a5ef988408 ASoC: WM8962 accessory detection requires MICBIAS
Force MICBIAS on as well as SYSCLK as the WM8962 accessory detection can't
function without both. No point in making machine drivers manually enable
it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-01 18:56:33 +00:00
Mark Brown db0e55438c ASoC: Enable SYSCLK last when enabling WM8962 mic detection
Ensure everything is set up before we start detecting.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-01 18:56:26 +00:00
Mark Brown 2a761cde31 ASoC: Start WM8962 FLL if SYSCLK is enabled
Since we have code to automatically manage the start and stop of the FLL
based on the SYSCLK widget if SYSCLK is already enabled and the FLL is
configured then we need to start it up.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-01 18:56:21 +00:00
Mark Brown 0b7dd6ad92 ASoC: Ensure we always delay for WM8962 FLL when starting from SYSCLK
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-11-01 18:52:05 +00:00
Mark Brown 2af8de8c39 ASoC: Ensure the WM8962 oscillator and PLLs start up disabled
Since there is no current software control for these they would otherwise
be left enabled, consuming power.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-11-01 18:51:49 +00:00
Mark Brown 4f4488abc9 ASoC: Ensure WM8962 PLL registers are reset
The WM8962 has a separate software reset for the PLL registers. Ensure that
these are reset also on startup.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-11-01 18:44:55 +00:00
Paul Gortmaker d81a6d7176 sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed
These aren't modules, but they do make use of these macros, so
they will need export.h to get that definition.  Previously,
they got it via the implicit module.h inclusion.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:22 -04:00
Paul Gortmaker da155d5b40 sound: Add module.h to the previously silent sound users
Lots of sound drivers were getting module.h via the implicit presence
of it in <linux/device.h> but we are going to clean that up.  So
fix up those users now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:21 -04:00
Paul Gortmaker 6a550b99a0 blackfin: add module.h to files implicitly expecting to use it.
Its presence was implicit everywhere, but we are aiming to fix that,
so call out the users explicitly.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:02 -04:00
Mark Brown 64964e8264 ASoC: Fix return value of wm5100_gpio_direction_out()
We can't just pass back the return value of snd_soc_update_bits() as it
will be 1 if a bit changed rather than zero.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:08:31 +00:00
Mark Brown 3ff51c859f ASoC: Convert wm8400 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:08:22 +00:00
Mark Brown 8a709d92c7 ASoC: Convert wm8900 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:08:14 +00:00
Mark Brown dcd658c56b ASoC: Convert wm8904 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:08:08 +00:00
Mark Brown 187774cbe3 ASoC: Convert wm8960 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:08:04 +00:00
Mark Brown 20abf08879 ASoC: Convert wm8961 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:07:58 +00:00
Mark Brown 48dd231b0b ASoC: Convert wm8974 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:06:53 +00:00
Mark Brown 605b151ae3 ASoC: Convert wm8983 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:06:40 +00:00
Mark Brown 812f8a3524 ASoC: Convert wm8985 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:06:35 +00:00
Mark Brown be48f20d8f ASoC: Convert wm8988 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:06:30 +00:00
Mark Brown e1fc3f21c2 ASoC: Convert wm8990 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:06:25 +00:00
Mark Brown b6406a8027 ASoC: Convert wm8991 MICBIAS to a supply widget
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:06:18 +00:00
Mark Brown 9ce316236b ASoC: Convert wm8995 MICBIASes to supply widgets
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31 19:06:10 +00:00
Hong Xu 5a7c5f26df ASoC: WM8904: Set `invert' bit for Capture Switch
Set `invert' bit for Capture Switch. Otherwise analogue is muted when
Capture Switch is ON.

Signed-off-by: Hong Xu <hong.xu@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-31 12:50:03 +00:00
Axel Lin d558cfc300 ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt
Current implementation in wm8711_set_dai_fmt always clear BIT[3:2]
(the Input Audio Data Bit Length Select) of WM8711_IFACE(07h) register.
Input Audio Data Bit Length Select bits are set by wm8711_hw_params,
we should leave BIT[3:2] untouched in wm8711_set_dai_fmt.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-31 12:38:28 +00:00
Axel Lin 04c57163c8 ASoC: wm8711: Fix wrong mask for setting input audio data bit length select
The Input Audio Data Bit Length Select is controlled by BIT[3:2] of
WM8711_IFACE(07h) register.
Current code incorrectly masks BIT[1:0] which is for Audio Data Format Select.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-31 12:38:18 +00:00
Linus Torvalds 68d99b2c8e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (549 commits)
  ALSA: hda - Fix ADC input-amp handling for Cx20549 codec
  ALSA: hda - Keep EAPD turned on for old Conexant chips
  ALSA: hda/realtek - Fix missing volume controls with ALC260
  ASoC: wm8940: Properly set codec->dapm.bias_level
  ALSA: hda - Fix pin-config for ASUS W90V
  ALSA: hda - Fix surround/CLFE headphone and speaker pins order
  ALSA: hda - Fix typo
  ALSA: Update the sound git tree URL
  ALSA: HDA: Add new revision for ALC662
  ASoC: max98095: Convert codec->hw_write to snd_soc_write
  ASoC: keep pointer to resource so it can be freed
  ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
  ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
  ASoC: da7210: Add support for line out and DAC
  ASoC: da7210: Add support for DAPM
  ALSA: hda/realtek - Fix DAC assignments of multiple speakers
  ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value
  ASoC: Set sgtl5000->ldo in ldo_regulator_register
  ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
  ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture
  ...
2011-10-28 14:25:01 -07:00
ramesh.babu@linux.intel.com e50fad4f02 ASoC: Allow machines to ignore pmdown_time per-link
With this flag, each dai_link in machine driver can choose
to ignore pmdown_time during DAPM shut down sequence.

If the ignore_pmdown_time is set, the DAPM for corresponding DAI
will be executed immediately.

Signed-off-by: Ramesh Babu K V <ramesh.babu@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-27 12:05:50 +02:00
Axel Lin 68e4798143 ASoC: tlv320aic3x: Clear BIT_CLK_MASTER and WORD_CLK_MASTER bits for for slave mode
According to the datasheet:

Page0 / Register8: Audio Serial Data interface Control Register A
BIT 7: Bit Clock Directional Control
        0: Bit clock is an input (slave mode)
        1: Bit clock is an output (master mode)

BIT 6: Word Clock Directional Control
        0: Word clock is an input (slave mode)
        1: Word clock is an output (master mode)

Current code sets BIT_CLK_MASTER and WORD_CLK_MASTER bits for master mode,
but does not clear these bits for slave mode.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-27 12:00:15 +02:00
Axel Lin b01a3d69f8 ASoC: tlv320aic23: Clear TLV320AIC23_MS_MASTER bit for slave mode
According to the datasheet:

Digital Audio Interface Format (07h) register:
BIT6:	Master/slave mode
	0: Slave
	1: Master

Current code sets TLV320AIC23_MS_MASTER bit for master mode,
but does not clear it for slave mode.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-27 12:00:14 +02:00
Axel Lin b272cc769a ASoC: wm8940: Fix mask for setting BCLKDIV
According to the datasheet:
BCLK is controlled by BIT[4:2] of WM8940_CLOCK(06h) register.

Signed-off-by: Chris Paulson-Ellis <chris@edesix.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-27 11:59:26 +02:00
Axel Lin 9c173d15f9 ASoC: tlv320aic3x: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-27 11:58:28 +02:00
Takashi Iwai bb14eb0da7 Merge branch 'topic/asoc' into for-linus 2011-10-27 10:43:40 +02:00
Axel Lin 5927f94700 ASoC: wm8940: Properly set codec->dapm.bias_level
Reported-by: Chris Paulson-Ellis <chris@edesix.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
2011-10-27 09:17:08 +02:00
Takashi Iwai 9430148d80 Merge branch 'topic/remove-irqf_disable' into for-linus 2011-10-26 23:51:48 +02:00
Linus Torvalds 59e5253417 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (59 commits)
  MAINTAINERS: linux-m32r is moderated for non-subscribers
  linux@lists.openrisc.net is moderated for non-subscribers
  Drop default from "DM365 codec select" choice
  parisc: Kconfig: cleanup Kernel page size default
  Kconfig: remove redundant CONFIG_ prefix on two symbols
  cris: remove arch/cris/arch-v32/lib/nand_init.S
  microblaze: add missing CONFIG_ prefixes
  h8300: drop puzzling Kconfig dependencies
  MAINTAINERS: microblaze-uclinux@itee.uq.edu.au is moderated for non-subscribers
  tty: drop superfluous dependency in Kconfig
  ARM: mxc: fix Kconfig typo 'i.MX51'
  Fix file references in Kconfig files
  aic7xxx: fix Kconfig references to READMEs
  Fix file references in drivers/ide/
  thinkpad_acpi: Fix printk typo 'bluestooth'
  bcmring: drop commented out line in Kconfig
  btmrvl_sdio: fix typo 'btmrvl_sdio_sd6888'
  doc: raw1394: Trivial typo fix
  CIFS: Don't free volume_info->UNC until we are entirely done with it.
  treewide: Correct spelling of successfully in comments
  ...
2011-10-25 12:11:02 +02:00
Manuel Lauss 3766386037 MIPS: Alchemy: remove all CONFIG_SOC_AU1??? defines
Now that no driver any longer depends on the CONFIG_SOC_AU1???  symbols,
it's time to get rid of them: Move some of the platform devices to the
boards which can use them, Rename a few (unused) constants in the header,
Replace them with MIPS_ALCHEMY in the various Kconfig files.  Finally
delete them altogether from the Alchemy Kconfig file.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/2707/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-10-24 23:34:24 +01:00
Axel Lin bdb527e9ae ASoC: wm8940: Fix a typo for the mask of setting WM8940_BCLKDIV
The registers are 16 bits, thus remove an extra F for the mask.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-24 14:09:50 +02:00
Axel Lin 49fa4d9b5a ASoC: wm8940: Fix setting PLL Output clock division ratio
According to the datasheet:
The PLL Output clock division ratio is controlled by BIT[5:4] of
WM8940_GPIO register(08h).
Current code read/write the WM8940_ADDCNTRL(07h) register which is wrong.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-24 14:09:42 +02:00
Axel Lin 753ddf5215 ASoC: wm8996: Avoid a redundant i2c_get_clientdata call in wm8996_i2c_remove
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-24 14:09:33 +02:00
Axel Lin 1d533de998 ASoC: wm8400: Fix setting Fout clock divider for FLL Control 4
What we want here is to clear the WM8400_FLL_OUTDIV_MASK bits then
OR with factors.outdiv.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-24 14:09:26 +02:00
Axel Lin 0d8d293898 ASoC: max98095: Convert codec->hw_write to snd_soc_write
codec->hw_write is broken now, convert codec->hw_write to snd_soc_write.

The hardware has 2 banks of registers sharing a section in I2C register space.
The 1st bank is the primary one and is cached.
The 2nd bank is for loading coefficients only and they do not need cache.
These coefficients registers are therefore direct writes.
Thus we set cache_bypass flag to deal with this before calling snd_soc_write.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-22 11:09:54 +01:00
Julia Lawall 226d0f22d0 ASoC: keep pointer to resource so it can be freed
Add a new variable for storing resources accessed subsequent to the one
accessed using request_mem_region, so the one accessed using
request_mem_region can be released if needed.

The resource variable names are also changed to be more descriptive.

This code is also missing some calls to iounmap.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

if (E == NULL)
{
  ... when != if (E == NULL || ...) S1 else S2
      when != E = E1
*E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-22 10:46:35 +01:00
Axel Lin 33cb92cff9 ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
Ensure all mask bits are clear before setting new value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-22 10:35:20 +01:00
Axel Lin 3205e6629b ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-22 10:34:59 +01:00
Ashish Chavan 52082d8f56 ASoC: da7210: Add support for line out and DAC
DA7210 has three line outputs. OUT1 Left, OUT1 Right and OUT2 (mono).
This patch adds support for gain controls for these three line outs.
It also adds support for overall DAC gain control.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-22 10:34:50 +01:00
Ashish Chavan 6950c60dc1 ASoC: da7210: Add support for DAPM
This patch adds support for DAPM covering all inputs and outputs
as well as ADC and DAC.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-22 10:34:22 +01:00
Axel Lin 064a4bcee4 ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value
We have defined SGTL5000_LINREG_VDDD_MASK in sgtl5000.h,
use it instead of hardcoded (0x1 << 4) - 1 for the mask.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-21 09:56:06 +01:00
Axel Lin 5b13de7aa7 ASoC: Set sgtl5000->ldo in ldo_regulator_register
Otherwise calling ldo_regulator_remove() does not unregister regulator
and free memories.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-21 09:55:43 +01:00
Axel Lin ff39dbe935 ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-20 15:03:23 +01:00
Axel Lin 35024f4922 ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-20 15:03:05 +01:00
Axel Lin 6765ff778e ASoC: rt5631: Remove unused codec field from struct rt5631_priv
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-20 15:02:34 +01:00
Axel Lin f96c255df7 ASoC: ak4671: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-20 15:02:26 +01:00
Axel Lin cf0feafbc3 ASoC: Fix reg_word_size for ak4104
According to the register map in datasheet, the registers are 8 bit.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-20 15:02:09 +01:00
Axel Lin 9f9619a078 ASoC: wm9081: Fix setting soft VMID ramp enable with VMID 2*240k
According to the datasheet:
BIT 2:1
        VMID_SEL[1:0] VMID Divider Enable and Select
        00 = VMID disabled
        01 = 2x40k Omh divider
        10 = 2x240k Omh divider
        11 = 2x5k Omh divider

To set VMID 2*240k, we should OR reg with 0x04 instead of 0x40.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-20 14:48:22 +01:00
Axel Lin 24441e17fe ASoC: ak4641: Use SND_SOC_DAPM_DAC for Voice Playback stream widget
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 18:01:43 +01:00
Ashish Chavan de5eaf844e ASoC: da7210: Add support for ALC and Noise suppression
This patch adds controls to set following ALC parameters,
 - Max gain, Min gain, Noise gain, Attack rate, Release rate and delay

It also adds a switch to enable/disable noise suppression.

As per DA7210 data sheet, ALC and noise suppression can be enabled
only if certain conditions are met. This condition checks are handled
by simply using "_EXT" version of controls to capture change events.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Acked-by: Liam Girdwod <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 17:59:08 +01:00
Ashish Chavan 5eda19497b ASoC: da7210: Add support for mute and zero cross controls
This patch adds support for below set of controls,
(1) Mute controls for MIC, AUX and ADC
(2) Zero cross controls for head phone, AUX, INPGA and line out
(3) Head phone mode selection - class H or G

It also adds digital_mute() call back.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 17:58:58 +01:00
Axel Lin 812b404c90 ASoC: ak4641: Remove unused codec field from struct ak4641_priv
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 17:58:49 +01:00
Axel Lin 2ee9c183f3 ASoC: ssm2602: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 15:22:01 +01:00
Mark Brown f8faadb6f2 ASoC: WM9081 interrupt status register is volatile
Not that we have interrupt handling in the driver at the minute.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-10-19 13:10:01 +01:00
Axel Lin dc56c5a862 ASoC: sgtl5000: Fix setting mic bias resistor
According to the datasheet:
CHIP_MIC_CTRL 0x002A

BITS[9:8] BIAS_RESISTOR
        0x0 = Powerd off
        0x1 = 2.0 kohm
        0x2 = 4.0 kohm
        0x3 = 8.0 kohm

To set mic bias resistor, we need to update bits[9:8] of
SGTL5000_CHIP_MIC_CTRL register.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 13:08:39 +01:00
Axel Lin 56c09aa520 ASoC: sgtl5000: Fix define for SGTL5000_BIAS_R_MASK
According to the datasheet:
CHIP_MIC_CTRL 0x002A

BITS[9:8] BIAS_RESISTOR
        0x0 = Powerd off
        0x1 = 2.0 kohm
        0x2 = 4.0 kohm
        0x3 = 8.0 kohm

Thus SGTL5000_BIAS_R_MASK should be defined as 0x0300 instead of 0x0200.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 13:08:18 +01:00
Axel Lin 54c96cfd1a ASoC: ad193x: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 12:07:43 +01:00
Mark Brown 4b1cfcb4f3 ASoC: Fix prefixing of DAPM controls
We don't want to clear the prefix while we're creating the DAPM controls
for the device as the prefix is applied during control creation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-10-18 11:16:31 +01:00
Mark Brown 680fa1f807 ASoC: Convert WM9081 to table based control init
At least for the core controls, the optionally selected controls are still
added programatically.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-10-18 11:16:15 +01:00
Mark Brown 6473a14805 ASoC: Update WM1811 DCS codes for latest evaluation results
Evaluation of larger quantities of material has provided new DCS codes
values to be applied for WM1811.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-10-18 11:15:36 +01:00
Axel Lin a6785d7df8 ASoC: wm8580: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin 29c6a01df8 ASoC: wm8900: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin de5035b1dd ASoC: wm8900: Fix the mask defines
Now we have done bitwise NOT against the mask bits for the defines of
WM8900_REG_CLOCKING1_BCLK_MASK,
WM8900_REG_CLOCKING1_OPCLK_MASK and WM8900_LRC_MASK.

But we don't have the bitwise NOT against the mask bits for the defines of
WM8900_REG_CLOCKING2_DAC_CLKDIV,
WM8900_REG_CLOCKING2_ADC_CLKDIV and WM8900_REG_DACCTRL_AIF_LRCLKRATE.

It is error prone to mix the inconsistent meaning for different mask defines.
So lets make the defines for each mask to be corresponding to the bits
defines in datasheet. Don't add extra "bitwise NOT" to the defines.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin 151b75995a ASoC: wm8900: Fix wrong mask for setting DAC_CLKDIV/ADC_CLKDIV/LRCLK_MODE
After checking the datasheet, I think what we want to do here is to
clear the WM8900_REG_CLOCKING2_DAC_CLKDIV/WM8900_REG_CLOCKING2_ADC_CLKDIV/
WM8900_REG_DACCTRL_AIF_LRCLKRATE bits and then OR with div value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin df3431b74e ASoC: wm8741: Use snd_soc_cache_sync to sync reg_cache with the hardware
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:47:01 +01:00
Axel Lin 3a340104fa ASoC: wm8741: Fix setting interface format for DSP modes
According to the datasheet:
Format Control (05h)
BITS[3:2]
        FMT[1:0] Audio data format selection
                00 = right justified mode
                01 = left justified mode
                10 = I2S mode
                11 = DSP mode
BIT[4]  LRP Polarity selec for LRCLK/DSP mode select
                0 = normal LRCLK poalrity/DSP mode A
                1 = inverted LRCLK poarity/DSP mode B

For SND_SOC_DAIFMT_DSP_A, we should set 0x000C instead of 0x0003.
For SND_SOC_DAIFMT_DSP_B, we should set 0x001C instead of 0x0013.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-17 22:46:41 +01:00
Ashish Chavan 4ced2b96f3 ASoC: da7210: Add support for High pass and Voice filters for ADC and DAC
This patch add controls for setting cut-off for high pass and voice
filters of ADC and DAC. There are also switches to enable/disable
these filters.

Also removed hard coded, fixed  values of these parameters used by
previous version of driver.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:43:33 +01:00
Ashish Chavan 0ee6e9e721 ASoC: da7210: Add support for ADC & DAC equalizers
This patch adds support for ADC and DAC five band equalizers
available on DA7210 codec.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:43:32 +01:00
Olof Johansson 01840bbe5f ASoC: Tegra: sparse cleanup
Fixes the following sparse warnings:

sound/soc/tegra/tegra_das.c:215:8: warning: Using plain integer as NULL pointer
sound/soc/tegra/tegra_das.c:237:8: warning: Using plain integer as NULL pointer
sound/soc/tegra/tegra_pcm.c:370:32: warning: symbol 'tegra_pcm_platform' was not declared. Should it be static?

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:43:16 +01:00
Peter Ujfalusi 35dec69757 ASoC: twl6040: Request core to inline the DAPM sequence
We need to have as less time between McPDM shutdown,
and power down of the DAC on the twl6040 codec as possible.
Request core to ignore the pmdown_time for the playback
stream.
Backround: with the McPDM protocol we are sendning not only
the pure audio stream, but OMAP McPDM also transmits
additional information (for example offset cancellation).
If McPDM is stopped prior to the DAC this information will
be not sent to the codec, which can result noise rendered
by the twl6040 codec.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:42:21 +01:00
Peter Ujfalusi 1d69c5c5de ASoC: core: Add flag to ignore pmdown_time at pcm_close
With this flag codec drivers can indicate that it is desired
to ignore the pmdown_time for DAPM shutdown sequence when
playback stream is stopped.
The DAPM sequence will be executed without delay in this case.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:42:21 +01:00
Ashish Chavan 7a0e67b687 ASoC: da7210: bugfix for head phone volume control
This patch takes care of reserved bits of headphone volume
register by using correct volume range.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:31 +01:00
Axel Lin f3aa7219b1 ASoC: ad193x: Fix define of AD193X_PLL_INPUT_MASK
Current code defines AD193X_PLL_INPUT_MASK as (~0x6) which is quite
different from other MASK defines.
To make it consistent with other mask defines, define AD193X_PLL_INPUT_MASK
as 0x6 and change the code accordingly.
I think this change improves the readability.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 79d0726513 ASoC: wm8990: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

This patch also includes a comment fix in wm8990_set_dai_pll(),
if freq_in and freq_out are 0, what we do is to clear WM8990_PLL_ENA bit.
Thus the comment should be "Turn off PLL".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 790f932500 ASoC: wm8990: Fix wrong bit setting for WM8990_POWER_MANAGEMENT_2
If (fakepower & ((1 << WM8990_INMIXR_PWR_BIT) | (1 << WM8990_AINRMUX_PWR_BIT)))
is false, we should clear WM8990_AINR_ENA bits instead of WM8990_AINL_ENA.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 1a8e8d2234 ASoC: wm8400: Fix wrong bit setting for WM8400_POWER_MANAGEMENT_2
If (fakepower & ((1 << WM8400_INMIXR_PWR) | (1 << WM8400_AINRMUX_PWR)))
is false, we should clear WM8400_AINR_ENA bits instead of WM8400_AINL_ENA.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin c639adc68f ASoC: wm8991: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 3f387a2170 ASoC: wm8991: Fix wrong bit setting for WM8991_POWER_MANAGEMENT_2
If (fakepower & ((1 << WM8991_INMIXR_PWR_BIT)|(1 << WM8991_AINRMUX_PWR_BIT))))
is false, we should clear WM8991_AINR_ENA bits instead of WM8991_AINL_ENA.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin 370f464533 ASoC: wm8961: Convert codec->hw_read to snd_soc_read
codec->hw_read is broken now, let's covert to snd_soc_read.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin 38c436aa9f ASoC: tlv320aic3x: Convert codec->hw_read to snd_soc_read
codec->hw_read is broken now, let's covert to snd_soc_read.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin 524205ce71 ASoC: alc5623: Convert codec->hw_read to snd_soc_read
codec->hw_read is broken now, let's covert to snd_soc_read.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin f9dfbf91cb ASoC: tlv320aic23: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Mark Brown a6f096f3b6 ASoC: Convert DA7210 to table based DAPM init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:18:49 +01:00
Axel Lin bc6ae96a44 ASoC: tlv320aic32x4: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:38:36 +01:00
Peter Ujfalusi 694b00010b ASoC: twl6040: Rename the Earphone Driver event handler
Since the event handler is only used by the Earphone Driver, it is better
to rename it from twl6040_power_mode_event to twl6040_ep_drv_event.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:40 +01:00
Peter Ujfalusi aa1a41082f ASoC: twl6040: Change event ordering for Earphone driver
It is better to switch HS Power Mode (if it was in low power mode) before
we enable the Earpiece driver. The switched off EP driver can filter out
noise coming from the Low Power to High Performance transition on the
HSL DAC.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:40 +01:00
Peter Ujfalusi fac2f3e4dc ASoC: twl6040: Remove PLL usage restrictions
There is no limitation dictated by outputs or inputs regarding to the
selected PLL (LP/HP).
Remove the checks for this, and allow all path with any PLL configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:39 +01:00
Peter Ujfalusi f872826e94 ASoC: twl6040: Remove Capture restriction for 17.64MHz sysclk
Capture is supported in all PLL configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:39 +01:00
Paul Bolle 6760235fa4 Drop default from "DM365 codec select" choice
SND_DM365_EXTERNAL_CODEC does not exist, so it's a useless default.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-13 18:19:31 +02:00
Mark Brown 1cba77c163 ASoC: Update WM5100 accessory detection for revision A
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 12:20:24 +01:00
Axel Lin 7c04241acb ASoC: ak4535: fixup cache register table
ak4535_reg should be 8bit, but cache table is defined as 16bit.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-13 11:59:20 +01:00
Kuninori Morimoto 19b115e523 ASoC: ak4642: fixup cache register table
ak4642 register was 8bit, but cache table was defined as 16bit.
ak4642 doesn't work correctry without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-13 11:58:10 +01:00
Axel Lin edf413f689 ASoC: sta32x: Write the register default value to cache for reserved registers
Chip documentation explicitly requires that the reset values
of reserved register bits are left untouched.

codec->hw_read is broken now.
Here we use below trick to avoid writing to reserved registers while resume.
Write the register default value to cache for reserved registers,
so the write to the these registers are suppressed by the cache
restore code when it skips writes of default registers.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 11:50:05 +01:00
Axel Lin f0bbc2b55f ASoC: sta32x: Set reg_cache_default to sta32x_regs
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 11:50:05 +01:00
Axel Lin dbe37dbc1b ASoC: pxa: Remove redundant snd_soc_dapm_sync() calls from machine drivers
The core will sync DAPM as part of the card initialization, there is no
need for machine drivers to do so during their setup.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 11:50:04 +01:00
Axel Lin b29a33a211 ASoC: Make SND_SOC_SAARB and SND_SOC_TAVOREVB3 select MFD_88PM860X
In saarb_pm860x_init() and evb3_pm860x_init(), we call
pm860x_hs_jack_detect() and pm860x_mic_jack_detect() which in turn
calls pm860x_set_bits().
Thus make SND_SOC_SAARB and SND_SOC_TAVOREVB3 select MFD_88PM860X.

This patch fixes below build error if CONFIG_MFD_88PM860X is not configured.

  LD      .tmp_vmlinux1
sound/built-in.o: In function `pm860x_write_reg_cache':
last.c:(.text+0x29e9c): undefined reference to `pm860x_reg_write'
sound/built-in.o: In function `pm860x_set_bias_level':
last.c:(.text+0x29ecc): undefined reference to `pm860x_set_bits'
last.c:(.text+0x29f00): undefined reference to `pm860x_reg_write'
last.c:(.text+0x29f18): undefined reference to `pm860x_reg_write'
sound/built-in.o: In function `pm860x_read_reg_cache':
last.c:(.text+0x29f40): undefined reference to `pm860x_reg_read'
sound/built-in.o: In function `pm860x_probe':
last.c:(.text+0x2a034): undefined reference to `pm860x_bulk_read'
sound/built-in.o: In function `pm860x_codec_handler':
last.c:(.text+0x2a344): undefined reference to `pm860x_reg_read'
last.c:(.text+0x2a354): undefined reference to `pm860x_reg_read'
sound/built-in.o: In function `pm860x_mic_jack_detect':
last.c:(.text+0x2a450): undefined reference to `pm860x_set_bits'
sound/built-in.o: In function `pm860x_hs_jack_detect':
last.c:(.text+0x2a4d0): undefined reference to `pm860x_set_bits'
last.c:(.text+0x2a4f8): undefined reference to `pm860x_set_bits'
last.c:(.text+0x2a510): undefined reference to `pm860x_set_bits'
make: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 17:09:15 +01:00
Ashish Chavan 0f8ea586d7 ASoC: da7210: Add support for other DAI word lengths, format and mode
This patchs adds support for following,
(1) DAI 20 and 32 bit word sizes
(2) DAI left and right justified formats
(3) DAI slave mode

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 15:57:06 +01:00
Peter Ujfalusi 33b6816ca3 ASoC: twl6040: Workaround for headset DC offset caused pop noise
Both Headset DAC need to be turned on/off at the same time before
any of the output drivers are enabled (HS Left/Right, Earpiece).
Move the HS DAC enable code to sequenced DAPM_SUPPLY, and attach
it to the DACs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 13:11:54 +01:00
Peter Ujfalusi 67c341302f ASoC: twl6040: Support for vibra output paths
twl6040 have two vibra output drivers.
They can be operated with audio stream coming through
the PDM interface (fifth channel).
The vibra outputs can be controlled via the input/FF
driver as well.
Selection between the two mode is implemented within
the codec driver, the input/FF driver can only operate if
the routing is set to "Input FF".
Changing from "Input FF" to "Audio PDM" mode is protected
as well: The switchin can only be done, if there is no
running effect from the input/FF.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:48:52 +01:00
Axel Lin 40a4971010 ASoC: da7210: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:25:59 +01:00
Axel Lin 48df93d4c7 ASoC: Remove impossible case from wm8994_hw_params
We set hw_params callback for wm8994_aif3_dai_ops to wm8994_aif3_hw_params.
Thus no need to check wm8994-aif3 in wm8994_hw_params.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:25:58 +01:00
Axel Lin 75b9a5782e ASoC: Delete ads117x.h
This is not required after multi-component patch.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:25:58 +01:00
Axel Lin b91470bb37 ASoC: ak4642: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:21:12 +01:00
Mark Brown b90d2f9084 ASoC: Instantiate card widgets immediately
This ensures they are available prior to the card late_probe().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 18:59:17 +01:00
Mark Brown ba896ede9a ASoC: Implement WM5100 accessory detection support
The WM5100 includes an advanced, low power, accessory detect subsystem
capable of detecting both accessory presence and button presses while
the device is in an ultra low power mode. Implement initial support for
this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 18:59:01 +01:00
Mark Brown 3a53d82729 ASoC: Add missing default for WM5100 Clocking 1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 18:25:11 +01:00
Wolfram Sang 684a65d4fb ASoC: Fix typo in Kconfig symbol for tlv320aic32x4
It is currently named "TVL" instead of "TLV".

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Peter Ujfalusi 8066eb55b5 ASoC: tlv320dac33: Convert to table based init
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Peter Ujfalusi f7c93f018d ASoC: twl4030: Convert to table based init
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Peter Ujfalusi a175fce01b ASoC: twl6040: Convert to table based init
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Axel Lin 6f25e4eed9 ASoC: Writing register default value for the reset register
The WM8983 can be reset by performing a write of any value to
the software reset register.
To avoid writing to the software reset register while resume,
we should write the same value in wm8983_reg_defs to software
reset register in wm8983_probe().
The write to the reset register is suppressed by the cache
restore code when it skips writes of default registers.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Mark Brown 35f0678ef7 ASoC: Convert Goni to data based DAPM init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
2011-10-11 14:30:19 +01:00
Peter Ujfalusi f8cf149f3e ASoC: sdp3430: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:12 +01:00
Peter Ujfalusi 93b4d790b7 ASoC: osk5912: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core. With this change we do not need the init function
since the remaining snd_soc_dapm_enable_pin calls are
not needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:12 +01:00
Peter Ujfalusi 8966c2dd51 ASoC: n810: Let the core to register DAPM widgets/routes and controls
Pass the DAPM widgets/routes and static controls via the
snd_soc_card struct to core. In this way the machine driver
does not need to handle the DAPM widgets/routes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:11 +01:00
Peter Ujfalusi d2266025ea ASoC: am3517evm: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core. With this change we do not need the init function
since the remaining snd_soc_dapm_enable_pin calls are
not needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Anuj Aggarwal <anuj.aggarwal@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:11 +01:00
Peter Ujfalusi d805846960 ASoC: sdp4430: No need to call dapm_pin_enable at init time
Widgets are connected by default.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:11 +01:00
Peter Ujfalusi fc8e5b4c6b ASoC: sdp4430: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:11 +01:00
Peter Ujfalusi cd4a3d5d0d ASoC: zoom2: No need to call dapm_pin_enable at init time
Widgets are connected by default.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:11 +01:00
Peter Ujfalusi 1083dbd1d7 ASoC: zoom2: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:11 +01:00
Peter Ujfalusi cb4248779d ASoC: OMAP machines: Remove soc_dapm_sync() call from init
No need to call soc_dapm_sync at init time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Anuj Aggarwal <anuj.aggarwal@ti.com>
Cc: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Gražvydas Ignotas <notasas@gmail.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 16:18:10 +01:00
Mark Brown 03b5362d2f ASoC: Convert Jive to table based init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
2011-10-10 11:10:44 +01:00
Mark Brown ce363f6d34 ASoC: Convert SMDK WM8580 to table based DAPM init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
2011-10-10 11:07:36 +01:00
Mark Brown 257fe5930d ASoC: Convert SmartQ to table based init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
2011-10-10 11:07:33 +01:00
Mark Brown 8ae232299e ASoC: Convert RX1950 to table based init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
2011-10-10 11:07:30 +01:00
Mark Brown 6119d016b1 ASoC: Convert H1940 to table based init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
2011-10-10 11:07:26 +01:00
Mark Brown 4f5448ae4b ASoC: Convert Simtec machines to table based DAPM init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 11:06:22 +01:00
Michael Opdenacker 6179b772ac ASoC: fix checkpatch.pl error in omap-mcbsp
Signed-off-by: Michael Opdenacker <michael.opdenacker@linaro.org>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:31:59 +01:00
Axel Lin 3b18450371 ASoC: ak4535: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:59 +01:00
Axel Lin fa5fdb473e ASoC: wm8988: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:59 +01:00
Axel Lin 0bad3d8453 ASoC: wm8974: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:59 +01:00
Axel Lin e46199ece4 ASoC: wm8971: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin bc45df2dd9 ASoC: wm8960: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin 788b6e8efa ASoC: wm8940: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin abe11d0aac ASoC: wm8776: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin 4d4adfc979 ASoC: wm8750: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:57 +01:00
Axel Lin 9bf311fe17 ASoC: wm8731: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:57 +01:00
Axel Lin 960622da0d ASoC: wm8711: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:57 +01:00
Axel Lin 94f17e9cfa ASoC: wm8510: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:56 +01:00
Mark Brown 25c77c5fae ASoC: Fix DAPM sync for TLV320AIC3x custom DAPM widget
We really should be doing this in the core, not in a driver...

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
2011-10-10 10:28:26 +01:00
Mark Brown 3ebb5c9b10 ASoC: Squash error codes from regmap down to -1 on read
The ASoC code always uses -1 as the error code due to reporting errors in
band with the value. Ensure we don't confuse anything by making sure we
don't pass actual error codes back into the rest of the code on read.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-09 14:35:59 +01:00
Mark Brown 024dc07855 ASoC: Cache connected input and output recursions
The number of connected input and output endpoints for a given widgets
can't change during a DAPM run so there is no need to redo the recursion
through branches of the tree we've already visited. Doing this on one of
my test systems gives an improvement of:

         Power    Path   Neighbour
Before:  63       607    731
After:   63       141    181

which scales up well as more widgets are involved in paths.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-09 12:07:48 +01:00
Mark Brown 7ca3a18b05 ASoC: Assign power_check when we allocate DAPM widgets
This ensures none of the rest of the code ever encounters a widget which
does not have a power check function.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-08 17:55:55 +01:00
Mark Brown 2dc00213b0 ASoC: Ensure all DAPM widgets are instantiated with the card
Specifically for the widgets added by machine driver late probe functions.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-08 17:55:51 +01:00
Mark Brown 87bea31c7b ASoC: Remove redundant snd_soc_dapm_sync() calls from machine drivers
The core will sync DAPM as part of the card initialization, there is no
need for machine drivers to do so during their setup.

OMAP drivers are omitted as I know Peter already has patches for them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-08 14:10:54 +01:00
Mark Brown 4f4c007222 ASoC: Suppress early calls to snd_soc_dapm_sync()
Ensure we only have one sync during the initial startup of the card by
making snd_soc_dapm_sync() a noop on non-instantiated cards. This avoids
any bounces due to things like jacks reporting their initial state on
partially initialised cards. The callers that don't also get called at
runtime should just be removed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-08 11:47:32 +01:00
Mark Brown 4f6d45f121 Merge branch 'for-3.1' into for-3.2 2011-10-06 20:03:18 +01:00
Axel Lin ac60155f7a ASoC: Return early with -EINVAL if invalid dai format is detected
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 20:02:56 +01:00
Axel Lin 3c08600144 ASoC: wm8990: Remove incorrect comments
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 20:02:56 +01:00
Axel Lin 416a0ce5f2 ASoC: wm8990: Convert to snd_soc_cache_sync for sync reg_cache with the hardware
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 20:02:55 +01:00
Wolfram Sang 23524eb16a ASoC: tlv320aic32x4 fix initialization of micpga routing
Checking the pdata-flags used 'or', so the check is always true. Use 'and' to
correctly mask the flags.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 20:00:11 +01:00
Mark Brown 143d62a45b ASoC: Ensure DAPM widgets are set up before we sync jacks
We synchronise jack state on startup - when we do that make sure that we
have set up all the DAPM widgets first in case we end up touching any of
the partially set up widgets when syncing the jack pins.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
2011-10-06 16:18:39 +01:00
Peter Ujfalusi c4671a9585 ASoC: Replace remaining use of *_volsw_2r with *_volsw
The snd_soc_*_volsw_2r functionality has been merged to
*volsw callbacks.
Few places still used the get, or put variant of volsw_2r,
replace those with the corresponding *_volsw.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 11:16:08 +01:00
Mark Brown 9a185b9aba ASoC: Remove references to linux@wolfsonmicro.com
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 11:10:01 +01:00
Axel Lin 698570062d ASoC: Remove unused variable 'wm9090' in wm9090_probe
Eliminate below build warning:
  CC      sound/soc/codecs/wm9090.o
sound/soc/codecs/wm9090.c: In function 'wm9090_probe':
sound/soc/codecs/wm9090.c:550: warning: unused variable 'wm9090'

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:16:58 +01:00
Axel Lin 0df2c594b9 ASoC: imx: Remove unused variable 'dai'
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:16:58 +01:00
Axel Lin 089f3383c7 ASoC: Remove unused function declaration in imx-ssi.h
These functions are removed in commit f0fba2ad
"ASoC: multi-component - ASoC Multi-Component Support".
Let's remove the leftover function declaration in header file.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:16:58 +01:00
Peter Ujfalusi a0acf47f1b ASoC: twl6040: Warn user in twl6040_put_volsw for error case
Let the user know, that the callback has been called with unexpected
register parameter.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:10 +01:00
Peter Ujfalusi db382da5ff ASoC: twl6040: Simply call snd_soc_put_volsw form the custom code
The ASoC core now have one callback function, which can handle
single, and double register mixer controls.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:10 +01:00
Peter Ujfalusi 974815ba4f ASoC: core: Combine snd_soc_put_volsw/put_volsw_2r functions
Handle the put_volsw/put_volsw_2r in one function.

To avoid build breakage in twl6040 keep the
snd_soc_put_volsw_2r as define, and map it snd_soc_put_volsw.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:10 +01:00
Peter Ujfalusi f7915d9975 ASoC: core: Combine snd_soc_get_volsw/get_volsw_2r functions
Handle the get_volsw/get_volsw_2r in one function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi e8f5a10307 ASoC: core: Combine snd_soc_info_volsw/info_volsw_2r functions
Handle the info_volsw/info_volsw_2r in one function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi 08a1ed76f5 ASoC: twl6040: Prepare for core put_volsw/volsw_2r merger
Avoid using the mc->rreg to identify the 2r type of gain control.
Introduce a variable to track this.
This change is needed to avoid breakage with the upcoming volsw volsw_2r
merger.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi e49b68339e ASoC: twl6040: Simplify custom get_volsw callback
The custom get_volsw does not need to call any core get_volsw calls,
since we are returning the shadow values for the gains.
Return -EINVAL in the unlikely event, if the function has been called
for unhandled control. This way we can remove one check in the code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi 0f9887d11e ASoC: Consolidate use of controls with custom get/put function
Use the macros for controls require custom get/put function.
This is to make sure that the soc_mixer_control is used
consistently among the drivers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Arun KS <arunks@mistralsolutions.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:08 +01:00
Mark Brown 7508b12a8e ASoC: Use dapm_mark_dirty() for new DAPM widgets for consistency
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 12:54:33 +01:00
Mark Brown f68d7e1687 ASoC: Stop checking for supplied widgets after we find the first
We don't really care how many widgets a supply is supplying, we just care
if the number is non-zero. This didn't actually produce any improvement
in the test cases I've been using but seems obviously sensible enough that
I'm pushing it out anyway.

We could do a similar thing for other widgets but this may be unhelpful
for further refactorings Liam was working on aiming to allow us to
identify connected audio paths.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 11:22:40 +01:00
Mark Brown f3bf3e456a ASoC: Don't mark the outputs of supplies as dirty on state changes
The whole point of supply widgets is that they aren't inputs to their
sinks so a state change in a supply should never affect the state of the
widget being supplied and we don't need to mark them as dirty.

           Power    Path   Neighbour
Before:    69       727    905
After:     63       607    731

This is particularly useful where supplies affect large portions of the
chip (eg, a bandgap supplying the analogue sections).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 11:22:30 +01:00
Mark Brown 9b8a83b205 ASoC: Only run power_check() on a widget once per run
Some widgets will get power_check() run on them more than once during a
DAPM run, most commonly due to supply widgets checking to see if their
consumers are powered up. It's wasteful to do this so cache the result
of power_check() during a run. For one system I tested this on I got an
improvement of:

           Power    Path   Neighbour
Before:    106      970    1186
After:     69       727    905

from this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 11:22:22 +01:00
Mark Brown 75c1f891b4 ASoC: Add verbose debugging showing why widgets get marked dirty
Help diagnose why we're checking widgets by providing some logging when
we first dirty them. This should possibly be a trace point if it's useful
but can be absurdly verbose if enabled, we can always change it later if
desired.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 11:22:14 +01:00
Mark Brown fe4fda5d8f ASoC: Reduce the number of neigbours we mark dirty when updating power
If two widgets are not currently connected then there is no need to
propagate a power state change between them as we mark the affected
widgets when we change a connection. Similarly if a neighbour widget is
already in the state being set for the current widget then there is no
need to recheck.

On one system I tested this gave:

           Power    Path   Neighbour
Before:    114      1066   1327
After:     106      970    1186

which is an improvement, although relatively small.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:21 +01:00
Mark Brown db432b414e ASoC: Do DAPM power checks only for widgets changed since last run
In order to reduce the number of DAPM power checks we run keep a list of
widgets which have been changed since the last DAPM run and iterate over
that rather than the full widget list. Whenever we change the power state
for a widget we add all the source and sink widgets it has to the dirty
list, ensuring that all widgets in the path are checked.

This covers more widgets than we need to as some of the neighbour widgets
won't be connected but it's simpler as a first step. On one system I tried
this gave:

           Power    Path   Neighbour
Before:    207      1939   2461
After:     114      1066   1327

which seems useful.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:20 +01:00
Mark Brown 565631008f ASoC: Mark headphone, mic, speaker and line widgets as always connected
We're not actually doing any dynamic power management based on connection
and output drivers (which are pretty much the same thing) are marked as
unconditionally connected already.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:19 +01:00
Mark Brown d805002bef ASoC: Factor out widget power check operation
We've got the same code in two different places, let's have it in a single
place instead.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:19 +01:00
Mark Brown 35c64bcad5 ASoC: Ensure all DAPM widgets have a power check callback
Makes the code simpler.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:18 +01:00
Mark Brown f9de6d741d ASoC: Move bias level decision into main dapm_power_widgets()
Future patches will try to reduce the number of widgets we check on each
DAPM run but we're still going to need to look and see if the devices is
on at all so we can manage the overall device bias. Move these checks out
into the main dapm_power_widgets() function so we don't have to think about
them for now.

Once we're doing more incremental updates it'll probably be worth using
refcounts for each bias level to avoid having to do the sweep over all
widgets but that's not going to be where the big performance wins are.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:18 +01:00
Mark Brown 05623c4314 ASoC: Factor write of widget power out into a separate function
Split the decision about what the new power should be out from the
implementation of that decision.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:17 +01:00
Mark Brown 38f3f31a0a ASoC: Remove direct register cache accesses from WM8962 driver
Also fix return values for speaker switch updates.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-04 16:50:09 +01:00
Peter Ujfalusi bfd3d4e9fb ASoC: twl6040: Simplify custom put_volsw callback
Return -EINVAL in the unlikely event, if the function has been called
for unhandled control. This way we can remove one check in the code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:28:29 +01:00
Axel Lin 672f4c4d75 ASoC: Remove unneeded hw_write initialisation in wm8523
It is not required after commit 8d50e447
"ASoC: Factor out I/O for Wolfson 8 bit data 16 bit register CODECs"

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:06:23 +01:00
Axel Lin 499cb184e2 ASoC: Remove unneeded hw_write initialisation in ak4671
It is not required now.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:06:23 +01:00
Axel Lin d434bc32d0 ASoC: wm8711: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:05:13 +01:00
Axel Lin 696f9175fc ASoC: wm8988: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:05:12 +01:00
Axel Lin f5b00d024f ASoC: wm8750: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:05:11 +01:00
Axel Lin 1a3bbb40da ASoC: Avoid writing to WM8971_RESET in wm8971_resume
Writing to WM8971_RESET resets all registers to the default state.
Thus we should avoid writing to WM8971_RESET on resume.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:04:30 +01:00
Mark Brown 5d224e8f18 Merge branch 'for-3.1' into for-3.2 2011-10-04 15:44:43 +01:00
Axel Lin c527e6aadc ASoC: wm8994: Fix setting rate_reg for wm8994-aif2
For wm8994-aif2, the rate_reg should be WM8994_AIF2_RATE.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-04 15:43:29 +01:00