summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/88pm860x-codec.c
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', ↵Mark Brown2015-08-301-16/+12
|\ \ | | | | | | | | | 'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next
| | * ASoC: 88pm860x: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGELars-Peter Clausen2015-08-051-16/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD() that it automatically calculates the number of items in the TLV and is hence less prone to manual error. Generate using the following coccinelle script // <smpl> @@ declarer name DECLARE_TLV_DB_RANGE; identifier tlv; constant x; @@ -unsigned int tlv[] = { - TLV_DB_RANGE_HEAD(x), +DECLARE_TLV_DB_RANGE(tlv, ... -}; +); // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: 88pm860x: Don't change pm860x->dir setting if pm860x_set_dai_sysclk failsAxel Lin2015-07-071-3/+1
|/ | | | | | | | | | | | | | 88pm860x does not support slave mode, so it returns -EINVAL for PM860X_CLK_DIR_IN. Current code changes pm860x->dir setting before return error, so it has impact on the logic of pm860x_pcm_set_dai_fmt. This patch adds comment for the reason to return -EINVAL for PM860X_CLK_DIR_IN, and avoid changing pm860x->dir setting if pm860x_set_dai_sysclk fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown2015-06-051-2/+1
|\
| * ASoC: 88pm860x: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen2015-05-111-1/+1
| | | | | | | | | | | | | | | | | | 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(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: Move bias level update to the coreLars-Peter Clausen2015-04-271-1/+0
| | | | | | | | | | | | | | | | | | 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>
* | ASoC: codecs: use SNDRV_PCM_FMTBIT_* for format bitmaskMaciej S. Szmigiero2015-05-251-8/+8
|/ | | | | | | | | | | | snd_soc_pcm_stream.formats is a bitmask of SNDRV_PCM_FMTBIT_*, not of SNDRV_PCM_FORMAT_* (which are sequential integers), however some of ASoC CODEC drivers use these values instead. Found out by sparse on 0-day kernel tester. Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: 88pm860x: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen2015-01-141-2/+2
| | | | | | | | 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> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | 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>
* ASoC: 88pm860x-codec: Fix possibly missing string terminationDaniel Mack2014-10-071-1/+1
| | | | | | | | | | Coverity spotted an issue with strncpy() in pm860x_codec_probe() which does not take the \0 termination byte into account. Fix this by making the buffers one byte larger so the can really accommodate MAX_NAME_LEN bytes long strings. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: 88pm860x-codec: Cleanup manual bias level transitionsLars-Peter Clausen2014-09-061-3/+0
| | | | | | | | | | | | | 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 either. The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe() can also be removed as the core will automatically do this after the CODEC has been probed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: 88pm860x: Convert to params_width()Mark Brown2014-07-311-6/+6
| | | | | | The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge branches 'topic/sta350', 'topic/core', 'topic/dapm' and 'topic/cache' ↵Mark Brown2014-04-221-4/+8
|\ \ | | | | | | | | | of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-component
| | * ASoC: codec: fix the sparse check warnings.Xiubo Li2014-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some thing Likes: reproduce: make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) >> sound/soc/codecs/wm8997.c:1084:15: sparse: symbol \ 'wm8997_get_regmap' was not declared. Should it be static? Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * ASoC: 88pm860x: Remove the set_cache_io() entirely from ASoC probe.Xiubo Li2014-04-141-4/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | As we can set the CODEC I/O while snd_soc_register_codec(), so the calling of set_cache_io() from CODEC ASoC probe could be removed entirely. And then we can set the CODEC I/O in the device probe instead of CODEC ASoC probe as earily as possible. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen2014-04-141-4/+4
|/ | | | | | | | | | | | | | | For CODEC controls snd_kcontrol_chip() currently returns a pointer to the CODEC that registered the control. With the upcoming consolidation of platform and CODEC controls this will change. Prepare for this by introducing the snd_soc_kcontrol_codec() helper function that will hide the implementation details of how the CODEC for a control can be obtained. This will allow us to change this easily in the future. The patch also updates all CODEC drivers to use the new helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown2014-03-131-2/+1
|\
| * ASoC: io: New signature for snd_soc_codec_set_cache_io()Xiubo Li2014-03-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Now that all users have been converted to regmap and the config.reg_bits and config.val_bits can be setted by each user through regmap core API. So these two params are redundant here. Since the only control type that left is SND_SOC_REGMAP, so remove it. Drop the control params and add struct regmap *regmap to simplify the code. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| |
| \
*-. \ Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ad1836', ↵Mark Brown2014-03-121-58/+58
|\ \ \ | |_|/ |/| | | | | 'asoc/topic/ad193x', 'asoc/topic/adau1977', 'asoc/topic/ak4104', 'asoc/topic/ak4641', 'asoc/topic/ak4671' and 'asoc/topic/alc5623' into asoc-next
| * | ASoC: 88pm860x: Use SOC_ENUM_SINGLE_DECL()Takashi Iwai2014-02-231-58/+58
| |/ | | | | | | | | | | | | | | | | 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>
* | ASoC: 88pm860: Fix IO setupLars-Peter Clausen2014-03-101-0/+3
|/ | | | | | | | | | | | The 88pm860 is a MFD device and the CODEC driver is using the regmap struct of the parent device, hence automatic IO setup will not work and we need to manually call snd_soc_codec_set_cache_io(). The issue was introduced in commit f9ded3b2e7 ("ASoC: 88pm860x: Use regmap for I/O"). Fixes: f9ded3b2e7 ("ASoC: 88pm860x: Use regmap for I/O"). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
* Merge remote-tracking branch 'asoc/topic/88pm860x' into asoc-nextMark Brown2013-10-241-62/+13
|\
| * ASoC: 88pm860x: Use regmap for I/OMark Brown2013-09-201-55/+5
| | | | | | | | | | | | | | | | | | As part of a move to remove the duplication of regmap functionality in ASoC convert the 88pm860x driver to use the regmap from the MFD. This means that we no longer cache the registers so performance will be slightly reduced on I/O operations. Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: 88pm60x: Don't use control data for i2cMark Brown2013-09-201-8/+9
| | | | | | | | | | | | | | | | In preparation for using the regmap directly in the CODEC driver replace references to the I2C client using control_data with references to the driver private data. Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: 88pm860x: array overflow in snd_soc_put_volsw_2r_st()Dan Carpenter2013-09-131-0/+3
|/ | | | | | | | | This is called from snd_ctl_elem_write() with user supplied data so we need to add some bounds checking. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
* Merge tag 'asoc-v3.11-2' of ↵Takashi Iwai2013-06-281-4/+2
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: More updates for v3.11 Some more fixes and enhancements, and also a bunch of refectoring for AC'97 support which enables more than one AC'97 controller driver to be built in.
| * ASoC: 88pm860x: Use SND_SOC_DAPM_PGA_E() instead of open-coding itLars-Peter Clausen2013-06-191-4/+2
| | | | | | | | | | Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: 88pm860x: Remove redundant platform_set_drvdata()Sachin Kamat2013-05-121-7/+2
|/ | | | | | | | | Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: remove __dev* attributesBill Pemberton2012-12-101-3/+3
| | | | | | | | | | | 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>
* ASoC: Convert 88pm860x-codec to devm_kzalloc()Axel Lin2011-12-271-5/+2
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Convert 88pm860x-codec to table based DAPM and control initAxel Lin2011-12-201-7/+8
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Convert CODEC drivers to module_platform_driverMark Brown2011-11-281-11/+1
| | | | | | Factors out a bit of boilerplate. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen2011-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: Include delay.h in 88pm860xMark Brown2011-09-221-0/+1
| | | | | Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: 88pm860x-codec - reset the codec correctlyBas Vermeulen2011-09-211-0/+3
| | | | | | | Reset the codec according to the Audio power-up delay errata for the 88PM8607. Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: 88pm860x-codec - Allow independent use of both I2S playback and captureBas Vermeulen2011-09-211-2/+8
| | | | | | | Introduce a I2S CLK supply so playback and capture can operate independently. Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: s/w->kcontrols/w->kcontrol_news/gStephen Warren2011-05-031-1/+1
| | | | | | | | | | A future change will modify struct snd_soc_dapm_widget to store the actual kcontrol pointers for each kcontrol_new in a field named kcontrols. Rename the existing kcontrols field to enable this. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Yet more x86 tracepoint workaroundsMark Brown2010-12-291-1/+1
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: Remove unused reg_cache fields from device structsLars-Peter Clausen2010-12-281-1/+0
| | | | | | | | | | | The multi-component patch(commit f0fba2ad1) moved the allocation of the register cache from the driver to the ASoC core. Most drivers where adjusted to this, but there are quite a few drivers left which now have an unused reg_cache field in their private device struct. This patch removes these unused fields. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: ifdef out trace points from modules for x86Mark Brown2010-12-231-0/+2
| | | | | | No idea why this works on ARM but not x86. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add jack IRQ trace to 88pm860x driverMark Brown2010-12-221-0/+5
| | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Simplify pm860x_probe error handlingAxel Lin2010-11-301-7/+5
| | | | | | | | Simplify pm860x_probe error handling and return actual error code we got. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Do not include soc-dapm.hJarkko Nikula2010-11-221-1/+0
| | | | | | | | There is no need to include soc-dapm.h since soc.h includes it. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Decouple DAPM from CODECsLiam Girdwood2010-11-061-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths. This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec. This patch does not change current functionality and a large part of changes come because of structure and internal API changes. Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <jhnikula@gmail.com>. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Manuel Lauss <manuel.lauss@googlemail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Cliff Cai <cliff.cai@analog.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Ryan Mallon <ryan@bluewatersys.com> Cc: Timur Tabi <timur@freescale.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Jassi Brar <jassi.brar@samsung.com> Cc: Daniel Gloeckner <dg@emlix.com> Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: add 88pm860x codec driverHaojian Zhuang2010-08-181-0/+1486
Add 88PM860x codec driver. 88PM860x codec supports two interfaces. And it also supports headset/mic/hook/short detection. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud