GitHub/moto-9609/android_kernel_motorola_exynos9610.git
7 years agoALSA: usx2y: Suppress kernel warning at page allocation failures
Takashi Iwai [Mon, 2 Oct 2017 12:06:43 +0000 (14:06 +0200)]
ALSA: usx2y: Suppress kernel warning at page allocation failures

The usx2y driver allocates the stream read/write buffers in continuous
pages depending on the stream setup, and this may spew the kernel
warning messages with a stack trace like:
  WARNING: CPU: 1 PID: 1846 at mm/page_alloc.c:3883
  __alloc_pages_slowpath+0x1ef2/0x2d70
  Modules linked in:
  CPU: 1 PID: 1846 Comm: kworker/1:2 Not tainted
  ....

It may confuse user as if it were any serious error, although this is
no fatal error and the driver handles the error case gracefully.
Since the driver has already some sanity check of the given size (128
and 256 pages), it can't pass any crazy value.  So it's merely page
fragmentation.

This patch adds __GFP_NOWARN to each caller for suppressing such
kernel warnings.  The original issue was spotted by syzkaller.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoRevert "ALSA: echoaudio: purge contradictions between dimension matrix members and...
Takashi Sakamoto [Tue, 26 Sep 2017 00:11:49 +0000 (09:11 +0900)]
Revert "ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members"

This reverts commit 275353bb684e to fix a regression which can abort
'alsactl' program in alsa-utils due to assertion in alsa-lib.

alsactl: control.c:2513: snd_ctl_elem_value_get_integer: Assertion `idx < sizeof(obj->value.integer.value) / sizeof(obj->value.integer.value[0])' failed.

alsactl: control.c:2976: snd_ctl_elem_value_get_integer: Assertion `idx < ARRAY_SIZE(obj->value.integer.value)' failed.

This commit is a band-aid. In a point of usage of ALSA control interface,
the drivers still bring an issue that they prevent userspace applications
to have a consistent way to parse each levels of the dimension information
via ALSA control interface.

Let me investigate this issue. Current implementation of the drivers
have three control element sets with dimension information:
 * 'Monitor Mixer Volume' (type: integer)
 * 'VMixer Volume' (type: integer)
 * 'VU-meters' (type: boolean)

Although the number of elements named as 'Monitor Mixer Volume' differs
depending on drivers in this group, it can be calculated by macros
defined by each driver (= (BX_NUM - BX_ANALOG_IN) * BX_ANALOG_IN). Each
of the elements has one member for value and has dimension information
with 2 levels (= BX_ANALOG_IN * (BX_NUM - BX_ANALOG_IN)). For these
elements, userspace applications are expected to handle the dimension
information so that all of the elements construct a matrix where the
number of rows and columns are represented by the dimension information.

The same way is applied to elements named as 'VMixer Volume'. The number
of these elements can also be calculated by macros defined by each
drivers (= PX_ANALOG_IN * BX_ANALOG_IN). Each of the element has one
member for value and has dimension information with 2 levels
(= BX_ANALOG_IN * PX_ANALOG_IN). All of the elements construct a matrix
with the dimension information.

An element named as 'VU-meters' gets a different way in a point of
dimension information. The element includes 96 members for value. The
element has dimension information with 3 levels (= 3 or 2 * 16 * 2). For
this element, userspace applications are expected to handle the dimension
information so that all of the members for value construct a matrix
where the number of rows and columns are represented by the dimension
information. This is different from the way for the former.

As a summary, the drivers were not designed to produce a consistent way to
parse the dimension information. This makes it hard for general userspace
applications such as amixer to parse the information by a consistent way,
and actually no userspace applications except for 'echomixer' utilize the
dimension information. Additionally, no drivers excluding this group use
the information.

