Commit graph

2313 commits

Author SHA1 Message Date
Mark Brown 3a4cbf8896 ASoC: Fix build of tlv320dac33
The problem was introduced due to the obscure formatting some of the
older drivers use.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-21 21:15:38 +00:00
Mark Brown 09452f23eb ASoC: Push WM5100 interrupt request into I2C probe
This is more what the device model wants us to do and will allow use by
non-audio functions before the audio part of the device has come up.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:32 +00:00
Mark Brown 46c1a877c6 ASoC: Make WM5100 interrupt path use regmap directly
This will allow us to move the interrupt allocation out of the ASoC part
of the driver and simplifies the locking by removing any reliance in the
bulk of the interrupt path on the big CODEC lock.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:32 +00:00
Mark Brown 218240e27f ASoC: Remove redundant set_bias_level() from WM5100 remove()
The framework should bring the device down before it calls the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:32 +00:00
Peter Ujfalusi 8819f65cec ASoC: twl4030: Use core to set the msbits constraint
Core can set the msbits constraint in behalf of the dai.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:31 +00:00
Peter Ujfalusi 8d725b2bcb ASoC: tlv320dac33: Use core to set the msbits constraint
Core can set the msbits constraint in behalf of the dai.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:31 +00:00
Fabio Estevam f2c6e757f6 ASoC: sgtl5000: Print revision number in hex
Throughout the sgtl5000 driver source code and also in the sgtl5000 datasheet
the revision code is shown in hexadecimal.

