summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2017-11-10ASoC: rt5514: mark PM functions as __maybe_unusedArnd Bergmann
The new functions are only used when CONFIG_PM is enabled, leading to a harmless warning: sound/soc/codecs/rt5514-spi.c:474:12: error: 'rt5514_resume' defined but not used [-Werror=unused-function] sound/soc/codecs/rt5514-spi.c:464:12: error: 'rt5514_suspend' defined but not used [-Werror=unused-function] This marks them as __maybe_unused to make the build silent again. Fixes: 58f1c07d23cd ("ASoC: rt5514: Voice wakeup support.") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-10ASoC: rt5663: Check the JD status in the button pushingoder_chiou@realtek.com
Check the JD status in the button pushing to prevent the IRQ that is locked by button pushing event while the jack unpluging. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09Merge tag 'sound-4.14' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "The amount of the changes isn't as quite small as wished, nevertheless they are straight fixes that deserve merging to 4.14 final. Most of fixes are about ALSA core bugs spotted by fuzzer: a follow-up fix for the previous nested rwsem patch, a fix to avoid the resource hogs due to too many concurrent ALSA timer invocations, and a fix for a crash with SYSEX MIDI transfer over OSS sequencer emulation that is used by none but fuzzer. The rest are usual HD-audio and USB-audio device-specific quirks, which are safe to apply" * tag 'sound-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - fix headset mic problem for Dell machines with alc274 ALSA: seq: Fix OSS sysex delivery in OSS emulation ALSA: seq: Avoid invalid lockdep class warning ALSA: timer: Limit max instances per timer ALSA: usb-audio: support new Amanero Combo384 firmware version
2017-11-09ASoC: amd: Modified DMA transfer Mechanism for PlaybackVijendar Mukunda
Before rendering starts, DMA driver copies full buffer valid data to ACP SRAM for the first time, after that ACP SRAM to I2S FIFO DMA will be initiated. After rendering first half of ACP SRAM, IOC will be raised then Audio data will be copied from first half of System Memory to first half of ACP SRAM. Similarly after rendering second half of ACP SRAM, IOC will be raised then Audio Data will be copied from second half of the System Memory to second half of the ACP SRAM in ping-pong way till rendering stops. Old design introducing latency issues resulting stutter sound observed during playback. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: Akshu Agrawal <Akshu.Agrawal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09ASoC: rt5645: Wait for 400msec before concluding on value of RT5645_VENDOR_ID2Akshu Agrawal
Minimum time required between power On of codec and read of RT5645_VENDOR_ID2 is 400msec. We should wait that long before reading the value. TEST=Cold boot the device and check for sound device. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09ASoC: sun4i-codec: fixed 32bit audio capture support for H3/H2+Andrea Bondavalli
32bit and 24bit audio capture formats for H3/H2+ are broken because the RX_SAMPLE_BITS and the RX_FIFO_MODE bits of AC_ADC_FIFOC register of the audio codec are not set to operate in 24bit mode but in 16bit mode only. The following patch sets the H3 audio codec registers and the DMA bus width properly when a 24/32bit capture is requested. Signed-off-by: Andrea Bondavalli <andrea.bondavalli74@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09ASoC: da7213: add support for DSP modesPierre-Louis Bossart
DSP modes are documented in the data sheet but not enabled in the driver. The work-around already implemented for DA7218/9 is also required to make sure the bit clock handling in DSP modes follows ASoC conventions. Tested with ARD-AUDIO-DA7212 and Minnowmax Turbot boards Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09ASoC: sun8i-codec: Add a comment on the LRCK inversionMaxime Ripard
The current code might be a bit intriguing without having experienced the issue before, and might come up as a mistake. Make explicit what's going on by adding a comment. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09ASoC: sun8i-codec: Set the BCLK dividerMaxime Ripard
While the current code was reporting to be able to work in master mode, it failed to do so because the BCLK divider wasn't programmed, meaning that the BCLK would run at the PLL's frequency no matter the sample rate. It was obviously a bit too fast. Add support to retrieve the divider to use, and set it. Since our PLL is not always able to generate a perfect multiple of the sample rate, we'll have to choose the closest divider that matches our setup. Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec") Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2017-11-09ASoC: rt5663: Delay and retry reading rt5663 ID registerOder Chiou
In the probe, the codec may not be ready for I2C reading or there are some glitches on the i2c line. So if the i2c reading value is incorrect, it will read again after delay. This issue is similar the patch https://patchwork.kernel.org/patch/9681421/. In current project, these 2 devices were connected to the same i2c line, and they met the same problem. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09ALSA: hda - fix headset mic problem for Dell machines with alc274Hui Wang
Confirmed with Kailang of Realtek, the pin 0x19 is for Headset Mic, and the pin 0x1a is for Headphone Mic, he suggested to apply ALC269_FIXUP_DELL1_MIC_NO_PRESENCE to fix this problem. And we verified applying this FIXUP can fix this problem. Cc: <stable@vger.kernel.org> Cc: Kailang Yang <kailang@realtek.com> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-08ASoC: amd: use do_div rather than 64 bit division to fix 32 bit buildsGuenter Roeck
ERROR: "__aeabi_uldivmod" [sound/soc/amd/snd-soc-acp-pcm.ko] undefined! 64-bit divides require special operations to avoid build errors on 32-bit systems. [Reword the commit message to make it clearer - Alex] fixes: 61add8147942 (ASoC: amd: Report accurate hw_ptr during dma) Signed-off-by: Guenter Roeck <groeck@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/678919 Reviewed-by: Jason Clinton <jclinton@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/681618 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: rt5514-spi: check irq status to schedule data copy in resume functionoder_chiou@realtek.com
For wake on voice use case, we need to copy data from DSP buffer to PCM stream when system wakes up by voice. However the edge triggered IRQ could be missed when system wakes up, in that case the irq function will not be called. If the substream was constructed beforce suspend, we will schedule data copy in resume function. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: rt5514: Voice wakeup support.oder_chiou@realtek.com
If the rt5514 Wake on Voice device is opened while suspended, it will be able to wake up the system when a voice command is detected. This patch also supports user-space policy to override wakeup behavior by /sys/bus/spi/drivers/rt5514/spi2.0/power/wakeup. Signed-off-by: Chinyue Chen <chinyue@chromium.org> Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: wm8994: mark expected switch fall-throughsGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 402005 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: wm8993: mark expected switch fall-throughsGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115168 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: wm8753: mark expected switch fall-throughsGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 146568 Addresses-Coverity-ID: 146569 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: tpa6130a2: mark expected switch fall-throughGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115164 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: tlv320dac31xx: mark expected switch fall-throughGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1195220 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: tlv320aic23: mark expected switch fall-throughGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 146566 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: msm8916-wcd-analog: mark expected switch fall-throughGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1397957 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: add snd_soc_component_read32Kuninori Morimoto
Current codec drivers are using snd_soc_read(). It will be replaced into snd_soc_component_read(), but these 2 are using different style. For example, it will be - val = snd_soc_read(xxx, reg); + ret = snd_soc_component_read(xxx, reg, &val); + if (ret < 0) { + ... + } To more smooth replace, let's add snd_soc_component_read32 which is copied from snd_soc_read() - val = snd_soc_read(xxx, reg); + val = snd_soc_component_read32(xxx, reg); Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: hdac_hdmi: Fix possible memory leak on parse and map nid failureSubhransu S. Prusty
During failure, widgets in cvt_list and pin_list are not freed. So fix the possible memory leak by freeing them when failure occurs. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: hdac_hdmi: Fix possible NULL pointer dereferenceSubhransu S. Prusty
Pointers hdac_hdmi_pcm and hda_device_id can be NULL, so add check for valid pointer to avoid NULL pointer dereference. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: hdac_hdmi: Fix static checker warning for sprintf usageSubhransu S. Prusty
Use snprintf instead of sprintf to shut the warning. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: Skylake: Add dynamic module id supportSriram Periyasamy
Module id is a property of firmware manifest and can vary between platforms so use the uuid instead of module id for pins. Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: Skylake: Optimize UUID handling to fill pin infoSriram Periyasamy
Modify skl_tplg_get_uuid() to copy just UUID rather than only for module UUID and skl_tplg_fill_pin() to fill the pin info which can include UUID token also. Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: Skylake: Check for NHLT ACPI header signaturePankaj Bharadiya
In certain buggy BIOS acpi_evaluate_dsm() may not return the correct NHLT table, so check the NHLT table header signature before accessing it. Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: Skylake: Fix uuid_module memory leak in failure casePankaj Bharadiya
In the loop that adds the uuid_module to the uuid_list list, allocated memory is not properly freed in the error path free uuid_list whenever any of the memory allocation in the loop fails to avoid memory leak. Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: Skylake: Fix potential NULL pointer dereferencePankaj Bharadiya
Pointer 'mconfig' returned from call to skl_tplg_fe_get_cpr_module() can be NULL. So check for the valid pointer before dereferencing. Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: Skylake: Add channel map in updown mixer module IPCGuneshwor Singh
DSP expects channel map to be sent in the IPC for updown mixer module. So add ch_map info in updown mixer module config. Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: Skylake: Fix updown mixer module formatGuneshwor Singh
DSP expects length of the coefficient for updown mixer module to be 8. So fix the max coefficient length and since we are using default values for coefficient select which is zero, we need not explicitly initialize it. Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: sun8i-codec: Fix left and right channels inversionMaxime Ripard
Since its introduction, the codec had an inversion of the left and right channels. It turned out to be pretty simple as it appears that the codec doesn't have the same polarity on the LRCK signal than the I2S block. Fix this by inverting our bit value for the LRCK inversion. Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec") Cc: <stable@vger.kernel.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: amd: Make the driver name consistent across filesAkshu Agrawal
This fixes the issue of driver not getting auto loaded with MODULE_ALIAS. find /sys/devices -name modalias -print0 | xargs -0 grep 'audio' /sys/devices/pci0000:00/0000:00:01.0/acp_audio_dma.0.auto/modalias:platform:acp_audio_dma TEST=boot and check for device in lsmod [Removed yet more ChromeOS crap from the changelog -- broonie] Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Tested-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Jason Clinton <jclinton@chromium.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: sun8i-codec: Invert Master / Slave conditionMaxime Ripard
The current code had the condition backward when checking if the codec should be running in slave or master mode. Fix it, and make the comment a bit more readable. Fixes: 36c684936fae ("ASoC: Add sun8i digital audio codec") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2017-11-08ASoC: Intel: improve SND_SOC_INTEL_MACH dependenciesArnd Bergmann
I ran into a build error with CONFIG_SND_SOC_INTEL_COMMON=m and SND_SOC_INTEL_MACH=y: ERROR: "snd_soc_acpi_intel_broadwell_machines" [sound/soc/intel/common/snd-soc-sst-acpi.ko] undefined! ERROR: "snd_soc_acpi_intel_haswell_machines" [sound/soc/intel/common/snd-soc-sst-acpi.ko] undefined! ERROR: "snd_soc_acpi_intel_cherrytrail_machines" [sound/soc/intel/atom/sst/snd-intel-sst-acpi.ko] undefined! ERROR: "snd_soc_acpi_intel_baytrail_machines" [sound/soc/intel/atom/sst/snd-intel-sst-acpi.ko] undefined! The problem here is that the sound/soc/intel/common/ directory is then entered only for building modules, but the sst-acpi.o never gets built since it depends on a built-in Kconfig symbol. That configuration obviously makes no sense since all options below SND_SOC_INTEL_MACH also depend on something else that in turn depends on CONFIG_SND_SOC_INTEL_COMMON. Adding a SND_SOC_INTEL_SST_TOPLEVEL dependency to SND_SOC_INTEL_MACH solves the build error. I notice we can also consolidate the 'depends on SND_SOC_INTEL_MACH' lines by using an 'if' block to simplify it further and make sure the configuration stays sane. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-By: Vinod Koul <vinod.koul@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: Intel: improve DMADEVICES dependencyArnd Bergmann
As pointed out by Pierre-Louis Bossart, the dependency I added was broader than necessary, only Baytrail and Haswell/Broadwell actually need it, the others don't. At the same time, we have individual entries for the codecs that all have the 'select' statement but now don't need it any more. Fixes: f7a88db6fffd ("ASoC: Intel: fix Kconfig dependencies") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: amd: Report accurate hw_ptr during dmaVijendar Mukunda
Using hw register to read transmitted byte count and report accordingly the hw pointer. TEST= modprobe snd-soc-acp-pcm.ko modprobe snd-soc-acp-rt5645.ko aplay <file> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: Akshu Agrawal <Akshu.Agrawal@amd.com> Tested-by: Akshu Agrawal <akshu.agrawal@amd.com> Reviewed-by: Jason Clinton <jclinton@chromium.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: rt5514-spi: Let the buf_size to align with period_bytesOder Chiou
The patch lets the buf_size to align with period_bytes to prevent the buffer reading over the real size of the DSP buffer and also avoid to calculate the wrong size of remaining data. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-08ASoC: pcm512x: Scrub my work address from the driverMark Brown
It's difficult for me to handle upstream mail that ends up in my work account and this was done outside of work anyway so replace my work address with my usual address for upstream stuff. Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-07ALSA: seq: Fix OSS sysex delivery in OSS emulationTakashi Iwai
The SYSEX event delivery in OSS sequencer emulation assumed that the event is encoded in the variable-length data with the straight buffering. This was the normal behavior in the past, but during the development, the chained buffers were introduced for carrying more data, while the OSS code was left intact. As a result, when a SYSEX event with the chained buffer data is passed to OSS sequencer port, it may end up with the wrong memory access, as if it were having a too large buffer. This patch addresses the bug, by applying the buffer data expansion by the generic snd_seq_dump_var_event() helper function. Reported-by: syzbot <syzkaller@googlegroups.com> Reported-by: Mark Salyzyn <salyzyn@android.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-07Merge branch 'linus' into locking/core, to resolve conflictsIngo Molnar
Conflicts: include/linux/compiler-clang.h include/linux/compiler-gcc.h include/linux/compiler-intel.h include/uapi/linux/stddef.h Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-11-06ASoC: stm32: spdifrx: fix control DMA error managementolivier moysan
Fix DMA channel request error handling. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-06ASoC: stm32: spdifrx: fix 16 bits captureolivier moysan
Change DMA bus width to manage properly 16 bits packed format. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-06ALSA: ice1712: define i2c eeprom addr to header fileKonstantinos Tsimpoukas
Signed-off-by: Konstantinos Tsimpoukas <kostaslinuxxx@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-06Merge branch 'topic/usb-ep-check-v2' into for-nextTakashi Iwai
Pull another fix of URB EP type check. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-06ALSA: usx2y: Fix invalid stream URBsTakashi Iwai
The us122l driver creates URBs per the fixed endpoints, and this may end up with URBs with inconsistent pipes when a fuzzer or a malicious program deals with the manipulated endpoints. It ends up with a kernel warning like: usb 1-1: BOGUS urb xfer, pipe 0 != type 3 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 24 at drivers/usb/core/urb.c:471 usb_submit_urb+0x113e/0x1400 Call Trace: usb_stream_start+0x48a/0x9f0 sound/usb/usx2y/usb_stream.c:690 us122l_start+0x116/0x290 sound/usb/usx2y/us122l.c:365 us122l_create_card sound/usb/usx2y/us122l.c:502 us122l_usb_probe sound/usb/usx2y/us122l.c:588 .... For avoiding the bad access, this patch adds a few sanity checks of the validity of created URBs like previous similar fixes using the new usb_urb_ep_type_check() helper function. Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-06ASoC: rsnd: return -EIO if rsnd_dmaen_request_channel() failedKuninori Morimoto
PTR_ERR(NULL) is success. Normally when a function returns both NULL and error pointers, it means that NULL is not a error. But, rsnd_dmaen_request_channel() returns NULL if requested resource was failed. Let's return -EIO if rsnd_dmaen_request_channel() was failed on rsnd_dmaen_nolock_start(). This patch fixes commit edce5c496c6a ("ASoC: rsnd: Request/Release DMA channel eachtime") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-06ALSA: timer: Limit max instances per timerTakashi Iwai
Currently we allow unlimited number of timer instances, and it may bring the system hogging way too much CPU when too many timer instances are opened and processed concurrently. This may end up with a soft-lockup report as triggered by syzkaller, especially when hrtimer backend is deployed. Since such insane number of instances aren't demanded by the normal use case of ALSA sequencer and it merely opens a risk only for abuse, this patch introduces the upper limit for the number of instances per timer backend. As default, it's set to 1000, but for the fine-grained timer like hrtimer, it's set to 100. Reported-by: syzbot Tested-by: Jérôme Glisse <jglisse@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-03ASoC: wm8741: Fix setting BCLK and LRCLK polaritySergej Sawazki
After checking the code and the datasheet, it seems like we are handling the clock inversion (SND_SOC_DAIFMT_NB_IF and SND_SOC_DAIFMT_IB_IF) not correctly. >From the datasheet (Table 58): R5 Format Control, BITS[5:4], [BCP:LRP]: (0) 00 = normal BCLK, normal LRCLK (1) 01 = normal BCLK, inverted LRCLK <-- Fix this (2) 10 = inverted BCLK, normal LRCLK (3) 11 = inverted BCLK, inverted LRCLK <-- Fix this Signed-off-by: Sergej Sawazki <sergej@taudac.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>