The reverted commit was written based on the latter way. A commit
860c1994a70a ('ALSA: control: add dimension validator for userspace
elements') is written based on the latter way, too. The patch should be
reconsider too in the same time to re-define a consistent way to parse the
dimension information.

Reported-by: Mark Hills <mark@xwax.org>
Reported-by: S. Christian Collins <s.chriscollins@gmail.com>
Fixes: 275353bb684e ('ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members')
Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor
Takashi Iwai [Fri, 22 Sep 2017 14:18:53 +0000 (16:18 +0200)]
ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor

When a USB-audio device receives a maliciously adjusted or corrupted
buffer descriptor, the USB-audio driver may access an out-of-bounce
value at its parser.  This was detected by syzkaller, something like:

  BUG: KASAN: slab-out-of-bounds in usb_audio_probe+0x27b2/0x2ab0
  Read of size 1 at addr ffff88006b83a9e8 by task kworker/0:1/24
  CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.0-rc1-42251-gebb2c2437d80 #224
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
  Workqueue: usb_hub_wq hub_event
  Call Trace:
   __dump_stack lib/dump_stack.c:16
   dump_stack+0x292/0x395 lib/dump_stack.c:52
   print_address_description+0x78/0x280 mm/kasan/report.c:252
   kasan_report_error mm/kasan/report.c:351
   kasan_report+0x22f/0x340 mm/kasan/report.c:409
   __asan_report_load1_noabort+0x19/0x20 mm/kasan/report.c:427
   snd_usb_create_streams sound/usb/card.c:248
   usb_audio_probe+0x27b2/0x2ab0 sound/usb/card.c:605
   usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
   really_probe drivers/base/dd.c:413
   driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
   __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
   bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
   __device_attach+0x26e/0x3d0 drivers/base/dd.c:710
   device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
   bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
   device_add+0xd0b/0x1660 drivers/base/core.c:1835
   usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932
   generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174
   usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266
   really_probe drivers/base/dd.c:413
   driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
   __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
   bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
   __device_attach+0x26e/0x3d0 drivers/base/dd.c:710
   device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
   bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
   device_add+0xd0b/0x1660 drivers/base/core.c:1835
   usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457
   hub_port_connect drivers/usb/core/hub.c:4903
   hub_port_connect_change drivers/usb/core/hub.c:5009
   port_event drivers/usb/core/hub.c:5115
   hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195
   process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119
   worker_thread+0x221/0x1850 kernel/workqueue.c:2253
   kthread+0x3a1/0x470 kernel/kthread.c:231
   ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

This patch adds the checks of out-of-bounce accesses at appropriate
places and bails out when it goes out of the given buffer.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: pcm: Fix structure definition for X32 ABI
Baolin Wang [Thu, 21 Sep 2017 06:03:29 +0000 (14:03 +0800)]
ALSA: pcm: Fix structure definition for X32 ABI

X32 ABI uses the 64bit timespec in addition to 64bit alignment of 64bit
values. We have added compat ABI for these ioctls, but this patch adds
one missing padding into 'struct snd_pcm_mmap_status_x32' to fix
incompatibilities.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: usb-audio: Add sample rate quirk for Plantronics C310/C520-M
Kai-Heng Feng [Wed, 20 Sep 2017 01:21:40 +0000 (09:21 +0800)]
ALSA: usb-audio: Add sample rate quirk for Plantronics C310/C520-M

Like other Plantronics devices, C310 and C520-M do not support sample
rate reading. Add them to the sample rate quirk accordingly.

BugLink: https://bugs.launchpad.net/bugs/1708499
BugLink: https://bugs.launchpad.net/bugs/1709282
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: hda - program ICT bits to support HBR audio
Sriram Periyasamy [Tue, 19 Sep 2017 22:25:05 +0000 (17:25 -0500)]
ALSA: hda - program ICT bits to support HBR audio

On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake,
KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital
Converter Control #3 needs to be set explicitly for HDMI/DisplayPort
High Bit Rate (HBR) audio playback to work. This was not required in
earlier platforms when HBR was first introduced. The ICT bits are
defined in Section 7.3.3.9 of the HDaudio 1.0a specification.

Since the ICT bitfield was not specified for HDAudio 1.0 devices
(before 2009), we only program it on machines more recent than
Haswell.

We tested that this fix is not needed on Baytrail-I (MinnowBoard
Turbot) and believe by extension it also does not apply to Braswell.

[ Moved AC_VERB_SET_DIGI_CONVERT_3 definition to the right place
  by tiwai ]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797

Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: asihpi: fix a potential double-fetch bug when copying puhm
Meng Xu [Tue, 19 Sep 2017 05:21:56 +0000 (01:21 -0400)]
ALSA: asihpi: fix a potential double-fetch bug when copying puhm

The hm->h.size is intended to hold the actual size of the hm struct
that is copied from userspace and should always be <= sizeof(*hm).

However, after copy_from_user(hm, puhm, hm->h.size), since userspace
process has full control over the memory region pointed by puhm, it is
possible that the value of hm->h.size is different from what is fetched-in
previously (get_user(hm->h.size, (u16 __user *)puhm)). In other words,
hm->h.size is overriden and the relation between hm->h.size and the hm
struct is broken.

This patch proposes to use a seperate variable, msg_size, to hold
the value of the first fetch and override hm->h.size to msg_size
after the second fetch to maintain the relation.

Signed-off-by: Meng Xu <mengxu.gatech@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: compress: Remove unused variable
Guneshwor Singh [Thu, 14 Sep 2017 12:19:40 +0000 (17:49 +0530)]
ALSA: compress: Remove unused variable

Commit 04c5d5a430fc ("ALSA: compress: Embed struct device") removed
the statement that used 'str' but didn't remove the variable itself.
So remove it.

[Adding stable to Cc since pr_debug() may refer to the uninitialized
 buffer -- tiwai]

Fixes: 04c5d5a430fc ("ALSA: compress: Embed struct device")
Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: seq: Cancel pending autoload work at unbinding device
Takashi Iwai [Tue, 12 Sep 2017 10:41:20 +0000 (12:41 +0200)]
ALSA: seq: Cancel pending autoload work at unbinding device

ALSA sequencer core has a mechanism to load the enumerated devices
automatically, and it's performed in an off-load work.  This seems
causing some race when a sequencer is removed while the pending
autoload work is running.  As syzkaller spotted, it may lead to some
use-after-free:
  BUG: KASAN: use-after-free in snd_rawmidi_dev_seq_free+0x69/0x70
  sound/core/rawmidi.c:1617
  Write of size 8 at addr ffff88006c611d90 by task kworker/2:1/567

  CPU: 2 PID: 567 Comm: kworker/2:1 Not tainted 4.13.0+ #29
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
  Workqueue: events autoload_drivers
  Call Trace:
   __dump_stack lib/dump_stack.c:16 [inline]
   dump_stack+0x192/0x22c lib/dump_stack.c:52
   print_address_description+0x78/0x280 mm/kasan/report.c:252
   kasan_report_error mm/kasan/report.c:351 [inline]
   kasan_report+0x230/0x340 mm/kasan/report.c:409
   __asan_report_store8_noabort+0x1c/0x20 mm/kasan/report.c:435
   snd_rawmidi_dev_seq_free+0x69/0x70 sound/core/rawmidi.c:1617
   snd_seq_dev_release+0x4f/0x70 sound/core/seq_device.c:192
   device_release+0x13f/0x210 drivers/base/core.c:814
   kobject_cleanup lib/kobject.c:648 [inline]
   kobject_release lib/kobject.c:677 [inline]
   kref_put include/linux/kref.h:70 [inline]
   kobject_put+0x145/0x240 lib/kobject.c:694
   put_device+0x25/0x30 drivers/base/core.c:1799
   klist_devices_put+0x36/0x40 drivers/base/bus.c:827
   klist_next+0x264/0x4a0 lib/klist.c:403
   next_device drivers/base/bus.c:270 [inline]
   bus_for_each_dev+0x17e/0x210 drivers/base/bus.c:312
   autoload_drivers+0x3b/0x50 sound/core/seq_device.c:117
   process_one_work+0x9fb/0x1570 kernel/workqueue.c:2097
   worker_thread+0x1e4/0x1350 kernel/workqueue.c:2231
   kthread+0x324/0x3f0 kernel/kthread.c:231
   ret_from_fork+0x25/0x30 arch/x86/entry/entry_64.S:425

The fix is simply to assure canceling the autoload work at removing
the device.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: firewire: Use common error handling code in snd_motu_stream_start_duplex()
Markus Elfring [Wed, 6 Sep 2017 11:30:14 +0000 (13:30 +0200)]
ALSA: firewire: Use common error handling code in snd_motu_stream_start_duplex()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: asihpi: Kill BUG_ON() usages
Takashi Iwai [Thu, 7 Sep 2017 08:51:54 +0000 (10:51 +0200)]
ALSA: asihpi: Kill BUG_ON() usages

BUG_ON() is the worst choice for a trivial sanity check.
Either it should be removed or replaced with a softer one like
WARN_ON() if still really needed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: core: Use %pS printk format for direct addresses
Helge Deller [Wed, 6 Sep 2017 20:28:01 +0000 (22:28 +0200)]
ALSA: core: Use %pS printk format for direct addresses

The debug functions uses wrongly the %pF instead of the %pS printk format
specifier for printing symbols for the address returned by
_builtin_return_address(0). Fix it for the ia64, ppc64 and parisc64
architectures.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: ymfpci: Use common error handling code in snd_ymfpci_create()
Markus Elfring [Wed, 6 Sep 2017 19:12:51 +0000 (21:12 +0200)]
ALSA: ymfpci: Use common error handling code in snd_ymfpci_create()

* Add a jump target so that a bit of exception handling can be better
  reused at the end of this function.

  This issue was detected by using the Coccinelle software.

* The script "checkpatch.pl" pointed information out like the following.

  ERROR: do not use assignment in if condition

  Thus fix a few source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: ymfpci: Use common error handling code in snd_card_ymfpci_probe()
Markus Elfring [Wed, 6 Sep 2017 18:45:11 +0000 (20:45 +0200)]
ALSA: ymfpci: Use common error handling code in snd_card_ymfpci_probe()

* Add a jump target so that a bit of exception handling can be better
  reused at the end of this function.

  This issue was detected by using the Coccinelle software.

* The script "checkpatch.pl" pointed information out like the following.

  ERROR: do not use assignment in if condition

  Thus fix a few source code places.

[ This also fixed a potential use-after-free at error path of
  snd_opl3_hwdep_new(), too -- tiwai ]

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: 6fire: Use common error handling code in usb6fire_chip_probe()
Markus Elfring [Wed, 6 Sep 2017 14:26:29 +0000 (16:26 +0200)]
ALSA: 6fire: Use common error handling code in usb6fire_chip_probe()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: usx2y: Use common error handling code in submit_urbs()
Markus Elfring [Wed, 6 Sep 2017 13:00:08 +0000 (15:00 +0200)]
ALSA: usx2y: Use common error handling code in submit_urbs()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: us122l: Use common error handling code in us122l_create_card()
Markus Elfring [Wed, 6 Sep 2017 12:45:09 +0000 (14:45 +0200)]
ALSA: us122l: Use common error handling code in us122l_create_card()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: hdspm: Use common error handling code in snd_hdspm_probe()
Markus Elfring [Tue, 5 Sep 2017 20:22:21 +0000 (22:22 +0200)]
ALSA: hdspm: Use common error handling code in snd_hdspm_probe()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: rme9652: Use common code in hdsp_get_iobox_version()
Markus Elfring [Tue, 5 Sep 2017 20:08:30 +0000 (22:08 +0200)]
ALSA: rme9652: Use common code in hdsp_get_iobox_version()

Add a jump target so that a bit of common code can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: maestro3: Use common error handling code in two functions
Markus Elfring [Wed, 6 Sep 2017 06:18:30 +0000 (08:18 +0200)]
ALSA: maestro3: Use common error handling code in two functions

Add jump targets so that a bit of exception handling can be better reused
at the end of these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoMerge tag 'asoc-v4.14-cs43130' of git://git.kernel.org/pub/scm/linux/kernel/git/broon...
Takashi Iwai [Mon, 4 Sep 2017 16:13:29 +0000 (18:13 +0200)]
Merge tag 'asoc-v4.14-cs43130' of git://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for the CS43130 driver

A couple of warning fixes for the newly added CS43130 driver.

7 years agoALSA: hda/ca0132 - Fix memory leak at error path
Takashi Iwai [Mon, 4 Sep 2017 15:38:36 +0000 (17:38 +0200)]
ALSA: hda/ca0132 - Fix memory leak at error path

The CA0132 codec driver doesn't call the free function at its error
path of the probe, which leaves the allocated memory.  Call
ca0132_free() properly at the error handling.

Fixes: a73d511c4867 ("ALSA: hda/ca0132: Add unsol handler for DSP and jack detection")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: hda: Fix forget to free resource in error handling code path in hda_codec_drive...
Wang YanQing [Mon, 4 Sep 2017 15:17:09 +0000 (23:17 +0800)]
ALSA: hda: Fix forget to free resource in error handling code path in hda_codec_driver_probe

When hda_codec_driver_probe meet error and return failure, we need
to free resource with patch_ops.free, or we will get resource leak.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoASoC: cs43130: Fix unused compiler warnings for PM runtime
Takashi Iwai [Mon, 4 Sep 2017 13:54:48 +0000 (15:54 +0200)]
ASoC: cs43130: Fix unused compiler warnings for PM runtime

Add __maybe_unused prefix for addressing the following warnings:
  sound/soc/codecs/cs43130.c:2615:12: warning: ‘cs43130_runtime_resume’ defined but not used [-Wunused-function]
  sound/soc/codecs/cs43130.c:2596:12: warning: ‘cs43130_runtime_suspend’ defined but not used [-Wunused-function]

Fixes: 8f1e5bf9b440 ("ASoC: cs43130: Add support for CS43130 codec")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: cs43130: Fix possible Oops with invalid dev_id
Takashi Iwai [Mon, 4 Sep 2017 13:54:47 +0000 (15:54 +0200)]
ASoC: cs43130: Fix possible Oops with invalid dev_id

As compiler spotted out, there is the potential NULL-dereference in
the code when dc-measure OF is given for other than 43130/43131:
  sound/soc/codecs/cs43130.c:2089:18: warning: ‘hpload_seq’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Warn it and return before triggering Oops.

Fixes: 8f1e5bf9b440 ("ASoC: cs43130: Add support for CS43130 codec")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoMerge tag 'asoc-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound...
Takashi Iwai [Mon, 4 Sep 2017 12:50:49 +0000 (14:50 +0200)]
Merge tag 'asoc-v4.14' of git://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v4.14

This is quite a large release by volume of patches and diff, a lot of
that is mechanical cleanup patches but it's great to also see a range of
vendors actively working on adding new features and fixing issues in
their drivers.  Intel and Realtek have been especially active here.

 - Continued work towards moving everything to the component model from
   Morimoto-san.
 - Use of devres for jack detection GPIOs, eliminating some potential
   resource leaks.
 - Jack detection support for Qualcomm MSM8916.
 - Support for Allwinner H3, Cirrus Logic CS43130, Intel Kabylake
   systems with RT5663, Realtek RT274, TI TLV320AIC32x6 and Wolfson
   WM8523.

7 years agoASoC: cs43130: fix spelling mistake: "irq_occurrance" -> "irq_occurrence"
Colin Ian King [Mon, 4 Sep 2017 10:12:32 +0000 (11:12 +0100)]
ASoC: cs43130: fix spelling mistake: "irq_occurrance" -> "irq_occurrence"

Trivial fix to spelling mistake in variable name

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoALSA: atmel: Remove leftovers of AVR32 removal
Andy Shevchenko [Fri, 1 Sep 2017 16:15:07 +0000 (19:15 +0300)]
ALSA: atmel: Remove leftovers of AVR32 removal

The ALSA related include header files are left overs after the commit

020c5260c2b1 ("ALSA: atmel: Remove AVR32 bits from the driver")

Fixes: 020c5260c2b1 ("ALSA: atmel: Remove AVR32 bits from the driver")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: atmel: convert AC97c driver to GPIO descriptor API
Andy Shevchenko [Fri, 1 Sep 2017 16:15:06 +0000 (19:15 +0300)]
ALSA: atmel: convert AC97c driver to GPIO descriptor API

Convert the driver to use GPIO descriptor API.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: hda/realtek - Enable jack detection function for Intel ALC700
PeiSen Hou [Fri, 1 Sep 2017 07:11:56 +0000 (15:11 +0800)]
ALSA: hda/realtek - Enable jack detection function for Intel ALC700

Intel ALC 700 needs this patch for jack detection function.
Because ALC700's jack detect function defaults is disable.
So alc700 needs pathc to enable jack detection function.

Signed-off-by: PeiSen Hou <pshou@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoMerge branch 'for-next' into for-linus
Takashi Iwai [Mon, 4 Sep 2017 08:10:27 +0000 (10:10 +0200)]
Merge branch 'for-next' into for-linus

7 years agoALSA: hda: Fix regression of hdmi eld control created based on invalid pcm
Wang YanQing [Sun, 3 Sep 2017 13:18:49 +0000 (21:18 +0800)]
ALSA: hda: Fix regression of hdmi eld control created based on invalid pcm

Commit fb087eaaef72 ("ALSA: hda - hdmi eld control created based on pcm")
forget to filter out invalid pcm numbers, if there is only one invalid pcm
number, then this issue causes we create eld control for invalid pcm silently,
but when there are more than one invalid pcm numbers, then this issue bring
probe error looks like below dmesg:
"
kernel: [    1.647283] snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops 0xc2967540)
kernel: [    1.651192] snd_hda_intel 0000:00:03.0: Too many HDMI devices
kernel: [    1.651195] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
kernel: [    1.651197] snd_hda_intel 0000:00:03.0: Too many HDMI devices
kernel: [    1.651199] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
kernel: [    1.651201] snd_hda_intel 0000:00:03.0: Too many HDMI devices
kernel: [    1.651203] snd_hda_intel 0000:00:03.0: Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
kernel: [    1.651676] snd_hda_intel 0000:00:03.0: control 3:0:0:ELD:0 is already present
kernel: [    1.651787] snd_hda_codec_hdmi: probe of hdaudioC0D0 failed with error -16
"

