aboutsummaryrefslogtreecommitdiffstats
path: root/sound (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-04ASoC: dapm: delete dapm_kcontrol_data paths list before freeing itSrinivas Kandagatla1-0/+2
dapm_kcontrol_data is freed as part of dapm_kcontrol_free(), leaving the paths pointer dangling in the list. This leads to system crash when we try to unload and reload sound card. I hit this bug during ADSP crash/reboot test case on Dragon board DB410c. Without this patch, on SLAB Poisoning enabled build, kernel crashes with "BUG kmalloc-128 (Tainted: G W ): Poison overwritten" Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2018-06-04ALSA: usb-audio: remove redundant check on errColin Ian King1-2/+0
The check on err is redundant as both the true and false paths end up on a break statement. Remove the redundant check. Detected by CoverityScan, CID#1268773 ("Identical code for different branches") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-04Merge branch 'for-next' into for-linusTakashi Iwai118-1423/+8602
4.18-rc1 merge material. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-01ASoC: topology: Move skl-tplg-interface.h to uapiGuenter Roeck5-250/+4
skl-tplg-interface.h describes firmware format details for Skylake topology files. It is part of the ABI and should reside in the uapi directory. While moving the file, also replace the license boilerplate with the SPDX License Identifier. No functional change. Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-01ASoC: topology: Move v4 manifest header data structures to uapiGuenter Roeck1-56/+0
Topology manifest v4 is still part of the ABI. Move its data structures into the uapi header file. No functional change. Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-01ASoC: topology: Improve backwards compatibility with v4 topology filesGuenter Roeck3-2/+248
Commit dc31e741db49 ("ASoC: topology: ABI - Add the types for BE DAI") introduced sound topology files version 5. Initially, this change made the topology code incompatible with v4 topology files. Backwards compatibility with v4 configuration files was subsequently added with commit 288b8da7e992 ("ASoC: topology: Support topology file of ABI v4"). Unfortunately, backwards compatibility was never fully implemented. First, the manifest size in (Skylake) v4 configuration files is set to 0, which causes manifest_new_ver() to bail out with error messages similar to the following. snd_soc_skl 0000:00:1f.3: ASoC: invalid manifest size snd_soc_skl 0000:00:1f.3: tplg component load failed-22 snd_soc_skl 0000:00:1f.3: Failed to init topology! snd_soc_skl 0000:00:1f.3: ASoC: failed to probe component -22 skl_n88l25_m98357a skl_n88l25_m98357a: ASoC: failed to instantiate card -22 skl_n88l25_m98357a: probe of skl_n88l25_m98357a failed with error -22 After this problem is fixed, the following error message is seen instead. snd_soc_skl 0000:00:1f.3: ASoC: old version of manifest snd_soc_skl 0000:00:1f.3: Invalid descriptor token 1093938482 snd_soc_skl 0000:00:1f.3: ASoC: failed to load widget media0_in cpr 0 snd_soc_skl 0000:00:1f.3: tPlg component load failed-22 This message is seen because backwards compatibility for loading widgets was never implemented. The lack of audio support when running the upstream kernel on recent Chromebooks has been reported in various forums, and can be traced back to this problem. Attempts to fix the problem, usually by providing v5 configuration files, were only partially successful. Let's implement backward compatibility properly to solve the problem for good. Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-01ALSA: pci/hda: Remove unused, broken, header fileBen Hutchings1-40/+0
sound/pci/hda/local.h seems to be an earlier version of sound/hda/local.h; it was added at the same time but doesn't seem to have ever been used (within the git history). Most of its macros depend on a hdac_read_parm() function which is not defined anywhere. Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-01ASoC: TSCS454: Add SupportSteven Eckhoff4-0/+5830
Currently there is no support for Tempo Semiconductor's TSCS454 CODEC. Add support for it. Signed-off-by: Steven Eckhoff <steven.eckhoff.opensource@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-01ASoC: Intel: kbl: Move codec sysclk config to codec_init functionMac Chiang1-8/+9
On APL, commit fd0f237572ad ("ASoC: Intel: bxt: Move codec sysclk config to codec_init function") fixed an issue related to jack detection. The MCLK for DA7219 does not change in this platform, but is currently being configured everytime as part of the platform_clock event handler for DAPM. The upshot of this is that we have unnecessary calls to this function, and it also means that if a stream hasn't yet been started, DA7219 driver does not have the correct MCLK rates programmed and so the HP detection feature does not operate as expected. The same fix is needed on KBL. This patch rectifies this issue by moving the sysclk call to codec_init function so it's only called once at initialisation. Signed-off-by: Mac Chiang <mac.chiang@intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-01ASoC: simple-card: set cpu dai clk in hw_paramsDaniel Mack1-0/+21
The simple-card driver currently accepts a clock node in the cpu dai sub-node and only uses it as an alternative to the 'system-clock-frequency' property to get the current frequency. This patch adds another use of the passed clock node. If mclk-fs is specified, the clocks in cpu and codec dai sub-nodes will be set to the calculated rate (stream rate * mclk_fs) in hw_params. This allows platforms to pass tuneable clocks as phandle that will automatically be set to the right rates. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-01ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream()Bo Chen1-1/+3
When 'kzalloc()' fails in 'snd_hda_attach_pcm_stream()', a new pcm instance is created without setting its operators via 'snd_pcm_set_ops()'. Following operations on the new pcm instance can trigger kernel null pointer dereferences and cause kernel oops. This bug was found with my work on building a gray-box fault-injection tool for linux-kernel-module binaries. A kernel null pointer dereference was confirmed from line 'substream->ops->open()' in function 'snd_pcm_open_substream()' in file 'sound/core/pcm_native.c'. This patch fixes the bug by calling 'snd_device_free()' in the error handling path of 'kzalloc()', which removes the new pcm instance from the snd card before returns with an error code. Signed-off-by: Bo Chen <chenbo@pdx.edu> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-31ALSA: oxygen: use match_string() helperYisheng Xie1-7/+7
match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-31ASoC: dapm: use match_string() helperXie Yisheng1-11/+7
match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: max98095: use match_string() helperXie Yisheng1-8/+5
match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: max98088: use match_string() helperXie Yisheng1-8/+5
match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: Intel: bytcr_rt5651: Set card long_name based on quirksHans de Goede1-0/+11
Many X86 devices using a BYT SoC + RT5651 codec are cheap devices with generic DMI strings, causing snd_soc_set_dmi_name() to fail to set a long_name, making it impossible for userspace to have a correct UCM profile which knowns which input is connected to the internal mic, which input is connected to the hsmic (for correct jack-based switching) and which inputs are unused. Our quirks already specify which inputs the internal and headset mic are connected to. This commit sets a long_name based on the quirks so that userspace can have UCM profiles doing the right thing based on the long_name. Note that if we ever encounter the need for a special UCM profile for some device we can add a quirk to set a specific long_name for the device, Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: mt6797-mt6351: add hostless phone call pathKai Chieh Chuang1-0/+46
Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: mt6797: add Hostless DAIKai Chieh Chuang5-0/+129
add path for hosltess lpbk from ADDA Capture to ADDA Playback add path for hostless phone call between ADDA DAI and PCM DAI Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: mt6797: add PCM interfaceKai Chieh Chuang5-0/+494
Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: mediatek: export mtk-afe symbols as neededArnd Bergmann1-0/+5
The new mt6797-afe driver uses some functions in a common file, which works for a built-in driver but fails for a loadable module: ERROR: "mtk_afe_pcm_free" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined! ERROR: "mtk_afe_add_sub_dai_control" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined! ERROR: "mtk_afe_pcm_new" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined! ERROR: "mtk_afe_combine_sub_dai" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined! ERROR: "mtk_afe_pcm_ops" [sound/soc/mediatek/mt6797/snd-soc-mt6797-afe.ko] undefined! This exports the five symbols above for modules. Fixes: b3c702f56bf5 ("ASoC: mt6797: combine DAI to register component") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ASoC: codecs: PCM1789: include gpio/consumer.hArnd Bergmann1-1/+1
When CONFIG_GPIOLIB is disabled, this codec fails to build because gpio/consumer.h is not included implicitly. sound/soc/codecs/pcm1789.c: In function 'pcm1789_common_init': sound/soc/codecs/pcm1789.c:247:19: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_gpio_request_one'? [-Werror=implicit-function-declaration] pcm1789->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); ^~~~~~~~~~~~~~~~~~~~~~~ Fixes: 4ae340d1be36 ("ASoC: codecs: Add support for PCM1789") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-31ALSA: xen-front: fix a loop timeoutDan Carpenter1-1/+1
We want the loop to exit when "to" is set to zero, but in the current code it's set to -1. Also I tweaked the indenting so it doesn't look like we're passing "--to" to xenbus_read_unsigned(). Fixes: cc3196ae197c ("ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-30ASoC: core: Fix return code shown on error for hw_paramsJon Hunter1-1/+1
When the call to hw_params for a component fails, the error code is held by the variable '__ret' but the error message displays the value held by the variable 'ret'. Fix the return code shown when hw_params fails for a component. Fixes: b8135864d4d3 ("ASoC: snd_soc_component_driver has snd_pcm_ops") Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-30ALSA: xen-front: freeing an error pointerDan Carpenter1-0/+2
kfree() doesn't accept error pointers so I've set "str" to NULL on these paths. Fixes: fd3b36045c2c ("ALSA: xen-front: Read sound driver configuration from Xen store") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-30ALSA: hda/realtek - Enable mic-mute hotkey for several Lenovo AIOsHui Wang1-1/+5
We have several Lenovo AIOs like M810z, M820z and M920z, they have the same design for mic-mute hotkey and led and they use the same codec with the same pin configuration, so use the pin conf table to apply fix to all of them. Fixes: 29693efcea0f ("ALSA: hda - Fix micmute hotkey problem for a lenovo AIO machine") Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-29ALSA: hda/realtek - Fixup for HP x360 laptops with B&O speakersTom Briden2-1/+106
Added a new helper file for these fixups due to requiring a huge number of coefs being set to get the top speakers to work, as well as setting pin 0x17 for the top speakers and the correct input source of 0x17 for volume control [ Note: this is a revised work based on Tom's fixup patch with the replacement of the full COEF tables provided by Realtek. Also, the fixup function has a proper HDA_FIXUP_ACT_* handling now. The credit for the new COEF table goes to Kailang -- tiwai ] Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189331 Cc: Kailang Yang <kailang@realtek.com> Signed-off-by: Tom Briden <tom@decompile.me.uk> Tested-by: Tom Briden <tom@decompile.me.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-29ASoC: atmel-i2s: add driver for the new Atmel I2S controllerCyrille Pitchen3-0/+776
This patch adds support for the Atmel I2S controller embedded into sama5d2x SoCs. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: qdsp6: q6routing: Add support to all TDM MixersSrinivas Kandagatla1-1/+454
This patch adds TX and RX TDM mixers for 40 TDM ports. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: qdsp6: q6routing: Add macros for mixersSrinivas Kandagatla1-534/+97
All the mixer controls are pretty much same from all the afe ports. Make these as proper macros for 2 reasons. 1> To avoid any typos in adding new mixer controls for each port. 2> Easy to edit from single place, easy to add new ports This also prepares the routing driver to accomdate 40 tdm dais. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: qdsp6: q6afe-dai: add support to tdm daisSrinivas Kandagatla1-1/+573
This patch adds support to 40 TDM ports supported in AFE. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: qdsp6: q6afe-dai: use q6afe_dai_prepare() for MI2SSrinivas Kandagatla1-35/+18
Use common q6afe_dai_prepare() for MI2S dais, this will remove some code duplication. Also make the if statement to switch to make the code look neater. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: qdsp6: qdafe: add support to tdm portsSrinivas Kandagatla2-2/+447
This patch adds support to tdm ports in AFE. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: dpcm: symmetry constraint on FE substreamKai Chieh Chuang1-2/+3
We should set BE symmetric constraint on FE substream. in case one BE is used by two FE1/FE2, the first BE runtime will use FE1's substream->runtime. hence the FE1's will be constrained by BE symmetry property. Though, second FE2 call dpcm_apply_symmetry, the be_substream->runtime == FE1's substream->runtime. The FE2's substream->runtime will not be constrained by BE's symmetry property. Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: dpcm: fix BE dai not hw_free and shutdownKai Chieh Chuang1-2/+4
In case, one BE is used by two FE1/FE2 FE1--->BE--> | FE2----] when FE1/FE2 call dpcm_be_dai_hw_free() together the BE users will be 2 (> 1), hence cannot be hw_free the be state will leave at, ex. SND_SOC_DPCM_STATE_STOP later FE1/FE2 call dpcm_be_dai_shutdown(), will be skip due to wrong state. leaving the BE not being hw_free and shutdown. The BE dai will be hw_free later when calling dpcm_be_dai_shutdown() if still in invalid state. Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: AMD: make channel 1 dma as circularAgrawal, Akshu1-64/+10
channel 1: SYSMEM<->ACP channel 2: ACP<->I2S Instead of waiting on period interrupt of ch 2 and then starting dma on ch1, we make ch1 dma as circular. This removes dependency of period granularity on hw pointer. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Tested-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ASoC: Intel: bytcr_rt5640: Add quirk for the ARCHOS 80 Cesium 8" windows tabletHans de Goede1-0/+10
Add a quirk for the ARCHOS 80 Cesium 8" windows tablet, this device mostly works with the default settings, except that it has only one speaker. So add a quirk with the default settings + the mono-speaker flag. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-29ALSA: hda/realtek - Refactor alc269_fixup_hp_mute_led_mic*()Takashi Iwai1-19/+13
Just a code refactoring to use the common helper for the all three functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-29ALSA: hda/realtek - Fixup mute led on HP Spectre x360Tom Briden1-0/+19
This patch adds the mute LED control for HP Spectre x360 Kabylake model. The mute LED is controlled via VREF bits on NID 0x1b, so we need a new fixup function. Note that this doesn't fix the other issues like the missing speaker output on the machine. They will be addressed by later patches. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189331 Signed-off-by: Tom Briden <tom@decompile.me.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-29ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffersTakashi Iwai5-5/+63
Currently, USB-audio driver allocates the PCM buffer via vmalloc(), as this serves merely as an intermediate buffer that is copied to each URB transfer buffer. This works well in general on x86, but on some archs this may result in cache coherency issues when mmap is used. OTOH, it works also on such arch unless mmap is used. This patch is a step for mitigating the inconvenience; a new module option "use_vmalloc" is provided so that user can choose to allocate the DMA coherent buffer instead of the existing vmalloc buffer. The drawback is that it'd be the standard dma_alloc_coherent() calls and the system would require contiguous pages on non-x86 archs. Note that it's a global option and not dynamically switchable since the buffer is pre-allocated at the probe time. In theory, it's possible to be switchable, but it'd be trickier and racier. As default use_vmalloc option is set to true, so that the old behavior is kept. For allowing the coherent mmap on ARM or MIPS, pass use_vmalloc=0 option explicitly. Reported-and-tested-by: Daniel Danzberger <daniel@dd-wrt.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-29ALSA: hda: Add Intel NUC5i7RY to the power_save blacklistHans de Goede1-0/+2
Power-saving is causing a humming sound when active on the Intel NUC5i7RY, add it to the blacklist. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199607 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-29ALSA: xen: ensure nul-terminated device nameArnd Bergmann1-1/+1
gcc-8 warns that pcm_instance->name is not necessarily terminated correctly if the input is more than 80 characters long or lacks a termination byte itself: In function 'strncpy', inlined from 'cfg_device' at sound/xen/xen_snd_front_cfg.c:399:3, inlined from 'xen_snd_front_cfg_card' at sound/xen/xen_snd_front_cfg.c:509:9: include/linux/string.h:254:9: error: '__builtin_strncpy' specified bound 80 equals destination size [-Werror=stringop-truncation] return __builtin_strncpy(p, q, size); Using strlcpy() instead of strncpy() makes this a bit safer. Fixes: fd3b36045c2c ("ALSA: xen-front: Read sound driver configuration from Xen store") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: usb-audio: Avoid lowlevel device objectTakashi Iwai1-25/+5
Simplify the device management by replacing the lowlevel device object allocation with the card->private_data. Nowadays there is almost no advantage by the lowlevel device, and with card->private_data, the code becomes cleaner. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: usb-audio: Follow standard coding styleTakashi Iwai5-26/+41
Avoid if ((err = ...) style and expand to multiple lines instead. No change in the end result, but just the beautification. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: usb-audio: Move autoresume call at the end of openTakashi Iwai1-36/+37
... so that we can avoid the extra goto lines. Also beautify the code to follow the standard codex. No functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: usb-audio: Simplify PCM open/close callbacksTakashi Iwai1-26/+8
The stream direction in open and close callbacks can be retrieved from substream->direction, hence we don't have to stick with the unique PCM ops hard-coded for each direction. Rewrite the common open/close callback functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: aloop: Reduced duplicated PCM ops definitionTakashi Iwai1-16/+3
The PCM ops defined for playback and capture are identical. Just use the single one for both. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: xen-front: fix unsigned error check on return from to_sndif_formatColin Ian King1-3/+4
The negative error return from the call to to_sndif_format is being assigned to an unsigned 8 bit integer and hence the check for a negative value is always going to be false. Fix this by using ret as the error return and hence the negative error can be detected and assign the u8 sndif_format to ret if there is no error. Detected by CoverityScan, CID#1469385 ("Unsigned compared against 0") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamoccchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28ALSA: xen-front: remove redundant error check on retColin Ian King1-2/+0
The error for a -ve value in ret is redundant as all previous assignments to ret have an associated -ve check and hence it is impossible for ret to be less that zero at the point of the check. Remove this redundant error check. Detected by CoveritScan, CID#1469407 ("Logically Dead code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28sound: Use octal not symbolic permissionsJoe Perches41-103/+102
Convert the S_<FOO> symbolic permissions to their octal equivalents as using octal and not symbolic permissions is preferred by many as more readable. see: https://lkml.org/lkml/2016/8/2/1945 Done with automated conversion via: $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...> Miscellanea: o Wrapped one multi-line call to a single line Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-27ALSA: dice: unuse second stream for MIDI conformant data channel for TC Electronic modelsTakashi Sakamoto1-5/+3
At present, all of models produced by TC Electronic except for Konnekt Live are supported with hard-coded their stream formats. Studio Konnekt 48 is sore model to support dual streams for both directions. The second stream has no MIDI conformant data channel in its data block. But current implementation transfers the second stream with MIDI conformant data channel. This commit fixes this issue. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>