summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2018-03-28Merge remote-tracking branches 'asoc/topic/da7219', 'asoc/topic/da732x', ↵Mark Brown
'asoc/topic/da9055' and 'asoc/topic/dmic' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cx20442', 'asoc/topic/cygnus', ↵Mark Brown
'asoc/topic/da7210', 'asoc/topic/da7213' and 'asoc/topic/da7218' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cs42l73', 'asoc/topic/cs42xx8', ↵Mark Brown
'asoc/topic/cs43130', 'asoc/topic/cs4349' and 'asoc/topic/cs53l30' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cs4271', 'asoc/topic/cs42l42', ↵Mark Brown
'asoc/topic/cs42l51', 'asoc/topic/cs42l52' and 'asoc/topic/cs42l56' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cs35l33', 'asoc/topic/cs35l34', ↵Mark Brown
'asoc/topic/cs35l35', 'asoc/topic/cs4265' and 'asoc/topic/cs4270' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/cpcap', 'asoc/topic/cq93vc' and ↵Mark Brown
'asoc/topic/cs35l32' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/arizona', 'asoc/topic/atmel', ↵Mark Brown
'asoc/topic/bd28623', 'asoc/topic/blackfin' and 'asoc/topic/bt-sco' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/ak5386', 'asoc/topic/ak5558', ↵Mark Brown
'asoc/topic/alc5623', 'asoc/topic/alc5632' and 'asoc/topic/amd' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/ak4554', 'asoc/topic/ak4613', ↵Mark Brown
'asoc/topic/ak4641', 'asoc/topic/ak4642' and 'asoc/topic/ak4671' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/adav80x', 'asoc/topic/ads117x', ↵Mark Brown
'asoc/topic/ak4104', 'asoc/topic/ak4458' and 'asoc/topic/ak4535' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/ad73311', 'asoc/topic/adau1373', ↵Mark Brown
'asoc/topic/adau17x1', 'asoc/topic/adau1977' and 'asoc/topic/adau7002' into asoc-next
2018-03-28Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ab8500', ↵Mark Brown
'asoc/topic/ac97', 'asoc/topic/ad1836' and 'asoc/topic/ad193x' into asoc-next
2018-03-28Merge remote-tracking branch 'asoc/topic/samsung' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/rt5665' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm512x' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm5102a' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm3168a' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm3008' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm186x' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm179x' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm1789' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm1681' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/pcm' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/intel' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branch 'asoc/topic/component-platform' into asoc-nextMark Brown
2018-03-28Merge remote-tracking branches 'asoc/fix/mtk', 'asoc/fix/rt5659', ↵Mark Brown
'asoc/fix/ssm2602' and 'asoc/fix/topology' into asoc-linus
2018-03-28Merge remote-tracking branch 'asoc/fix/component' into asoc-linusMark Brown
2018-03-28ASoC: tscs42xx: Remove owner assignment from i2c_driverFabio Estevam
Structure i2c_driver does not need to set the owner field, as this will be populated by the driver core. Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-28ASoC: cpcap: replace codec to componentKuninori Morimoto
Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-28ASoC: Intel: bytcr_rt5651: don't use codec anymoreKuninori Morimoto
commit aeec6cc08215 ("ASoC: Intel: bytcr_rt5651: Configure PLL1 before using it") is using codec->dev, but codec is replaced to component. Let's use component Fixes: aeec6cc08215 ("ASoC: Intel: bytcr_rt5651: Configure PLL1 before using it") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-28ASoC: amd: don't use codec anymoreKuninori Morimoto
commit c88d31153356 ("ASoC: amd: Enable da7219 master clock using common clock framework") is using rtd->codec, but codec is replaced to component. Let's use component Fixes: c88d31153356 ("ASoC: amd: Enable da7219 master clock using common clock framework") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-27ALSA: usb-audio: fix memory leak on cvalColin Ian King
With the current exit return path of the ctl_info allocation failure cval is not being freed resulting in a memory leak. Fix this by kfree'ing it on the return. Detected by CoverityScan, CID#1466878 ("Resource Leak") Fixes: 21e9b3e931f7 ("ALSA: usb-audio: fix uac control query argument") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-27ALSA: pcm: Fix mutex unbalance in OSS emulation ioctlsTakashi Iwai
The previous fix 40cab6e88cb0 ("ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams") introduced some mutex unbalance; the check of runtime->oss.rw_ref was inserted in a wrong place after the mutex lock. This patch fixes the inconsistency by rewriting with the helper functions to lock/unlock parameters with the stream check. Fixes: 40cab6e88cb0 ("ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-27ALSA: pcm: potential uninitialized return valuesDan Carpenter
Smatch complains that "tmp" can be uninitialized if we do a zero size write. Fixes: 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-27ASoC: topology: Fix kcontrol name string handlingLiam Girdwood
Fix the topology kcontrol string handling so that string pointer references are strdup()ed instead of being copied. This fixes issues with kcontrol templates on the stack or ones that are freed. Remember and free the strings too when topology is unloaded. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2018-03-27ALSA: aloop: Mark paused device as inactiveRobert Rosengren
Show paused ALSA aloop device as inactive, i.e. the control "PCM Slave Active" set as false. Notification sent upon state change. This makes it possible for client capturing from aloop device to know if data is expected. Without it the client expects data even if playback is paused. Signed-off-by: Robert Rosengren <robert.rosengren@axis.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-26ALSA: pcm: Use dma_bytes as size parameter in dma_mmap_coherent()Stefan Roese
When trying to use the driver (e.g. aplay *.wav), the 4MiB DMA buffer will get mmapp'ed in 16KiB chunks. But this fails with the 2nd 16KiB area, as the page offset is outside of the VMA range (size), which is currently used as size parameter in snd_pcm_lib_default_mmap(). By using the DMA buffer size (dma_bytes) instead, the complete DMA buffer can be mmapp'ed and the issue is fixed. This issue was detected on an ARM platform (TI AM57xx) using the RME HDSP MADI PCIe soundcard. Fixes: 657b1989dacf ("ALSA: pcm - Use dma_mmap_coherent() if available") Signed-off-by: Stefan Roese <sr@denx.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-26treewide: Align function definition open/close bracesJoe Perches
Some functions definitions have either the initial open brace and/or the closing brace outside of column 1. Move those braces to column 1. This allows various function analyzers like gnu complexity to work properly for these modified functions. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Paul Moore <paul@paul-moore.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-24ALSA: usb-audio: update clock valid controlAndrew Chant
Make the "clock valid" control a global control instead of a mixer so that it doesn't appear in mixer applications. Additionally, remove the check for writeability prohibited by spec, and Use common code to read the control value. Tested with a UAC2 Audio device that presents a clock validity control. The control still shows up in /proc usbmixer but not in alsamixer. Signed-off-by: Andrew Chant <achant@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-24ALSA: usb-audio: UAC2 jack detectionAndrew Chant
This implements UAC2 jack detection support, presenting jack status as a boolean read-only mono mixer. The presence of any channel in the UAC2_TE_CONNECTOR control for a terminal will result in the mixer saying the jack is connected. Mixer naming follows the convention in sound/core/ctljack.c, terminating the mixer with " Jack". For additional clues as to which jack is being presented, the name is prefixed with " - Input Jack" or " - Output Jack" depending on if it's an input or output terminal. This is required because terminal names are ambiguous between inputs and outputs and often duplicated - Bidirectional terminal types (0x400 -> 0x4FF) "... may be used separately for input only or output only. These types require two Terminal descriptors. Both have the same type." (quote from "USB Device Class Definition for Terminal Types") Since bidirectional terminal types are common for headphone adapters, this distinguishes between two otherwise identically-named jack controls. Tested with a UAC2 audio device with connector control capability. Signed-off-by: Andrew Chant <achant@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streamsTakashi Iwai
OSS PCM stream management isn't modal but it allows ioctls issued at any time for changing the parameters. In the previous hardening patch ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write"), we covered these races and prevent the corruption by protecting the concurrent accesses via params_lock mutex. However, this means that some ioctls that try to change the stream parameter (e.g. channels or format) would be blocked until the read/write finishes, and it may take really long. Basically changing the parameter while reading/writing is an invalid operation, hence it's even more user-friendly from the API POV if it returns -EBUSY in such a situation. This patch adds such checks in the relevant ioctls with the addition of read/write access refcount. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23ALSA: pcm: Avoid potential races between OSS ioctls and read/writeTakashi Iwai
Although we apply the params_lock mutex to the whole read and write operations as well as snd_pcm_oss_change_params(), we may still face some races. First off, the params_lock is taken inside the read and write loop. This is intentional for avoiding the too long locking, but it allows the in-between parameter change, which might lead to invalid pointers. We check the readiness of the stream and set up via snd_pcm_oss_make_ready() at the beginning of read and write, but it's called only once, by assuming that it remains ready in the rest. Second, many ioctls that may change the actual parameters (i.e. setting runtime->oss.params=1) aren't protected, hence they can be processed in a half-baked state. This patch is an attempt to plug these holes. The stream readiness check is moved inside the read/write inner loop, so that the stream is always set up in a proper state before further processing. Also, each ioctl that may change the parameter is wrapped with the params_lock for avoiding the races. The issues were triggered by syzkaller in a few different scenarios, particularly the one below appearing as GPF in loopback_pos_update. Reported-by: syzbot+c4227aec125487ec3efa@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23ALSA: usb-audio: Integrate native DSD support for ITF-USB based DACs.Nobutaka Okabe
Integrate the native DSD support quirk codes of "ITF-USB DSD" based DACs. Now, "is_itf_usb_dsd_2alts_dac()" and "is_itf_usb_dsd_3alts_dac()" is integrated into one function "is_itf_usb_dsd_dac()". So, remove the logic to distinguish UD-501 and UD-501V2 by the "Product Name". The integration is possible by changing the following two functions. - snd_usb_select_mode_quirk(): Change the determination condition of the DSD mode switch command, from the altset number being used, to the audio format being played. Actually, this operation is same as playback using ASIO driver in Windows environment. - snd_usb_interface_dsd_format_quirk(): To which altset supports native DSD is determined by the number of altsets. Previously, it's a constant "2" or "3". Signed-off-by: Nobutaka Okabe <nob77413@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23ALSA: usb-audio: FIX native DSD support for TEAC UD-501 DACNobutaka Okabe
There are two versions of TEAC UD-501, the normal version and the vendor updated version(UD-501V2). They have the same VID/PID, but the num of the altsetting is different, UD-501 has 2 altsets for stream, and UD-501V2 has 3. So, add the logic to distinguish them by the Product Name, not by the PID. Signed-off-by: Nobutaka Okabe <nob77413@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23ALSA: usb-audio: Add native DSD support for Luxman DA-06Nobutaka Okabe
Add native DSD support quirk for Luxman DA-06 DAC, by adding the PID/VID 1852:5065. Rename "is_marantz_denon_dac()" function to "is_itf_usb_dsd_2alts_dac()" to cover broader device family sharing the same USB audio implementation(*). For the same reason, rename "is_teac_dsd_dac()" function to "is_itf_usb_dsd_3alts_dac()". (*) These devices have the same USB controller "ITF-USB DSD", supplied by INTERFACE Co., Ltd. "ITF-USB DSD" USB controller has two patterns, Pattern 1. (2 altsets version) - Altset 0: for control - Altset 1: for stream (S32) - Altset 2: for stream (S32, DSD_U32) Pattern 2. (3 altsets version) - Altset 0: for control - Altset 1: for stream (S16) - Altset 2: for stream (S32) - Altset 3: for stream (S32, DSD_U32) "is_itf_usb_dsd_2alts_dac()" returns true, if the DAC has "Pattern 1" USB controller, and "is_itf_usb_dsd_3alts_dac()" returns true, if "Pattern2". Signed-off-by: Nobutaka Okabe <nob77413@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge for applying more series of fixes for USB DSD support. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23ALSA: usb-audio: Add native DSD support for TEAC UD-301Nobutaka Okabe
Add native DSD support quirk for TEAC UD-301 DAC, by adding the PID/VID 0644:804a. Signed-off-by: Nobutaka Okabe <nob77413@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23ALSA: usb-audio: fix uac control query argumentAndrew Chant
This patch fixes code readability and should have no functional change. Correct uac control query functions to account for the 1-based indexing of USB Audio Class control identifiers. The function parameter, u8 control, should be the constant defined in audio-v2.h to identify the control to be checked for readability or writeability. This patch fixes all callers that had adjusted, and makes explicit the mapping between audio_feature_info[] array index and the associated control identifier. Signed-off-by: Andrew Chant <achant@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>