Print it hex format, for consistency.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:31 +00:00
Mark Brown 0132615da5 ASoC: Say we can't read WM5100 ID register
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:30 +00:00
Mark Brown 2688738eba ASoC: When releasing WM5100 put /RESET into reset
Reset is active low, make sure we leave it asserted when release the
device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:30 +00:00
Mark Brown 99b0292d94 ASoC: 24 bits are significant on wm_hubs DAIs
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:30 +00:00
Mark Brown 85f883933c ASoC: Make WM8993 I2C usage unconditional
The WM8993 only supports I2C so don't ifdef the I2C support in the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:30 +00:00
Mark Brown 164548d3b3 ASoC: Implement basic WM8993 interrupt support
If an interrupt is supplied then use it for thermal warning and FLL lock
notifications. When using the interrupt raise the timeout for the FLL lock
substantially to reduce the chances of spurious warnings.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:30 +00:00
Mark Brown a4b5233792 ASoC: 24 bits are significant on the WM8996 audio interfaces
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:30 +00:00
Mark Brown 5f52ee4875 ASoC: Add WM8962 DAC and ADC L/R swap support
Simple switches since there's no per-channel control.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:29 +00:00
Dimitris Papastamos d19fd5db3e ASoC: wm8983: Remove useless snd_kcontrol
This must be a leftover from a previous driver.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:29 +00:00
Mark Brown cef6d1d450 ASoC: Convert WM8962 register access map to modern style
Much more compact, both in terms of source and especially in terms of
RAM used at runtime.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:28 +00:00
Mark Brown 291d64be31 ASoC: Make WM8962 I2C usage unconditional
We only support I2C so no need to ifdef.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:27 +00:00
Manjunath Hadli 2e932f2940 ASoC: CQ93VC: remove machine specific header file inclusion from codec driver
remove unnecessary inclusion of machine specific header
file mach/dm365.h from cq93vc.c voice codec driver
which comes in the way of platform code consolidation.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:27 +00:00
Liam Girdwood 08656910bb ASoC: twl6040 - add method to query HS DC offset step size in mV
Provide a method for mach drivers to query the HS DC offset step size in mV.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:26 +00:00
Mark Brown 9b85fc9063 ASoC: Optimise performance of WM8904 ADC 128fs OSR mode
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:26 +00:00
Mark Brown 3294c4c603 ASoC: Convert WM8955 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:25 +00:00
Mark Brown 95860fdf0f ASoC: Convert WM8955 to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:25 +00:00
Mark Brown 9887cb9e65 ASoC: Use standard register cache sync for WM8955
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:25 +00:00
Mark Brown ba5c88d02d ASoC: Convert WM8955 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:25 +00:00
Mark Brown 1e9c898df0 ASoC: Make I2C usage unconditional in WM8955
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:24 +00:00
Mark Brown 42dad0d84a ASoC: Convert WM8940 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:24 +00:00
Mark Brown b5531205f5 ASoC: Make I2C usage unconditional in WM8940
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:24 +00:00
Mark Brown 84d0d83180 ASoC: Convert WM8904 to direct regmap API usage
The device has a very sparse register map so should benefit from using a
rbtree cache.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:24 +00:00
Mark Brown 274eb8f9d8 ASoC: Use standard cache sync for WM8904
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:24 +00:00
Mark Brown 93e26d4e44 ASoC: Convert wm8904 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:23 +00:00
Mark Brown 429440c947 ASoC: Make WM8904 I2C usage unconditional
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:23 +00:00
Mark Brown 891271c28f ASoC: Convert wm8804 to direct regmap API usage
The register map for this device is actually fairly sparse so the rbtree
should be beneficial.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:23 +00:00
Mark Brown f649f1a8aa ASoC: Convert wm8804 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:22 +00:00
Mark Brown e055cd67fd ASoC: Use standard cache sync for wm8804
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:22 +00:00
Mark Brown c2562a8e3b ASoC: Remove wm8974 private data
It's only ever referenced when being allocated and freed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:22 +00:00
Mark Brown a2bd691c64 ASoC: Convert wm8974 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:21 +00:00
Mark Brown 7a389651bd ASoC: Make wm8974 I2C usage unconditional
The driver only supports I2C at present.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:21 +00:00
Mark Brown 028b0a0a92 ASoC: Convert wm8971 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:21 +00:00
Mark Brown c4850644ce ASoC: Convert wm8971 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:21 +00:00
Mark Brown 542cc361de ASoC: Make WM8971 I2C usage unconditional
The driver only supports I2C so no need to worry about SPI only systems.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:21 +00:00
Mark Brown d3398ff059 ASoC: Convert WM8753 to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:20 +00:00
Mark Brown bfea3abb80 ASoC: Move WM8993 resource acquisition and device reset to bus probe
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:20 +00:00
Mark Brown d0ad0af043 ASoC: Convert wm8993 to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:20 +00:00
Mark Brown 391d9e4e5c ASoC: Move WM9090 device identification and reset to I2C probe
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:20 +00:00
Mark Brown ec2c0fec11 ASoC: Convert WM9090 to use regmap directly
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:20 +00:00
Mark Brown 008f8d4f99 ASoC: Push wm8978 reset down into the I2C probe
Ensures that we get control of the CODEC earlier and don't try to probe
the card at all if register I/O isn't working.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:19 +00:00
Mark Brown ee60d0155d ASoC: Convert wm8978 to direct regmap API usage
Helps push the register cache code down out of ASoC and improves resume
times by using the more efficient regmap cache sync code.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:19 +00:00
Mark Brown f98692ea6d ASoC: Use standard cache sync for WM8978
Saves a bit of code and supports further refactoring.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:19 +00:00
Mark Brown 623105dc97 ASoC: Convert wm8978 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:19 +00:00
Mark Brown 803b37885d ASoC: Convert wm8978 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:19 +00:00
Mark Brown ad6cdec507 ASoC: Remove unused control type from wm8978 driver
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:18 +00:00
Mark Brown 0d6df67583 ASoC: Make WM8978 I2C usage unconditional
The driver only supports I2C.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:18 +00:00
Mark Brown fed2200711 ASoC: Disable register synchronisation for low frequency WM8996 SYSCLK
With a low frequency SYSCLK and a fast I2C clock register synchronisation
may occasionally take too long to take effect, causing I/O issues. Disable
synchronisation in order to avoid any issues.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2012-01-20 13:54:34 +00:00
Mark Brown 495174a8ff ASoC: Don't go through cache when applying WM5100 rev A updates
These are all to either uncached registers or fixes to register defaults,
in the former case the cache won't do anything and in the latter case
we're fixing things so the cache sync will do the right thing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2012-01-20 13:54:33 +00:00
Mark Brown e53e417331 ASoC: Mark WM5100 register map cache only when going into BIAS_OFF
Writing to the registers won't work if we do actually manage to hit a fully
powered off state.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2012-01-20 13:54:33 +00:00
Wolfram Sang 0c93a167a6 ASoC: tlv320aic32x4: always enable analouge block
Register LDOCTLEN must always be initialized to clear the analog power
control bit, otherwise the analog block will stay deactivated.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:54:33 +00:00
Wolfram Sang 01b37e94c0 ASoC: tlv320aic32x4: always enable dividers
Dividers (such as MDAC) are always needed, independent of the codec
being I2S master or slave. Needed on a custom board where the codec has
to be slave.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:54:33 +00:00
Zeng Zhaoming bb362e2e4f ASoC: sgtl5000: Fix wrong register name in restore
Correct SGTL5000_CHIP_CLK_CTRL to SGTL5000_CHIP_REF_CTRL in
sgtl5000_restore_regs(), and add comment to explain the
restore order.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Zeng Zhaoming <zengzm.kernel@gmail.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:54:32 +00:00
Linus Torvalds 9278e634b4 Merge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: Wait for WM8993 FLL to stabilise
  ASoC: core - Free platform DAPM context at platform removal.
  ASoC: dapm - Fix check for codec context in dapm_power_widgets().
  ASoC: sgtl5000: update author email address
  ASoC: Fix DMA channel leak in imx-pcm-dma-mx2 driver.
