summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/mc13783.c
AgeCommit message (Collapse)Author
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal
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>
2016-08-08ASoC: codec duplicated callback function goes to component on mc13783Kuninori Morimoto
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>
2015-07-15ASoC: Constify snd_soc_dai_ops variablesAxel Lin
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>
2015-05-01ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() callsAxel Lin
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
2015-01-14ASoC: mc13783: Update set_tdm_slot() semanticsLars-Peter Clausen
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>
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-10-08ASoC: mc13783: Ensure we only try to dereference valid of_nodesMark Brown
Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-06-21ASoC: mc13783: Add missing of_node_putSachin Kamat
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>
2014-05-22Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', ↵Mark Brown
'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next
2014-05-22Merge remote-tracking branch 'asoc/topic/enum' into asoc-nextMark Brown
2014-04-29ASoC: mc13783: Add devicetree supportAlexander Shiyan
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>
2014-04-14ASoC: mc13783: Replace usage deprecated MUX/ENUM macrosLars-Peter Clausen
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>
2014-04-14ASoC: codec: fix the sparse check warnings.Xiubo Li
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>
2014-04-14ASoC: mc13783: Remove the set_cache_io() entirely from ASoC probe.Xiubo Li
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>
2014-03-23Merge remote-tracking branch 'asoc/topic/codecs' into asoc-nextMark Brown
2014-03-18ASoC: codecs: Replace instances of rtd->codec with dai->codecLars-Peter Clausen
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>
2014-03-13Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown
2014-03-11ASoC: io: New signature for snd_soc_codec_set_cache_io()Xiubo Li
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>
2014-03-01ASoC: mc13783: Use SOC_ENUM_SINGLE_VIRT_DECL()Lars-Peter Clausen
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>
2014-03-01Merge branches 'topic/dapm', 'topic/sign', 'topic/adau1373', ↵Mark Brown
'topic/max98090', 'topic/mc13783', 'fix/wm8994' and 'topic/wm8995' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-enum
2014-02-23ASoC: mc13783: 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>
2014-02-20ASoC: mc13783: Remove superfluous constTakashi Iwai
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>
2014-01-06ASoC: mc13783: trivial: Cleanup moduleAlexander Shiyan
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>
2014-01-06ASoC: mc13783: Drop fixed ADC & DAC ports usageAlexander Shiyan
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>
2014-01-06ASoC: mc13783: Use core error messages if registration failsAlexander Shiyan
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-06ASoC: mc13783: Use module_platform_driver_probe()Alexander Shiyan
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>
2013-10-25Merge tag 'asoc-v3.13' of ↵Takashi Iwai
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.
2013-10-14sound: Remove unnecessary semicolonsJoe Perches
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>
2013-10-11ASoC: mc13783: add more DAPM routesSteffen Trumtrar
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>
2013-10-11ASoC: mc13783: add mixer controlsSteffen Trumtrar
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>
2013-09-25ASoC: mc13783: Use regmap directly from ASoCMark Brown
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>
2013-09-25mfd: mc13xxx: Move SPI erratum workaround into SPI I/O functionMark Brown
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>
2013-09-11ASoC: mc13783: add spi errata fixSteffen Trumtrar
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>
2013-08-06ASoC: mc13783: Remove embedded snd_soc_codec structs from private data structsLars-Peter Clausen
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>
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-09-22Merge tag 'v3.6-rc6' into for-3.7Mark Brown
Linux 3.6-rc6 has all our bug fixes. Conflicts (trivial overlap): sound/soc/omap/am3517evm.c
2012-09-11ASoC: Revert "ASoC: mc13783: Provide codec->control_data"Fabio Estevam
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-06ASoC: imx-mc13783: use defines instead of numerical address of registerGaëtan Carlier
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>
2012-09-06ASoC: mc13783: Remove mono supportFabio Estevam
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>
2012-07-26ASoC: mc13783: Provide codec->control_dataFabio Estevam
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>
2012-05-18ASoC: mc13783 codec cleanupsPhilippe Rétornaz
Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18ASoC: Add mc13783 codecPhilippe Rétornaz
Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>