summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2017-09-27Merge remote-tracking branch 'fslc/4.1-2.0.x-imx' into toradex_4.1-2.0.x-imxMax Krummenacher
2017-09-22Merge tag 'v4.1.44' into 4.1-2.0.x-imxOtavio Salvador
Linux 4.1.44 * tag 'v4.1.44': (180 commits) Linux 4.1.44 mtd: fsl-quadspi: fix macro collision problems with READ/WRITE pinctrl: samsung: Remove bogus irq_[un]mask from resource management pinctrl: sunxi: add a missing function of A10/A20 pinctrl driver pnfs/blocklayout: require 64-bit sector_t iio: adc: vf610_adc: Fix VALT selection value for REFSEL bits usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume usb: quirks: Add no-lpm quirk for Moshi USB to Ethernet Adapter USB: Check for dropped connection before switching to full speed uas: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069 iio: light: tsl2563: use correct event code staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read USB: hcd: Mark secondary HCD as dead if the primary one died USB: serial: pl2303: add new ATEN device id USB: serial: cp210x: add support for Qivicon USB ZigBee dongle USB: serial: option: add D-Link DWM-222 device ID nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays fuse: initialize the flock flag in fuse_file on allocation iscsi-target: Fix iscsi_np reset hung task during parallel delete iscsi-target: fix memory leak in iscsit_setup_text_cmd() ... Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2017-09-10ASoC: do not close shared backend dailinkBanajit Goswami
[ Upstream commit b1cd2e34c69a2f3988786af451b6e17967c293a0 ] Multiple frontend dailinks may be connected to a backend dailink at the same time. When one of frontend dailinks is closed, the associated backend dailink should not be closed if it is connected to other active frontend dailinks. Change ensures that backend dailink is closed only after all connected frontend dailinks are closed. Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org> Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by: Patrick Lai <plai@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-09-10ALSA: hda - Fix speaker output from VAIO VPCL14M1RSergei A. Trusov
[ Upstream commit 3f3c371421e601fa93b6cb7fb52da9ad59ec90b4 ] Sony VAIO VPCL14M1R needs the quirk to make the speaker working properly. Tested-by: Dmitriy <mexx400@yandex.ru> Cc: <stable@vger.kernel.org> Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-09-10ASoC: dpcm: Avoid putting stream state to STOP when FE stream is pausedPatrick Lai
[ Upstream commit 9f169b9f52a4afccdab7a7d2311b0c53a78a1e6b ] When multiple front-ends are using the same back-end, putting state of a front-end to STOP state upon receiving pause command will result in backend stream getting released by DPCM framework unintentionally. In order to avoid backend to be released when another active front-end stream is present, put the stream state to PAUSED state instead of STOP state. Signed-off-by: Patrick Lai <plai@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-09-10ALSA: usb-audio: test EP_FLAG_RUNNING at urb completionIoan-Adrian Ratiu
[ Upstream commit 13a6c8328e6056932dc680e447d4c5e8ad9add17 ] Testing EP_FLAG_RUNNING in snd_complete_urb() before running the completion logic allows us to save a few cpu cycles by returning early, skipping the pending urb in case the stream was stopped; the stop logic handles the urb and sets the completion callbacks to NULL. Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-09-10ASoC: tlv320aic3x: Mark the RESET register as volatilePeter Ujfalusi
[ Upstream commit 63c3194b82530bd71fd49db84eb7ab656b8d404a ] The RESET register only have one self clearing bit and it should not be cached. If it is cached, when we sync the registers back to the chip we will initiate a software reset as well, which is not desirable. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-09-10ASoC: compress: Derive substream from stream based on directionSatish Babu Patakokila
[ Upstream commit 01b8cedfd0422326caae308641dcadaa85e0ca72 ] Currently compress driver hardcodes direction as playback to get substream from the stream. This results in getting the incorrect substream for compressed capture usecase. To fix this, remove the hardcoding and derive substream based on the stream direction. Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org> Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-08-06Merge tag 'v4.1.43' into 4.1-2.0.x-imxOtavio Salvador
Linux 4.1.43 * tag 'v4.1.43': (182 commits) Linux 4.1.43 HID: core: prevent out-of-bound readings ipvs: SNAT packet replies only for NATed connections Revert "dmaengine: ep93xx: Don't drain the transfers in terminate_all()" staging: comedi: ni_mio_common: fix E series ni_ai_insn_read() data kvm: vmx: Do not disable intercepts for BNDCFGS tracing: Use SOFTIRQ_OFFSET for softirq dectection for more accurate results PM / QoS: return -EINVAL for bogus strings sched/topology: Optimize build_group_mask() sched/topology: Fix overlapping sched_group_mask crypto: caam - fix signals handling crypto: atmel - only treat EBUSY as transient if backlog crypto: talitos - Extend max key length for SHA384/512-HMAC and AEAD Add "shutdown" to "struct class". mnt: Make propagate_umount less slow for overlapping mount propagation trees mnt: In propgate_umount handle visiting mounts in any order mnt: In umount propagation reparent in a separate pass vt: fix unchecked __put_user() in tioclinux ioctls exec: Limit arg stack to at most 75% of _STK_LIM s390: reduce ELF_ET_DYN_BASE ...
2017-07-31ALSA: hda - set input_path bitmap to zero after moving it to new placeHui Wang
[ Upstream commit a8f20fd25bdce81a8e41767c39f456d346b63427 ] Recently we met a problem, the codec has valid adcs and input pins, and they can form valid input paths, but the driver does not build valid controls for them like "Mic boost", "Capture Volume" and "Capture Switch". Through debugging, I found the driver needs to shrink the invalid adcs and input paths for this machine, so it will move the whole column bitmap value to the previous column, after moving it, the driver forgets to set the original column bitmap value to zero, as a result, the driver will invalidate the path whose index value is the original colume bitmap value. After executing this function, all valid input paths are invalidated by a mistake, there are no any valid input paths, so the driver won't build controls for them. Fixes: 3a65bcdc577a ("ALSA: hda - Fix inconsistent input_paths after ADC reduction") Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-07-10Merge tag 'v4.1.42' into 4.1-2.0.x-imxOtavio Salvador
Linux 4.1.42 * tag 'v4.1.42': (146 commits) Linux 4.1.42 mm: fix new crash in unmapped_area_topdown() mm: larger stack guard gap, between vmas alarmtimer: Rate limit periodic intervals MIPS: Fix bnezc/jialc return address calculation usb: dwc3: exynos fix axius clock error path to do cleanup genirq: Release resources in __setup_irq() error path swap: cond_resched in swap_cgroup_prepare() mm/memory-failure.c: use compound_head() flags for huge pages USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead of IS_ERR() usb: r8a66597-hcd: decrease timeout usb: r8a66597-hcd: select a different endpoint on timeout USB: gadget: dummy_hcd: fix hub-descriptor removable fields [media] pvrusb2: reduce stack usage pvr2_eeprom_analyze() usb: core: fix potential memory leak in error path during hcd creation USB: hub: fix SS max number of ports iio: proximity: as3935: recalibrate RCO after resume staging: rtl8188eu: prevent an underflow in rtw_check_beacon_data() ...
2017-06-25ASoC: Fix use-after-free at card unregistrationTakashi Iwai
[ Upstream commit 4efda5f2130da033aeedc5b3205569893b910de2 ] soc_cleanup_card_resources() call snd_card_free() at the last of its procedure. This turned out to lead to a use-after-free. PCM runtimes have been already removed via soc_remove_pcm_runtimes(), while it's dereferenced later in soc_pcm_free() called via snd_card_free(). The fix is simple: just move the snd_card_free() call to the beginning of the whole procedure. This also gives another benefit: it guarantees that all operations have been shut down before actually releasing the resources, which was racy until now. Reported-and-tested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-06-25ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECTTakashi Iwai
[ Upstream commit ba3021b2c79b2fa9114f92790a99deb27a65b728 ] snd_timer_user_tselect() reallocates the queue buffer dynamically, but it forgot to reset its indices. Since the read may happen concurrently with ioctl and snd_timer_user_tselect() allocates the buffer via kmalloc(), this may lead to the leak of uninitialized kernel-space data, as spotted via KMSAN: BUG: KMSAN: use of unitialized memory in snd_timer_user_read+0x6c4/0xa10 CPU: 0 PID: 1037 Comm: probe Not tainted 4.11.0-rc5+ #2739 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 dump_stack+0x143/0x1b0 lib/dump_stack.c:52 kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:1007 kmsan_check_memory+0xc2/0x140 mm/kmsan/kmsan.c:1086 copy_to_user ./arch/x86/include/asm/uaccess.h:725 snd_timer_user_read+0x6c4/0xa10 sound/core/timer.c:2004 do_loop_readv_writev fs/read_write.c:716 __do_readv_writev+0x94c/0x1380 fs/read_write.c:864 do_readv_writev fs/read_write.c:894 vfs_readv fs/read_write.c:908 do_readv+0x52a/0x5d0 fs/read_write.c:934 SYSC_readv+0xb6/0xd0 fs/read_write.c:1021 SyS_readv+0x87/0xb0 fs/read_write.c:1018 This patch adds the missing reset of queue indices. Together with the previous fix for the ioctl/read race, we cover the whole problem. Reported-by: Alexander Potapenko <glider@google.com> Tested-by: Alexander Potapenko <glider@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-06-25ALSA: timer: Fix race between read and ioctlTakashi Iwai
[ Upstream commit d11662f4f798b50d8c8743f433842c3e40fe3378 ] The read from ALSA timer device, the function snd_timer_user_tread(), may access to an uninitialized struct snd_timer_user fields when the read is concurrently performed while the ioctl like snd_timer_user_tselect() is invoked. We have already fixed the races among ioctls via a mutex, but we seem to have forgotten the race between read vs ioctl. This patch simply applies (more exactly extends the already applied range of) tu->ioctl_lock in snd_timer_user_tread() for closing the race window. Reported-by: Alexander Potapenko <glider@google.com> Tested-by: Alexander Potapenko <glider@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-06-17Merge remote-tracking branch 'fslc/4.1-2.0.x-imx' into ↵Marcel Ziswiler
toradex_4.1-2.0.x-imx-next Conflicts: arch/arm/boot/dts/imx7d.dtsi arch/arm/mach-imx/busfreq-imx.c arch/arm/mach-imx/imx_rpmsg.c drivers/mmc/host/sdhci-esdhc-imx.c Parts moved to: arch/arm/boot/dts/imx7s.dtsi Note: This also includes NXP's latest rel_imx_4.1.15_2.1.0_ga.
2017-06-17Merge tag 'v4.1.41' into 4.1-2.0.x-imxOtavio Salvador
Linux 4.1.41 * tag 'v4.1.41': (473 commits) Linux 4.1.41 mm/huge_memory.c: respect FOLL_FORCE/FOLL_COW for thp xc2028: Fix use-after-free bug properly iio: proximity: as3935: fix as3935_write ipx: call ipxitf_put() in ioctl error path sched/fair: Initialize throttle_count for new task-groups lazily sched/fair: Do not announce throttled next buddy in dequeue_task_fair() iio: dac: ad7303: fix channel description mwifiex: pcie: fix cmd_buf use-after-free in remove/reset rtlwifi: rtl8821ae: setup 8812ae RFE according to device type ARM: tegra: paz00: Mark panel regulator as enabled on boot fs/xattr.c: zero out memory copied to userspace in getxattr vfio/type1: Remove locked page accounting workqueue crypto: algif_aead - Require setkey before accept(2) staging: gdm724x: gdm_mux: fix use-after-free on module unload drm/ttm: fix use-after-free races in vm fault handling f2fs: sanity check segment count ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf ipv6: initialize route null entry in addrconf_init() rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string ... Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2017-06-17Merge remote-tracking branch 'imx/imx_4.1.15_2.0.0_ga' into 4.1-2.0.x-imxOtavio Salvador
* imx/imx_4.1.15_2.0.0_ga: (157 commits) MLK-14762 ARM: dts: imx6sll-evk: correct gpio pin for lcd power control MLK-14285-3 usb: phy: mxs: optimize disconnect line condition MLK-14285-2 usb: chipidea: set mode for usb phy driver MLK-14285-1 usb: phy: add usb mode for usb_phy MLK-14747 driver: cpufreq: Correct dc regulator voltage on imx6ull MLK-14720 epdc: correct WFE setting when bypass legacy process MLK-13801-02 ARM: dts: Correct the gpt timer clock source on imx6ul/ull/sll MLK-13801-01 ARM: imx: add gpt_3m clock on imx6sll MLK-14680 pxp/epdc: add LUT cancellation feature MLK-14518-2 pxp: set data path for pxp after reset MLK-14518-1 pxp: initialize pxp according to recommended flow MLK-14516 epdc: bypass pxp legacy process when there's no transformation MLK-14369 epdc: sync LUT status to PXP before enable collision detection MLK-13198 pxp: imx7d: fix error histogram status report issue MLK-13917 pxp: fix build error for pxp library in user space MLK-13862-2 epdc/pxp: imx6ull/imx6sll: enhance the LUT cleanup flow to avoid stalling display MLK-13862-1 epdc/pxp: imx7d: enhance the LUT cleanup flow to avoid stalling display MLK-14697 ARM: dts: imx: update the setpoint data of imx6sll MXSCM-266 arm: dts: increase lpddr2 voltage to 1.25V MXSCM-265: dts: place imx6sxscm dtb files under CONFIG_SOC_IMX6SX ...
2017-06-13ALSA: hda - Fix deadlock of controller device lock at unbindingTakashi Iwai
[ Upstream commit ab949d519601880fd46e8bc1445d6a453bf2dc09 ] Imre Deak reported a deadlock of HD-audio driver at unbinding while it's still in probing. Since we probe the codecs asynchronously in a work, the codec driver probe may still be kicked off while the controller itself is being unbound. And, azx_remove() tries to process all pending tasks via cancel_work_sync() for fixing the other races (see commit [0b8c82190c12: ALSA: hda - Cancel probe work instead of flush at remove]), now we may meet a bizarre deadlock: Unbind snd_hda_intel via sysfs: device_release_driver() -> device_lock(snd_hda_intel) -> azx_remove() -> cancel_work_sync(azx_probe_work) azx_probe_work(): codec driver probe() -> __driver_attach() -> device_lock(snd_hda_intel) This deadlock is caused by the fact that both device_release_driver() and driver_probe_device() take both the device and its parent locks at the same time. The codec device sets the controller device as its parent, and this lock is taken before the probe() callback is called, while the controller remove() callback gets called also with the same lock. In this patch, as an ugly workaround, we unlock the controller device temporarily during cancel_work_sync() call. The race against another bind call should be still suppressed by the parent's device lock. Reported-by: Imre Deak <imre.deak@intel.com> Fixes: 0b8c82190c12 ("ALSA: hda - Cancel probe work instead of flush at remove") Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-06-13ALSA: ppc/awacs: shut up maybe-uninitialized warningArnd Bergmann
[ Upstream commit b268c34e5ee92a4cc3099b0caaf26e6bfbdf0f18 ] The awacs sound driver produces a false-positive warning in ppc64_defconfig: sound/ppc/awacs.c: In function 'snd_pmac_awacs_init': include/sound/control.h:219:9: warning: 'master_vol' may be used uninitialized in this function [-Wmaybe-uninitialized] I haven't come up with a good way to rewrite the code to avoid the warning, so here is a bad one: I initialize the variable before the conditionall initialization so gcc no longer has to worry about it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-06-08ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430Alexander Tsoy
[ Upstream commit 1fc2e41f7af4572b07190f9dec28396b418e9a36 ] This model is actually called 92XXM2-8 in Windows driver. But since pin configs for M22 and M28 are identical, just reuse M22 quirk. Fixes external microphone (tested) and probably docking station ports (not tested). Signed-off-by: Alexander Tsoy <alexander@tsoy.me> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-30sgtl5000: improve switch on vag power for line_in -> outputMax Krummenacher
Commit '3e3ea9ba80e8 sgtl5000: switch on vag power for line_in -> output' switched on VAG power when using a direct connection from line_in -> headphone output, but it did not switch it off when switching back to DAC -> HP. Additionally with commit 'abff9e8b0ddf ASoC: sgtl5000: fix VAG power up timing' the combination of the two commits introduced a pop on the headphone when using DAC -> HP. Detect the HP muxing state differently and thus address both issues. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-30ASoC: sgtl5000: Allow LRCLK pad drive strength to be changedFabio Estevam
Introduce the "lrclk-strength" property to allow LRCLK pad drive strength to be changed via device tree. When running a stress playback loop test on a mx6dl wandboard channel swap can be noticed on about 10% of the times. While debugging this issue I noticed that when probing the SGTL5000 LRCLK pin with the scope the swap did not happen. After removing the probe the swap started to happen again. After changing the LRCLK pad drive strength to the maximum value the issue is gone. Same fix works on a mx6dl Colibri board as well. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Tested-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 570c70a60f53ca737ead4e5966c446bf0d39fac9) Conflicts: Documentation/devicetree/bindings/sound/sgtl5000.txt
2017-05-30ASoC: sgtl5000: add headphone and LINEOUT mute controlsRichard Leitner
These controls mute/unmute the LINEOUT and headphone outputs of SGTL5000 using its CHIP_ANA_CTRL register. Signed-off-by: Richard Leitner <dev@g0hl1n.net> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 904a987345258ff95892685bcc4462f18ac259cd)
2017-05-30sgtl5000: add Lineout volume controlKalle Kankare
This controls the volume for the line out pins of SGTL5000. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 0593d4612146dc16ff6bd23423bdd434dd7b8c7b)
2017-05-30ASoC: sgtl5000: Do not disable regulators in SND_SOC_BIAS_OFFEric Nelson
Disabling the SGTL5000 through regulators would certainly save more power than simply disabling the reference voltages as described in the data sheet, but won't properly restore things on resume. This driver does not support active regulators. So we simply disable the reference bias currents. Signed-off-by: Eric Nelson <eric@nelint.com> Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 8419caa7270291e26f8b34b12b29680586c85d30)
2017-05-30ASoC: sgtl5000: Disable internal PLL earlyEric Nelson
To handle the soft reboot case, the internal PLL must be disabled in SGTL5000_CHIP_CLK_CTRL before clearing bits SGTL5000_VCOAMP_POWERUP and SGTL5000_PLL_POWERUP in register SGTL5000_CHIP_ANA_POWER. Signed-off-by: Eric Nelson <eric@nelint.com> Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Tested-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 08dea16e0960ea5caf7876045b747145cb677096)
2017-05-30ASoC: sgtl5000: Initialize CHIP_ANA_POWER to power-on defaultsEric Nelson
Initialize CHIP_ANA_POWER to match power on defaults, which disables ADC, DAC, and charge pumps. In the process, remove references to the following register/bitfields from the sgtl5000_set_power_regs routine: CHIP_ANA_POWER/LINREG_SIMPLE_POWERUP and CHIP_LINREG_CTRL/LINREG_VDD_MASK And remove CHIP_ANA_POWER and CHIP_LINREG_CTRL from the set of default registers so they don't get clobbered by sgtl5000_fill_defaults(). Signed-off-by: Eric Nelson <eric@nelint.com> Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Tested-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 3d632cc87204b51a4b32bdaa970fe6b8d879347e)
2017-05-30ASoC: sgtl5000: Write all default registersEric Nelson
If an error occurs writing defaults, produce an error message but continue writing other registers. The failure of a single write should not cause catastrophic device failure. In at least one occurrence, I2C writes of CHIP_ANA_POWER were nacked, though continuing allowed the device to operate properly. Signed-off-by: Eric Nelson <eric@nelint.com> Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Tested-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit f219b16959ee3df2fd49f09493b3f6b28487c416)
2017-05-30ASoC: sgtl5000: Fix regulator supportEric Nelson
Regulator support on SGTL5000 is broken because the VDDIO and VDDA and VDDD should be powered on before enabling MCLK as shown in Figure 4 of [1]. This requires moving control of the regulators from the codec block to the I2C block of the driver. The bulk of this patch consists of swapping the codec device with the i2c client. The new field num_supplies in struct sgtl5000_priv is used instead of ARRAY_SIZE(supplies) to handle the special case when the internal LDO is used instead of external VDDD. Note that ER1 in the SGTL5000 Errata document [2] suggests that all designs should use external VDDD. Since the internal LDO can only be enabled after I2C is available, there's no benefit in treating it as a regulator, so this patch removes the regulator structure surrounding it. Instead, a single block of code in sgtl5000_i2c_probe() performs the initialization sequence in section 2.2.1.1 of [3] and page 26 of [1]. References: [1] SGTL5000 data sheet http://cache.nxp.com/files/analog/doc/data_sheet/SGTL5000.pdf [2] SGTL5000 errata http://cache.nxp.com/files/analog/doc/errata/SGTL5000ER.pdf [3] SGTL5000 Initialization and programming app note http://cache.nxp.com/files/analog/doc/app_note/AN3663.pdf Signed-off-by: Eric Nelson <eric@nelint.com> Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Tested-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 940adb280d23512965409c1fd6b42cc796ce6eb8)
2017-05-30ASoC: sgtl5000: Remove misleading commentClemens Gruber
All new designs should use external VDDD according to official documentation. See ER1 in errata sheet: http://cache.nxp.com/files/analog/doc/errata/SGTL5000ER.pdf Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Tested-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 7e74436410a9a74f41f3be9cc45b504e83544f60)
2017-05-30ASoC: sgtl5000: fix VAG power up timingJean-Michel Hautbois
When power up, a "pop" is heard on line-in and mic-in. An analysis of the PCM shows it lasts ~400ms and looks like a filter response. VAG power up should be delayed by 400ms as VAG power down is. Signed-off-by: Jean-Michel Hautbois <jean-michel.hautbois@veo-labs.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit c803cc2dcd722e08020c1ba63bb5ceece4a19fdb)
2017-05-30ASoC: sgtl5000: fix error message output for MicBias voltageGianluca Renzi
Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Takashi Iwai <tiwai@suse.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Gianluca Renzi <gianlucarenzi@eurekelettronica.it> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit fb97d75b038659998257f7dd767d8229dce50b74)
2017-05-30ASoC: sgtl5000: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen
The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 8533eb24a9515c2a9e6779cfd377ab0c46ed8a77) cherry-picked to have less conflicts for other cherry-picks. Provide required function locally.
2017-05-30ASoC: sgtl5000: Calculate Lineout Channel Output LevelAlexander Stein
Currently LO_VOL_* stays at it's default (0x4 each) but this should be calculated after setting VAG_VAL and LO_VAGCNTRL. LO_VOL_* = 40 * log10(VAG_VAL / LO_VAGCNTRL) + 15 To avoid the log10 operation a table for all valid register values is precalculated which contains the corresponding value (VAG_VAL * 100 / LO_VAGCNTRL). Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 1f39d9397f8a27becd2b72009865610a71c64b0f)
2017-05-30ASoC: sgtl5000: Use specific variable for lo_vagAlexander Stein
This is a preparation for calculating lo_vol which needs both vag and lo_vag. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit d2b7c2aaf7b565532c7d9937519b199fbca4a779)
2017-05-30Revert "ASoC: sgtl5000: Allow LRCLK pad drive strength to be changed"Max Krummenacher
This reverts commit 56b32850e08f94d5a5db28454ffce7aeb4ca6be9. revert this to get be able to cherry-pick the mainlined patch Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-17ASoC: intel: Fix PM and non-atomic crash in bytcr driversTakashi Iwai
[ Upstream commit 6e4cac23c5a648d50b107d1b53e9c4e1120c7943 ] The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior. Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like: BUG: scheduling while atomic: systemd-sleep/3144/0x00000003 Call Trace: dump_stack+0x5c/0x7a __schedule_bug+0x55/0x70 __schedule+0x63c/0x8c0 schedule+0x3d/0x90 schedule_timeout+0x16b/0x320 ? del_timer_sync+0x50/0x50 ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core] ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core] ? remove_wait_queue+0x60/0x60 ? sst_prepare_and_post_msg+0x275/0x960 [snd_intel_sst_core] ? sst_pause_stream+0x9b/0x110 [snd_intel_sst_core] .... This patch addresses these appropriately, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org> # v4.1+ Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: seq: Don't break snd_use_lock_sync() loop by timeoutTakashi Iwai
[ Upstream commit 4e7655fd4f47c23e5249ea260dc802f909a64611 ] The snd_use_lock_sync() (thus its implementation snd_use_lock_sync_helper()) has the 5 seconds timeout to break out of the sync loop. It was introduced from the beginning, just to be "safer", in terms of avoiding the stupid bugs. However, as Ben Hutchings suggested, this timeout rather introduces a potential leak or use-after-free that was apparently fixed by the commit 2d7d54002e39 ("ALSA: seq: Fix race during FIFO resize"): for example, snd_seq_fifo_event_in() -> snd_seq_event_dup() -> copy_from_user() could block for a long time, and snd_use_lock_sync() goes timeout and still leaves the cell at releasing the pool. For fixing such a problem, we remove the break by the timeout while still keeping the warning. Suggested-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: hda - fix a problem for lineout on a Dell AIO machineHui Wang
[ Upstream commit 2f726aec19a9d2c63bec9a8a53a3910ffdcd09f8 ] On this Dell AIO machine, the lineout jack does not work. We found the pin 0x1a is assigned to lineout on this machine, and in the past, we applied ALC298_FIXUP_DELL1_MIC_NO_PRESENCE to fix the heaset-set mic problem for this machine, this fixup will redefine the pin 0x1a to headphone-mic, as a result the lineout doesn't work anymore. After consulting with Dell, they told us this machine doesn't support microphone via headset jack, so we add a new fixup which only defines the pin 0x18 as the headset-mic. [rearranged the fixup insertion position by tiwai in order to make the merge with other branches easier -- tiwai] Fixes: 59ec4b57bcae ("ALSA: hda - Fix headset mic detection problem for two dell machines") Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: seq: Fix race during FIFO resizeTakashi Iwai
[ Upstream commit 2d7d54002e396c180db0c800c1046f0a3c471597 ] When a new event is queued while processing to resize the FIFO in snd_seq_fifo_clear(), it may lead to a use-after-free, as the old pool that is being queued gets removed. For avoiding this race, we need to close the pool to be deleted and sync its usage before actually deleting it. The issue was spotted by syzkaller. Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: seq: Fix racy cell insertions during snd_seq_pool_done()Takashi Iwai
[ Upstream commit c520ff3d03f0b5db7146d9beed6373ad5d2a5e0e ] When snd_seq_pool_done() is called, it marks the closing flag to refuse the further cell insertions. But snd_seq_pool_done() itself doesn't clear the cells but just waits until all cells are cleared by the caller side. That is, it's racy, and this leads to the endless stall as syzkaller spotted. This patch addresses the racy by splitting the setup of pool->closing flag out of snd_seq_pool_done(), and calling it properly before snd_seq_pool_done(). BugLink: http://lkml.kernel.org/r/CACT4Y+aqqy8bZA1fFieifNxR2fAfFQQABcBHj801+u5ePV0URw@mail.gmail.com Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: seq: Fix link corruption by event error handlingTakashi Iwai
[ Upstream commit f3ac9f737603da80c2da3e84b89e74429836bb6d ] The sequencer FIFO management has a bug that may lead to a corruption (shortage) of the cell linked list. When a sequencer client faces an error at the event delivery, it tries to put back the dequeued cell. When the first queue was put back, this forgot the tail pointer tracking, and the link will be screwed up. Although there is no memory corruption, the sequencer client may stall forever at exit while flushing the pending FIFO cells in snd_seq_pool_done(), as spotted by syzkaller. This patch addresses the missing tail pointer tracking at snd_seq_fifo_cell_putback(). Also the patch makes sure to clear the cell->enxt pointer at snd_seq_fifo_event_in() for avoiding a similar mess-up of the FIFO linked list. Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: hda - Add subwoofer support for Dell Inspiron 17 7000 GamingTakashi Iwai
[ Upstream commit 493de342748cc6f52938096f5480cf291da58a0b ] Dell Inspiron 17 7000 Gaming laptop needs a similar quirk like Inspiron 7599 to support its subwoofer speaker. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=194191 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: timer: Reject user params with too small ticksTakashi Iwai
[ Upstream commit 71321eb3f2d0df4e6c327e0b936eec4458a12054 ] When a user sets a too small ticks with a fine-grained timer like hrtimer, the kernel tries to fire up the timer irq too frequently. This may lead to the condensed locks, eventually the kernel spinlock lockup with warnings. For avoiding such a situation, we define a lower limit of the resolution, namely 1ms. When the user passes a too small tick value that results in less than that, the kernel returns -EINVAL now. Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: hda - Fix micmute hotkey problem for a lenovo AIO machineHui Wang
[ Upstream commit 29693efcea0f38cf40d0055d2401490a4f9bf8be ] On this machine, the micmute button is connected to Line2 of the codec and the micmute led is connected to GPIO2 of the codec. After applying this quirk, both hotkey and led work well. Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-05-17ALSA: hda - fix Lewisburg audio issueJaroslav Kysela
[ Upstream commit e7480b34ad1ab84a63540b2c884cb92c0764ab74 ] Like for Sunrise Point, the total stream number of Lewisburg's input and output stream exceeds 15 (GCAP is 0x9701), which will cause some streams do not work because of the overflow on SDxCTL.STRM field if using the legacy stream tag allocation method. Fixes: 5cf92c8b3dc5 ("ALSA: hda - Add Intel Lewisburg device IDs Audio") Signed-off-by: Jaroslav Kysela <perex@perex.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
2017-04-05ASoC: sgtl5000: Allow LRCLK pad drive strength to be changedFabio Estevam
Introduce the "lrclk-strength" property to allow LRCLK pad drive strength to be changed via device tree. When running a stress playback loop test on a mx6dl wandboard channel swap can be noticed on about 10% of the times. While debugging this issue I noticed that when probing the SGTL5000 LRCLK pin with the scope the swap did not happen. After removing the probe the swap started to happen again. After changing the LRCLK pad drive strength to the maximum value the issue is gone. Same fix works on a mx6dl Colibri board as well. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Backport from http://mailman.alsa-project.org/pipermail/alsa-devel/2017-April/119525.html Conflicts: Documentation/devicetree/bindings/sound/sgtl5000.txt sound/soc/codecs/sgtl5000.c Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2017-04-03sgtl5000: switch on vag power for line_in -> outputMax Krummenacher
The VAG power is switched off whenever there is no ADC or DAC activity resulting in a non functional local loop from line in to headphone out. Switch on VAG power or keep it on when line in gets directly connected to the output. TODO: when switching the muxer back to DAC switch the VAG power off if no recording or playing is happening. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-03-24Merge remote-tracking branch 'fslc/4.1-2.0.x-imx' into toradex_4.1-2.0.x-imxMax Krummenacher
2017-03-17Merge tag 'v4.1.39' into 4.1-2.0.x-imxOtavio Salvador
Linux 4.1.39 * tag 'v4.1.39': (138 commits) Linux 4.1.39 KVM: x86: remove data variable from kvm_get_msr_common KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX KVM: x86: pass host_initiated to functions that read MSRs perf/core: Fix the perf_cpu_time_max_percent check perf/core: Make sysctl_perf_cpu_time_max_percent conform to documentation perf/core: Fix implicitly enable dynamic interrupt throttle perf/core: Fix dynamic interrupt throttle Fix missing sanity check in /dev/sg printk: use rcuidle console tracepoint vfs: fix uninitialized flags in splice_to_pipe() drm/radeon: Use mode h/vdisplay fields to hide out of bounds HW cursor ARM: 8658/1: uaccess: fix zeroing of 64-bit get_user() drm/dp/mst: fix kernel oops when turning off secondary monitor [media] siano: make it work again with CONFIG_VMAP_STACK mmc: core: fix multi-bit bus width without high-speed mode futex: Move futex_init() to core_initcall xen-netfront: Delete rx_refill_timer in xennet_disconnect_backend() scsi: aacraid: Fix INTx/MSI-x issue with older controllers cpumask: use nr_cpumask_bits for parsing functions ... Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>