2012-01-18 12:53:36 -08:00
Mark Brown 986b2f2c21 ASoC: Wait for WM8993 FLL to stabilise
Ensure the FLL is locked before we return from set_fll().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-17 16:48:27 +00:00
Zeng Zhaoming f7cb8a4be1 ASoC: sgtl5000: update author email address
Update MODULE_AUTHOR email address.

Signed-off-by: Zeng Zhaoming <zengzm.kernel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-16 15:06:06 +00:00
Linus Torvalds a429638cac 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: (526 commits)
  ASoC: twl6040 - Add method to query optimum PDM_DL1 gain
  ALSA: hda - Fix the lost power-setup of seconary pins after PM resume
  ALSA: usb-audio: add Yamaha MOX6/MOX8 support
  ALSA: virtuoso: add S/PDIF input support for all Xonars
  ALSA: ice1724 - Support for ooAoo SQ210a
  ALSA: ice1724 - Allow card info based on model only
  ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations
  ALSA: hdspm - Provide unique driver id based on card serial
  ASoC: Dynamically allocate the rtd device for a non-empty release()
  ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC
  ALSA: hda - Fix the detection of "Loopback Mixing" control for VIA codecs
  ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs
  ALSA: hda - Use auto-parser for HP laptops with cx20459 codec
  ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info()
  ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref()
  ALSA: hda/cirrus - support for iMac12,2 model
  ASoC: cx20442: add bias control over a platform provided regulator
  ALSA: usb-audio - Avoid flood of frame-active debug messages
  ALSA: snd-usb-us122l: Delete calls to preempt_disable
  mfd: Put WM8994 into cache only mode when suspending
  ...

Fix up trivial conflicts in:
 - arch/arm/mach-s3c64xx/mach-crag6410.c:
	renamed speyside_wm8962 to tobermory, added littlemill right
	next to it
 - drivers/base/regmap/{regcache.c,regmap.c}:
	duplicate diff that had already come in with other changes in
	the regmap tree
2012-01-12 08:00:30 -08:00
Takashi Iwai d6b2450797 Merge branch 'for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc into topic/asoc 2012-01-11 15:30:53 +01:00
Liam Girdwood e48b46ba16 ASoC: twl6040 - Add method to query optimum PDM_DL1 gain
The DL1 PDM interface adds a little gain depending on the output device.
Add a method to retrieve the gain value for machine driver usage.

Signed-off-by: Liam Girdwood <lrg@ti.com>
2012-01-11 12:43:24 +00:00
Linus Torvalds 269d430131 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (40 commits)
  regulator: set constraints.apply_uV to 0 in of_get_fixed_voltage_config
  regulator: max8925: fix enabled/disabled judgement mistake
  regulator: add regulator_bulk_force_disable function
  regulator: pass regulator_register of_node in fixed voltage driver
  regulator: add regulator_force_disable() definition for !CONFIG_REGULATOR
  regulator: Enable supply regulator if child rail is enabled.
  regulator: mc13892: Convert to devm_kzalloc()
  regulator: mc13783: Convert to devm_kzalloc()
  regulator: Fix checking return value of create_regulator
  regulator: Fix the error handling if create_regulator fails
  regulator: Export regulator_is_supported_voltage()
  regulator: mc13892: add device tree probe support
  regulator: mc13892: remove the unnecessary prefix from regulator name
  regulator: Convert wm831x regulator drivers to devm_kzalloc()
  regulator: da9052: Staticize non-exported symbols
  regulator: Replace kzalloc with devm_kzalloc and if-else with a switch-case for da9052-regulator
  regulator: Update da9052-regulator for DT changes
  regulator: DA9052/53 Regulator support
  regulator: pass device_node to of_get_regulator_init_data()
  regulator: If a single voltage is set with device tree then set apply_uV
  ...
2012-01-10 10:20:34 -08:00
Janusz Krzysztofik f75a8ff67d ASoC: cx20442: add bias control over a platform provided regulator
Now that a regulator device for controlling the codec chip reset state
over a platform agnostic regulator API is available on the only board
using this driver so far, extend the driver with a bias control function
which will request virtual power to the codec chip from that virtual
regulator, and will supersede the present implementation existing at the
sound card level.

Thanks to the regulator sharing mechanism, both the old (the sound card)
and the new (the codec) implementations should coexist smoothly until
the sound card file is updated. For this to work as expected, update the
sound card .set_bias_level callback to not touch codec->dapm.bias_level.

While extending the cx20442 structure, drop unused control_type member.

