summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/ab8500-codec.c
AgeCommit message (Collapse)Author
2015-05-11ASoC: ab8500: 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 with snd_soc_codec_get_dapm(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-11ASoC: ab8500-codec: don't export static symbolJulia Lawall
The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ type T; identifier f; @@ static T f (...) { ... } @@ identifier r.f; declarer name EXPORT_SYMBOL_GPL; @@ -EXPORT_SYMBOL_GPL(f); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-15Merge 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-10ASoC: ab8500-codec: Move control lock to the driver levelLars-Peter Clausen
The ab8500 driver uses a driver specific lock to protect concurrent access to some of the control put/get handlers and uses the snd_soc_codec mutex for some others. This patch updates the driver to consistently use the driver specific lock for all controls. This will allow us to eventually remove the snd_soc_codec mutex. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> 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-09-01ASoC: ab8500-codec: Revert back to regmapLars-Peter Clausen
Commit ff795d614bfa ("ASoC: ab8500: Convert register I/O to regmap") initially converted the ab8500 CODEC driver to use regmap rather than legacy ASoC IO. This was reverted though in commit 63e6d43bf80d ("ASoC: ab8500: Revert to using custom I/O functions") since the inital conversion was not working properly. This was presumebly because the SOC_SINGLE_XR_SX controls, which are used by this driver, did not properly support regmap at that point. This has since been fixed in commit 6137a5ca326d ("ASoC: Prepare SOC_SINGLE_XR_SX controls for regmap"). So revert back to regmap again. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-08-17ASoC: ab8500-codec: Drop bank prefix from AB8500_GPIO_DIR4_REG register defineLars-Peter Clausen
The AB8500_GPIO_DIR4_REG register define has the bank for the register in the upper 8 bits and the register itself in the lower 8 bits. When passing it to abx500_{set,get}_register_interruptible() the upper bits get truncated which generates the following warning from sparse: sound/soc/codecs/ab8500-codec.c:1972:53: warning: cast truncates bits from constant value (1013 becomes 13) sound/soc/codecs/ab8500-codec.c:1980:53: warning: cast truncates bits from constant value (1013 becomes 13) The bank is passed separately to abx500_{set,get}_register_interruptible() so the code works fine as it is. Given that all users of AB8500_GPIO_DIR4_REG always truncate the upper 8 bits just remove them from the define. Also remove the unnecessary casts to u8. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen
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>
2013-11-20Merge remote-tracking branch 'asoc/fix/fsl' into asoc-linusMark Brown
2013-11-19ASoC: ab8500: Revert to using custom I/O functionsLee Jones
It's been reported that these break audio on Snowball so revert them until a Snowball user has time to investigate. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-04Merge remote-tracking branch 'asoc/topic/ab8500' into asoc-nextMark Brown
2013-10-30ASoC: ab8500: Fix invalid cast to long pointerTakashi Iwai
Don't cast to long pointers blindly just for using find_first_bit() and co. This is certainly not portable at all. Reimplement the code with ffs() and fls() instead. This is a slight optimization, too. Spotted by coverity CID 1056484 and 1056485. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-30ASoC: ab8500: Add missing of NULL check of devm_kzalloc()Takashi Iwai
Spotted by coverity CID 712316. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-24Merge remote-tracking branch 'asoc/topic/ab8500' into asoc-nextMark Brown
2013-09-24ASoC: ab8500: Explicitly set I/O upMark Brown
We do some I/O in probe so we need to ensure the I/O operations are fully set up then. Reported-by: Olof Johansson <olof@lixom.net> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-20ASoC: ab8500: Convert register I/O to regmapMark Brown
As part of a general push to eliminate the duplicated register I/O support in ASoC convert ab8500 to use regmap. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org>
2013-09-20ASoC: ab8500: Use ASoC I/O functionsMark Brown
In preparation for moving away from implementing the ASoC level register I/O functionality change direct calls to the ab8500 implementation of that to use snd_soc_write() Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org>
2013-09-20ASoC: ab8500: Downgrade noisy log messageMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org>
2013-09-13ASoC: ab8500-codec: info leak in anc_status_control_put()Dan Carpenter
If the user passes an invalid value it leads to an info leak when we print the error message or it could oops. This is called with user supplied data from snd_ctl_elem_write(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-05-25ASoC: ab8500-codec: Move codec ops on a separate structureFabio Baltieri
Define ab8500 codec operations structure on its own rather than inline with snd_soc_dai_drivers to clean up the code and make the style coherent with other codec drivers. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-21ASoC: ab8500-codec: Set rx dai slots from rx_maskFabio Baltieri
Replace hard coded rx slot numbers from ab8500_codec_set_dai_tdm_slot using the ones requested by the machine driver in rx_mask instead. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-21ASoC: ab8500-codec: Set tx dai slots from tx_maskFabio Baltieri
Replace hard-coded tx slot numbers from ab8500_codec_set_dai_tdm_slot using the ones requested by the machine driver in tx_mask instead. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-12ASoC: ab8500-codec: Add missing ad_to_slot definitionsFabio Baltieri
According to the AB8500 user manual AD to Slot register multiplexer accept values from 0 to 15 where: 0 to 7 corresponds to AD_OUTx slots 8 to 11 corresponds to zero output 12 to 15 sets the output in tristate mode Update enum_ad_to_slot_map array to reflect this definition. This also allows alsamixer to properly display the default configuration, as all controls are set to tristate (=12) at reset. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-29Merge branch 'master' into for-nextJiri Kosina
Conflicts: drivers/devfreq/exynos4_bus.c Sync with Linus' tree to be able to apply patches that are against newer code (mvneta).
2013-01-09sound: soc: Fix typo in sound/codecsMasanari Iida
Correct spelling typo in sound/soc/codecs Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-12-09ASoC: 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-11-14ASoC: ab8500: Staticise non-exported ab85000_codec_daiMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-22Merge remote-tracking branch 'asoc/topic/ux500' into for-3.7Mark Brown
2012-09-20ASoC: codecs: Enable AB8500 CODEC for Device TreeLee Jones
We continue to allow the AB8500 CODEC to be registered via the AB8500 Multi Functional Device API, only this time we extract its configuration from the Device Tree binary. Acked-by: Ola Lilja <ola.o.lilja@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-09-11ASoC: Revert "ASoC: ab8500: Inform SoC Core that we have our own I/O ↵Fabio Estevam
arrangements" Since commit 98d3088e5 (SoC: core: Fix check before defaulting to regmap) , it is not necessary to provide codec->control_data anymore. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-08ASoC: dapm: Add flags to regulator suppliesMark Brown
This will be used to enable additional control of the regulators. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-08-03ASoC: ab8500: Remove pointless castMark Brown
There's never any need to cast away from void. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Lee Jones <lee.jones@linaro.org>
2012-07-31ASoC: ab8500: Inform SoC Core that we have our own I/O arrangementsLee Jones
If codec->control_data is not populated SoC Core assumes we want to use regmap, which fails catastrophically, as we don't have one: Unable to handle kernel NULL pointer dereference at virtual address 00000080 pgd = c0004000 [00000080] *pgd=00000000 Internal error: Oops: 17 [#1] PREEMPT SMP ARM Modules linked in: CPU: 1 Not tainted (3.5.0-rc6-00884-g0b2419e-dirty #130) PC is at regmap_read+0x10/0x5c LR is at hw_read+0x80/0x90 pc : [<c01a91b8>] lr : [<c0216804>] psr: 60000013 Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-17ASoC: Ux500: unlock on an error pathDan Carpenter
There is a missing mutex_unlock() here. The cleanup path also has more debug output. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-13ASoC: Ux500: Correct license stringsOla Lilja
GPLv2 -> GPL v2 Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11ASoC: codecs: Add AB8500 codec-driverOla Lilja
Add codec-driver for ST-Ericsson AB8500 mixed-signal ASIC. Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>