summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5682.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge series "ASoC: topology: fix error handling flow" from Pierre-Louis ↵Mark Brown2020-07-081-9/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bossart <pierre-louis.bossart@linux.intel.com>: While experimenting and introducing errors in Baytrail topology files until I got them right, I encountered multiple kernel oopses and memory leaks. This is a first batch to harden the code, but we should probably think of a tool to fuzz the topology... Pierre-Louis Bossart (5): ASoC: topology: fix kernel oops on route addition error ASoC: topology: fix tlvs in error handling for widget_dmixer ASoC: topology: use break on errors, not continue ASoC: topology: factor kfree(se) in error handling ASoC: topology: add more logs when topology load fails. sound/soc/soc-topology.c | 97 ++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 39 deletions(-) base-commit: a5911ac5790acaf98c929b826b3f7b4a438f9759 -- 2.25.1
| * ASoC: rt5682: cancel jack_detect_work if hs_jack is set to null even ↵Oder Chiou2020-07-011-9/+10
| | | | | | | | | | | | | | | | | | | | | | soundwire mode Base on https://patchwork.kernel.org/patch/11237953/ Soundwire mode also should follow it. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200701071645.32061-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge branch 'for-5.8' of ↵Mark Brown2020-06-291-1/+8
|\| | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.9
| * ASoC: rt5682: fix the pop noise while OMTP type headset pluginShuming Fan2020-06-241-1/+8
| | | | | | | | | | | | | | | | | | To turn the headphone output switch off during jack type detection, it could avoid the pop noise when jack type switches to OMTP type. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20200623125312.27896-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codecs: rt*: rename to snd_soc_component_read()Kuninori Morimoto2020-06-221-8/+8
| | | | | | | | | | | | | | | | | | | | | | We need to use snd_soc_component_read() instead of snd_soc_component_read32() This patch renames _read32() to _read() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87d05z4mce.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: soc-component: merge snd_soc_component_read() and ↵Kuninori Morimoto2020-06-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_component_read32() We had read/write function for Codec, Platform, etc, but these has been merged into snd_soc_component_read/write(). Internally, it is using regmap or driver function. In read case, each styles are like below regmap ret = regmap_read(..., reg, &val); driver function val = xxx->read(..., reg); Because of this kind of different style, to keep same read style, when we merged each read function into snd_soc_component_read(), we created snd_soc_component_read32(), like below. commit 738b49efe6c6 ("ASoC: add snd_soc_component_read32") (1) val = snd_soc_component_read32(component, reg); (2) ret = snd_soc_component_read(component, reg, &val); Many drivers are using snd_soc_component_read32(), and some drivers are using snd_soc_component_read() today. In generally, we don't check read function successes, because, we will have many other issues at initial timing if read function didn't work. Now we can use soc_component_err() when error case. This means, it is easy to notice if error occurred. This patch aggressively merge snd_soc_component_read() and _read32(), and makes snd_soc_component_read/write() as generally style. This patch do 1) merge snd_soc_component_read() and snd_soc_component_read32() 2) it uses soc_component_err() when error case (easy to notice) 3) keeps read32 for now by #define 4) update snd_soc_component_read() for all drivers Because _read() user drivers are not too many, this patch changes all user drivers. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/87sgev4mfl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: DAI wclk supports 44100 Hz outputderek.fang2020-06-151-18/+31
| | | | | | | | | | | | | | | | | | DAI Wclk of rt5682 only supports 48000Hz output so far, this patch lets it support 44100Hz. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1591938925-1070-4-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: Let PLL2 support the freq conversion for 44100Hz sample ratederek.fang2020-06-151-1/+8
|/ | | | | | | | | PLL2 of rt5682 only supports the freq conversion for 48000Hz sample rate so far, this patch lets it support 44100Hz. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1591938925-1070-3-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: Let dai clks be registered whether mclk exists or notderek.fang2020-06-151-5/+6
| | | | | | | | | | | According to ideal rt5682 CCF, the root clk is mclk. But in some platforms, mclk is not exported to CCF. In this condition, rt5682_register_dai_clks will not be called. This patch lets dai clks could be registered whether mclk exists or not. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1591938925-1070-5-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: split i2c driver into separate moduleArnd Bergmann2020-05-281-730/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With SND_SOC_AMD_RV_RT5682_MACH using the i2c version of the driver, we can easily get a build failure when I2C is built-in but soundwire is not: WARNING: unmet direct dependencies detected for SND_SOC_RT5682 Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (I2C [=y] || SOUNDWIRE [=m]) && (SOUNDWIRE [=m] || !SOUNDWIRE [=m]) && (I2C [=y] || !I2C [=y]) Selected by [y]: - SND_SOC_AMD_RV_RT5682_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AMD_ACP3x [=y] && I2C [=y] && CROS_EC [=y] Selected by [m]: - SND_SOC_RT5682_SDW [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SOUNDWIRE [=m] && (I2C [=y] || !I2C [=y]) Rework the driver to have three separate modules, with the main driver just dealing with the common bits and the actual initialization as part of i2c and sdw specific modules. The conversion is fairly mechanical to keep it easy to review, i.e. it moves code around with the minimal required renaming and changes. Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform") Fixes: fd443a20c2f0 ("ASoC: rt5682: fix I2C/Soundwire dependencies") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200528091851.2889754-1-arnd@arndb.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream()Pierre-Louis Bossart2020-05-181-0/+3
| | | | | | | | | | | | | | | | | | | | Now that the sdw_stream is allocated in machine driver, set_sdw_stream() is also called with a NULL argument during the dailink shutdown. In this case, the drivers should not allocate any memory, and just return. Detected with KASAN/kmemleak. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Cc: Oder Chiou <oder_chiou@realtek.com> Cc: Shuming Fan <shumingf@realtek.com> Cc: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200515211531.11416-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: remove unwanted btn_type assignmentTzung-Bi Shih2020-04-301-1/+0
| | | | | | | | | The following dev_err() is intended to print unexpected btn_type. Removes the unwanted btn_type assignment. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200430082231.151127-7-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: remove duplicate rt5682_reset() callsTzung-Bi Shih2020-04-301-4/+0
| | | | | | | | | Removes duplicate rt5682_reset() calls. rt5682_calibrate() calls rt5682_reset() anyway. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200430082231.151127-6-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: replace message printing from pr_() to dev_()Tzung-Bi Shih2020-04-301-6/+9
| | | | | | | | Replaces message printing from pr_() to dev_(). Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200430082231.151127-5-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: remove empty default caseTzung-Bi Shih2020-04-301-17/+2
| | | | | | | | Removes empty default case. Also adds a missing break statement. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200430082231.151127-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: fix space issuesTzung-Bi Shih2020-04-301-82/+70
| | | | | | | | Fixes blank lines and indent issues. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200430082231.151127-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: simplify assertionsTzung-Bi Shih2020-04-301-6/+5
| | | | | | | | Simplifies assertions for errors. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200430082231.151127-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: Fix build error without CONFIG_I2CYueHaibing2020-04-011-1/+4
| | | | | | | | | | | | | | | | | If I2C is n but SoundWire is m, building fails: sound/soc/codecs/rt5682.c:3716:1: warning: data definition has no type or storage class module_i2c_driver(rt5682_i2c_driver); ^~~~~~~~~~~~~~~~~ sound/soc/codecs/rt5682.c:3716:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] sound/soc/codecs/rt5682.c:3716:1: warning: parameter names (without types) in function declaration Guard this use #ifdef CONFIG_I2C. Fixes: 5549ea647997 ("ASoC: rt5682: fix unmet dependencies") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20200401091055.34112-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'for-5.6' of ↵Mark Brown2020-03-271-0/+2
|\ | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7
| * ASoC: rt5682: fix the random recording noise of headsetShuming Fan2020-03-181-0/+2
| | | | | | | | | | | | | | | | | | | | The cycle time of FIFO clock should increase 2 times to avoid the random recording noise issue. This setting could apply to all known situations in i2s mode. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20200317073308.11572-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: move DAI clock registry to I2S modeShuming Fan2020-03-271-20/+19
| | | | | | | | | | | | | | | | | | The SoundWire mode doesn't need the DAI clocks. Therefore, the DAI clock registry moves to I2S mode case. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20200327073849.18291-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: Add a property for DMIC delayOder Chiou2020-03-231-1/+11
| | | | | | | | | | | | | | | | | | The patch adds a property for DMIC delay (ms) to avoid pop noise and changes the default delay setting. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200323082547.7898-2-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: Add a property for DMIC clock rateOder Chiou2020-03-231-2/+7
| | | | | | | | | | | | | | | | | | The patch adds a property for DMIC clock rate (hz) and changes the default to the common optimize DMIC clock rate. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200323082547.7898-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: remove noisy debug messagesShuming Fan2020-03-181-2/+2
| | | | | | | | | | | | | | | | | | Some debug messages are too noisy. This patch removes it. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20200317073321.12660-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge branch 'for-5.6' of ↵Mark Brown2020-03-131-1/+1
|\| | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7
| * ASoC: rt5682: Revise the DAC1 volume settingOder Chiou2020-03-131-1/+1
| | | | | | | | | | | | | | | | The max volume of the DAC1 Playback Volume is 0dB. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200313023850.28875-2-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * Merge branch 'for-5.5' of ↵Mark Brown2019-12-101-0/+2
| |\ | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.6
* | | ASoC: rt5682: Fine tune the HP performance in soundwire modeOder Chiou2020-03-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The setting is sync with I2C/I2S mode. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200313023850.28875-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5682: Revise the function nameOder Chiou2020-02-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This patch revises the function name. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200219102858.20166-2-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5682: Add the soundwire supportOder Chiou2020-02-261-40/+486
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds the soundwire support for ALC5682. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/20200219102858.20166-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5682: Add CCF usage for providing I2S clksDerek Fang2020-02-181-2/+405
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a need to use RT5682 as DAI clock master for other codecs within a platform, which means that the DAI clocks are required to remain, regardless of whether the RT5682 is actually running playback/capture. The RT5682 CCF basic functions are implemented almost by the existing internal functions and asoc apis. It needs a clk provider (rt5682 mclk) to generate the bclk and wclk outputs. The RT5682 CCF supports and restricts as below: 1. Fmt of DAI-AIF1 must be configured to master before using CCF. 2. Only accept a 48MHz clk as the clk provider. 3. Only provide a 48kHz wclk and a set of multiples of wclk as bclk. There are some temporary limitations in this patch until a better implementation. Signed-off-by: Derek Fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1582033912-6841-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5682: Enable PLL2 functionderek.fang2020-02-131-45/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enable RT5682 PLL2 function to implement the more complex frequency conversion. Signed-off-by: derek.fang <derek.fang@realtek.com> Link: https://lore.kernel.org/r/1581577510-1807-1-git-send-email-derek.fang@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: rt5682: Add the field "is_sdw" of private dataOder Chiou2020-02-111-64/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The field "is_sdw" is used for distinguishing the driver whether is run in soundwire mode or not. That will run the separated setting in runtime to make sure the driver can be run with the same build between i2s mode and soundwire mode. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://lore.kernel.org/r/980b97e1ab9c4fab8bd345ec2158f1fd@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge tag 'asoc-fix-v5.5-rc2' of ↵Takashi Iwai2019-12-171-0/+2
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.5 A collection of fixes since the merge window, mostly driver specific but there's a few in the core that clean up fallout from the refactorings done in the last cycle.
| * ASoC: rt5682: fix i2c arbitration lost issueShuming Fan2019-11-251-0/+2
| | | | | | | | | | | | | | | | This patch modified the HW initial setting to fix i2c arbitration lost issue. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20191125091940.11953-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge branch 'asoc-5.5' into asoc-nextMark Brown2019-11-221-0/+15
|\|
| * ASoC: rt5682: improve the sensitivity of push buttonShuming Fan2019-10-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | The sensitivity could improve by decreasing the HW debounce time and reduce the delay time of workequeue. This patch added a device property for HW debounce time control. We could change this value to tune the sensitivity of push button. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20191030085533.14299-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: fix the charge pump capacitor dischargesShuming Fan2019-11-181-24/+3
| | | | | | | | | | | | | | | | | | | | Due to switching the HV to LV mode while stopping playback, the charge pump capacitor will be discharged to the source of the pump circuit. Therefore, this patch removed the event control. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20191118091624.18699-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: cancel jack_detect_work if hs_jack is set to nullBard liao2019-11-121-0/+1
|/ | | | | | | | | | jack_detect_work will be triggered by rt5682_irq. We should cancel it if hs_jack is set to null. Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191111222152.19723-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: add NULL handler to set_jack functionJaska Uimonen2019-10-011-2/+10
| | | | | | | | | | Implement NULL handler in set_jack function to disable irq's. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927201408.925-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: use devm_snd_soc_register_component()Kuninori Morimoto2019-07-021-10/+3
| | | | | | | | | | We have devm_xxx version of snd_soc_register_component, let's use it. This patch also removes related empty functions Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner2019-06-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ASoC: codecs: rt5682: initialize mutex before usingXun Zhang2019-04-251-1/+1
| | | | | | | | | | In rt5682 codec driver, a mutex called "calibrate_mutex" is used in rt5682_calibrate() before initialization, which causes warning in lock debug. Move the initialization before the usage of mutex. Signed-off-by: Xun Zhang <xun2.zhang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: recording has no sound after bootingShuming Fan2019-03-181-9/+5
| | | | | | | | | If ASRC turns on, HW will use clk_dac as the reference clock whether recording or playback. Both of clk_dac and clk_adc should set proper clock while using ASRC. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: fix jack type detection issueShuming Fan2019-03-181-7/+5
| | | | | | | | The jack type detection needs the main bias power of analog. The modification makes sure the main bias power on/off while jack plug/unplug. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: Check JD status when system resumeShuming Fan2019-03-181-17/+17
| | | | | | | | | The IRQ function may not work when system suspend. We remove snd_soc_dapm_force_enable_pin function call to make sure the bias off when idle and run into suspend/resume function. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'asoc-5.0' into asoc-5.1 for dapm tableMark Brown2019-02-061-0/+2
|\
| * ASoC: rt5682: Correct the setting while select ASRC clk for AD/DA filterShuming Fan2019-01-221-0/+2
| | | | | | | | | | | | | | | | | | AD/DA ASRC function control two ASRC clock sources separately. Whether AD/DA filter select which clock source, we enable AD/DA ASRC function for all cases. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5682: add default pdata for i2s modeBard liao2019-01-171-0/+8
|/ | | | | | | | Add a default pdata which can fit most HW design. So we don't need to add a lot of DMI checking in this driver. Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5682: Fix recording no sound issueShuming Fan2019-01-031-0/+1
| | | | | | | | The ADC mixer setting needs to restore to default value after calibration. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>