Created against linxu-3.2-rc6, tested on top of patch 1/4 "ARM: OMAP1:
ams-delta: set up a regulator over the modem reset GPIO pin".

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
2012-01-09 11:20:16 +00:00
Axel Lin 7a748e4318 ASoC: sta32x: Optimize the array work to find rate_min and rate_max
For a given ir and fs, there is at most one possible match for the case
mclk_ratios[ir][j].ratio * fs == freq.
Thus we can break from the inner loop once a match is found.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-03 21:18:32 +00:00
Axel Lin 748b217827 ASoC: Fix return value of wm8580_set_sysclk()
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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 13:08:40 +00:00
Axel Lin 385bd9379b ASoC: Fix return value of wm8903_gpio_direction_in() and wm8903_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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 13:08:39 +00:00
Axel Lin fe75fe0e04 ASoC: Fix return value of wm8962_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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 13:08:34 +00:00
Axel Lin 16aff769d7 ASoC: Fix return value of ak4641_pcm_set_dai_fmt()
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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 13:08:33 +00:00
Axel Lin 6945e9f9df ASoC: Convert tpa6130a2 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:13 +00:00
Axel Lin a54877d745 ASoC: Convert tlv320dac33 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:13 +00:00
Axel Lin 7fd8a67446 ASoC: Convert cs4270 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:13 +00:00
Axel Lin 360b70ca5e ASoC: Convert alc5623 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:13 +00:00
Axel Lin e2257db325 ASoC: Convert tlv320aic3x to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:12 +00:00
Axel Lin a8163023d2 ASoC: Convert tlv320aic26 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:12 +00:00
Axel Lin 099830608a ASoC: Convert tlv320aic23 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:12 +00:00
Axel Lin d999c021b6 ASoC: Convert sta32x to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:12 +00:00
Axel Lin 8eeffe9891 ASoC: Convert ssm2602 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:12 +00:00
Axel Lin a92b0a0803 ASoC: Convert rt5631 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:12 +00:00
Axel Lin bf791bdb38 ASoC: Convert max9850 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:11 +00:00
Axel Lin b1b548824b ASoC: Convert max98095 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:11 +00:00
Axel Lin 49ba767324 ASoC: Convert max98088 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:11 +00:00
Axel Lin 021b918efb ASoC: Convert cs42l51 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02 12:28:11 +00:00
Ashish Chavan 24b6f263d9 ASoC: da7210: Add support for line input and mic
DA7210 has three line inputs (AUX1 Left, AUX1 Right and AUX2) and
a stereo MIC. This patch adds gain controls for MIC, AUX1, AUX2 as
well as INPGA.

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>
2012-01-02 12:27:29 +00:00
Mark Brown 1b39bf3468 ASoC: Enable ASoC register map dump for some regmap CODECs
It's still useful to be able to poke around in the register map at
runtime.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-30 01:59:39 +00:00
Mark Brown a421a0e41c ASoC: Remove unused label from wm8994 probe()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-29 11:54:43 +00:00
Axel Lin 658ecf7784 ASoC: Convert tlv320aic32x4 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:22:41 +00:00
Axel Lin 558460c65a ASoC: Convert jz4740 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:22:41 +00:00
Axel Lin 38b81c1d25 ASoC: Convert adau1701 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:22:40 +00:00
Axel Lin 6e4f17cb2b ASoC: Convert ad1836 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:22:40 +00:00
Axel Lin 80c2f9da4e ASoC: Convert adau1373 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:22:40 +00:00
Axel Lin 30c88f2ca8 ASoC: Convert ad193x to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:22:40 +00:00
Fabio Estevam 512fa7c40b ASoC: Convert sgtl5000 to use devm_kzalloc()
Convert sgtl5000 codec driver to use devm_kzalloc().

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:20:20 +00:00
Fabio Estevam cf1ee98d80 ASoC: sgtl5000: Fix voltage units in dev_err message
vdda, vddio and vddd are voltages expressed in milivolts (mV), so use the
proper annotation.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28 17:20:20 +00:00
Axel Lin 6ab7e71a9c ASoC: Convert 88pm860x-codec to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-27 12:58:02 +00:00
Axel Lin 6ce91ad4d8 ASoC: Convert uda1380 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-27 12:58:02 +00:00
Axel Lin eb3bb97ce7 ASoC: Convert lm4857 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-27 12:58:02 +00:00
Axel Lin 306bf6b19e ASoC: Convert da7210 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-27 12:58:02 +00:00
Mark Brown 2c9d9b6fa7 Merge branch 'for-3.2' into for-3.3 2011-12-23 18:08:02 +00:00
Joachim Eastwood 990fc3d0b2 ASoC: wm8776: add missing break in sample size switch
Broken in commit d1dc698a54

Signed-off-by: Joachim Eastwood <joachim.eastwood@jotron.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-23 18:03:21 +00:00
Axel Lin 3f7cec0493 ASoC: Convert cs42l51 to table based DAPM and control init
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 12:04:33 +00:00
Axel Lin f4f8e4c32c ASoC: Convert 88pm860x-codec to table based DAPM and control init
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 12:04:33 +00:00
Axel Lin 5b48a5a6df ASoC: Convert ak4671 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 10:13:58 +00:00
Axel Lin 2ff49eea9b ASoC: Convert ak4642 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 10:13:58 +00:00
Axel Lin 4273fcfd71 ASoC: Convert ak4641 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 10:13:58 +00:00
Axel Lin 7246492dcf ASoC: Convert ak4535 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 10:13:58 +00:00
Axel Lin 3922d5180f ASoC: Convert ak4104 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 10:13:57 +00:00
Axel Lin 6048ef768e ASoC: Rename rt562[1|2]_vol_snd_controls to alc562[1|2]_vol_snd_controls
The module desciption says this is ASoC alc5621/2/3 driver.
Make the naming consistent with the reset of the code.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 00:58:08 +00:00
Axel Lin 58fa8e456c ASoC: Convert uda1380 to table based DAPM and control init
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 00:32:24 +00:00
Axel Lin 5ee65ec628 ASoC: Convert max9850 to table based DAPM and control init
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 00:32:24 +00:00
Mark Brown 202a51a8d9 ASoC: Use standard cache sync code in wm8961
We write the reset register with the default value so it should not be
mistakenly written.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-17 09:39:44 +00:00
Mark Brown 2ec2a9061d ASoC: Convert wm8961 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-17 09:39:43 +00:00
Mark Brown 69be6660f3 ASoC: Remove I2C ifdefs from wm8961 driver
The driver only supports I2C so no need to conditionalise its use.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-17 09:39:42 +00:00
Mark Brown b9791c0109 ASoC: Convert WM8960 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-17 09:39:41 +00:00
Mark Brown ec641c4590 ASoC: Fix partial cherry pick in wm8993
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-15 11:54:00 +08:00
Mark Brown 45ba82d817 ASoC: Tune the accessory detection rates for WM8996
Use longer intervals when the microphone is not inserted to increase
robustness against leisurely insertion.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-14 19:35:14 +08:00
Mark Brown d0616bbed1 ASoC: Use standard register cache sync in wm8993
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-14 17:07:51 +08:00
Mark Brown f6a9336879 ASoC: Convert wm8993 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-14 17:07:47 +08:00
Mark Brown ffbf2a363e ASoC: Use standard snd_soc_cache_sync() for WM9090
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-14 17:07:39 +08:00
Mark Brown 42f3b0109e ASoC: Remove cache default for volatile wm9081 reset register
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-14 17:06:29 +08:00
Mark Brown 6f8d272a44 ASoC: Fix wm8995 regmap usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-14 13:48:12 +08:00
Leon Romanovsky 9215aa4d96 ASoC: Rename ALC5632 MICBIAS to common name convention.
Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-13 14:27:19 +08:00
Mark Brown cae59c7b21 ASoC: Remove WM8994 register cache
Now that the mfd is using the register map cache there's no need for the
CODEC driver to do any register cache management or any funny dances to
interact with the other drivers using the device so just remove the cache
initialisation and volatility information.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-13 00:20:11 +08:00
Mark Brown d9a7666ff3 ASoC: Remove ASoC-specific WM8994 I/O code
Just go directly to the regmap API, saving code and making integration
that bit more direct.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-13 00:20:06 +08:00
Mark Brown 68556ca1e0 Merge branch 'mfd/wm8994' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc into for-3.3 2011-12-13 00:19:20 +08:00
Mark Brown 4de45284d3 mfd: Define some additional wm8994 registers
Add a bunch of definitions for wm8994 registers that are not currently
used by software.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2011-12-13 00:10:06 +08:00
Mark Brown 0a105ddb35 Merge branch 'for-3.2' into for-3.3 2011-12-12 12:59:06 +08:00
Jonathan Neuschäfer 62e4a13e60 ASoC: WM8958: correctly show firmware magic on mismatch
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-12 12:44:02 +08:00
Mark Brown f04b8d6ece Merge branch 'for-3.2' into for-3.3 2011-12-11 03:01:33 +08:00
Mark Brown 37d5993c5c ASoC: Fix WM8996 24.576MHz clock operation
Record the clock after the divider as that is what all SYSCLK users see.
Without this the other clock configuration in the device comes out at
half rate.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-12-11 03:01:09 +08:00
Mark Brown 3025ae45d6 ASoC: Convert wm8770 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-09 20:36:59 +08:00
Axel Lin 7fcadfd176 ASoC: Fix comments for disabling amplifier and PGA
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-09 20:28:28 +08:00
Mark Brown 46ce904f7d ASoC: Convert WM8900 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-09 20:28:18 +08:00
Mark Brown 5a37452421 ASoC: Convert WM8804 to table based control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-09 20:28:17 +08:00
Mark Brown bc9c040d36 ASoC: Make WM8770 SPI usage unconditional
The device only supports SPI.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-09 20:28:16 +08:00
Mark Brown bf97ca9a0d ASoC: Convert WM8776 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-09 20:28:15 +08:00
Axel Lin 16b24881a0 ASoC: wm8960: 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-12-08 11:37:31 +08:00
Mark Brown 4105ab846c ASoC: Rely on core enabling the wm8994 with runtime PM
No need to do this in the driver now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-08 09:22:48 +08:00
Stephen Warren f18b4e2ee9 ASoC: WM8903: Add of_match_table
This allows the device to be matched against the device tree using the
compatible flag directly, as is standard, rather than falling back to
matching .id_table against the non-vendor portion of the first compatible
property value.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-07 21:51:04 +08:00
Mark Brown 21abbb024f Merge branch 'for-3.2' into for-3.3 2011-12-06 11:01:38 +00:00
Axel Lin f8f626f537 ASoC: Fix build dependency for SND_SOC_JZ4740_CODEC
Currently SND_SOC_JZ4740_CODEC depends on SOC_JZ4740 but SOC_JZ4740 is not
defined in any Kconfig. Thus the codec driver will not be built when select
"Build all ASoC CODEC drivers".
(Unless it is selected by SND_JZ4740_SOC_QI_LB60).
Remove the dependency with SOC_JZ4740, then this code driver can be built when
select "Build all ASoC CODEC drivers".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 11:01:20 +00:00
Axel Lin 68bfcafaae ASoC: Include linux/io.h for jz4740 codec
Include linux/io.h to fix below build errors:

  CC      sound/soc/codecs/jz4740.o
