summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/mc13783.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: mc13783: replace codec to componentKuninori Morimoto2018-02-121-35/+33
| | | | | | | | | | | | | | 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: use snd_soc_component_init_regmap() on mc13783Kuninori Morimoto2017-12-041-6/+3
| | | | | | | | | To setup regmap, ALSA SoC has snd_soc_component_init_regmap() and .get_regmap. But these are duplicated feature. Let's use snd_soc_component_init_regmap() and remove .get_regmap 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: codec duplicated callback function goes to component on mc13783Kuninori 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: Constify snd_soc_dai_ops variablesAxel Lin2015-07-151-3/+3
| | | | | | | | The snd_soc_dai_ops variables are not modified after initialization in these drivers, so make them const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() callsAxel Lin2015-05-011-2/+2
| | | | | | | | | | mc13xxx_reg_rmw() won't change any bit if passing 0 to the mask field. Pass AUDIO_SSI_SEL instead of 0 for the mask field to set AUDIO_SSI_SEL bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* ASoC: mc13783: Update set_tdm_slot() semanticsLars-Peter Clausen2015-01-141-5/+5
| | | | | | | | | | | The mc13783 driver uses inverted semantics for the tx_mask and rx_mask parameter of the set_tdm_slot() callback compared to rest of ASoC. This patch updates the driver's semantics to be consistent with the rest of ASoC, i.e. a set bit means a active slot and a cleared bit means a inactive slot. This will allow us to use the set_tdm_slot() API in a more generic way. 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: mc13783: Ensure we only try to dereference valid of_nodesMark Brown2014-10-081-6/+10
| | | | | Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mc13783: Add missing of_node_putSachin Kamat2014-06-211-2/+4
| | | | | | | of_get_child_by_name expects of_node_put be called when done. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', ↵Mark Brown2014-05-221-1/+13
|\ \ | | | | | | | | | 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next
| | * ASoC: mc13783: Add devicetree supportAlexander Shiyan2014-04-291-1/+13
| |/ | | | | | | | | | | | | | | This patch adds devicetree support for mc13783-codec. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge remote-tracking branch 'asoc/topic/enum' into asoc-nextMark Brown2014-05-221-4/+4
|\ \
| * | ASoC: mc13783: Replace usage deprecated MUX/ENUM macrosLars-Peter Clausen2014-04-141-4/+4
| |/ | | | | | | | | | | | | | | | | SND_SOC_DAPM_VIRT_MUX and SOC_DAPM_ENUM_VIRT are deprecated and merely an alias for SND_SOC_DAPM_MUX and SOC_DAPM_ENUM. Replace the deprecated macros so we can eventually remove their definition. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | 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: mc13783: Remove the set_cache_io() entirely from ASoC probe.Xiubo Li2014-04-141-8/+6
|/ | | | | | | | | | | | 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>
* Merge remote-tracking branch 'asoc/topic/codecs' into asoc-nextMark Brown2014-03-231-4/+2
|\
| * ASoC: codecs: Replace instances of rtd->codec with dai->codecLars-Peter Clausen2014-03-181-4/+2
| | | | | | | | | | | | | | | | | | | | | | With CODEC to CODEC links rtd->codec does not necessarily point to the driver's CODEC. CODEC drivers should always use dai->codec and never even look at the PCM runtime. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown2014-03-131-2/+2
|\ \
| * | ASoC: io: New signature for snd_soc_codec_set_cache_io()Xiubo Li2014-03-111-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: mc13783: Use SOC_ENUM_SINGLE_VIRT_DECL()Lars-Peter Clausen2014-03-011-4/+2
| | | | | | | | | | | | | | | | | | For the upcoming consolidation for MUXs and virtual MUXs we need to mark virtual enums as such. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Mark Brown <broonie@linaro.org>
| |
| \
*-. \ Merge branches 'topic/dapm', 'topic/sign', 'topic/adau1373', ↵Mark Brown2014-03-011-7/+7
|\ \ \ | | |/ | |/| | | | 'topic/max98090', 'topic/mc13783', 'fix/wm8994' and 'topic/wm8995' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-enum
| | * ASoC: mc13783: Use SOC_ENUM_SINGLE_DECL()Takashi Iwai2014-02-231-7/+7
| |/ | | | | | | | | | | | | | | | | 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: mc13783: Remove superfluous constTakashi Iwai2014-02-201-4/+4
|/ | | | | | | | | | As SOC_ENUM_SINGLE_DECL() itself contains const modifier now, we can reduce const from its users. 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: mc13783: trivial: Cleanup moduleAlexander Shiyan2014-01-061-10/+7
| | | | | | | | This is a trivial cleanup: remove useless variable mc13xxx and extra spaces. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: mc13783: Drop fixed ADC & DAC ports usageAlexander Shiyan2014-01-061-2/+1
| | | | | | | | There are no users of this driver without pdata, so stop using constant assignment of ADC and DAC ports. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: mc13783: Use core error messages if registration failsAlexander Shiyan2014-01-061-8/+0
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: mc13783: Use module_platform_driver_probe()Alexander Shiyan2014-01-061-4/+2
| | | | | | | | mc13783-codec is probed only by MC13XXX MFD core driver so use module_platform_driver_probe(). Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge tag 'asoc-v3.13' of ↵Takashi Iwai2013-10-251-56/+79
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.13 - Further work on the dmaengine helpers, including support for configuring the parameters for DMA by reading the capabilities of the DMA controller which removes some guesswork and magic numbers fromm drivers. - A refresh of the documentation. - Conversions of many drivers to direct regmap API usage in order to allow the ASoC level register I/O code to be removed, this will hopefully be completed by v3.14. - Support for using async register I/O in DAPM, reducing the time taken to implement power transitions on systems that support it.
| * ASoC: mc13783: add more DAPM routesSteffen Trumtrar2013-10-111-6/+52
| | | | | | | | | | | | | | Add more infrastructure (i.e. routes, muxes, switches) to the mc13783 DAPM. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: mc13783: add mixer controlsSteffen Trumtrar2013-10-111-0/+18
| | | | | | | | | | | | | | Add more controls to the alsa mixer infrastructure. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: mc13783: Use regmap directly from ASoCMark Brown2013-09-251-46/+9
| | | | | | | | | | | | | | | | As part of a push to remove the register I/O functionality from ASoC (since it is now duplicated in the regmap API) convert the mc13783 driver to use regmap directly. Signed-off-by: Mark Brown <broonie@linaro.org>
| * mfd: mc13xxx: Move SPI erratum workaround into SPI I/O functionMark Brown2013-09-251-4/+0
| | | | | | | | | | | | | | | | | | Move the workaround for double sending AUDIO_CODEC and AUDIO_DAC writes into the SPI core, aiding refactoring to eliminate the ASoC custom I/O functions and avoiding the extra writes for I2C. Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | sound: Remove unnecessary semicolonsJoe Perches2013-10-141-1/+1
|/ | | | | | | These aren't necessary after switch and if blocks. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: mc13783: add spi errata fixSteffen Trumtrar2013-09-111-0/+4
| | | | | | | | | | | | | | | | | The MC13783 Chip Errata, Rev. 4 says, that depending on SPI clock and main audio clock speed, the Audio Codec or Stereo DAC do sometimes not start when programmed to do so. This is due to an internal clock timing issue related to the loading of the SPI bits into the audio block. On an i.MX27 based system, this issue lead to switched audio channels under certain circumstances: RTC + Touch + Audio are used and loaded at startup. The mentioned workaround of writing registers 40 and 41 two times is implemented here. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Cc: stable@vger.kernel.org Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: mc13783: Remove embedded snd_soc_codec structs from private data structsLars-Peter Clausen2013-08-061-1/+0
| | | | | | | It is unused and a leftover of the pre multi-component era. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: codecs: remove __dev* attributesBill Pemberton2012-12-101-1/+1
| | | | | | | | | | | 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>
* Merge tag 'v3.6-rc6' into for-3.7Mark Brown2012-09-221-4/+4
|\ | | | | | | | | | | | | Linux 3.6-rc6 has all our bug fixes. Conflicts (trivial overlap): sound/soc/omap/am3517evm.c
| * ASoC: mc13783: Remove mono supportFabio Estevam2012-09-061-4/+4
| | | | | | | | | | | | | | | | | | | | Playing a mono track on a mc13783 codec results in incorrect playback rate. Remove mono support so that a mono track can be played correctly. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Tested-by: Gaëtan Carlier <gcembed@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Revert "ASoC: mc13783: Provide codec->control_data"Fabio Estevam2012-09-111-2/+0
| | | | | | | | | | | | | | | | 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: imx-mc13783: use defines instead of numerical address of registerGaëtan Carlier2012-09-061-27/+31
|/ | | | | | | This uses already defined name of registers and makes code more readable. Signed-off-by: Gaëtan Carlier <gcembed@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: mc13783: Provide codec->control_dataFabio Estevam2012-07-261-0/+2
| | | | | | | | | | | | | | | | | | If codec->control_data is not provided, the following crash happens: Unable to handle kernel NULL pointer dereference at virtual address 00000078 pgd = 80004000 [00000078] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 Tainted: G W (3.5.0-next-20120725+ #1263) PC is at regmap_read+0x18/0x64 LR is at hw_read+0x50/0x98 pc : [<802bcd90>] lr : [<803cad18>] psr: 60000013 ... Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: mc13783 codec cleanupsPhilippe Rétornaz2012-05-181-21/+7
| | | | | Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add mc13783 codecPhilippe Rétornaz2012-05-181-0/+800
Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>