summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/ak4642.c
AgeCommit message (Collapse)Author
2021-09-27ASoC: ak4642: Use modern ASoC DAI format terminologyMark Brown
As part of moving to remove the old style defines for the bus clocks update the ak4642 driver to use more modern terminology for clocking. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210920164042.16624-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21ASoC: ak*: sync parameter naming (rate/sample_bits)Kuninori Morimoto
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y2gun6vc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-30ASoC: ak4642: convert to SPDX identifiersKuninori Morimoto
As original license mentioned, it is GPL-2.0 in SPDX. Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL". See ${LINUX}/include/linux/module.h "GPL" [GNU Public License v2 or later] "GPL v2" [GNU Public License v2] Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-14ASoC: ak4642: don't have .use_pmdown_timeKuninori Morimoto
snd_soc_runtime_ignore_pmdown_time() returns "ignore pmdown time" decision. Then, it collects each component driver's .use_pmdown_time settings by using AND operation. But, ak4613 has no reason to ignore/use pmdown time. Thus, It should has use_pmdown_time=0, it means it doesn't have decision right of "ignore pmdown time". Otherwise, ak4642 paired driver's pmdown_time settings doesn't have meaning. In other words, "ignore pmdown time" is determined irrespective of the value of paired driver's settings (= ignore will be 0 by ak4642). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: ak4642: replace codec to componentKuninori Morimoto
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>
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>
2017-06-30ASoC: ak4642: make arrays fs_list and ps_list static constColin Ian King
Don't populate the arrays fs_list and ps_list on the stack but make them static const. Makes the object code smaller: Before: text data bss dec hex filename 12084 4888 64 17036 428c sound/soc/codecs/ak4642.o After: text data bss dec hex filename 11883 5032 64 16979 4253 sound/soc/codecs/ak4642.o Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-11ASoC: ak4642: Replace mdelay function to msleepHarunobu Kurokawa
Replace mdelay to msleep to avoid busy loop on ak4642_lout_event(). Otherwise, sometimes playback doesn't work correctly when pulseaudio was used. Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: codec duplicated callback function goes to component on ak4642Kuninori 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>
2016-05-31ASoC: ak4642: Implement suspend callbackPeter Ujfalusi
Add the suspend callback to accompany the existing resume operation. With the suspend/resume callbacks the regmap (regcache) state handling can follow the recommended sequence. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-18ASoC: ak4642: Enable cache usage to fix crashes on resumeMark Brown
The ak4642 driver is using a regmap cache sync to restore the configuration of the chip on resume but (as Peter observed) does not actually define a register cache which means that the resume is never going to work and we trigger asserts in regmap. Fix this by enabling caching. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Reported-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2016-04-20ASoC: ak4642: Remove CLK_IS_ROOTStephen Boyd
This flag is a no-op now (see commit 47b0eeb3dc8a "clk: Deprecate CLK_IS_ROOT", 2016-02-02) so remove it. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16ASoC: ak4642: exchange macro name to avoid redefinitionKuninori Morimoto
71a0138ab("ASoC: ak4642: enable to use MCKO as fixed rate output pin on DT") added new FS() macro, but x86 already has it in arch/x86/include/uapi/asm/ptrace-abi.h This patch exchange FS() to FSs() to avoid redefinition warning Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: ak4642: enable to use MCKO as fixed rate output pin on DTKuninori Morimoto
ak4642 chip can output clock via MCKO pin as audio reference clock. This patch supports it on DT Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14ASoC: ak4642: use *dev on ak4642_i2c_probe()Kuninori Morimoto
Let's replace &i2c->dev to dev Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ac97', ↵Mark Brown
'asoc/topic/ak4542', 'asoc/topic/arizona' and 'asoc/topic/atmel' into asoc-next
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07ASoC: ak4642: Fix up max_register settingAxel Lin
The max_register setting for ak4642, ak4643 and ak4648 are wrong, fix it. According to the datasheet: the maximum valid register for ak4642 is 0x1f the maximum valid register for ak4643 is 0x24 the maximum valid register for ak4648 is 0x27 The default settings for ak4642 and ak4643 are the same for 0x0 ~ 0x1f registers, so it's fine to use the same reg_default table with differnt num_reg_defaults setting. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen
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>
2015-04-12Merge remote-tracking branches 'asoc/topic/4554', 'asoc/topic/ab8500', ↵Mark Brown
'asoc/topic/ak4642', 'asoc/topic/arizona' and 'asoc/topic/atmel' into asoc-next
2015-04-10ASoC: ak4642: fixup channels_minKuninori Morimoto
ak4642 doesn't have Mono record, ak4643 have it, but not supported. This patch fixes channel mismatch Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-24ASoC: ak4642: enable stereo line output power-save modeTakeshi Kihara
ak4642 has power-save mode for stereo line to reduce pop noise. This patch enables it. Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-17ASoC: ak4642: tidyup DAPM route for playbackKuninori Morimoto
It needs DAC -> Playback route instead of direct settings via SND_SOC_DAPM_DAC. otherwise, it can't find correct path if sound card used prefix name Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-22ASoC: ak4642: Cleanup manual bias level transitionsLars-Peter Clausen
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>
2014-07-28ASoC: ak4642: Make of_device_id array constKiran Padwal
Make of_device_id array const, because all OF functions handle it as const Signed-off-by: Kiran Padwal <kiran.padwal21@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14ASoC: ak4642: Add support for extended sysclk frequencies of the ak4648Sascha Hauer
Additionally to the ak4642 pll frequencies the ak4648 also supports 13MHz, 19.2MHz and 26MHz. This adds support for these frequencies. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14ASoC: ak4642: Add driver data and driver private structSascha Hauer
Currently unused, this is done to let the driver distinguish between the different supported codec types in later patches. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14ASoC: ak4642: Add ALC controlsSascha Hauer
ALC and ALC Zero crossing detection has been enabled unconditionally. Add controls for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14ASoC: ak4642: Fix typo zoro -> zeroSascha Hauer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-11ASoC: codec: Simplify ASoC probe code.Xiubo Li
For some CODEC drivers like who act as the MFDs children are ignored by this patch. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02ASoC: ak4642: Convert to module_i2c_driver()Mark Brown
The device does not support anything other than I2C (at least with the current driver) so save code. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02ASoC: ak4642: Convert to direct regmap API usageMark Brown
This moves us towards being able to remove the ASoC level I/O code which duplicates regmap functionality. Currently the only difference between the supported devices in the driver is the regmap so we can replace the CODEC driver selections with regmap selection instead. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02ASoC: ak4642: Convert to table based control initMark Brown
Improves error handling and saves code. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-24ASoC: ak4642: Use IS_ENABLED() macroFabio Estevam
Using the IS_ENABLED() macro can make the code shorter and simpler. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-03Merge remote-tracking branch 'asoc/fix/ak4642' into asoc-linusMark Brown
2013-10-31ASoC: ak4642: prevent un-necessary changes to SG_SL1Phil Edworthy
If you record the sound during playback, the playback sound becomes silent. Modify so that the codec driver does not clear SG_SL1::DACL bit which is controlled under widget Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-09-17ASoC: ak4642: Remove redundant breakSachin Kamat
'break' after return statement is redundant. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-01-14ASoC: ak4642: remove __devinitconst annotationStephen Rothwell
CONFIG_HOTPLUG is always true now and the __dev* macros have been removed. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-10ASoC: ak4642: add Device Tree supportKuninori Morimoto
Support for loading the ak4642 codec module via devicetree. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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-11-21ASoC: ak4642: cleanup struct ak4642_privKuninori Morimoto
This patch removed struct ak4642_priv which had meaningless variable. It is no longer needed Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-05ASoC: ak4642: fixup: mute needs +1 stepKuninori Morimoto
ak4642 out_tlv is +12.0dB to -115.0 dB, and it supports mute. But current settings didn't care +1 step for mute. This patch adds it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-03-18Merge branch 'topic/asoc' into for-linusTakashi Iwai
2012-02-21ASoC: ak4642: fixup HeadPhone L/R dapm settingsKuninori Morimoto
Current ak4642 driver had wrong dapm settings for headphone L/R. If you select headphone L, and select R after that, headphone L setting was removed by R settings. This patch fixes it up. It provides just "Headphone Enable" to user side Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-04ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood
Currently ASoC can only add kcontrols using codec and platform component device handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for SoC card machine drivers too. This allows the kcontrol to have a direct handle to the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily get it's private data. This change makes snd_soc_add_controls() static and wraps it in the folowing calls (card and dai are new) :- snd_soc_add_card_controls() snd_soc_add_codec_controls() snd_soc_add_dai_controls() snd_soc_add_platform_controls() This patch also does a lot of small mechanical changes in individual codec drivers to replace snd_soc_add_controls() with snd_soc_add_codec_controls(). It also updates the McBSP DAI driver to use snd_soc_add_dai_controls(). Finally, it updates the existing machine drivers that register controls to either :- 1) Use snd_soc_add_card_controls() where no direct codec control is required. 2) Use snd_soc_add_codec_controls() where there is direct codec control. In the case of 1) above we also update the machine drivers to get the correct component data pointers from the kcontrol (rather than getting the machine pointer via the codec pointer). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20ASoC: Convert ak4642 to devm_kzalloc()Axel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-27ASoC: Remove unneeded platform_device.h inclusions from CODECsMark Brown
They've not been needed for a long time if they were ever required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-27ASoC: Remove driver versioning from ak4642Mark Brown
It's never been updated so it can't be that useful and it makes the driver needlessly chatty. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen
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>
2011-11-11ASoC: ak4642: add ak4648 supportKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>