sound/soc/codecs/jz4740.c: In function 'jz4740_codec_read':
sound/soc/codecs/jz4740.c:82: error: implicit declaration of function 'readl'
sound/soc/codecs/jz4740.c: In function 'jz4740_codec_write':
sound/soc/codecs/jz4740.c:92: error: implicit declaration of function 'writel'
sound/soc/codecs/jz4740.c: In function 'jz4740_codec_probe':
sound/soc/codecs/jz4740.c:373: error: implicit declaration of function 'ioremap'
sound/soc/codecs/jz4740.c:373: warning: assignment makes pointer from integer without a cast
sound/soc/codecs/jz4740.c:393: error: implicit declaration of function 'iounmap'
make[3]: *** [sound/soc/codecs/jz4740.o] Error 1
make[2]: *** [sound/soc/codecs] Error 2
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 11:01:10 +00:00
Mark Brown 6664ee115b ASoC: Don't fail if we can't read the IRQ type in WM8903
If we fail to read the IRQ type from the interrupt controller don't
fail, just assume a value and solider on - we may fail later when we try
to request the IRQ but it's possible we'll succeed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:30:24 +00:00
Stephen Warren 5d680b3a84 ASoC: WM8903: Add device tree binding
Document the device tree binding for the WM8903 codec, and modify the
driver to extract platform data from the device tree, if present.

Based on work by John Bonesio, but significantly reworked since then.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Stephen Warren 9d35f3e100 ASoC: WM8903: Get default irq_active_low from IRQ controller
If the WM8903 is hooked up to an interrupt, set the irq_active_low flag
in the default platform data based on the IRQ's IRQ_TYPE. Map IRQ_TYPE_NONE
(a lack of explicit configuration/restriction) to irq_active_low = false;
the previous default.

This code is mainly added to support device tree interrupt bindings,
although will work perfectly well in a non device tree system too.

Any interrupt controller that supports only a single IRQ_TYPE could
set each IRQ's type based on that restriction. This applies equally
with and without device tree. To cater for interrupt controllers
that don't do this, for which irqd_get_trigger_type() will return
IRQ_TYPE_NONE, the platform data irq_active_low field may be used
in systems that don't use device tree.

With device tree, every IRQ must have some IRQ_TYPE set.

Controllers that support DT and multiple IRQ_TYPEs must define the
interrupts property (as used in interrupt source nodes) such that it
defines the IRQ_TYPE to use. When the core DT setup code initializes
wm8903->irq, the interrupts property will be parsed, and as a side-
effect, set the IRQ's IRQ_TYPE for the WM8903 probe() function to read.

Controllers that support DT and a single IRQ_TYPE could arrange to
set the IRQ_TYPE somehow during their initialization, or hard-code
it during the processing of the child interrupts property.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Stephen Warren db81778409 ASoC: WM8903: Remove conditionals checking pdata != NULL
The pdata pointer is now always valid. Remove any conditions that check
its validity.

This patch is mostly just removing an indentation level. One variable had
to be moved due to the removal of a scope, and one comment was split into
two. Viewing the patch with git show/diff -b will show that it's actually
very small.

Note that WM8903_MIC_BIAS_CONTROL_0 is now written unconditionally,
whereas it used to be written only if pdata was supplied. Since
defpdata.micdet_cfg = 0, this unconditional write simply echos the HW
defaults in the case where pdata is not supplied.

Based on work by John Bonesio, but significantly reworked since then.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Stephen Warren a0f203d384 ASoC: WM8903: Fix platform data gpio_cfg confusion
wm8903_platform_data.gpio_cfg[] was intended to be interpreted as follows:
0:       Don't touch this GPIO's configuration register
1..7fff: Write that value to the GPIO's configuration register
8000:    Write zero to the GPIO's configuration register
other:   Undefined (invalid)

The rationale is that platform data is usually global data, and a value of
zero means that the field wasn't explicitly set to anything (e.g. because
the field was new to the pdata type, and existing users weren't update to
initialize it) and hence the value zero should be ignored. 0x8000 is an
explicit way to get 0 in the register.

The code worked this way until commit 7cfe561 "ASoC: wm8903: Expose GPIOs
through gpiolib", where the behaviour was changed due to my lack of
awareness of the above rationale.

This patch reverts to the intended behaviour, and updates all in-tree users
to use the correct scheme. This also makes WM8903 consistent with other
devices that use a similar scheme.

WM8903_GPIO_NO_CONFIG is also renamed to WM8903_GPIO_CONFIG_ZERO so that
its name accurately reflects its purpose.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Colin Cross <ccross@android.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Axel Lin f031efe940 ASoC: Fix reg_cache_size for stac9766
reg_cache_size is supposed to be the number of elements in the register cache,
not the size in bytes.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 13:30:39 +00:00
Axel Lin 68020db8ac ASoC: uda1380: Convert to gpio_request_one()
Using gpio_request_one can make the error handling simpler.

Also remove a redundant "Failed to issue reset" error message.
We already show the error message in uda1380_reset() error path.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 13:24:49 +00:00
Mark Brown b71951d63d Merge branch 'for-3.2' into for-3.3 2011-12-04 23:47:39 +00:00
Axel Lin ef1497707c ASoC: uda1380: Return proper error in uda1380_modinit failure path
Return proper error for uda1380_modinit if i2c_add_driver() fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-04 23:47:15 +00:00
Mark Brown 59792aa91f ASoC: Sort WM9090 in with the CODEC drivers
The driver itself has been a regular CODEC driver for a while now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:22 +00:00
Mark Brown 4911ccdb9d ASoC: Convert WM2000 into a standard CODEC driver
We've been able to handle external amps for a while now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:21 +00:00
Mark Brown 8aa1fe81c5 ASoC: Convert wm2000 to use regmap API
The driver wasn't even using the ASoC common code.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:20 +00:00
Mark Brown 012d12db0c ASoC: Remove unused struct wm2000_setup_data
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:19 +00:00
Mark Brown e41d5a3b7a ASoC: Convert WM8728 to table based control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:18 +00:00
Mark Brown 2f5374d8cf ASoC: Convert WM8711 to table based control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:17 +00:00
Mark Brown 0f185e3f8b ASoC: Convert WM8750 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:16 +00:00
Mark Brown 0e62780f5f ASoC: Convert WM8741 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:14 +00:00
Mark Brown f235c649c1 ASoC: Convert WM8580 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:13 +00:00
Mark Brown b6709f3bbd ASoC: Convert WM8510 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:12 +00:00
Mark Brown b4505ab141 ASoC: Convert WM8400 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:11 +00:00
Mark Brown e6c94e9f6d ASoC: Convert WM8350 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:10 +00:00
Mark Brown 455b91bfe8 ASoC: Convert WM9090 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:09 +00:00
Mark Brown 2edaed82b7 ASoC: Convert WM8750 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:08 +00:00
Mark Brown 5aefb306e3 ASoC: Convert WM8741 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:07 +00:00
Mark Brown b903c0ed2e ASoC: Convert WM8400 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:06 +00:00
Mark Brown 0d1fe0d452 ASoC: Convert WM8350 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:05 +00:00
Mark Brown b03e96e4d6 ASoC: Convert WM2000 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:04 +00:00
Mark Brown 6cd4eb9592 ASoC: Remove unused AUDIO_NAME define from WM8960
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:03 +00:00
Mark Brown 3a0d077f3d ASoC: Remove I2C ifdefs from WM8960
The driver only supports I2C as the control interface.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:02 +00:00
Mark Brown 091edccf7f ASoC: Remove unused -codec from Wolfson device driver names
Devices that aren't MFDs don't need to distinguish this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:01 +00:00
Stephen Warren c0eb27cf84 ASoC: WM8903: Create default platform data structure
When no platform data is supplied, point pdata at a default platform
structure. This enables two future changes:

a) Defines the default platform data values in a single place.
b) There is always a valid pdata pointer, so some conditional code can
   be simplified by a later patch.

