summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ab8500-codec.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: ab8500: replace codec to componentKuninori Morimoto2018-02-121-151/+144
| | | | | | | | | | | | | | Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal2017-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ab8500: Remove explicit initialization of driver callbacks to NULLLars-Peter Clausen2016-11-231-2/+0
| | | | | | | | | | | Fields of structs with global storage are implicitly initialized to 0/NULL, there is usually no need to do this explicitly. Removing the initialization of the legacy suspend/resume callback fields also gets the driver ready for the day when they are eventually removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/nau8810', 'asoc/topic/of-bool', ↵Mark Brown2016-09-291-5/+5
|\ \ | | | | | | | | | 'asoc/topic/omap' and 'asoc/topic/platform-drvdata' into asoc-next
| | * ASoC: use of_property_read_boolJulia Lawall2016-08-081-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use of_property_read_bool to check for the existence of a property. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e1,e2; statement S2,S1; @@ - if (of_get_property(e1,e2,NULL)) + if (of_property_read_bool(e1,e2)) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codec duplicated callback function goes to component on ab8500-codecKuninori Morimoto2016-08-081-6/+8
|/ | | | | | | | | | codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch moves these functions from codec driver to component driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ab8500-codec: remove platform data based probeArnd Bergmann2016-07-121-29/+4
| | | | | | | | | | | The ux500 platform hasn't used board files for a long time, and nothing defines a ab8500_codec_platform_data, so we can just remove the probing based on that and always use device tree properties directly. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
*-. Merge remote-tracking branches 'asoc/topic/ab8500', 'asoc/topic/adau17x1', ↵Mark Brown2016-03-131-1/+0
|\ \ | | | | | | | | | 'asoc/topic/ads117x', 'asoc/topic/adsp' and 'asoc/topic/arizona' into asoc-next
| * | ASoC: ab8500: remove the useless 'break' after 'return'Xiubo Li2016-01-221-1/+0
| |/ | | | | | | | | | | | | 'break' here is not useful after 'return' or 'goto'. Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: ab8500: Fix enum ctl accesses in a wrong typeTakashi Iwai2016-03-011-4/+4
|/ | | | | | | | | | "Sidetone Status" and "ANC Status" ctls in ab8500 codec driver are enum, while the current driver accesses wrongly via value.integer.value[]. They have to be via value.enumerated.item[] instead. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ab8500: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGELars-Peter Clausen2015-08-051-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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: ab8500: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen2015-05-111-9/+11
| | | | | | | | | 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>
* ASoC: ab8500-codec: don't export static symbolJulia Lawall2015-03-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds2014-12-141-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * 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: ab8500-codec: Move control lock to the driver levelLars-Peter Clausen2014-11-101-16/+16
|/ | | | | | | | | | | 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>
* ASoC: ab8500-codec: Revert back to regmapLars-Peter Clausen2014-09-011-34/+28
| | | | | | | | | | | | | | 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>
* ASoC: ab8500-codec: Drop bank prefix from AB8500_GPIO_DIR4_REG register defineLars-Peter Clausen2014-08-171-6/+5
| | | | | | | | | | | | | | | | | | | | 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>
* ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen2014-04-141-6/+6
| | | | | | | | | | | | | | | 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/fix/fsl' into asoc-linusMark Brown2013-11-201-6/+8
|\
| * Merge remote-tracking branch 'asoc/topic/ab8500' into asoc-nextMark Brown2013-11-031-6/+8
| |\
| | * ASoC: ab8500: Fix invalid cast to long pointerTakashi Iwai2013-10-301-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * ASoC: ab8500: Add missing of NULL check of devm_kzalloc()Takashi Iwai2013-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | Spotted by coverity CID 712316. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | ASoC: ab8500: Revert to using custom I/O functionsLee Jones2013-11-191-32/+34
|/ / | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'asoc/topic/ab8500' into asoc-nextMark Brown2013-10-241-41/+37
|\ \ | |/
| * ASoC: ab8500: Explicitly set I/O upMark Brown2013-09-241-0/+2
| | | | | | | | | | | | | | | | 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>
| * ASoC: ab8500: Convert register I/O to regmapMark Brown2013-09-201-34/+30
| | | | | | | | | | | | | | | | 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>
| * ASoC: ab8500: Use ASoC I/O functionsMark Brown2013-09-201-6/+4
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: ab8500: Downgrade noisy log messageMark Brown2013-09-201-1/+1
| | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org>
* | ASoC: ab8500-codec: info leak in anc_status_control_put()Dan Carpenter2013-09-131-1/+6
|/ | | | | | | | | | 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
* ASoC: ab8500-codec: Move codec ops on a separate structureFabio Baltieri2013-05-251-12/+7
| | | | | | | | | 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>
* ASoC: ab8500-codec: Set rx dai slots from rx_maskFabio Baltieri2013-05-211-9/+20
| | | | | | | | 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>
* ASoC: ab8500-codec: Set tx dai slots from tx_maskFabio Baltieri2013-05-211-12/+19
| | | | | | | | 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>
* ASoC: ab8500-codec: Add missing ad_to_slot definitionsFabio Baltieri2013-05-121-0/+6
| | | | | | | | | | | | | | | | | | 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>
* Merge branch 'master' into for-nextJiri Kosina2013-01-291-4/+4
|\ | | | | | | | | | | | | | | Conflicts: drivers/devfreq/exynos4_bus.c Sync with Linus' tree to be able to apply patches that are against newer code (mvneta).
| * 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: ab8500: Staticise non-exported ab85000_codec_daiMark Brown2012-11-141-1/+1
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | sound: soc: Fix typo in sound/codecsMasanari Iida2013-01-091-1/+1
|/ | | | | | | Correct spelling typo in sound/soc/codecs Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge remote-tracking branch 'asoc/topic/ux500' into for-3.7Mark Brown2012-09-221-0/+81
|\
| * ASoC: codecs: Enable AB8500 CODEC for Device TreeLee Jones2012-09-201-0/+81
| | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: Revert "ASoC: ab8500: Inform SoC Core that we have our own I/O ↵Fabio Estevam2012-09-111-3/+0
| | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: dapm: Add flags to regulator suppliesMark Brown2012-09-081-4/+4
| | | | | | | | | | | | | | 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>
* | ASoC: ab8500: Remove pointless castMark Brown2012-08-031-3/+3
|/ | | | | | | 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>
* ASoC: ab8500: Inform SoC Core that we have our own I/O arrangementsLee Jones2012-07-311-0/+4
| | | | | | | | | | | | | | | | | | 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>
* ASoC: Ux500: unlock on an error pathDan Carpenter2012-06-171-1/+2
| | | | | | | | 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>
* ASoC: Ux500: Correct license stringsOla Lilja2012-06-131-1/+1
| | | | | | | | | 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>
* ASoC: codecs: Add AB8500 codec-driverOla Lilja2012-06-111-0/+2521
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>
OpenPOWER on IntegriCloud