summaryrefslogtreecommitdiffstats
path: root/sound/soc/dwc
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: dwc: Fix non-DT instantiationMark Brown2023-10-131-1/+1
| | | | | | | | | | | | Commit d6d6c513f5d2 ("ASoC: dwc: Use ops to get platform data") converted the DesignWare I2S driver to use a DT specific function to obtain platform data but this breaks at least non-DT systems such as AMD. Revert it. Fixes: d6d6c513f5d2 ("ASoC: dwc: Use ops to get platform data") Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20231013-asoc-fix-dwc-v1-1-63211bb746b9@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: i2s: Fix unused functionsTakashi Iwai2023-08-281-0/+2
| | | | | | | | | | | | | A few newly added functions aren't built unless CONFIG_OF is set, which result in the build failure due to defined-but-not-used errors. Put "#ifdef CONFIG_OF" around those functions to suppress the build error. Fixes: 52ea7c0543f8 ("ASoC: dwc: i2s: Add StarFive JH7110 SoC support") Link: https://lore.kernel.org/r/20230828113537.27600-1-tiwai@suse.de Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: dwc: i2s: Add StarFive JH7110 SoC supportXingyu Wu2023-08-232-21/+284
| | | | | | | | | | | | | | | | | | | | Add StarFive JH7110(TX0/TX1/RX channels) SoC support in the designware I2S driver and a flag to check if it is on the JH7110 SoC. These channels need to enable clocks, resets and syscon register on the JH7110 SoC. So add init ops in platform data for the JH7110 SoC to do this. Their resets should be deassert before changing the parent of clocks so these are done in the init ops of platform data. The I2S controllers use DMA controller by platform data on the JH7110 and their settings about snd_dmaengine_dai_dma_data() should be added in the dw_configure_dai_by_pd(). And use dmaengine PCM registration if these do not have IRQ on the JH7110 SoC. Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com> Link: https://lore.kernel.org/r/20230821144151.207339-4-xingyu.wu@starfivetech.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Use ops to get platform dataXingyu Wu2023-08-231-1/+1
| | | | | | | | Use of_device_get_match_data() to get platform data. Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com> Link: https://lore.kernel.org/r/20230821144151.207339-3-xingyu.wu@starfivetech.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: merge DAI call back functions into opsKuninori Morimoto2023-08-141-9/+9
| | | | | | | | | | ALSA SoC merges DAI call backs into .ops. This patch merge these into one. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru> Link: https://lore.kernel.org/r/87o7jhb0v4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Add TDM mode supportMaxim Kochetkov2023-07-093-7/+90
| | | | | | | | | | | | Depending on hardware implementaion of DWC I2S controller may support TDM mode if enabled in SoC at design time. Unfortunately there is no way to detect TDM capability for DWC by reading registers. Anyway, if such capability enabled, TDM mode can be enabled and configured by dai-tdm-slot-* DT options. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru> Link: https://lore.kernel.org/r/20230622200031.120168-1-fido_max@inbox.ru Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: don't assign addr_width for dt configsMaxim Kochetkov2023-06-191-6/+0
| | | | | | | | | | | For proper DMA operation addr_width must corresponds with audio format (S16, S24, S32, etc). Proper bus width calculations is performed by snd_hwparams_to_dma_slave_config(). So drop wrong addr_width asignment for dt configs and let snd_hwparams_to_dma_slave_config() do the job. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru> Link: https://lore.kernel.org/r/20230613191552.724748-1-fido_max@inbox.ru Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: add DMA handshake controlMaxim Kochetkov2023-06-192-2/+43
| | | | | | | | | | DMA mode uses hardware handshake signals. DMACR register is used to enable the DMA Controller interface operation. So add DMA enable/disable to i2s_start()/i2s_stop() functions if using DMA mode. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru> Link: https://lore.kernel.org/r/20230613191910.725049-1-fido_max@inbox.ru Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Merge fixes due to dependenciesMark Brown2023-06-161-32/+9
|\ | | | | | | So we can apply the tlv320aic3xxx DT conversion.
| * ASoC: dwc: move DMA init to snd_soc_dai_driver probe()Maxim Kochetkov2023-05-231-32/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using DMA mode we are facing with Oops: [ 396.458157] Unable to handle kernel access to user memory without uaccess routines at virtual address 000000000000000c [ 396.469374] Oops [#1] [ 396.471839] Modules linked in: [ 396.475144] CPU: 0 PID: 114 Comm: arecord Not tainted 6.0.0-00164-g9a8eccdaf2be-dirty #68 [ 396.483619] Hardware name: YMP ELCT FPGA (DT) [ 396.488156] epc : dmaengine_pcm_open+0x1d2/0x342 [ 396.493227] ra : dmaengine_pcm_open+0x1d2/0x342 [ 396.498140] epc : ffffffff807fe346 ra : ffffffff807fe346 sp : ffffffc804e138f0 [ 396.505602] gp : ffffffff817bf730 tp : ffffffd8042c8ac0 t0 : 6500000000000000 [ 396.513045] t1 : 0000000000000064 t2 : 656e69676e65616d s0 : ffffffc804e13990 [ 396.520477] s1 : ffffffd801b86a18 a0 : 0000000000000026 a1 : ffffffff816920f8 [ 396.527897] a2 : 0000000000000010 a3 : fffffffffffffffe a4 : 0000000000000000 [ 396.535319] a5 : 0000000000000000 a6 : ffffffd801b87040 a7 : 0000000000000038 [ 396.542740] s2 : ffffffd801b94a00 s3 : 0000000000000000 s4 : ffffffd80427f5e8 [ 396.550153] s5 : ffffffd80427f5e8 s6 : ffffffd801b44410 s7 : fffffffffffffff5 [ 396.557569] s8 : 0000000000000800 s9 : 0000000000000001 s10: ffffffff8066d254 [ 396.564978] s11: ffffffd8059cf768 t3 : ffffffff817d5577 t4 : ffffffff817d5577 [ 396.572391] t5 : ffffffff817d5578 t6 : ffffffc804e136e8 [ 396.577876] status: 0000000200000120 badaddr: 000000000000000c cause: 000000000000000d [ 396.586007] [<ffffffff806839f4>] snd_soc_component_open+0x1a/0x68 [ 396.592439] [<ffffffff807fdd62>] __soc_pcm_open+0xf0/0x502 [ 396.598217] [<ffffffff80685d86>] soc_pcm_open+0x2e/0x4e [ 396.603741] [<ffffffff8066cea4>] snd_pcm_open_substream+0x442/0x68e [ 396.610313] [<ffffffff8066d1ea>] snd_pcm_open+0xfa/0x212 [ 396.615868] [<ffffffff8066d39c>] snd_pcm_capture_open+0x3a/0x60 [ 396.622048] [<ffffffff8065b35a>] snd_open+0xa8/0x17a [ 396.627421] [<ffffffff801ae036>] chrdev_open+0xa0/0x218 [ 396.632893] [<ffffffff801a5a28>] do_dentry_open+0x17c/0x2a6 [ 396.638713] [<ffffffff801a6d9a>] vfs_open+0x1e/0x26 [ 396.643850] [<ffffffff801b8544>] path_openat+0x96e/0xc96 [ 396.649518] [<ffffffff801b9390>] do_filp_open+0x7c/0xf6 [ 396.655034] [<ffffffff801a6ff2>] do_sys_openat2+0x8a/0x11e [ 396.660765] [<ffffffff801a735a>] sys_openat+0x50/0x7c [ 396.666068] [<ffffffff80003aca>] ret_from_syscall+0x0/0x2 [ 396.674964] ---[ end trace 0000000000000000 ]--- It happens because of play_dma_data/capture_dma_data pointers are NULL. Current implementation assigns these pointers at snd_soc_dai_driver startup() callback and reset them back to NULL at shutdown(). But soc_pcm_open() sequence uses DMA pointers in dmaengine_pcm_open() before snd_soc_dai_driver startup(). Most generic DMA capable I2S drivers use snd_soc_dai_driver probe() callback to init DMA pointers only once at probe. So move DMA init to dw_i2s_dai_probe and drop shutdown() and startup() callbacks. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru> Link: https://lore.kernel.org/r/20230512110343.66664-1-fido_max@inbox.ru Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Merge up fixes for CIMark Brown2023-05-151-2/+2
|\| | | | | | | Avoid tripping over fixed issues in CI.
| * ASoC: dwc: limit the number of overrun messagesMaxim Kochetkov2023-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | On slow CPU (FPGA/QEMU emulated) printing overrun messages from interrupt handler to uart console may leads to more overrun errors. So use dev_err_ratelimited to limit the number of error messages. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru Link: https://lore.kernel.org/r/20230505062820.21840-1-fido_max@inbox.ru Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: dwc: extend supported formatsMaxim Kochetkov2023-05-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | The COMP1_TX_WORDSIZE_0/COMP2_RX_WORDSIZE_0 fields in the comp registers indicate the maximum wordsize supported. DWC I2S controller can operate with any smaller wordsize. So extend the formats to let I2S to operate in any allowed modes. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru Link: https://lore.kernel.org/r/20230505053521.18233-1-fido_max@inbox.ru Signed-off-by: Mark Brown <broonie@kernel.org
* | ASoC: dwc: add optional reset supportMaxim Kochetkov2023-05-082-6/+22
|/ | | | | | | | Some SoC may have resets for I2S subsystem. So add optional reset support. Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru Link: https://lore.kernel.org/r/20230504071618.52012-1-fido_max@inbox.ru Signed-off-by: Mark Brown <broonie@kernel.org
* ASoC: dwc: dwc-i2s: Convert to platform remove callback returning voidUwe Kleine-König2023-03-201-3/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-63-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Migrate to new style legacy DAI naming flagCharles Keepax2022-06-271-3/+4
| | | | | | | | | | | Change the legacy DAI naming flag from opting in to the new scheme (non_legacy_dai_naming), to opting out of it (legacy_dai_naming). This driver appears to be on the CPU side of the DAI link and currently uses the legacy naming, so add the new flag. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220623125250.2355471-24-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Rename set_fmt_new back to set_fmtCharles Keepax2022-06-061-1/+1
| | | | | | | | | | Now the core has been migrated across to the new direct clock specification we can move the drivers back to the normal set_fmt callback. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220519154318.2153729-35-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Update to use set_fmt_new callbackCharles Keepax2022-06-061-5/+5
| | | | | | | | | | As part of updating the core to directly tell drivers if they are clock provider or consumer update this CPU side driver to use the new direct callback. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220519154318.2153729-8-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc-i2s: Handle errors for clk_enableJiasheng Jiang2022-03-021-5/+12
| | | | | | | | | | As the potential failure of the clk_enable(), it should be better to check it, as same as clk_prepare_enable(). Fixes: c9afc1834e81 ("ASoC: dwc: Disallow building designware_pcm as a module") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Link: https://lore.kernel.org/r/20220301084742.3751939-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc-i2s: Update to modern clocking terminologyMark Brown2021-09-271-6/+6
| | | | | | | | | As part of moving to remove the old style defines for the bus clocks update the dwc-i2s driver to use more modern terminology for clocking. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210921205313.46710-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Get IRQ optionallyRobin Murphy2021-08-261-1/+1
| | | | | | | | | | The IRQ is explicitly optional, so use platform_get_irq_optional() and avoid platform_get_irq() logging a spurious error when trying to use the thing in DMA mode. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/c857f334e3c9e651e088b675b3938cb5f798b133.1629906123.git.robin.murphy@arm.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'sound-5.14-rc1' of ↵Linus Torvalds2021-07-021-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "As the diffstat scatters over the tree, we've got many tree-wide small changes, but also got quite a few intrusive changes in the core side. The only ABI-visible core change is the new rawmidi framing mode support while others are kernel-internal, mostly code refactoring and/or nice improvements. Here are some highlights: Core: - A new framing access mode for rawmidi to get timestamps - Cleanup / refactoring of buffer memory management helper code - Support for automatic negotiation of ASoC DAI formats - Revival of software suspend for PCM and control core, as a preliminary work for PCI BAR rescan support ASoC: - Accessory detection support for several Qualcomm parts - Support for IEC958 control with hdmi-codec - Merging of Tegra machine drivers into a single driver - Support for AmLogic SM1 TOACODEC, Intel AlderLake-M, several NXP i.MX8 variants, NXP TFA1 and TDF9897, Rockchip RK817, Qualcomm Quinary MI2S, Texas Instruments TAS2505 USB-audio: - Reduction of latency at playback start - Code cleanup / fixes of usx2y driver - Scarlett2 mixer code fixes and enhancements - Quirks for Ozone and Denon devices HD-audio: - A few quirks for HP and ASUS machines - Display power management fixes Others: - FireWire code refactoring and enhancements - Tree-wide trivial coding-style fixes" * tag 'sound-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (594 commits) ALSA: usb-audio: scarlett2: Fix for loop increment in scarlett2_usb_get_config ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 630 G8 ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 445 G8 ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 450 G8 ALSA: hda/realtek - Add ALC285 HP init procedure ALSA: hda/realtek - Add type for ALC287 ALSA: scarlett2: Fix scarlett2_*_ctl_put() return values again ALSA: scarlett2: Fix pad count for 18i8 Gen 3 ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 830 G8 Notebook PC ALSA: firewire-lib: Fix 'amdtp_domain_start()' when no AMDTP_OUT_STREAM stream is found ASoC: qcom: lpass-cpu: mark IRQ_CLEAR register as volatile and readable ALSA: hda: Release codec display power during shutdown/reboot ALSA: hda: Release controller display power during shutdown/reboot ALSA: hda/realtek: Apply LED fixup for HP Dragonfly G1, too ASoC: fsl: remove unnecessary oom message ASoC: tlv320aic32x4: dt-bindings: add TAS2505 to compatible ASoC: tlv320aic32x4: add support for TAS2505 ASoC: tlv320aic32x4: add type to device private data struct ASoC: tegra30: ahub: Use devm_platform_get_and_ioremap_resource() ASoC: tegra: tegra210_admaif: Use devm_platform_get_and_ioremap_resource() ...
| * ASoC: dwc: dwc-i2s: Use devm_platform_get_and_ioremap_resource()Yang Yingliang2021-06-151-2/+1
| | | | | | | | | | | | | | | | | | Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210615132933.1372463-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | clkdev: remove CONFIG_CLKDEV_LOOKUPArnd Bergmann2021-06-081-1/+1
|/ | | | | | | | | This option is now synonymous with CONFIG_HAVE_CLK, so use the latter globally. Any out-of-tree platform ports that still use a private clk_get()/clk_put() implementation should move to CONFIG_COMMON_CLK. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* ASoC: dwc: Fix -Wmissing-prototypes warningsYueHaibing2021-03-291-3/+3
| | | | | | | | | | | | | | | | | | | | while CONFIG_SND_DESIGNWARE_PCM is not set, building with W=1 shows this: sound/soc/dwc/local.h:127:6: warning: no previous prototype for ‘dw_pcm_push_tx’ [-Wmissing-prototypes] void dw_pcm_push_tx(struct dw_i2s_dev *dev) { } ^~~~~~~~~~~~~~ sound/soc/dwc/local.h:128:6: warning: no previous prototype for ‘dw_pcm_pop_rx’ [-Wmissing-prototypes] void dw_pcm_pop_rx(struct dw_i2s_dev *dev) { } ^~~~~~~~~~~~~ sound/soc/dwc/local.h:129:5: warning: no previous prototype for ‘dw_pcm_register’ [-Wmissing-prototypes] int dw_pcm_register(struct platform_device *pdev) ^~~~~~~~~~~~~~~ Change these to inline functions to fix the warnings. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210329150524.18184-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: use asoc_substream_to_rtd()Kuninori Morimoto2020-07-231-1/+1
| | | | | | | | | Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/878sff0yt0.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: use snd_soc_xxx_active()Kuninori Morimoto2020-05-181-1/+1
| | | | | | | | | | We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87k11e58hu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointerKuninori Morimoto2020-03-271-1/+1
| | | | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/87wo7bir8j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: dwc-i2s: use for_each_pcm_streams() macroKuninori Morimoto2020-02-181-4/+4
| | | | | | | | Signed-off-by: Kuninori Morimoto <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> Link: https://lore.kernel.org/r/87y2t1aa8t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: soc-pcm: merge playback/cature_active into stream_activeKuninori Morimoto2020-02-181-2/+2
| | | | | | | | | | | | | | | | DAI has playback_active and capture_active to care usage count. OTOH, we have SNDRV_PCM_STREAM_PLAYBACK/CAPTURE. But because of this kind of implementation mismatch, ALSA SoC has many verbose code. To solve this issue, this patch merge playback_active/capture_active into stream_active[2]; Signed-off-by: Kuninori Morimoto <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> Link: https://lore.kernel.org/r/875zg5botu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: dwc-i2s: move .suspend/.resume to componentKuninori Morimoto2020-01-211-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>
* ASoC: dwc: Use managed buffer allocationTakashi Iwai2019-12-111-22/+2
| | | | | | | | | | | | Clean up the drivers with the new managed buffer allocation API. The superfluous snd_pcm_lib_malloc_pages() and snd_pcm_lib_free_pages() calls are dropped, as well as the superfluous snd_pcm_lib_preallocate_free_for_all() call. As of the result, hw_free and pcm_destruct ops became empty and got removed. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210142614.19405-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Drop superfluous ioctl PCM opsTakashi Iwai2019-12-111-1/+0
| | | | | | | | | ASoC PCM core deals the empty ioctl field now as default. Let's kill the redundant lines. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210145406.21419-6-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Remove superfluous snd_dma_continuous_data()Takashi Iwai2019-11-091-1/+1
| | | | | | | | | | | | The recent change (commit 08422d2c559d: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers. Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20191108094641.20086-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: dwc: dwc-pcm: remove snd_pcm_opsKuninori Morimoto2019-10-081-22/+26
| | | | | | | | | snd_pcm_ops is no longer needed. Let's use component driver callback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87h84r90dk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2019-05-212-0/+2
| | | | | | | | | | | | | | Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ASoC: dwc: Drop superfluous PCM preallocation error checksTakashi Iwai2019-02-061-1/+2
| | | | | | | | | snd_pcm_lib_preallocate_pages() and co always succeed, so the error check is simply redundant. Drop it. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
*-. Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es7134', ↵Mark Brown2018-03-281-0/+4
|\ \ | | | | | | | | | 'asoc/topic/es8316', 'asoc/topic/es8328' and 'asoc/topic/fsl' into asoc-next
| * | ASoC: dwc: Extends DW_I2S_QUIRK_COMP_PARAM1 to playbackAkshu Agrawal2018-02-161-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | When we have same register to tell capture and playback capability of a device and we want separate cpu dais for playback and capture. Then, DW_I2S_QUIRK_COMP_PARAM1 is used to enable one capability per dai. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: dwc-pcm: replace platform to componentKuninori Morimoto2018-02-121-2/+3
|/ | | | | | | Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: fix typos in KconfigNik Nyby2017-10-091-2/+2
| | | | | | | This fixes a few typos in the snd_designware description. Signed-off-by: Nik Nyby <nikolas@gnu.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Delete an error message for a failed memory allocation in ↵Markus Elfring2017-08-141-3/+1
| | | | | | | | | | | | dw_i2s_probe() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: constify snd_soc_dai_ops structureGustavo A. R. Silva2017-07-171-1/+1
| | | | | | | | | This structure is only stored in the ops field of a snd_soc_dai_driver structure. That field is declared const, so snd_soc_dai_ops structures that have this property can be declared as const also. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Added a quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to dwc driverVijendar Mukunda2017-06-281-0/+6
| | | | | | | | | | | | | Added quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to Designware driver. This quirk will set idx value to 1. By setting this quirk, it will override supported format as 16 bit resolution and bus width as 2 Bytes. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Disallow building designware_pcm as a moduleJose Abreu2017-04-304-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Designware PCM is an extension to Designware I2S and they are dependent on each other. For this reason, make Designware PCM a boolean which will compile with Desigwnare I2S module. The name of the module is not changed but the name of the files need to be changed. Also, without this commit we get errors when probbing designware_i2s module because of unspecified license: designware_pcm: module license 'unspecified' taints kernel. Disabling lock debugging due to kernel taint designware_pcm: Unknown symbol __rcu_read_lock (err 0) designware_pcm: Unknown symbol devm_snd_soc_register_platform (err 0) designware_pcm: Unknown symbol synchronize_rcu (err 0) designware_pcm: Unknown symbol __rcu_read_unlock (err 0) designware_pcm: Unknown symbol snd_soc_set_runtime_hwparams (err 0) So, this is really needed as a fix. Fixes: 79361b2b98b7 ("ASoC: dwc: Add PIO PCM extension") Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Enable 24 bit sample size in PIO modeJose Abreu2017-01-091-0/+2
| | | | | | | | | | | Sample size of 24 bits use in reality 32 bits for storage. We can safelly enable this sample size and treat the data as 32 bits. Tested in a x86_64 platform and in ARC AXS101 SDP platform. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Add record capability in PIO modeJose Abreu2017-01-093-23/+92
| | | | | | | | | | | | | | | Up until now PIO mode offered only playback support. With this patch we add support for record mode. The PCM was refactored so that we could reuse the existing infrastructure without many changes. We have support for 16 and 32 bits of sample size using only 2 channels. Tested in a x86_64 platform and in ARC AXS101 SDP platform. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Fix PIO mode initializationJose Abreu2016-12-141-14/+11
| | | | | | | | | | | | | | | | | | | | We can no longer rely on the return value of devm_snd_dmaengine_pcm_register(...) to check if the DMA handle is declared in the DT. Previously this check activated PIO mode but currently dma_request_chan returns either a valid channel or -EPROBE_DEFER. In order to activate PIO mode check instead if the interrupt line is declared. This reflects better what is documented in the DT bindings (see Documentation/devicetree/bindings/sound/ designware-i2s.txt). Also, initialize use_pio variable which was never being set causing PIO mode to never work. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dwc: Drop DMA channel names assignmentSylwester Nawrocki2016-08-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | The dw_configure_dai_by_dt() function and further dev->{play,capture} _dma_data.dt data structures seem to be used in this driver only in case of a system using devicetree, thus chan_name assignments have no effect since they will be ignored in dmaengine_pcm_request_chan_of() call and will be substituted with values taken form dmaengine_pcm_dma_channel_names[] table ("tx", "rx"). Also there is no any "TX", "RX" dma-names entries in arch/arm/boot/dts, only lower case "tx", "rx" seem to be used. Lastly, this driver doesn't set SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag when registering a dmaengine PCM to indicate the chan_name should be used. My intention is to eventually remove the struct snd_dmaengine_dai_dma_data chan_name field as there is also a chan_names[] field in struct snd_dmaengine_pcm_config which can be used for same purpose. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* SoC: dwc: trivial fix of spelling mistake "unsuppted" -> "unsupported"Colin Ian King2016-06-261-1/+1
| | | | | | | trivial fix to spelling mistake in dev_err message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>