Based on work by John Bonesio, but significantly reworked since then.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 11:19:08 +00:00
Mark Brown 7d46a528c6 ASoC: Move initial WM8903 identification and reset to I2C probe
Get control of the device earlier and avoid trying to do an ASoC probe
on a card that won't work.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 11:00:10 +00:00
Mark Brown ee244ce4ea ASoC: Convert WM8903 to direct regmap API usage
Converting to an rbtree cache as regcache doesn't have a flat cache.
Since the top of the register map is fairly sparse this should be an
overall win.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 11:00:07 +00:00
Mark Brown 82ae55dbcc ASoC: Don't resync WM8903 register cache on reset
We only do this on initial power on so it's at best a waste of time as
the core will have already defaulted to the same values.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:45 +00:00
Mark Brown 45e967553f ASoC: Use a normal cache sync for WM8903
The driver used to use a complicated method to sync the register cache
after having brought the bias level up to standby in resume due to the
use of the write sequencer to manage the initial power up. Now that we
don't use the write sequencer there is no need for this and we can just
use snd_soc_cache_sync() directly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:45 +00:00
Mark Brown 88a1b12b9c ASoC: WM8903 only supports I2C so don't ifdef it
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:44 +00:00
Mark Brown f4a10837c9 ASoC: Use table based control init for WM8903
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:43 +00:00
Mark Brown 2950cd2208 ASoC: Convert WM8903 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:32 +00:00
Mark Brown 33e57f221a Merge branch 'for-3.2' into for-3.3 2011-12-02 17:44:55 +00:00
Mark Brown 87b86ade8b ASoC: Mark WM8994 ADC muxes as virtual
Since they don't actually have power bits but do have events associated
with them it's important that we bootstrap their state properly which
making them virtual does.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-02 17:44:37 +00:00
Mark Brown 91e20854e5 ASoC: Convert WM8994 MICBIASes to supply widgets
There are some in tree systems using the driver but none use the MICBIAS
widgets.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-02 17:37:49 +00:00
Mark Brown 3631e8d43e ASoC: Add missing err label
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-02 10:55:12 +00:00
Stephen Warren 6f526f0a86 ASoC: WM8903: Disallow all invalid gpio_cfg pdata values
The GPIO registers are 15 bits wide. Hence values, higher than 0x7fff are
not legal GPIO register values. Modify the pdata.gpio_cfg handling code
to reject all illegal values, not just WM8903_GPIO_NO_CONFIG (0x8000). This
will allow the later use of 0xffffffff as an invalid value in future device
tree bindings, meaning "don't touch this GPIO's configuration".

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-02 10:35:25 +00:00
Lars-Peter Clausen 84b315ee89 ASoC: Drop unused state parameter from CODEC suspend callback
The existence of this parameter is purely historical. None of the CODEC drivers
uses it and we always pass in the same value anyway, so it should be safe to
remove it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-02 10:32:03 +00:00
Mark Brown 36c6b54cb0 ASoC: Make WM8962 beep a signal generator
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-12-02 10:27:01 +00:00
Mark Brown dea8e23741 ASoC: Make WM5100 tone generator widgets signal generators
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-12-02 10:26:22 +00:00
Mark Brown 7270cebef2 ASoC: Convert WM8994 to devm_kzalloc()
Still have a manual free in there for some realloc()ed memory as there's
no devm version of that.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:22:03 +00:00
Mark Brown cd1707a99a ASoC: Add platform data for WM8958/WM1811 microphone detection rates
Allow systems to override the default microphone detection rates using
platform data in case the settings are not suitable (eg, due to an
unusually noisy jack).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:22:01 +00:00
Mark Brown 52ac7ab247 ASoC: Ensure we reconfigure WM8958 microphone detection on rate changes
We don't need to rerun DAPM if the clock source is the same but we do
need to adjust the microphone detection rate in case we are moving from
an audio to a non-audio rate.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:21:58 +00:00
Mark Brown af6b6fe41c ASoC: Implement support for WM1811A jack detection
The WM1811A features an advanced low power accessory detection subsystem
which allows the device to be maintained in a very low power state while
the system is idle without sacrificing any accessory detection features.

Implement software support for this, automatically managing the power
configuration of the device depending on the detected accessory.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:21:55 +00:00
Mark Brown 157a75e664 ASoC: Rename WM8994 detecting flag to mic_detecting
More specific and avoids confusion with a following change.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:21:53 +00:00
Mark Brown 4585790d1c ASoC: Allow more WM8958/WM1811 button levels with default handler
The WM8958 and WM1811 support detecting a range of buttons. Allow the
user to provide platform data enabling more of these levels without
having to write a custom detection handler.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:21:51 +00:00
Mark Brown 604533de0f ASoC: Tune down active mode detection rate for WM8958 mic detection
Saves a little power.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:21:48 +00:00
Mark Brown 2a8a856d42 ASoC: Don't use control_data to get struct wm8994
This will support refactoring to make use of the regmap API more directly
in the core.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01 14:21:41 +00:00
Mark Brown a1691343a3 ASoC: Provide debug log of accessory status on WM8958
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-30 20:50:28 +00:00
Mark Brown b00adf76a6 ASoC: Enhance default WM8958 microphone detection
Actively manage the detection rate for microphones with WM8958, providing
improved power consumption and maximising the benefit from the hardware
debounce.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-29 20:22:00 +00:00