aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/sn95031.c
AgeCommit message (Collapse)Author
2015-05-15ASoC: sn95031: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen
The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level(). While we are at it also replace the if(x == A) ... else if(x == B) ... construct with a switch-case. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen
All drivers have the same line at the end of the set_bias_level callback to update the bias_level state. Move this update into snd_soc_dapm_force_bias_level() and remove them from the drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-23Merge branch 'for-next' into topic/hda-coreTakashi Iwai
2015-03-05ASoC: sn95031: Fix control-less DAPM routesLars-Peter Clausen
Routes without a control must use NULL for the control name. The sn95031 driver uses "NULL" instead in a few places. Previous to commit 5fe5b767dc6f ("ASoC: dapm: Do not pretend to support controls for non mixer/mux widgets") the DAPM core silently ignored non-NULL controls on non-mixer and non-mux routes. But starting with that commit it will complain and not add the route breaking the sn95031 driver in the process. This patch replaces the incorrect "NULL" control name with NULL to fix the issue. Fixes: 5fe5b767dc6f ("ASoC: dapm: Do not pretend to support controls for non mixer/mux widgets") Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-03-04ASoC: sn95031: Pass CODEC to sn95031_jack_detection()Lars-Peter Clausen
The sn95031 driver currently gets the CODEC implicitly from the jack that is passed to sn95031_jack_detection(). But the codec field is going to be removed from the snd_soc_jack struct, so refactor things to pass the CODEC explicitly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-14ASoC: sn95031: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen
The codec field of the snd_soc_widget struct is eventually going to be removed, use snd_soc_dapm_to_codec(w->dapm) instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-14Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-11-27ASoC: sn95031: Cleanup bias level transitionsLars-Peter Clausen
Since the ASoC core now takes care of setting the bias level to SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-05ASoC: sn95031: Use table based control setupLars-Peter Clausen
Makes the code a bit cleaner. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20ASoC: codecs: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-07-31ASoC: sn95031: Convert to params_width()Mark Brown
The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown
2014-03-11ASoC: codec: Simplify ASoC probe code.Xiubo Li
For some CODEC drivers like who act as the MFDs children are ignored by this patch. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23ASoC: sn95031: Use SOC_ENUM_SINGLE_DECL()Takashi Iwai
Just replace with the helper macro. No functional change at all. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-26ASoC: sn95031: Convert to regmapMark Brown
This moves us towards being able to remove the duplicated register I/O functionality in ASoC. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-05-15ASoC: sn95031: Staticize non exported structLars-Peter Clausen
The sn95031_codec struct is not used outside of sn95031.c, so make it static. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10ASoC: codecs: remove __dev* attributesBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-04ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood
Currently ASoC can only add kcontrols using codec and platform component device handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for SoC card machine drivers too. This allows the kcontrol to have a direct handle to the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily get it's private data. This change makes snd_soc_add_controls() static and wraps it in the folowing calls (card and dai are new) :- snd_soc_add_card_controls() snd_soc_add_codec_controls() snd_soc_add_dai_controls() snd_soc_add_platform_controls() This patch also does a lot of small mechanical changes in individual codec drivers to replace snd_soc_add_controls() with snd_soc_add_codec_controls(). It also updates the McBSP DAI driver to use snd_soc_add_dai_controls(). Finally, it updates the existing machine drivers that register controls to either :- 1) Use snd_soc_add_card_controls() where no direct codec control is required. 2) Use snd_soc_add_codec_controls() where there is direct codec control. In the case of 1) above we also update the machine drivers to get the correct component data pointers from the kcontrol (rather than getting the machine pointer via the codec pointer). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-27ASoC: Set idle_bias_off flag in snd_soc_codec_driverAxel Lin
Since commit 33c5f969 "ASoC: Allow idle_bias_off to be specified in CODEC drivers", now we can set idle_bias_off flag in struct snd_soc_codec_driver for devices can unconditionally support idle_bias_off. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-28ASoC: Convert CODEC drivers to module_platform_driverMark Brown
Factors out a bit of boilerplate. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen
Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure") introduced the possibility to have constant DAI ops structures, yet this is barley used in both existing drivers and also new drivers being submitted, although none of them modifies its DAI ops structure. The later is not surprising since existing drivers are often used as templates for new drivers. So this patch just constifies all existing snd_soc_dai_ops structs to eliminate the issue altogether. The patch was generated with the following coccinelle semantic patch: // <smpl> @@ identifier ops; @@ -struct snd_soc_dai_ops ops = +const struct snd_soc_dai_ops ops = { ... }; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31sound: Add module.h to the previously silent sound usersPaul Gortmaker
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-03ASoC: Remove needless codec->dapm.bias_level assignment to SND_SOC_BIAS_OFFAxel Lin
This assignment is done by the snd_soc_register_codec so there is no need to redo it in probe function of a codec driver. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30ASoC: sn95031: Do not use static variable for channel_indexAxel Lin
No reason to use static variable for channel_index. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26ASoC: Drop exporting sn95031_get_mic_biasAxel Lin
sn95031_get_mic_bias() is not used outside this driver and it is a static function now. Thus drop exporting sn95031_get_mic_bias. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23ASoC: Staticize sn95031_daisAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19ASoC: sn95031: Staticize sn95031_pcm_hw_paramsAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-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-09-04ASoC: sn95031: Fix the logic to find free channelAxel Lin
In the case of no free channel available, current implementation returns 0 instead of negative errno. This patch fixes the logic to return -EINVAL if no free channel available. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-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-04-18ASoC: Merge branch 'for-2.6.39' into for-2.6.40Mark Brown
Fix trivial conflict caused by silly spelling fix patch. Conflicts: sound/soc/codecs/wm8994.c
2011-04-18Merge commit 'v2.6.39-rc3' into for-2.6.39Mark Brown
2011-04-11Merge branch 'for-2.6.39' into for-2.6.40Mark Brown
2011-04-11ASoC: sn95031: decorate function with __devexit_p()Lu Guanqun
According to the comments in include/linux/init.h: "Pointers to __devexit functions must use __devexit_p(function_name), the wrapper will insert either the function_name or NULL, depending on the config options." Fix this issue in codecs sn95031. Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-03-31sound: Add delay.h to sound/soc/codecs/sn95031.cIngo Molnar
This is further fallout from delay.h removal from asm/apic.h and asm/dma.h: ca444564a947: x86: Stop including <linux/delay.h> in two asm header files Which caused this build failure: sound/soc/codecs/sn95031.c: In function ‘sn95031_get_mic_bias’: sound/soc/codecs/sn95031.c:153:2: error: implicit declaration of function ‘msleep’ [-Werror=implicit-function-declaration] Cc: Jean Delvare <khali@linux-fr.org> Cc: James E.J. Bottomley <James.Bottomley@suse.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> LKML-Reference: <20110325152014.297890ec@endymion.delvare> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-03-31ASoC: Use data based init for sn95031 DAPMLu Guanqun
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-15ASoC: sn95031: fix the amic tlv scaleVinod Koul
The tlv scale is defined as (min, step, mute). The mute is not supported here so put the value to 0 Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-15ASoC: sn95031: fix the DMIC path routingVinod Koul
This patch makes the DMIC dynamically connect to TX Mux, earlier code had erroneously made this as static path Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-15ASoC: sn95031: make playback rails depend on actual pins they controlVinod Koul
This patch makes the codec playback rails (headset and speaker) depend on actual pins they control. This enables better power management of the codec Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-11ASoC: mid-x86: Use the soc-jack apis for jack type detectionVinod Koul
This patch modifies the mfld_machine to use the new jack apis for adding the voltage zones for jack type detection. It also modifed TI sn95031 codec driver to use these new apis Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-09ASoC: sn95031: Add support for reading mic biasVinod Koul
This patch adds support to read the mic bias voltage when a jack is inserted. It uses ADC to measure. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-09ASoC: sn95031: Add jack support in the codecVinod Koul
This patch adds support for jack detection and reporting in the codec It however is not fully functional as it doesn't measure adc to figure out what got inserted which will be added later Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-31ASoC: sn95031: add capture supportHarsha Priya
This patch adds the support for capture path in sn95031 codec. This codec supports upto 6DMICs, 2 AMICs and Linein. The linein and AMICs are connected through a MUX to ADC. The TX paths can be assigned to any of the ADCs or DMICs. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-10ASoC: sn95031 fix the code style and format inconsistenciesVinod Koul
this patch fixes inconsistencies commented by Mark. This also fixes few other style things in audio_map & header file Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-06ASoC: sst v2: Add sn95031 codec driverVinod Koul
This patch adds the sn95031 asoc codec driver. This driver currently supports only playback. Capture and jack detection to be added later Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>