summaryrefslogtreecommitdiff
path: root/sound/drivers
AgeCommit message (Collapse)Author
2024-08-18ALSA: aloop: Allow using global timersIvan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240813120701.171743-2-ivan.orlov0322@gmail.com
2024-08-08ALSA: pcsp: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-15-tiwai@suse.de
2024-08-08ALSA: dummy: Use standard print APITakashi Iwai
Use pr_*() macro instead of open-coded printk() just for code simplification. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-14-tiwai@suse.de
2024-08-08ALSA: aloop: Use standard print APITakashi Iwai
Use pr_err() instead of open-coded printk() just for code simplification. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-13-tiwai@suse.de
2024-08-08ALSA: vx_core: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. The commented old debug prints are dropped, too. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-12-tiwai@suse.de
2024-08-08ALSA: vx_core: Drop unused dev fieldTakashi Iwai
The vx_core.dev field has never been set but referred incorrectly at firmware loading. Pass the proper device pointer from card->dev at request_firmware(), and drop the unused dev field from vx_core, too. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-11-tiwai@suse.de
2024-08-08ALSA: virmidi: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-10-tiwai@suse.de
2024-08-08ALSA: serial-u16550: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-9-tiwai@suse.de
2024-08-08ALSA: opl4: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-8-tiwai@suse.de
2024-08-08ALSA: opl3: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Some debug prints are cleaned up with a macro, too. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-7-tiwai@suse.de
2024-08-08ALSA: mtpav: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. The commented-out debug prints got removed, too. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-6-tiwai@suse.de
2024-08-08ALSA: mpu401_uart: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. The assignment of mpu->rmidi was moved to an earlier place, so that dev_*() can access to the proper device pointer. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-5-tiwai@suse.de
2024-08-08ALSA: mpu401: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-4-tiwai@suse.de
2024-08-08ALSA: mts64: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-3-tiwai@suse.de
2024-08-08ALSA: portman2x4: Use standard print APITakashi Iwai
Use the standard print API with dev_*() instead of the old house-baked one. It gives better information and allows dynamically control of debug prints. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240807133452.9424-2-tiwai@suse.de
2024-08-01ALSA: aloop: use snd_pcm_direction_name()Kuninori Morimoto
We already have snd_pcm_direction_name(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87r0bbk528.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-03parport: Remove parport_driver.devmodelDr. David Alan Gilbert
'devmodel' hasn't actually been used since: 'commit 3275158fa52a ("parport: remove use of devmodel")' and everyone now has it set to true and has been fixed up; remove the flag. (There are still comments all over about it) Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lore.kernel.org/r/20240502154823.67235-4-linux@treblig.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-09ALSA: pcmtest: Add missing module descriptionsTakashi Iwai
Now that make W=1 starts complaining the lack of MODULE_DESCRIPTION(), let's add the missing information. Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Closes: https://lore.kernel.org/r/ZjpQm-hxLQtpgkUx@smile.fi.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Dragan Simic <dsimic@manjaro.org> Link: https://lore.kernel.org/r/20240508091128.25274-6-tiwai@suse.de
2024-05-08ALSA: drivers: Use *-y instead of *-objs in MakefileTakashi Iwai
*-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20240507135513.14919-7-tiwai@suse.de
2024-04-18ALSA: aloop: add support for up to 768kHz sample ratePavel Hofman
Many modern codecs support rates up to 768kHz (including DSD1024). Add support for rates up to 768kHz to the loopback driver. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Message-ID: <20240416121726.628679-4-pavel.hofman@ivitera.com>
2024-04-18ALSA: aloop: add DSD formatsPavel Hofman
The snd-aloop loopback driver does not modify or access the actual samples in any way, defines no volume or mute controls, it's strictly bitperfect. Therefore DSD formats can be supported without any modification. Add all DSD formats to the list of supported formats. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Message-ID: <20240416121726.628679-2-pavel.hofman@ivitera.com>
2024-03-21Merge tag 'tty-6.9-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty / serial driver updates from Greg KH: "Here is the big set of TTY/Serial driver updates and cleanups for 6.9-rc1. Included in here are: - more tty cleanups from Jiri - loads of 8250 driver cleanups from Andy - max310x driver updates - samsung serial driver updates - uart_prepare_sysrq_char() updates for many drivers - platform driver remove callback void cleanups - stm32 driver updates - other small tty/serial driver updates All of these have been in linux-next for a long time with no reported issues" * tag 'tty-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (199 commits) dt-bindings: serial: stm32: add power-domains property serial: 8250_dw: Replace ACPI device check by a quirk serial: Lock console when calling into driver before registration serial: 8250_uniphier: Switch to use uart_read_port_properties() serial: 8250_tegra: Switch to use uart_read_port_properties() serial: 8250_pxa: Switch to use uart_read_port_properties() serial: 8250_omap: Switch to use uart_read_port_properties() serial: 8250_of: Switch to use uart_read_port_properties() serial: 8250_lpc18xx: Switch to use uart_read_port_properties() serial: 8250_ingenic: Switch to use uart_read_port_properties() serial: 8250_dw: Switch to use uart_read_port_properties() serial: 8250_bcm7271: Switch to use uart_read_port_properties() serial: 8250_bcm2835aux: Switch to use uart_read_port_properties() serial: 8250_aspeed_vuart: Switch to use uart_read_port_properties() serial: port: Introduce a common helper to read properties serial: core: Add UPIO_UNKNOWN constant for unknown port type serial: core: Move struct uart_port::quirks closer to possible values serial: sh-sci: Call sci_serial_{in,out}() directly serial: core: only stop transmit when HW fifo is empty serial: pch: Use uart_prepare_sysrq_char(). ...
2024-02-12ALSA: pcsp: Replace with DEFINE_SIMPLE_DEV_PM_OPS()Takashi Iwai
Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240207155140.18238-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-02-12ALSA: dummy: Replace with DEFINE_SIPMLE_DEV_PM_OPS()Takashi Iwai
Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240207155140.18238-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-02-12ALSA: aloop: Replace with DEFINE_SIMPLE_DEV_PM_OPS()Takashi Iwai
Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS() for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs. Just a cleanup, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240207155140.18238-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-01-27treewide, serdev: change receive_buf() return type to size_tFrancesco Dolcini
receive_buf() is called from ttyport_receive_buf() that expects values ">= 0" from serdev_controller_receive_buf(), change its return type from ssize_t to size_t. The need for this clean-up was noticed while fixing a warning, see commit 94d053942544 ("Bluetooth: btnxpuart: fix recv_buf() return value"). Changing the callback prototype to return an unsigned seems the best way to document the API and ensure that is properly used. GNSS drivers implementation of serdev receive_buf() callback return directly the return value of gnss_insert_raw(). gnss_insert_raw() returns a signed int, however this is not an issue since the value returned is always positive, because of the kfifo_in() implementation. gnss_insert_raw() could be changed to return also an unsigned, however this is not implemented here as request by the GNSS maintainer Johan Hovold. Suggested-by: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/all/087be419-ec6b-47ad-851a-5e1e3ea5cfcc@kernel.org/ Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> #for-iio Reviewed-by: Johan Hovold <johan@kernel.org> Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Alex Elder <elder@linaro.org> Acked-by: Maximilian Luz <luzmaximilian@gmail.com> # for platform/surface Acked-by: Lee Jones <lee@kernel.org> Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240122180551.34429-1-francesco@dolcini.it Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-19Merge tag 'sound-fix-6.8-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes: - Lots of ASoC SOF fixes and related reworks - ASoC TAS codec fixes including DT updates - A few HD-audio quirks and regression fixes - Minor fixes for aloop, oxygen and scarlett2 mixer" * tag 'sound-fix-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits) ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5 ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx ASoC: SOF: ipc4-loader: remove the CPC check warnings ASoC: SOF: ipc4-pcm: remove log message for LLP ALSA: hda: generic: Remove obsolete call to ledtrig_audio_get ALSA: scarlett2: Fix yet more -Wformat-truncation warnings ALSA: hda: Properly setup HDMI stream ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm() ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage" ALSA: oxygen: Fix right channel of capture volume mixer ALSA: aloop: Introduce a function to get if access is interleaved mode ASoC: mediatek: sof-common: Add NULL check for normal_link string ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link ASoC: mediatek: mt8192: Check existence of dai_name before dereferencing ASoC: Intel: bxt_rt298: Fix kernel ops due to COMP_DUMMY change ASoC: Intel: bxt_da7219_max98357a: Fix kernel ops due to COMP_DUMMY change ASoC: codecs: rtq9128: Fix TDM enable and DAI format control flow ASoC: codecs: rtq9128: Fix PM_RUNTIME usage ASoC: tas2781: Add tas2563 into driver ...
2024-01-12ALSA: aloop: Introduce a function to get if access is interleaved modeChancel Liu
There's a use case that playback stream of a loopback cable works on RW_INTERLEAVED mode while capture stream works on MMAP_INTERLEAVED mode: aplay -Dhw:Loopback,0,0 S32_48K_2ch.wav; arecord -Dplughw:Loopback,1,0 -fS32_LE -r16000 -c2 cap.wav; The plug plugin handles only slave PCM support MMAP mode. Not only plug plugin but also other plugins like direct plugins(dmix/dsnoop/dshare) work on MMAP access mode. In this case capture stream is the slave PCM works on MMAP_INTERLEAVED mode. However loopback_check_format() rejects this access setting and return: arecord: pcm_read:2240: read error: Input/output error To fix it a function called is_access_interleaved() is introduced to get if access is interleaved mode. If both access of capture stream and playback stream is interleaved mode loopback_check_format() will allow this kind of access setting. Fixes: 462494565c27 ("ALSA: aloop: Add support for the non-interleaved access mode") Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Link: https://lore.kernel.org/r/20240111025219.2678764-1-chancel.liu@nxp.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-12-11Merge 6.7-rc5 into tty-nextGreg Kroah-Hartman
We need the serial fixes in here as well to build off of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-08tty: serdev: convert to u8 and size_tJiri Slaby (SUSE)
Switch character types to u8 and sizes to size_t. To conform to characters/sizes in the rest of the tty layer. This patch converts struct serdev_device_ops hooks and its instantiations. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Cc: Rob Herring <robh@kernel.org> Acked-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20231206073712.17776-24-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-07ALSA: pcmtest: stop timer before buffer is releasedIvan Orlov
Stop timer in the 'trigger' and 'sync_stop' callbacks since we want the timer to be stopped before the DMA buffer is released. Otherwise, it could trigger a kernel panic in some circumstances, for instance when the DMA buffer is already released but the timer callback is still running. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20231206223211.12761-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-06ALSA: aloop: Add control element for getting the access modeIvan Orlov
Add new control element 'PCM Slave Access Mode' which shows the access mode (interleaved/non-interleaved) for the PCM playing device. Add corresponding control change notification calls. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230927113555.14877-2-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-06ALSA: aloop: Add support for the non-interleaved access modeIvan Orlov
The current version of the loopback driver supports interleaved access mode only. This patch introduces support for the non-interleaved access mode. When in the interleaved mode, the 'copy_play_buf' function copies data from the playback to the capture buffer using one memcpy call. This call copies samples for multiple, interleaved channels. In the non-interleaved mode we have multiple channel buffers, so we have to perform multiple memcpy calls to copy samples channel after channel. Add new function called 'copy_play_buf_part_n', which copies a part of each channel buffer from playback to capture. Modify the 'copy_play_buf' to use the corresponding memory copy function(just memcpy / copy_play_buf_part_n) depending on the access mode. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230927113555.14877-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-28Merge tag 'asoc-v6.6' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.6 The rest of the updates for v6.6, some of the highlights include: - A big API cleanup from Morimoto-san, rationalising the places we put functions. - Lots of work on the SOF framework, AMD and Intel drivers, including a lot of cleanup and new device support. - Standardisation of the presentation of jacks from drivers. - Provision of some generic sound card DT properties. - Conversion oof more drivers to the maple tree register cache. - New drivers for AMD Van Gogh, AWInic AW88261, Cirrus Logic cs42l43, various Intel platforms, Mediatek MT7986, RealTek RT1017 and StarFive JH7110.
2023-08-24ALSA: pcmtest: Add support for pcm pausingIvan Orlov
Add pause push/release support to the virtual PCM test driver. Add 'suspend' boolean field to the pcmtst_buf_iter structure, so we can pause the timer without shutting it down. Update the trigger callback handler correspondingly. Extract buffer initialization to the 'reset_buf_iterator' function since it is used in multiple places now. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230822150541.8450-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: pcmtest: Update comment about PCM copy opsTakashi Iwai
Just an update of a comment mentioning the old PCM callbacks to correct to the new PCM copy ops. Link: https://lore.kernel.org/r/20230815190136.8987-17-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: dummy: Convert to generic PCM copy opsTakashi Iwai
This patch converts the dummy driver code to use the new unified PCM copy callback. As dummy driver doesn't do anything in the callback, it's just a simple replacement. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230815190136.8987-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-18ALSA: Make SND_PCMTEST depend on DEBUG_FSRuan Jinjie
Since pcmtest is a test module that manipulates or gets notification via debugfs, without DEBUG_FS it can not work fine. So make SND_PCMTEST depend on DEBUG_FS. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Acked-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230817093740.1732738-1-ruanjinjie@huawei.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-13ALSA: Remove redundant of_match_ptr()Ruan Jinjie
The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com Reviewed-by: Takashi Iwai <tiwai@suse.de Link: https://lore.kernel.org/r/20230811071426.2343133-6-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-08ALSA: pcmtest: Remove redundant definitionsIvan Orlov
Remove redundant definitions of DEVNAME and CARD_NAME, as they're not useful. The former is not used anywhere, and the latter is used only in module parameters descriptions. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230804110740.9867-2-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-08ALSA: pcmtest: Move buffer iterator initialization to prepare callbackIvan Orlov
Trigger callback is not the best place for buffer iterator initialization, so move it out to the prepare callback, where it have to be. Minor enhancement: remove blank line. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230804110740.9867-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-16ALSA: Explicitly include correct DT includesRob Herring
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714175109.4066599-1-robh@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-14ALSA: pcmtest: minor optimizationsIvan Orlov
Decrease the buffer filling overhead with conditional remainder calculation in the 'inc_buf_pos' inline function. Fix the driver to use already defined variables where it is possible in 'check_buf_block_ni' and 'fill_block_pattern_n' functions. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230713075953.13692-2-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-14ALSA: pcmtest: Add 'open' PCM callback error injectionIvan Orlov
Extend 'pcmtest' virtual driver with 'open' callback error injection functionality, as it already can inject errors into other PCM callbacks. Add module parameter which enables EBUSY error injection in the 'open' PCM callback. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230713075953.13692-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-10ALSA: pcmtest: Don't use static storage to track per device dataUwe Kleine-König
While there is probably only ever a single instance of such a pcmtst device, it's still bad style to use a static variable to store per device data. Make use of platform_get_drvdata() and platform_set_drvdata() which fixes a data corruption if there should be two or more such devices (or this driver is used as a template for another driver). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230707075058.3402832-2-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-10ALSA: pcmtest: Convert to platform remove callback returning voidUwe Kleine-König
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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). 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: Ivan Orlov <ivan.orlov0322@gmail.com> Link: https://lore.kernel.org/r/20230707075058.3402832-1-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-07ALSA: Implement the new Virtual PCM Test DriverIvan Orlov
We have a lot of different virtual media drivers, which can be used for testing of the userspace applications and media subsystem middle layer. However, all of them are aimed at testing the video functionality and simulating the video devices. For audio devices we have only snd-dummy module, which is good in simulating the correct behavior of an ALSA device. I decided to write a tool, which would help to test the userspace ALSA programs (and the PCM middle layer as well) under unusual circumstances to figure out how they would behave. So I came up with this Virtual PCM Test Driver. This new Virtual PCM Test Driver has several features which can be useful during the userspace ALSA applications testing/fuzzing, or testing/fuzzing of the PCM middle layer. Not all of them can be implemented using the existing virtual drivers (like dummy or loopback). Here is what can this driver do: - Simulate both capture and playback processes - Generate random or pattern-based capture data - Inject delays into the playback and capturing processes - Inject errors during the PCM callbacks Also, this driver can check the playback stream for containing the predefined pattern, which is used in the corresponding selftest to check the PCM middle layer data transferring functionality. Additionally, this driver redefines the default RESET ioctl, and the selftest covers this PCM API functionality as well. The driver supports both interleaved and non-interleaved access modes, and have separate pattern buffers for each channel. The driver supports up to 4 channels and up to 8 substreams. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Acked-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230606193254.20791-2-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-05-22ALSA: add HAS_IOPORT dependenciesNiklas Schnelle
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Acked-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230522105049.1467313-33-schnelle@linux.ibm.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-04-24Merge tag 'asoc-v6.4' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v6.4 The bulk of the commits here are for the conversion of drivers to use void remove callbacks but there's a reasonable amount of other stuff going on, the pace of development with the SOF code continues to be high and there's a bunch of new drivers too: - More core cleanups from Morimto-san. - Update drivers to have remove() callbacks returning void, mostly mechanical with some substantial changes. - Continued feature and simplification work on SOF, including addition of a no-DSP mode for bringup, HDA MLink and extensions to the IPC4 protocol. - Hibernation support for CS35L45. - More DT binding conversions. - Support for Cirrus Logic CS35L56, Freescale QMC, Maxim MAX98363, nVidia systems with MAX9809x and RT5631, Realtek RT712, Renesas R-Car Gen4, Rockchip RK3588 and TI TAS5733.
2023-03-20ALSA: portman2x4: Convert to platform remove callback returning voidUwe Kleine-König
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-7-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>