This patch add invalid pcm number filter before calling hdmi_create_eld_ctl.

Fixes: fb087eaaef72 ("ALSA: hda - hdmi eld control created based on pcm")
Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoMerge remote-tracking branches 'asoc/topic/wm8524', 'asoc/topic/wm8804' and 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:13:19 +0000 (12:13 +0100)]
Merge remote-tracking branches 'asoc/topic/wm8524', 'asoc/topic/wm8804' and 'asoc/topic/zte' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic...
Mark Brown [Fri, 1 Sep 2017 11:13:15 +0000 (12:13 +0100)]
Merge remote-tracking branches 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic/utils', 'asoc/topic/ux500' and 'asoc/topic/wm8523' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5720', 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:13:10 +0000 (12:13 +0100)]
Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5720', 'asoc/topic/tegra', 'asoc/topic/tlv320aic32x4' and 'asoc/topic/tlv320aic3x' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/spear', 'asoc/topic...
Mark Brown [Fri, 1 Sep 2017 11:13:06 +0000 (12:13 +0100)]
Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/spear', 'asoc/topic/sta32x', 'asoc/topic/stm32' and 'asoc/topic/sunxi' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', 'asoc/topic...
Mark Brown [Fri, 1 Sep 2017 11:13:03 +0000 (12:13 +0100)]
Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', 'asoc/topic/rt5677' and 'asoc/topic/samsung' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/rt5563', 'asoc/topic/rt5616', 'asoc/topic...
Mark Brown [Fri, 1 Sep 2017 11:12:58 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/rt5563', 'asoc/topic/rt5616', 'asoc/topic/rt5645', 'asoc/topic/rt5659' and 'asoc/topic/rt5663' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/rk3036', 'asoc/topic/rockchip', 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:12:55 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/rk3036', 'asoc/topic/rockchip', 'asoc/topic/rt274' and 'asoc/topic/rt5514' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/psc-ac97' and 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:12:52 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/psc-ac97' and 'asoc/topic/pxa' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/mtk', 'asoc/topic/mxs', 'asoc/topic/nau882...
Mark Brown [Fri, 1 Sep 2017 11:12:48 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/mtk', 'asoc/topic/mxs', 'asoc/topic/nau8825', 'asoc/topic/nuc900' and 'asoc/topic/of-graph' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/kirkwood', 'asoc/topic/max9867', 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:12:44 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/kirkwood', 'asoc/topic/max9867', 'asoc/topic/max98926' and 'asoc/topic/max98927' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/hisi', 'asoc/topic/img', 'asoc/topic/jack...
Mark Brown [Fri, 1 Sep 2017 11:12:41 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/hisi', 'asoc/topic/img', 'asoc/topic/jack' and 'asoc/topic/jz4740' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es8316', 'asoc/topic...
Mark Brown [Fri, 1 Sep 2017 11:12:36 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es8316', 'asoc/topic/fsi', 'asoc/topic/fsl' and 'asoc/topic/hdmi' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/cs43130', 'asoc/topic/cs53l30', 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:12:32 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/cs43130', 'asoc/topic/cs53l30', 'asoc/topic/cygnus' and 'asoc/topic/davinci' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/cs35l33', 'asoc/topic/cs35l34' and 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:12:29 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/cs35l33', 'asoc/topic/cs35l34' and 'asoc/topic/cs42l42' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/blackfin', 'asoc/topic/build', 'asoc/topic...
Mark Brown [Fri, 1 Sep 2017 11:12:26 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/blackfin', 'asoc/topic/build', 'asoc/topic/cirrus' and 'asoc/topic/compress' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/topic/adau1977', 'asoc/topic/arizona', 'asoc...
Mark Brown [Fri, 1 Sep 2017 11:12:21 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/topic/adau1977', 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/au1x' and 'asoc/topic/bcm' into asoc-next

7 years agoMerge remote-tracking branch 'asoc/topic/rcar' into asoc-next
Mark Brown [Fri, 1 Sep 2017 11:12:20 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next

7 years agoMerge remote-tracking branch 'asoc/topic/intel' into asoc-next
Mark Brown [Fri, 1 Sep 2017 11:12:19 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/topic/intel' into asoc-next

7 years agoMerge remote-tracking branch 'asoc/topic/core' into asoc-next
Mark Brown [Fri, 1 Sep 2017 11:12:18 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/topic/core' into asoc-next

7 years agoMerge remote-tracking branch 'asoc/topic/const' into asoc-next
Mark Brown [Fri, 1 Sep 2017 11:12:17 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/topic/const' into asoc-next

7 years agoMerge remote-tracking branch 'asoc/topic/component' into asoc-next
Mark Brown [Fri, 1 Sep 2017 11:12:17 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/topic/component' into asoc-next

7 years agoMerge remote-tracking branch 'asoc/topic/msm8916' into asoc-next
Mark Brown [Fri, 1 Sep 2017 11:12:16 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/topic/msm8916' into asoc-next

7 years agoMerge remote-tracking branches 'asoc/fix/arizona' and 'asoc/fix/mtk' into asoc-linus
Mark Brown [Fri, 1 Sep 2017 11:12:13 +0000 (12:12 +0100)]
Merge remote-tracking branches 'asoc/fix/arizona' and 'asoc/fix/mtk' into asoc-linus

7 years agoMerge remote-tracking branch 'asoc/fix/rcar' into asoc-linus
Mark Brown [Fri, 1 Sep 2017 11:12:12 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus

7 years agoMerge remote-tracking branch 'asoc/fix/intel' into asoc-linus
Mark Brown [Fri, 1 Sep 2017 11:12:11 +0000 (12:12 +0100)]
Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus

7 years agoMerge tag 'asoc-fix-v4.13-rc7' into asoc-linus
Mark Brown [Fri, 1 Sep 2017 11:12:09 +0000 (12:12 +0100)]
Merge tag 'asoc-fix-v4.13-rc7' into asoc-linus

ASoC: Fixes for v4.13

A couple of fixes, one for a regression in simple-card introduced during
the merge window that was only reported this week and another for a
regression in registration of ACPI GPIOs.

# gpg: Signature made Thu 31 Aug 2017 12:50:29 BST
# gpg:                using RSA key ADE668AA675718B59FE29FEA24D68B725D5487D0
# gpg:                issuer "broonie@kernel.org"
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" [unknown]
# gpg:                 aka "Mark Brown <broonie@debian.org>" [unknown]
# gpg:                 aka "Mark Brown <broonie@kernel.org>" [unknown]
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>" [unknown]
# gpg:                 aka "Mark Brown <broonie@linaro.org>" [unknown]
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 3F25 68AA C269 98F9 E813  A1C5 C3F4 36CA 30F5 D8EB
#      Subkey fingerprint: ADE6 68AA 6757 18B5 9FE2  9FEA 24D6 8B72 5D54 87D0

7 years agoASoC: Intel: Skylake: Add IPC to configure the copier secondary pins
Pradeep Tewani [Fri, 1 Sep 2017 08:06:13 +0000 (13:36 +0530)]
ASoC: Intel: Skylake: Add IPC to configure the copier secondary pins

Copier can support upto 4 output pins. However, only pin 0 is configured
as a part of copier initialization. Configuring rest of pins require the
separate IPC to be sent to fw.

Signed-off-by: Pradeep Tewani <pradeep.d.tewani@intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: add missing compile rule for max98371
Kuninori Morimoto [Fri, 1 Sep 2017 04:33:01 +0000 (04:33 +0000)]
ASoC: add missing compile rule for max98371

It is still using old driver style, this patch also
fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: add missing compile rule for sirf-audio-codec
Kuninori Morimoto [Fri, 1 Sep 2017 04:33:27 +0000 (04:33 +0000)]
ASoC: add missing compile rule for sirf-audio-codec

It is still using old driver style, this patch also
fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: add missing compile rule for max98371
Kuninori Morimoto [Fri, 1 Sep 2017 04:33:01 +0000 (04:33 +0000)]
ASoC: add missing compile rule for max98371

It is still using old driver style, this patch also
fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: cs43130: Add devicetree bindings for CS43130
Li Xu [Fri, 18 Aug 2017 16:00:20 +0000 (11:00 -0500)]
ASoC: cs43130: Add devicetree bindings for CS43130

Add devicetree bindings documentation file for Cirrus
Logic CS43130 codec.

Signed-off-by: Li Xu <li.xu@cirrus.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: cs43130: Add support for CS43130 codec
Li Xu [Fri, 18 Aug 2017 16:00:19 +0000 (11:00 -0500)]
ASoC: cs43130: Add support for CS43130 codec

Add support for Cirrus Logic CS43130 codec.

Support:
I2S/DSP PCM playback.
DoP/DSD playback.
HP detection and DC/AC impedance measurement.

Signed-off-by: Li Xu <li.xu@cirrus.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: make clock direction configurable in asoc-simple
Vitaly Wool [Thu, 17 Aug 2017 11:42:36 +0000 (13:42 +0200)]
ASoC: make clock direction configurable in asoc-simple

Some CPU drivers (e. g. davinci-mcasp) may require the system clock to
be configured as OUT, while there's no good way currently to set
SND_SOC_CLK_OUT in simple-soc driver if the clock is fixed-rate.

This patch makes asoc_simple_card_init_dai() initialize clock to
SND_SOCK_CLK_OUT if explicitly stated in the relevant dts file. This
change is transparent and doesn't change the default behavior.

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoALSA: ctxfi: Remove null check before kfree
Himanshu Jha [Thu, 31 Aug 2017 15:06:42 +0000 (20:36 +0530)]
ALSA: ctxfi: Remove null check before kfree

kfree on NULL pointer is a no-op and therefore checking is redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoMerge tag 'asoc-fix-v4.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broon...
Takashi Iwai [Thu, 31 Aug 2017 12:08:26 +0000 (14:08 +0200)]
Merge tag 'asoc-fix-v4.13-rc7' of git://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v4.13

A couple of fixes, one for a regression in simple-card introduced during
the merge window that was only reported this week and another for a
regression in registration of ACPI GPIOs.

7 years agoMerge remote-tracking branch 'asoc/fix/rt5670' into asoc-fixes
Mark Brown [Thu, 31 Aug 2017 11:47:58 +0000 (12:47 +0100)]
Merge remote-tracking branch 'asoc/fix/rt5670' into asoc-fixes

7 years agoASoC: max98927: Changed device property read function
Ryan Lee [Mon, 28 Aug 2017 23:31:01 +0000 (16:31 -0700)]
ASoC: max98927: Changed device property read function

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path
Ryan Lee [Mon, 28 Aug 2017 23:31:00 +0000 (16:31 -0700)]
ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: max98927: Added PM suspend and resume function
Ryan Lee [Mon, 28 Aug 2017 23:30:59 +0000 (16:30 -0700)]
ASoC: max98927: Added PM suspend and resume function

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: max98927: Modified chip default register values
Ryan Lee [Mon, 28 Aug 2017 23:30:58 +0000 (16:30 -0700)]
ASoC: max98927: Modified chip default register values

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: max98927: Added missing \n to end of dev_err messages
Ryan Lee [Mon, 28 Aug 2017 23:30:56 +0000 (16:30 -0700)]
ASoC: max98927: Added missing \n to end of dev_err messages

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: max98927: Updated volatile register list
Ryan Lee [Mon, 28 Aug 2017 23:30:55 +0000 (16:30 -0700)]
ASoC: max98927: Updated volatile register list

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'
Christophe Jaillet [Thu, 31 Aug 2017 04:40:42 +0000 (06:40 +0200)]
ALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'

If 'clk_prepare_enable()' fails, we must release some resources before
returning. Add a new label in the existing error handling path and 'goto'
there.

Fixes: 260ea95cc027 ("ASoC: atmel: ac97c: Handle return value of clk_prepare_enable.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: rt5645: Add jack detection workaround for MINIX Z83-4 based devices
Ian W MORRISON [Wed, 30 Aug 2017 22:35:47 +0000 (08:35 +1000)]
ASoC: rt5645: Add jack detection workaround for MINIX Z83-4 based devices

The MINIX NEO Z83-4 and MINIX NEO Z83-4 Pro devices requires jd_mode=3
to make the jack detection work. Using a BIOS DMI product of "Z83-4"
will match both devices of 'NEO Z83-4' and 'Z83-4 Pro'.

Signed-off-by: Ian W Morrison <ianwmorrison@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: tlv320aic3x: Support for OCMV configuration
Peter Ujfalusi [Thu, 31 Aug 2017 08:49:47 +0000 (11:49 +0300)]
ASoC: tlv320aic3x: Support for OCMV configuration

In aic3x class of devices Output Common-Mode Voltage can be configured for
better analog performance.
The OCMV value depends on the Analog and digital domain power supply
voltage configuration.

The default OCMV of 1.35V gives best performance when AVDD is around 2.7V
and DVDD is 1.525V, but for higher AVDD/DVDD higher OCMV setting is
recommended.

The patch gives an automatic way of guessing the best OCMV which can be
overwritten by a DT parameter if needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoALSA: sh: Put missing KERN_* prefix
Takashi Iwai [Thu, 31 Aug 2017 08:57:36 +0000 (10:57 +0200)]
ALSA: sh: Put missing KERN_* prefix

sh audio driver prints its presence at probe function but a proper
KERN_ prefix is missing.  Put KERN_INFO there as it's merely an
advertisement.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: usx2y: Put missing KERN_CONT prefix
Takashi Iwai [Thu, 31 Aug 2017 09:00:20 +0000 (11:00 +0200)]
ALSA: usx2y: Put missing KERN_CONT prefix

The usx2y driver has a debug printk code without proper KERN_ prefix.
On recent kernels, KERN_CONT prefix is mandatory for continued output
lines.  Put it properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: usb-audio: Put missing KERN_CONT prefix
Takashi Iwai [Thu, 31 Aug 2017 08:59:12 +0000 (10:59 +0200)]
ALSA: usb-audio: Put missing KERN_CONT prefix

The usb-audio driver has a debug printk code without proper KERN_
prefix.  On recent kernels, KERN_CONT prefix is mandatory for
continued output lines.  Put it properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: asihpi: Put missing KERN_CONT prefix
Takashi Iwai [Thu, 31 Aug 2017 08:56:50 +0000 (10:56 +0200)]
ALSA: asihpi: Put missing KERN_CONT prefix

The asihpi driver has a debug printk code without proper KERN_
prefix.  On recent kernels, KERN_CONT prefix is mandatory for
continued output lines.  Put it properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: vx: Put missing KERN_CONT prefix
Takashi Iwai [Thu, 31 Aug 2017 08:56:12 +0000 (10:56 +0200)]
ALSA: vx: Put missing KERN_CONT prefix

The vx driver has a debug printk code without proper KERN_ prefix.
On recent kernels, KERN_CONT prefix is mandatory for continued output
lines.  Put it properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: opl3: Put missing KERN_CONT prefix
Takashi Iwai [Thu, 31 Aug 2017 08:53:35 +0000 (10:53 +0200)]
ALSA: opl3: Put missing KERN_CONT prefix

The opl3 driver has a debug printk code without proper KERN_ prefix.
On recent kernels, KERN_CONT prefix is mandatory for continued output
lines.  Put it properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoASoC: add Component level set_jack
Kuninori Morimoto [Thu, 24 Aug 2017 00:58:07 +0000 (00:58 +0000)]
ASoC: add Component level set_jack

In current ALSA SoC, Codec only has set_jack feature.
Codec will be merged into Component in next generation ALSA SoC,
thus current Codec specific feature need to be merged into it.
This is glue patch for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: add Component level set_pll
Kuninori Morimoto [Thu, 24 Aug 2017 00:57:51 +0000 (00:57 +0000)]
ASoC: add Component level set_pll

In current ALSA SoC, Codec only has set_pll feature.
Codec will be merged into Component in next generation ALSA SoC,
thus current Codec specific feature need to be merged into it.
This is glue patch for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: add Component level set_sysclk
Kuninori Morimoto [Thu, 24 Aug 2017 00:57:35 +0000 (00:57 +0000)]
ASoC: add Component level set_sysclk

In current ALSA SoC, Codec only has set_sysclk feature.
Codec will be merged into Component in next generation ALSA SoC,
thus current Codec specific feature need to be merged into it.
This is glue patch for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoMerge tag 'v4.13-rc7' into asoc-component
Mark Brown [Wed, 30 Aug 2017 21:15:31 +0000 (22:15 +0100)]
Merge tag 'v4.13-rc7' into asoc-component

Linux 4.13-rc7

7 years agoALSA: pcm: Unify ioctl functions for playback and capture streams
Takashi Iwai [Wed, 30 Aug 2017 13:39:32 +0000 (15:39 +0200)]
ALSA: pcm: Unify ioctl functions for playback and capture streams

Some ioctl functions are implemented individually for both playback
and capture streams although most of the codes are identical with just
a few different stream-specific function calls.  This patch unifies
these places, removes the superfluous trivial check and flattens the
call paths as a cleanup.  Meanwhile, for better readability, some
codes (e.g. xfer ioctls or forward/rewind ioctls) are factored out as
functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoALSA: Get rid of card power_lock
Takashi Iwai [Wed, 30 Aug 2017 14:13:25 +0000 (16:13 +0200)]
ALSA: Get rid of card power_lock

Currently we're taking power_lock at each card component for assuring
the power-up sequence, but it doesn't help anything in the
implementation at the moment: it just serializes unnecessarily the
callers, but it doesn't protect about the power state change itself.
It used to have some usefulness in the early days where we managed the
PM manually.  But now the suspend/resume core procedure is beyond our
hands, and power_lock lost its meaning.

This patch drops the power_lock from allover the places.
There shouldn't be any issues by this change, as it's no helper
regarding the power state change.  Rather we'll get better performance
by removing the serialization; which is the only slight concern of any
behavior change, but it can't be a showstopper, after all.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoASoC: hdmi-codec: Use different name for playback streams
Jeffy Chen [Sat, 12 Aug 2017 00:40:38 +0000 (08:40 +0800)]
ASoC: hdmi-codec: Use different name for playback streams

Currently the hdmi i2s playback stream and hdmi spdif playback stream
are using the same name. So when they are enabled at the same time,
kernel will print this warning:

[    2.201835] hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: Failed to
create Playback debugfs file

Assign different names to them to avoid that.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: simple_card_utils: fix fallback when "label" property isn't present
Lucas Stach [Tue, 29 Aug 2017 15:51:22 +0000 (17:51 +0200)]
ASoC: simple_card_utils: fix fallback when "label" property isn't present

snd_soc_of_parse_card_name() doesn't return an error if the requested
property isn't present, but silently fails to fill the card name. This can
not be changed, as it is a backwards compatibility measure itself.

We can not rely on the return value of this function alone, but must check
if the card name has been filled sucessfully when deciding to skip the
fallback path, which is in place for existing users.

Fixes: dedfaa1eedc7 (ASoC: simple-card-utils: enable "label" on
                     asoc_simple_card_parse_card_name)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: rsnd: Drop unit-addresses without reg properties
Geert Uytterhoeven [Wed, 30 Aug 2017 10:01:06 +0000 (12:01 +0200)]
ASoC: rsnd: Drop unit-addresses without reg properties

Nodes without reg properties must not have unit addresses:

    Warning (unit_address_vs_reg): Node .../rcar_sound,dvc/dvc@0 has a unit name, but no reg property

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: rockchip: constify snd_soc_ops structures
Jeffy Chen [Wed, 30 Aug 2017 09:58:14 +0000 (17:58 +0800)]
ASoC: rockchip: constify snd_soc_ops structures

Add const to dp/dmic snd_soc_ops.

Fixes: 626d84db64d7 (ASoC: rockchip: Add support for DMIC codec)
Fixes: 3313faf1053e (ASoC: rockchip: Add support for DP codec)
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: rt5663: Add delay for jack plug in
oder_chiou@realtek.com [Wed, 30 Aug 2017 05:08:31 +0000 (13:08 +0800)]
ASoC: rt5663: Add delay for jack plug in

Codec initialize takes some time when 3.5mm jack plugged in. Add a
delay to report jack plugged event to user space to avoid pop noise.

Signed-off-by: Hsinyu Chao <hychao@chromium.org>
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: rt274: add acpi id
Bard Liao [Wed, 30 Aug 2017 04:28:31 +0000 (12:28 +0800)]
ASoC: rt274: add acpi id

Add ACPI id for Intel platform.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Wed, 30 Aug 2017 13:17:10 +0000 (15:17 +0200)]
Merge branch 'for-linus' into for-next

7 years agoALSA: pcm: Fix power lock unbalance via OSS emulation
Takashi Iwai [Wed, 30 Aug 2017 12:50:07 +0000 (14:50 +0200)]
ALSA: pcm: Fix power lock unbalance via OSS emulation

PCM OSS emulation issues the drain ioctl without power lock.  It used
to work in the earlier kernels as the power lock was taken inside
snd_pcm_drain() itself.  But since 68b4acd32249 ("ALSA: pcm: Apply
power lock globally to common ioctls"), the power lock is taken
outside the function.  Due to that change, the call via OSS emulation
leads to the unbalanced power lock, thus it deadlocks.

As a quick fix, just take the power lock before snd_pcm_drain() call
for OSS emulation path.  A better cleanup will follow later.

Fixes: 68b4acd32249 ("ALSA: pcm: Apply power lock globally to common ioctls")
Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
7 years agoASoC: tas2552: Fix fraction overflow in PLL calculation
Oskar Schirmer [Fri, 25 Aug 2017 21:36:56 +0000 (21:36 +0000)]
ASoC: tas2552: Fix fraction overflow in PLL calculation

Setting the PLL involves the calculation of a fixed point ratio
with 4 decimal digits fraction, referred to as "J.D". The
fraction "D" is stored separately from the integer part "J"
and is limited to 0..9999.

The current algorithm uses integer registers to calculate the
fraction part, but failed to compensate for rounding errors,
resulting in values larger than 9999 for the fraction part
occasionally, e.g. for 44.1kHz audio rate and pll_clkin =
3763400 it would set J to 11 and D to 10002, which will at
best result in wrong pitch.

The critical part is the "pll_clkin / 10000", which would be
ok with real numbers, but using integer arithmetic the rounding
decreases the divisor, thus increasing the final quotient.

The issue is solved by linear interpolation over the reciprocal
function between the two adjacent points with integer divisor,
i.e. pll_clkin / 10000 and pll_clkin / 10000 + 1, and doing
all rounding to the lower result.

As a side effect to the bug fix, the approximation to the
desired frequency is much better, for the above mentioned
example we get 11.9993, while the true ratio is 11.9993623.

Signed-off-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: rockchip: Update description of rockchip, codec
Jeffy Chen [Thu, 24 Aug 2017 04:52:27 +0000 (12:52 +0800)]
ASoC: rockchip: Update description of rockchip, codec

Update description for newly added optional audio codecs.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
7 years agoASoC: rockchip: Add support for DMIC codec
Jeffy Chen [Thu, 24 Aug 2017 04:52:26 +0000 (12:52 +0800)]
ASoC: rockchip: Add support for DMIC codec

Add support for optional dmic codec.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>