aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/skl_hda_dsp_common.h (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2020-01-27ASoC: SOF: pci: add missing default_fw_name of JasperLakePan Xiuli1-0/+1
jsl_desc missed default_fw_name, this will fail the probe in nocodec or generice HDA mode due the firmware path is intel/sof/(null) Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200124213625.30186-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-27ASoC: SOF: trace: fix unconditional free in trace releaseKai Vehmanen1-2/+5
Check if DMA pages were successfully allocated in initialization before calling free. For many types of memory (like sgbufs) the extra free is harmless, but not all backends track allocation state, so add an explicit check. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200124213625.30186-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-27ASoC: SOF: core: release resources on errors in probe_continuePierre-Louis Bossart2-21/+16
The initial intent of releasing resources in the .remove does not work well with HDaudio codecs. If the probe_continue() fails in a work queue, e.g. due to missing firmware or authentication issues, we don't release any resources, and as a result the kernel oopses during suspend operations. The suggested fix is to release all resources during errors in probe_continue(), and use fw_state to track resource allocation state, so that .remove does not attempt to release the same hardware resources twice. PM operations are also modified so that no action is done if DSP resources have been freed due to an error at probe. Reported-by: Takashi Iwai <tiwai@suse.de> Co-developed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Bugzilla: http://bugzilla.suse.com/show_bug.cgi?id=1161246 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200124213625.30186-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2020-01-27ASoC: SOF: core: free trace on errorsPierre-Louis Bossart1-2/+5
free_trace() is not called on probe errors, fix Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200124213625.30186-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2020-01-27ASoC: SOF: fix an Oops, caused by invalid topologyGuennadi Liakhovetski1-0/+10
It is possible to create invalid topology that will cause a kernel Oops when trying to allocate buffers for a NULL substream. Specifically such an Oops was caused by a topology, where a DAI on a capture pipeline was referencing the PCM ID from a playback pipeline. Fix the Oops by explicitly checking for NULL. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200124213625.30186-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-27ASoC: amd: Fix for Subsequent Playback issue.Ravulapati Vishnu vardhan rao1-7/+7
If we play audio back to back, which kills one playback and immediately start another, we can hear clicks. This patch fixes the issue. Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com> Link: https://lore.kernel.org/r/1580124397-19842-1-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-27ASoC: SOF: Intel: do not disable i915 power during probeKai Vehmanen1-1/+2
Change HDA probe behaviour slightly so that i915 power is not turned off if i915 audio codecs are found in the initial probe done by SOF Intel driver, and power is kept on until HDA codec driver probe runs. This will reduce number of mode sets on platforms with low minimum CDCLK (like GLK) and brings the SOF probe sequence closer to legacy HDA driver in terms of i915 audio codec power management. BugLink: https://github.com/thesofproject/linux/issues/1642 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200120160117.29130-3-kai.vehmanen@linux.intel.com Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-27ASoC: SOF: Intel: refactor i915_get/put functionsKai Vehmanen3-20/+10
The current interface to control i915 display power is misleading. The hda_codec_i915_get() and hda_codec_i915_put() names suggest a refcounting based interface. This is confusing as no refcounting is done and the underlying HDAC library interface does not support refcounts eithers. Clarify the code by replacing the functions with a single hda_codec_i915_display_power() that is aligned with snd_hdac_display_power(). Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200120160117.29130-2-kai.vehmanen@linux.intel.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-24ASoC: rt1015: Remove unnecessary constNathan Chancellor1-1/+1
Clang warns: ../sound/soc/codecs/rt1015.c:392:14: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL(rt1015_boost_mode_enum, 0, 0, ^ ../include/sound/soc.h:355:2: note: expanded from macro 'SOC_ENUM_SINGLE_DECL' SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts) ^ ../include/sound/soc.h:352:2: note: expanded from macro 'SOC_ENUM_DOUBLE_DECL' const struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \ ^ 1 warning generated. Remove the const after static to fix it. Fixes: df31007400c3 ("ASoC: rt1015: add rt1015 amplifier driver") Link: https://github.com/ClangBuiltLinux/linux/issues/845 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Link: https://lore.kernel.org/r/20200124155750.33753-1-natechancellor@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-24ASoC: max98090: silence lockdep warningMarek Szyprowski1-1/+2
Commit 08df0d9a00f7 ("ASoC: max98090: revert "ASoC: max98090: fix lockdep warning"") provided a good rationale for removing separate lock for the SHDN register access. However it restored the lockdep warning during the system boot. To silence the lockdep warning, mark the mutex taken in the max98090_shdn_save() function with the lockdep class dedicated for the runtime DAPM operations: SND_SOC_DAPM_CLASS_RUNTIME. This finally fixes the following lockdep warning observed on Exynos4412-based Odroid U3 board: ====================================================== WARNING: possible circular locking dependency detected 5.5.0-rc7-next-20200123 #7329 Not tainted ------------------------------------------------------ alsactl/1105 is trying to acquire lock: ed4f7cf4 (&card->dapm_mutex){+.+.}, at: max98090_shdn_save+0x1c/0x28 but task is already holding lock: edb8d49c (&card->controls_rwsem){++++}, at: snd_ctl_ioctl+0xcc/0xbb8 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&card->controls_rwsem){++++}: snd_ctl_add_replace+0x3c/0x84 dapm_create_or_share_kcontrol+0x24c/0x2e0 snd_soc_dapm_new_widgets+0x308/0x594 snd_soc_bind_card+0x834/0xa94 devm_snd_soc_register_card+0x34/0x6c odroid_audio_probe+0x288/0x34c platform_drv_probe+0x6c/0xa4 really_probe+0x200/0x48c driver_probe_device+0x78/0x1f8 bus_for_each_drv+0x74/0xb8 __device_attach+0xd4/0x16c bus_probe_device+0x88/0x90 deferred_probe_work_func+0x3c/0xd0 process_one_work+0x230/0x7bc worker_thread+0x44/0x524 kthread+0x130/0x164 ret_from_fork+0x14/0x20 0x0 -> #0 (&card->dapm_mutex){+.+.}: lock_acquire+0xe8/0x270 __mutex_lock+0x9c/0xb18 mutex_lock_nested+0x1c/0x24 max98090_shdn_save+0x1c/0x28 max98090_put_enum_double+0x20/0x40 snd_ctl_ioctl+0x190/0xbb8 ksys_ioctl+0x484/0xb10 ret_fast_syscall+0x0/0x28 0xbede0564 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&card->controls_rwsem); lock(&card->dapm_mutex); lock(&card->controls_rwsem); lock(&card->dapm_mutex); *** DEADLOCK *** 1 lock held by alsactl/1105: #0: edb8d49c (&card->controls_rwsem){++++}, at: snd_ctl_ioctl+0xcc/0xbb8 stack backtrace: CPU: 2 PID: 1105 Comm: alsactl Not tainted 5.5.0-rc7-next-20200123 #7329 Hardware name: Samsung Exynos (Flattened Device Tree) [<c01126f0>] (unwind_backtrace) from [<c010e1e8>] (show_stack+0x10/0x14) [<c010e1e8>] (show_stack) from [<c0b5234c>] (dump_stack+0xb4/0xe0) [<c0b5234c>] (dump_stack) from [<c018a610>] (check_noncircular+0x1ec/0x208) [<c018a610>] (check_noncircular) from [<c018ca2c>] (__lock_acquire+0x1210/0x25ec) [<c018ca2c>] (__lock_acquire) from [<c018e728>] (lock_acquire+0xe8/0x270) [<c018e728>] (lock_acquire) from [<c0b71928>] (__mutex_lock+0x9c/0xb18) [<c0b71928>] (__mutex_lock) from [<c0b723c0>] (mutex_lock_nested+0x1c/0x24) [<c0b723c0>] (mutex_lock_nested) from [<c086097c>] (max98090_shdn_save+0x1c/0x28) [<c086097c>] (max98090_shdn_save) from [<c08613f8>] (max98090_put_enum_double+0x20/0x40) [<c08613f8>] (max98090_put_enum_double) from [<c0833f20>] (snd_ctl_ioctl+0x190/0xbb8) [<c0833f20>] (snd_ctl_ioctl) from [<c02cae14>] (ksys_ioctl+0x484/0xb10) [<c02cae14>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x28) Exception stack(0xed331fa8 to 0xed331ff0) ... Fixes: 08df0d9a00f7 ("ASoC: max98090: revert "ASoC: max98090: fix lockdep warning"") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200123134046.9769-1-m.szyprowski@samsung.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: soc-core: remove null_snd_soc_opsKuninori Morimoto1-4/+0
All rtd->dai_link callback functions are controlled by soc_rtd_xxxx(), and checking rtd->dai_link->ops. We don't need to have null_snd_soc_ops anymore. This patch removes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zhegl3oz.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: soc-pcm: add soc_rtd_trigger()Kuninori Morimoto1-10/+16
Add soc_rtd_trigger() to make the code easier to read Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/871rrsmi9j.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: soc-pcm: add soc_rtd_hw_free()Kuninori Morimoto1-4/+10
Add soc_rtd_hw_free() to make the code easier to read Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/8736c8mi9n.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: soc-pcm: add soc_rtd_hw_params()Kuninori Morimoto1-7/+15
Add soc_rtd_hw_params() to make the code easier to read Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874kwomi9r.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: soc-pcm: add soc_rtd_prepare()Kuninori Morimoto1-7/+14
Add soc_rtd_prepare() to make the code easier to read Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875zh4mi9v.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: soc-pcm: add soc_rtd_shutdown()Kuninori Morimoto1-4/+10
Add soc_rtd_shutdown() to make the code easier to read Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/877e1kmi9z.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: soc-pcm: add soc_rtd_startup()Kuninori Morimoto1-7/+14
Add soc_rtd_startup() to make the code easier to read Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/878sm0mia4.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: rt1015: add rt1015 amplifier driverJack Yu5-0/+1393
This is initial amplifier driver for rt1015. Signed-off-by: Jack Yu <jack.yu@realtek.com> Link: https://lore.kernel.org/r/20200115112519.22050-1-jack.yu@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-23ASoC: madera: Correct some kernel docCharles Keepax1-1/+1
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20200122104559.17043-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: Add MediaTek MT6660 Speaker Amp DriverJeff Chang4-0/+598
The MT6660 is a boosted BTL class-D amplifier with V/I sensing. A built-in DC-DC step-up converter is used to provide efficient power for class-D amplifier with multi-level class-G operation. The digital audio interface supports I2S, left-justified, right-justified, TDM and DSP A/B format for audio in with a data out used for chip information like voltage sense and current sense, which are able to be monitored via DATAO through proper Signed-off-by: Jeff Chang <jeff_chang@richtek.com> Link: https://lore.kernel.org/r/1579153597-23286-1-git-send-email-richtek.jeff.chang@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: dt-bindings: rt5645: add suppliersMatthias Brugger1-0/+4
The rt5645 and rt5650 have two suppliers, document them. Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com> Link: https://lore.kernel.org/r/20200114150151.8537-1-matthias.bgg@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: max98090: fix deadlock in max98090_dapm_put_enum_double()Tzung-Bi Shih1-1/+1
Commit 62d5ae4cafb7 ("ASoC: max98090: save and restore SHDN when changing sensitive registers SHDN bit") uses dapm_mutex to protect SHDN bit. However, snd_soc_dapm_put_enum_double() in max98090_dapm_put_enum_double() acquires the dapm_mutex again which cause a deadlock. Use snd_soc_dapm_put_enum_double_locked() instead to fix the deadlock. Fixes: 62d5ae4cafb7 ("ASoC: max98090: save and restore SHDN when changing sensitive registers SHDN bit") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200117073814.82441-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: dapm: add snd_soc_dapm_put_enum_double_lockedTzung-Bi Shih2-13/+43
Adds snd_soc_dapm_put_enum_double_locked() for those use cases if dapm_mutex has already locked. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200117073814.82441-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: max98090: revert "ASoC: max98090: fix lockdep warning"Tzung-Bi Shih2-7/+4
Commit 2dc98af62c32 ("ASoC: max98090: fix lockdep warning") introduced a helpful-less small lock: shdn_lock. Reverts the commit. Reasons: 1. Lockdep should not be happy by either the original or current code. From lockdep's point of view, there is a lock inversion anyway. Let d = dapm_mutex, c = controls_rwsem, s = shdn_lock, From the reported calling stack: lock acquisition order of snd_soc_register_card() is: d -> c. > snd_ctl_add_replace+0x3c/0x84 > dapm_create_or_share_kcontrol+0x24c/0x2e0 > snd_soc_dapm_new_widgets+0x308/0x594 > snd_soc_bind_card+0x80c/0xad4 > devm_snd_soc_register_card+0x34/0x6c If calling snd_soc_dapm_put_enum_double() in kcontrol's put (e.g. SOC_DAPM_ENUM_EXT), lock acquisition order is: c -> d. Note that, snd_soc_dapm_put_enum_double() acquires d. The possible lock inversion is always there if registering sound card and putting mixer control happen at the same time. In fact, it never happens because the control device don't show up to the userspace until the sound card build success. Commit 2dc98af62c32 ("ASoC: max98090: fix lockdep warning") changes the order to: c -> s -> d. The lock inversion is still there. 2. Commit 62d5ae4cafb7 ("ASoC: max98090: save and restore SHDN when changing sensitive registers SHDN bit") designed to use dapm_mutex to protect SHDN bit. Use a separate lock breaks the protection. DAPM changes SHDN bit automatically when it finds the path. Thus, any code wants to change the SHDN bit, need to acquire the dapm_mutex first. > SND_SOC_DAPM_SUPPLY("SHDN", M98090_REG_DEVICE_SHUTDOWN, > M98090_SHDNN_SHIFT, 0, NULL, 0), Fixes: 2dc98af62c32 ("ASoC: max98090: fix lockdep warning") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200117073814.82441-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: soc-core: remove bus_controlKuninori Morimoto12-35/+3
Now, snd_soc_dai_driver::bus_control is used for how to resume. But, no driver which has bus_control has DAI driver suspend/resume support. This patch removes pointless bus_control from ALSA SoC. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pnffx7i4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: soc-core: remove DAI suspend/resumeKuninori Morimoto3-55/+0
Historically, CPU and Codec were implemented different, but now it is merged as Component. ALSA SoC is supporting suspend/resume at DAI and Component level. The method is like below. 1) Suspend/Resume all CPU DAI if bus-control was 0 2) Suspend/Resume all Component 3) Suspend/Resume all CPU DAI if bus-control was 1 Historically 2) was Codec special operation. Because CPU and Codec were merged into Component, CPU suspend/resume has 3 chance to suspend(= 1/2/3), but Codec suspend/resume has 1 chance (= 2). Here, DAI side suspend/resume is caring bus-control, but no driver which is supporting suspend/resume is setting bus-control. This means 3) was never used. Here, used parameter for suspend/resume component->dev and dai->dev are same pointer. For that reason, we can merge DAI and Component suspend/resume. One note is that we should use 2), because it is caring BIAS level. This patch removes 1) and 3). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87r1zvx7i8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: pxa: pxa2xx-i2s: move .suspend/.resume to componentKuninori Morimoto1-6/+6
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87sgkbx7ic.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: pxa: pxa-ssp: move .suspend/.resume to componentKuninori Morimoto1-8/+8
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can swtcih all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87tv4rx7ij.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: ux500: ux500_msp_dai: remove unused DAI .suspend/.resumeKuninori Morimoto1-2/+0
This patch removes unused DAI driver .suspend/.resume Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v9p7x7io.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: samsung: i2s: move .suspend/.resume to componentKuninori Morimoto1-6/+7
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wo9nx7it.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: dwc: dwc-i2s: move .suspend/.resume to componentKuninori Morimoto1-14/+18
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y2u3x7iy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: uniphier: move .suspend/.resume to componentKuninori Morimoto4-38/+27
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zhejx7j4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: ti: omap-mcpdm: move .suspend/.resume to componentKuninori Morimoto1-8/+8
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/871rrvym3p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: sti: sti_uniperif: move .suspend/.resume to componentKuninori Morimoto1-6/+6
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/8736cbym3x.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: samsung: spdif: move .suspend/.resume to componentKuninori Morimoto1-6/+12
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874kwrym42.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: samsung: s3c24xx-i2s: move .suspend/.resume to componentKuninori Morimoto1-4/+4
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875zh7ym48.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: mediatek: move .suspend/.resume to componentKuninori Morimoto4-26/+14
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/877e1nym4e.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: jz4740: jz4740-i2s: move .suspend/.resume to componentKuninori Morimoto1-10/+8
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/878sm3ym4j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: cirrus: ep93xx-i2s: move .suspend/.resume to componentKuninori Morimoto1-8/+8
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a76jym4p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: atmel: atmel_ssc_dai: move .suspend/.resume to componentKuninori Morimoto1-10/+8
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87d0bfym53.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: bcm: cygnus-ssp: move .suspend/.resume to componentKuninori Morimoto1-6/+33
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87blqzym4w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: Intel: cht_bsw_rt5645: Remove unnecessary string buffers and snprintf callsDamian van Soelen1-22/+4
The snprintf calls filling cht_rt5645_cpu_dai_name / cht_rt5645_codec_aif_name always fill them with the same string ("ssp0-port" resp "rt5645-aif2") so instead of keeping these buffers around and making cpus->dai_name / codecs->dai_name point to this, simply update the *->dai_name pointers to directly point to a string constant containing the desired string. Signed-off-by: Damian van Soelen <dj.vsoelen@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115164619.101705-5-hdegoede@redhat.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: Intel: bytcr_rt5651: Remove unnecessary string buffers and snprintf callsJordy Ubink1-20/+4
The snprintf calls filling byt_rt56*_codec_aif_name/byt_rt56*_cpu_dai_name always fill them with the same string ("rt56*-aif2" resp. ssp0-port"). So instead of keeping these buffers around and making codecs->dai_name / cpus->dai_name point to them, simply update the *->dai_name pointers to directly point to a string constant containing the desired string. Signed-off-by: Jordy Ubink <jordyubink@hotmail.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115164619.101705-4-hdegoede@redhat.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: Intel: bytcr_rt5640: Remove unnecessary string buffers and snprintf callsNariman Etemadi1-22/+4
The snprintf calls filling byt_rt56*_codec_aif_name/byt_rt56*_cpu_dai_name always fill them with the same string ("rt56*-aif2" resp. ssp0-port"). So instead of keeping these buffers around and making codecs->dai_name / cpus->dai_name point to them, simply update the *->dai_name pointers to directly point to a string constant containing the desired string. Signed-off-by: Nariman Etemadi <narimantos@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115164619.101705-3-hdegoede@redhat.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: Intel: bytcr_rt5640: Remove code duplication in byt_rt5640_codec_fixupErik Bussing1-45/+23
The 16 and 24 bit paths in byt_rt5640_codec_fixup are mostly identical, introduce a local bits variable to address the only difference and move the common bits out of the if ... else ... . Signed-off-by: Erik Bussing <eabbussing@outlook.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115164619.101705-2-hdegoede@redhat.com Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: msm8916-wcd-analog: Add MIC BIAS Internal3Stephan Gerhold1-0/+4
PM8916 has three TX inputs that each have an (optional) internal RBIAS resistor. MIC BIAS Internal1/2 (for TX1/2) are already supported. TX3 does not have its own MIC BIAS supply, instead it is also supplied from MIC_BIAS1. Now that we have simplified the MIC BIAS Internal* implementation we can easily add support for it: Add a MIC BIAS Internal3 supply that enables the internal RBIAS resistor on TX3, and make sure to also enable the MIC_BIAS1 supply. Tested-by: Nikita Travkin <nikitos.tr@gmail.com> # longcheer-l8150 Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200114181229.42302-2-stephan@gerhold.net Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: msm8916-wcd-analog: Simplify MIC BIAS InternalStephan Gerhold1-70/+42
At the moment, MIC BIAS Internal* and MIC BIAS External* both reference the same register, and have a part of their initialization sequence duplicated. For example, the sequence for enabling MIC BIAS Internal1 is: I1. Enable MIC_BIAS1 supply (MICB_EN bit in CDC_A_MICB_1_EN) I2. Enable internal RBIAS (TX1_INT_RBIAS_EN bit in CDC_A_MICB_1_INT_RBIAS) The sequence for enabling MIC BIAS External1 is: E1. Enable MIC_BIAS1 supply (MICB_EN bit in CDC_A_MICB_1_EN) (E2. Ideally, make sure internal RBIAS is disabled. However, this should not happen in practice because DAPM will disable unused supplies...) Right now we have: SND_SOC_DAPM_SUPPLY("MIC BIAS Internal1", CDC_A_MICB_1_EN, 7, 0, ...) // I1 SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0, ...) // E1 and I2 is done in the PM event handler (pm8916_wcd_analog_enable_micbias_int1). We can simplify this by defining a common DAPM supply for I1/E1 ("MIC_BIAS1"), and one DAPM supply for I2 ("MIC BIAS Internal1"). Additional DAPM routes ensure that we also enable the MIC_BIAS1 supply for the internal and external pull up resistor. Another advantage of this is that we now disable the internal RBIAS when it is not needed. This makes it much easier to add support for MIC BIAS Internal3 as a next step. Tested-by: Nikita Travkin <nikitos.tr@gmail.com> # longcheer-l8150 Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200114181229.42302-1-stephan@gerhold.net Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: amd: Additional DAI for I2S SP instance.Ravulapati Vishnu vardhan rao2-2/+8
I2S SP instance has separate BCLK and LRCLK for Tx and Rx. Creating additional DAI for Rx. Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com> Link: https://lore.kernel.org/r/1579261510-12580-1-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: rt715: fix return value check in rt715_sdw_probe()Wei Yongjun1-2/+2
In case of error, the function devm_regmap_init() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: d1ede0641b05 ("ASoC: rt715: add RT715 codec driver") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20200117024149.75515-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17ASoC: rt711: fix return value check in rt711_sdw_probe()Wei Yongjun1-2/+2
In case of error, the function devm_regmap_init() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 320b8b0d13b8 ("ASoC: rt711: add rt711 codec driver") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20200115143034.94492-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>