1
0
Fork 0
Commit Graph

27347 Commits (2ce8008711e4837c11e99a94df55406085d0d098)

Author SHA1 Message Date
Mark Brown 9bc3b4ff18 Merge branch 'fix/rcar' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rcar 2017-06-07 20:30:32 +01:00
Kuninori Morimoto 07b7acb51d ASoC: rsnd: update pointer more accurate
Current rsnd driver updates pointer when DMA transfer was finished
in DMA transfer mode. But PulseAudio requests more accurate
pointer update when timer mode.
This patch consider about DMA transfer residue and update more
accurate pointer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:30:03 +01:00
Kuninori Morimoto 0d6b35212b ASoC: simple-scu-card: remove duplicate paramera from asoc_simple_card_parse_of
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:26:54 +01:00
Kuninori Morimoto d2fdcc285f ASoC: simple-card: remove duplicate parameter from asoc_simple_card_parse_of()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:26:34 +01:00
Ryo Kodama 411652982a ASoC: ak4613: Improve counting DAI number
Add the startup function to count DAI instead of hw_params.
This change matches the number of opened DAIs.
If this change isn't applied, you may get unexpected error due to
mismatching of count. Since the excution number of hw_params and
shutdown may be different, the mismatching happens.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Ryo Kodama <ryo.kodama.vz@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:24:00 +01:00
Kuninori Morimoto ca3b5ad30c ASoC: hdmi-codec: remove unused ratec
struct snd_pcm_hw_constraint_list ratec is not used.
Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:07:38 +01:00
Liam Girdwood c3421a6a65 ASoC: topology: Dont free template strings whilst they are in use.
Template name pointers are copied when creating new widgets and are freed
in widget destroy.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:05:40 +01:00
Liam Girdwood cc9d4714a8 ASoC: topology: rephrase deferred binding warning.
Rewrite the message to be more meaningful.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:05:40 +01:00
Liam Girdwood c8597af855 ASoC: topology: Allow bespoke configuration post widget creation
Current topology only allows for widget configuration before the widget
is registered. This patch also allows further configuration and usage
after registration is complete.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-07 20:05:40 +01:00
Andy Shevchenko 94116f8126 ACPI: Switch to use generic guid_t in acpi_evaluate_dsm()
acpi_evaluate_dsm() and friends take a pointer to a raw buffer of 16
bytes. Instead we convert them to use guid_t type. At the same time we
convert current users.

acpi_str_to_uuid() becomes useless after the conversion and it's safe to
get rid of it.

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Cc: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2017-06-07 12:20:49 +02:00
Takashi Sakamoto c6706de0ce ALSA: pcm: obsolete RULES_DEBUG local macro
Added tracepoints obsoleted RULES_DEBUG local macro and relevant codes.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07 10:49:17 +02:00
Takashi Sakamoto 37567c5503 ALSA: pcm: enable parameter tracepoints only when CONFIG_SND_DEBUG is enabled
In a previous commit, tracepoints are added for PCM parameter processing.
As long as I know, this implementation increases size of relocatable
object by 35%. For vendors who are conscious of memory footprint, it
brings apparent disadvantage.

This commit utilizes CONFIG_SND_DEBUG configuration to enable/disable the
tracepoints.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07 10:49:09 +02:00
Takashi Sakamoto be4e31dab0 ALSA: pcm: tracepoints for refining PCM parameters
When working for devices which support configurable modes for its data
transmission or which consists of several components, developers are
likely to use rules of parameters of PCM substream. However, there's no
infrastructure to assist their work.

In old days, ALSA PCM core got a local 'RULES_DEBUG' macro to debug
refinement of parameters for PCM substream. Although this is merely a
makeshift. With some modifications, we get the infrastructure.

This commit is for the purpose. Refinement of mask/interval type of
PCM parameters is probed as tracepoint events as 'hw_mask_param' and
'hw_interval_param' on existent 'snd_pcm' subsystem.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07 10:48:56 +02:00
Takashi Iwai d7f910bfed ALSA: timer: Wrap with spinlock for queue access
For accessing the snd_timer_user queue indices, we take tu->qlock.
But it's forgotten in a couple of places.

The one in snd_timer_user_params() should be safe without the
spinlock as the timer is already stopped.  But it's better for
consistency.

The one in poll is just a read-out, so it's not inevitably needed, but
it'd be good to make the result consistent, too.

Tested-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07 10:25:53 +02:00
Takashi Iwai 890e2cb5d1 ALSA: timer: Improve user queue reallocation
ALSA timer may reallocate the user queue upon request, and it happens
at three places for now: at opening, at SNDRV_TIMER_IOCTL_PARAMS, and
at SNDRV_TIMER_IOCTL_SELECT.  However, the last one,
snd_timer_user_tselect(), doesn't need to reallocate the buffer since
it doesn't change the queue size.  It does just because tu->tread
might have been changed before starting the timer.

Instead of *_SELECT ioctl, we should reallocate the queue at
SNDRV_TIMER_IOCTL_TREAD; then the timer is guaranteed to be stopped,
thus we can reassign the buffer more safely.

This patch implements that with a slight code refactoring.
Essentially, the patch achieves:
- Introduce realloc_user_queue() for (re-)allocating the ring buffer,
  and call it from all places.  Also, realloc_user_queue() uses
  kcalloc() for avoiding possible leaks.
- Add the buffer reallocation at SNDRV_TIMER_IOCTL_TREAD.  When it
  fails, tu->tread is restored to the old value, too.
- Drop the buffer reallocation at snd_timer_user_tselect().

Tested-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07 10:25:51 +02:00
Takashi Iwai 4c7aba46c9 Merge branch 'for-linus' into for-next
For applying more ALSA timer cleanups.
2017-06-07 10:25:30 +02:00
Takashi Iwai ba3021b2c7 ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECT
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>
2017-06-07 10:25:23 +02:00
Takashi Iwai d11662f4f7 ALSA: timer: Fix race between read and ioctl
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>
2017-06-07 10:25:20 +02:00
Takashi Sakamoto d2dc2a96de ALSA: fireface: constify ALSA specific operations
ALSA fireface driver has ALSA specific operations for MIDI/PCM data.
Structured data for the operations can be constified. Additionally,
The structured data can be function local.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07 07:55:15 +02:00
Takashi Sakamoto 875becf841 ALSA: firewire: process packets in 'struct snd_pcm_ops.ack' callback
In recent commit for ALSA PCM core, some arrangement is done for
'struct snd_pcm_ops.ack' callback. This is called when appl_ptr is
explicitly moved in intermediate buffer for PCM frames, except for
some cases described later.

For drivers in ALSA firewire stack, usage of this callback has a merit to
reduce latency between time of PCM frame queueing and handling actual
packets in recent isochronous cycle, because no need to wait for software
IRQ context from isochronous context of OHCI 1394.

If this works well in a case that mapped page frame is used for the
intermediate buffer, user process should execute some commands for ioctl(2)
to tell the number of handled PCM frames in the intermediate buffer just
after handling them. Therefore, at present, with a combination of below
conditions, this doesn't work as expected and user process should wait for
the software IRQ context as usual:
 - when ALSA PCM core judges page frame mapping is available for status
   data (struct snd_pcm_mmap_status) and control data
   (struct snd_pcm_mmap_control).
 - user process handles PCM frames by loop just with 'snd_pcm_mmap_begin()'
   and 'snd_pcm_mmap_commit()'.
 - user process uses PCM hw plugin in alsa-lib to operate I/O without
   'sync_ptr_ioctl' option.

Unfortunately, major use case include these three conditions.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07 07:53:32 +02:00
Dharageswari R e8883cb61a ASoC: Intel: Boards: Add 4-channel DMIC fixup.
This patch adds a 4-channel dmic fixup so that DMIC copier will receive
4 channel data and further selection will be done by mic-select module.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 20:00:43 +01:00
Dharageswari R 7a1b749b34 ASoC: Intel: Skylake: Add enum control for mic selection
User may prefer to select data from particular mics. A mic-select module
in DSP allows this selection.

Create possible enum controls to allow user to select a combination of
mics to capture data from. Based on the user selection, parameters are
generated and passed to mic-select module during init.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 20:00:43 +01:00
Dharageswari R db6879efb9 ASoC: Intel: Skylake: Add mic-select module type
mic-select module is a DSP module, which is used to select one or more
input channels.

This patch adds mic-select module type.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 20:00:43 +01:00
Douglas Anderson 98cf2c03b4 ASoC: Intel: sst: Delete sst_shim_regs64; saved regs are never used
In commit 9a075265c6 ("ASoC: Intel: sst: Remove unused function
sst_restore_shim64()"), we deleted the sst_restore_shim64() since it
was never used.  ...but a quick look at the code shows that we should
also be able to remove the sst_save_shim64() function and the
structure members we were storing data in.

Once we delete sst_save_shim64() there are no longer any users of the
'sst_shim_regs64' structure.  That means we can delete it completely
and also avoid allocating memory for it.  This saves a whopping 136
bytes of devm allocated memory.  We also get the nice benefit of
avoiding an error path in the init code.

Note that the saving code that we're removing (and the comments
talking about how important it is to do the save) has been around
since commit 336cfbb05e ("ASoC: Intel: mrfld- add ACPI module").

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:58:49 +01:00
Charles Keepax dc43f46a9b ASoC: cs35l35: Add additional delay for reset
Very fast systems may violate the minimum constraints for time the reset
line needs to remain low, or communicate with the device too soon after
releasing the reset. Fix this by adding some delays in to allow the chip
to properly reset, also factor out the reset into a function as it is
likely it will be re-used in later additions to the driver.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:54:18 +01:00
Peter Rosin a00cebf51d ASoC: atmel: tse850: fix off-by-one in the "ANA" enumeration count
At some point I added the "Low" entry at the beginning of the array
without bumping the enumeration count from 9 to 10. Fix this. While at
it, fix the anti-pattern for the other enumeration (used by MUX{1,2}).

Fixes: aa43112445 ("ASoC: atmel: tse850: add ASoC driver for the Axentia TSE-850")
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2017-06-06 19:53:36 +01:00
Kuninori Morimoto 8e16638256 ASoC: simple-card-utils: share same dev_dbg() for sysclk
Let's share same debug message for sysclk

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:46:08 +01:00
Kuninori Morimoto 4579771ebb ASoC: simple-card-utils: share same dev_dbg() for Dai Name
Let's share same debug message for DAI Name

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:46:08 +01:00
Kuninori Morimoto aaad9c131b ASoC: simple-card-utils: share same dev_dbg() for DAI format
Let's share same debug message for DAI format

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:46:07 +01:00
Kuninori Morimoto d4dbcb63c8 ASoC: simple-card-utils: share same dev_dbg() for Card Name
Let's share same debug message for Card Name

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:46:07 +01:00
Icenowy Zheng 8b2840b6da ASoC: sun4i-codec: Add support for V3s codec
The codec in the V3s is similar to the one found on the A31. One key
difference is the analog path controls are routed through the PRCM
block. This is supported by the sun8i-codec-analog driver, and tied
into this codec driver with the audio card's aux_dev.

In addition, the V3s does not have LINEIN, LINEOUT, MBIAS and MIC2,
MIC3, and the FIFO related registers are like H3.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:30:00 +01:00
Icenowy Zheng 2cfeaec0ec ASoC: sun8i-codec-analog: add support for V3s SoC
The V3s SoC features an analog codec with headphone support but without
mic2 and linein.

Add support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:29:54 +01:00
Icenowy Zheng 50aadc14ce ASoC: sun8i-codec-analog: prepare a mixer control/widget/route set for V3s
Allwinner V3s has an analog codec without MIC2 and Line In, which will
need a special set of mixer controls/widgets/routes, otherwise meaningless
controls will be exported to userspace and confuse the user.

Add the special set, and use it when the SoC has no MIC2 and Line In.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 19:27:34 +01:00
Takashi Iwai dd8038ec56 ASoC: Fixes for v4.12
This is the usual collection of device specific fixes, all accumilated
 since the merge window, plus one fix from Takashi for a nasty use after
 free bug that bit some things with deferred probe and an update to the
 maintainer address for the former Wolfson parts.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlk22AsTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0EjxB/9V2zJkKWppCYHGSChnEvjhuvZDimmr
 NUK51jgXDt83AmFU7UpgYvmBy5EQIgAqg+bgBgYB64UZrfde56Rx5JxV/WuiWzTI
 w/VceKBajvptI9Hq5sbUoYYWAQsjuvuh5baGnUwuMAxXd9vQtnzds1O6ysx7Nb5Y
 3XYo68HHssU5YhWnhYejyRABZxkW3LTEfedCA92XJmi5fzYV6ZFO0uofQ1UpRRXu
 6MK7o+fRuNEOG/koQk2IV4gLVBZGIqAVVHzvs7YIjRBk0trxBw+a5CgVLPmxkBgX
 uTzMT35QbLCPIc/mUEUzQxusX6DazN2ieOF5Hc1sNeoI5r7qTaAkMKUt
 =P0nM
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v4.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v4.12

This is the usual collection of device specific fixes, all accumilated
since the merge window, plus one fix from Takashi for a nasty use after
free bug that bit some things with deferred probe and an update to the
maintainer address for the former Wolfson parts.
2017-06-06 20:03:46 +02:00
Oder Chiou af2728e4de ASoC: rt5663: Fix the IRQ issue
The patch fixed the IRQ issue.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 18:04:52 +01:00
Kuninori Morimoto d70c34db33 ASoC: rsnd: remove unused rsnd_dai_path_info
commit 2ea2cc86db ("ASoC: rsnd: remove struct rcar_snd_info")
removed all struct rsnd_dai_path_info related code.
This patch removes unused rsnd_dai_path_info.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 17:55:08 +01:00
Kuninori Morimoto f07b38e53b ASoC: rsnd: remove unused rsnd_ssi_non_ops
rsnd_ssi_non_ops is never used. Let's remove it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-06 17:55:08 +01:00
Takashi Iwai 4eab0ea196 ALSA: hda/realtek - Reorder ALC269 ASUS quirk entries
A disorder is found in some ALC269 quirk entries for ASUS (1043:xxxx),
which should have been sorted in PCI SSID order.  Rearrange them, so
that I won't overlook the already existing entry like I did a couple
of times in the past...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-06 12:33:17 +02:00
Chris Chiu 28e8af8a16 ALSA: hda/realtek: Fix mic and headset jack sense on Asus X705UD
The ASUS X705UD laptop requires the known fixup ALC256_FIXUP_ASUS_MIC
in order to fix headphone jack sensing and to enable use of the internal
microphone.

Unfortunately jack sensing for the headset mic is still not working.

[rearranged the position to keep the PCI SSID order -- tiwai]

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-06 12:29:20 +02:00
Takashi Iwai fed5794fcc ALSA: pcm: Build OSS writev/readv helpers conditionally
The snd_pcm_oss_writev3() and snd_pcm_oss_readv3() are used only in
io.c with CONFIG_SND_PCM_OSS_PLUGINS=y.  Add an ifdef to reduce the
build of these functions.

Along with it, since they are called always for in-kernel copy, reduce
the argument and call snd_pcm_kernel_writev() and *_readv() directly
instead.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:26 +02:00
Takashi Iwai 13f72c8c28 ALSA: pcm: Kill set_fs() in PCM OSS layer
This is the last-standing one: kill the set_fs() usage in PCM OSS
layer by replacing with the new API functions to deal with the direct
in-kernel buffer copying.

The code to fill the silence can be replaced even to a one-liner to
pass NULL buffer instead of the manual copying.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:25 +02:00
Takashi Iwai 6854121372 ALSA: pcm: Direct in-kernel read/write support
Now all materials are ready, let's allow the direct in-kernel
read/write, i.e. a kernel-space buffer is passed for read or write,
instead of the normal user-space buffer.  This feature is used by OSS
layer and UAC1 driver, for example.

The __snd_pcm_lib_xfer() takes in_kernel argument that indicates the
in-kernel buffer copy.  When this flag is set, another transfer code
is used.  It's either via copy_kernel PCM ops or the normal memcpy(),
depending on the driver setup.

As external API, snd_pcm_kernel_read(), *_write() and other variants
are provided.

That's all.  This support is really simple because of the code
refactoring until now.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:24 +02:00
Takashi Iwai a9cd29e799 ALSA: pcm: Simplify snd_pcm_playback_silence()
Use the existing silence helper codes for simplification.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:23 +02:00
Takashi Iwai 5c7264cfbb ALSA: pcm: Unify read/write loop
Both __snd_pcm_lib_read() and __snd_pcm_write() functions have almost
the same code to loop over samples.  For simplification, this patch
unifies both as the single helper, __snd_pcm_lib_xfer().

Other than that, there should be no functional change by this patch.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:22 +02:00
Takashi Iwai 9f60063094 ALSA: pcm: More unification of PCM transfer codes
This patch proceeds more abstraction of PCM read/write loop codes.

For both interleaved and non-interleaved transfers, the same copy or
silence transfer code (which is defined as pcm_transfer_f) is used
now.  This became possible since we switched to byte size to copy_*
and fill_silence ops argument instead of frames.

And, for both read and write, we can use the same copy function (which
is defined as pcm_copy_f), just depending on whether interleaved or
non-interleaved mode.

The transfer function is determined at the beginning of the loop,
depending on whether the driver gives the specific copy ops or it's
the standard read/write.

Another bonus by this change is that we now guarantee the silencing
behavior when NULL buffer is passed to write helpers.  It'll simplify
some codes later.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:22 +02:00
Takashi Iwai c48f12ee0a ALSA: pcm: Call directly the common read/write helpers
Make snd_pcm_lib_read() and *_write() static inline functions that
call the common helper functions directly.  This reduces a slight
amount of codes, and at the same time, it's a preparation for the
further cleanups / fixes.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:21 +02:00
Takashi Iwai bdc4acf7f6 ALSA: pcm: Shuffle codes
Just shuffle the codes, without any change otherwise.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:20 +02:00
Takashi Iwai 6ba63929ae ALSA: pcm: Check PCM state by a common helper function
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:20 +02:00
Takashi Iwai 2ae48354a1 ALSA: pcm: Drop the old copy and silence ops
Now that all users of old copy and silence ops have been converted to
the new PCM ops, the old stuff can be retired and go away.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:19 +02:00
Takashi Iwai aa708c613b ASoC: blackfin: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
In AC97 and I2S-TDM mode, we need to convert back to frames, but
otherwise the conversion is pretty straightforward.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:10 +02:00
Takashi Iwai 1cc2f8ba0b ALSA: sh: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
Fixed also the user-space buffer copy with the proper
copy_from_user*() variant.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:03 +02:00
Takashi Iwai 4b83eff81c ALSA: sb: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
For avoiding the code redundancy, slightly hackish macros are
introduced.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:02 +02:00
Takashi Iwai a6970bb1dd ALSA: gus: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
For simplifying the code a bit, two local helpers are introduced here:
get_bpos() and playback_copy_ack().

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:01 +02:00
Takashi Iwai 0925e6b26f ALSA: hdsp: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
The conversion is straightforward with standard helper functions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:01 +02:00
Takashi Iwai 7b6ae34da6 ALSA: rme9652: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
The conversion is straightforward with standard helper functions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:38:00 +02:00
Takashi Iwai 53945f5b8a ALSA: rme96: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
The conversion is straightforward with standard helper functions, and
now we can drop the bytes <-> frames conversions in callbacks.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:37:59 +02:00
Takashi Iwai 032db751ef ALSA: rme32: Convert to the new PCM copy ops
Replace the copy and the silence ops with the new ops.
The conversion is straightforward with standard helper functions, and
now we can drop the bytes <-> frames conversions in callbacks.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:37:59 +02:00
Takashi Iwai 6c6ba11fad ALSA: korg1212: Convert to the new PCM ops
Replace the copy and the silence ops with the new PCM ops.
Although we can refactor this messy code, at this time, the changes
are kept as small as possible.  Let's clean up later.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:37:58 +02:00
Takashi Iwai 21de567366 ALSA: nm256: Convert to new PCM copy ops
Replace the copy and the silence ops with the new ops.
The conversion is straightforward with standard helper functions, and
now we can drop the bytes <-> frames conversions in callbacks.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:37:57 +02:00
Takashi Iwai b96c3a1556 ALSA: es1938: Convert to the new PCM copy ops
Replace the copy ops with the new copy_user and copy_kernel ops.
It's used only for a capture stream (for some hardware workaround),
thus we need no silence operation.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:37:57 +02:00
Takashi Iwai d53611d21e ALSA: dummy: Convert to new PCM copy ops
It's a dummy ops, so just replacing it.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:37:56 +02:00
Takashi Iwai 29d1a873de ALSA: pcm: Introduce copy_user, copy_kernel and fill_silence ops
For supporting the explicit in-kernel copy of PCM buffer data, and
also for further code refactoring, three new PCM ops, copy_user,
copy_kernel and fill_silence, are introduced.  The old copy and
silence ops will be deprecated and removed later once when all callers
are converted.

The copy_kernel ops is the new one, and it's supposed to transfer the
PCM data from the given kernel buffer to the hardware ring-buffer (or
vice-versa depending on the stream direction), while the copy_user ops
is equivalent with the former copy ops, to transfer the data from the
user-space buffer.

The major difference of the new copy_* and fill_silence ops from the
previous ops is that the new ops take bytes instead of frames for size
and position arguments.  It has two merits: first, it allows the
callback implementation often simpler (just call directly memcpy() &
co), and second, it may unify the implementations of both interleaved
and non-interleaved cases, as we'll see in the later patch.

As of this stage, copy_kernel ops isn't referred yet, but only
copy_user is used.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-02 19:37:23 +02:00
Linus Torvalds c531577bcd sound fixes for 4.12-rc4
This contains the fixes for a few reported regression for HD-audio and
 USB-audio.  All small, trivial, and boring.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEECxfAB4MH3rD5mfB6bDGAVD0pKaQFAlkxbHgOHHRpd2FpQHN1
 c2UuZGUACgkQbDGAVD0pKaSwzg//ZudLpexdkyOCwMZRf6Hft48bMMTH8xBYa/8r
 ORQn+zRCKq6lcbrtJ55IyFSO1cXtLAOzK/D/WSOdA48XXXcgb3h4uHLSmlJJCt02
 UdTETQs711BlZBC1ey7K4ZLwOOLFuHjnEaTsoodS5JvNdhZdxdX8WpSYijvCKgcg
 8cKn1r7sfLz6BYs6UVEQ45Wo5BxodKphBVvyikZZmdW8swDz+Kqqhi3HShMPATeR
 BUxuMF3+zdyIHYZ7FHPxzV5mEQg0peX0UgFCiMpAmi99nVxTgzafLCI12lFc5JVW
 jUIqqOHwd9vbSew/u8VFpY3KU4ENtc4UwzsTHWiTfXZWghMcxuBmPNTjuiz5+1qI
 WLpZzPJdx+xDMvgSShy2EK2EqpTYQqF76uCynm7KUZv5MumRLZ9yqAksrR+IniiE
 xNmOonqcNjcJw1iWrC0OHdRyiY4p1IW1QKyi7H4ge681j1P6Ur4mO5jeTYv4BCd6
 x8RZhAqKvhxtdDhV7xJZmGZSY/E/ZBkGCD6RO1h3+ZebKM7+TgJWYCizjGMrxn1y
 663UA5my8drHR/1RjIr/yGyhZ164mpZgLZewB4wv6CXL0ckQfnn9b55VN8/htnsf
 DclrYXCD4bOXxfB5F9qzIkL3AB/gKL8CSY7hMc8+C5a5CLFBgewBL6HnJHE917NC
 0RfsFpo=
 =8xnN
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This contains the fixes for a few reported regression for HD-audio and
  USB-audio. All small, trivial, and boring"

* tag 'sound-4.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Fix applying MSI dual-codec mobo quirk
  ALSA: usb: Avoid VLA in mixer_us16x08.c
  ALSA: usb: Fix a typo in Tascam US-16x08 mixer element
  Revert "ALSA: usb-audio: purge needless variable length array"
2017-06-02 09:40:47 -07:00
Takashi Iwai d2c3b14e1f ALSA: hda - Fix applying MSI dual-codec mobo quirk
The previous commit [63691587f7b0: ALSA: hda - Apply dual-codec quirk
for MSI Z270-Gaming mobo] attempted to apply the existing dual-codec
quirk for a MSI mobo.  But it turned out that this isn't applied
properly due to the MSI-vendor quirk before this entry.  I overlooked
such two MSI entries just because they were put in the wrong position,
although we have a list ordered by PCI SSID numbers.

This patch fixes it by rearranging the unordered entries.

Fixes: 63691587f7 ("ALSA: hda - Apply dual-codec quirk for MSI Z270-Gaming mobo")
Reported-by: Rudolf Schmidt <info@rudolfschmidt.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-01 09:46:47 +02:00
Takashi Iwai e49a14fa36 ALSA: usb: Avoid VLA in mixer_us16x08.c
This is another attempt to work around the VLA used in
mixer_us16x08.c.  Basically the temporary array is used individually
for two cases, and we can declare locally in each block, instead of
hackish max() usage.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-31 08:46:19 +02:00
Takashi Iwai 617163fc25 ALSA: usb: Fix a typo in Tascam US-16x08 mixer element
A mixer element created in a quirk for Tascam US-16x08 contains a
typo: it should be "EQ MidLow Q" instead of "EQ MidQLow Q".

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195875
Fixes: d2bb390a20 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk")
Cc: <stable@vger.kernel.org> # v4.11+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-31 08:46:16 +02:00
Takashi Iwai 64188cfbe5 Revert "ALSA: usb-audio: purge needless variable length array"
This reverts commit 89b593c30e ("ALSA: usb-audio: purge needless
variable length array").  The patch turned out to cause a severe
regression, triggering an Oops at snd_usb_ctl_msg().  It was overseen
that snd_usb_ctl_msg() writes back the response to the given buffer,
while the patch changed it to a read-only const buffer.  (One should
always double-check when an extra pointer cast is present...)

As a simple fix, just revert the affected commit.  It was merely a
cleanup.  Although it brings VLA again, it's clearer as a fix.  We'll
address the VLA later in another patch.

Fixes: 89b593c30e ("ALSA: usb-audio: purge needless variable length array")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195875
Cc: <stable@vger.kernel.org> # v4.11+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-31 08:46:14 +02:00
Colin Ian King 7421a1671a ALSA: pcm: include pcm_local.h and remove some extraneous tabs
We need to include pcm_local.h to clean up some smatch warnings:

symbol 'snd_pcm_timer_done' was not declared. Should it be static?
symbol 'snd_pcm_timer_init' was not declared. Should it be static?
symbol 'snd_pcm_timer_resolution_change' was not declared. Should
  it be static?

Also remove some extraneous tabs on empty lines and replace space
intentation with a tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-30 18:04:47 +02:00
Bhumika Goyal 905e46acd3 ALSA: declare snd_kcontrol_new structures as const
Declare snd_kcontrol_new structures as const as they are only passed an
argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Cross compiled these files:
sound/aoa/codecs/tas.c - powerpc
sound/mips/{hal2.c/sgio2audio.c} - mips
sound/ppc/{awacs.c/beep.c/tumbler.c} - powerpc
sound/soc/sh/siu_dai.c - sh
Could not find an architecture to compile sound/sh/aica.c.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-30 10:29:25 +02:00
Dave Airlie 2a1720376a Linux 4.12-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJZK2lrAAoJEHm+PkMAQRiGm3AH/13F1DlIk05aSXHoDr/idIpR
 GMHmk3YF+EuFjsL463Sh6s/SSWmz0Lda8euaoB4wCWvQFX2ZjTE+aOd79XlRiZJQ
 OTtLkV9I41eXIJUpEOHia7xZiCsbw+usqcHrm1aBoSh5KKV2iQmEOrnJdibqJVOF
 eXUMphNK/zFtAd2bKtQSxkaBnOOqsQUgVQSkr2K9rSg25l0KokFC6c5K5IjLn4x9
 QgDY4wmMvHrDz0CtpoqlNM4XqbsDJVrFeZGfg6hlMqSRDeXeg4h3Ol0VfIT496RP
 QBdrDb6hWO+HKt9B0M+7Q+8a/Fsw+5dtpqv1W/Wlr0i4CS6euU8NChAmrpkrqGo=
 =m5ba
 -----END PGP SIGNATURE-----

Backmerge tag 'v4.12-rc3' into drm-next

Linux 4.12-rc3

Daniel has requested this for some drm-intel-next work.
2017-05-30 15:54:15 +10:00
Dave Airlie a82256bc02 Merge tag 'drm-intel-next-2017-05-29' of git://anongit.freedesktop.org/git/drm-intel into drm-next
More stuff for 4.13:

- skl+ wm fixes from Mahesh Kumar
- some refactor and tests for i915_sw_fence (Chris)
- tune execlist/scheduler code (Chris)
- g4x,g33 gpu reset improvements (Chris, Mika)
- guc code cleanup (Michal Wajdeczko, Michał Winiarski)
- dp aux backlight improvements (Puthikorn Voravootivat)
- buffer based guc/host communication (Michal Wajdeczko)

* tag 'drm-intel-next-2017-05-29' of git://anongit.freedesktop.org/git/drm-intel: (253 commits)
  drm/i915: Update DRIVER_DATE to 20170529
  drm/i915: Keep the forcewake timer alive for 1ms past the most recent use
  drm/i915/guc: capture GuC logs if FW fails to load
  drm/i915/guc: Introduce buffer based cmd transport
  drm/i915/guc: Disable send function on fini
  drm: Add definition for eDP backlight frequency
  drm/i915: Drop AUX backlight enable check for backlight control
  drm/i915: Consolidate #ifdef CONFIG_INTEL_IOMMU
  drm/i915: Only GGTT vma may be pinned and prevent shrinking
  drm/i915: Serialize GTT/Aperture accesses on BXT
  drm/i915: Convert i915_gem_object_ops->flags values to use BIT()
  drm/i915/selftests: Silence compiler warning in igt_ctx_exec
  drm/i915/guc: Skip port assign on first iteration of GuC dequeue
  drm/i915: Remove misleading comment in request_alloc
  drm/i915/g33: Improve reset reliability
  Revert "drm/i915: Restore lost "Initialized i915" welcome message"
  drm/i915/huc: Update GLK HuC version
  drm/i915: Check for allocation failure
  drm/i915/guc: Remove action status and statistics from debugfs
  drm/i915/g4x: Improve gpu reset reliability
  ...
2017-05-30 15:25:28 +10:00
Kuninori Morimoto 1a2af56431 ASoC: audio-graph-scu-card: tidyup return method from probe()
Current return method from probe() is very confusable.
This patch tidyup it to normal return method

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-29 14:49:10 +01:00
Kuninori Morimoto 87f937b45f ASoC: add audio-graph-scu-card support
OF-graph base DT binding is used on V4L2, and ALSA SoC is using
different style of DT today. Now ALSA SoC supports simple-card driver
for generic/simple sound card, and we have simple-scu-card driver
for simple-card + ALSA DPCM case.
In the future, V4L2 / ALSA will support HDMI, and then, DT bindings
between V4L2 / ALSA should be merged.
This patch adds new Audio Graph SCU Card which is OF-graph base of
simple-scu-card

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-29 14:49:09 +01:00
Mark Brown 5ea929467d Merge branch 'topic/of-graph' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rcar 2017-05-29 14:27:19 +01:00
Shawn Guo 6a9a440681 ASoC: zx-i2s: fix harsh noise with 16-bit audio
The audio parameter setup in zx_i2s_hw_params() works fine with 32-bit
samples, but for 16-bit ones, all we can hear is harsh noises.
As suggested by vendor driver code, DMA burst size and TS width should
always be 32 bits, no matter audio sample is 16-bit or 32-bit.

Follow the suggestion above to fix the harsh noise issue seen with
16-bit audio samples.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-29 14:17:17 +01:00
Linus Torvalds e95806dffc sound fixes for 4.12-rc3
This contains a few HD-audio device-specific quirks and an endianess
 fix for USB-audio, as well as the update of quirk model list
 document.  All fixes are small and trivial.
 
 The document update could have been postponed, but it's a good thing
 for user and has absolutely zero risk of breakage, so included here.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJZJ+BaAAoJEGwxgFQ9KSmk19wQAJYCJ/ffZfmcj+DRCMTJpA1c
 LMVj5IYZAQydiLBSZjI9zAiPICE80GDH3d+aEK1Cd2ZDxAZcfNtiGqcOsE/f3xC/
 TN9bfi7yBIlrEq+N24h8Ev2qGwGYlcpvI/jnEskAz+SfXF0Do17yzfE9a2e9YDb+
 781egeLiD5Df32orUbFxqsREIwnycMpR8kSSCdAV068D3h8jnbOqupa54Xiovoc3
 cdf+iuY66FtifHv7K7LEJh7SckWtrDIXSq6fdiA7rRX1+ki9G73fu/hTKgRUvINU
 6lqYS5m9mBNyz5a/yfbklP92E1LuwmrtFJhWnM9AEbk7QNkThq96brHtwLETBI2S
 fGHUu7nI0LM9TOlmDTc36OZvqve84i0NdBoVrdFYrkT6mFEvtvTUwG7bFmlCw13x
 6NcRpJHqf3n9HWi4RKxXmUPANRPbQvGoU7ukNVc7+TU3yDXlGCqCcXmApRsWc4qV
 9tnPHpiQYOYb8sRvwcrZmghQV6Lgzn49+g8oHm8g63+kI2ABtKFeqdNM/Aw37h0D
 dpKkzTfbVAHB8PtxXMBaiKK1WPvelA7sRBT0lDSJ4Kl/x93OEeCyKaIvOU3krQOd
 c9NhsL99eEf3vLS/irM6v2TzyNula8NU8y2uC+TdrYJ1ac7HGa3bnJimIXGVBk9p
 g12kBwe9vrEi8OkjjQUk
 =L01h
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This contains a few HD-audio device-specific quirks and an endianess
  fix for USB-audio, as well as the update of quirk model list document.
  All fixes are small and trivial.

  The document update could have been postponed, but it's a good thing
  for user and has absolutely zero risk of breakage, so included here"

* tag 'sound-4.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430
  ALSA: hda - Update the list of quirk models
  ALSA: hda - Provide dual-codecs model option for a few Realtek codecs
  ALSA: hda - Apply dual-codec quirk for MSI Z270-Gaming mobo
  ALSA: hda - No loopback on ALC299 codec
  ALSA: usb-audio: fix Amanero Combo384 quirk on big-endian hosts
2017-05-26 09:03:09 -07:00
Mark Brown 7327a946a3 Merge remote-tracking branch 'asoc/fix/rt286' into asoc-linus 2017-05-26 12:42:28 +01:00
Mark Brown 6a9905e52c Merge remote-tracking branches 'asoc/fix/atmel', 'asoc/fix/cirrus', 'asoc/fix/da7213', 'asoc/fix/free' and 'asoc/fix/jack' into asoc-linus 2017-05-26 12:42:25 +01:00
Mark Brown 7a7ef5b9d5 Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus 2017-05-26 12:42:24 +01:00
Mark Brown 5e8338db84 Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus 2017-05-26 12:42:24 +01:00
Kuninori Morimoto 155b8f3aa6 ASoC: simple-card-utils: remove strict limitation of bit/frame master
Current asoc_simple_card_parse_daifmt is keeping backward compatibility
for bitmaster/framemaster which didn't use phandle.
The keep compatibility, it is checking prefix length, but it is
too strict. let's loosen it. Otherwise, OF-graph base sound card
which doesn't have prefix can't detect daifmt.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-26 12:40:53 +01:00
Kuninori Morimoto e8a3ce1130 ASoC: rsnd: fixup parent_clk_name of AUDIO_CLKOUTx
commit 25165f79ad ("ASoC: rsnd: enable clock-frequency for both
44.1kHz/48kHz") supported both 44.1kHz/48kHz for AUDIO_CLKOUTx,
but it didn't care its parent clock name.
This patch fixes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-26 12:39:07 +01:00
Richard Fitzgerald 503ada8a6d ASoC: wm_adsp: Fix typo in algorithm list warning message
The list terminator is 0xbedead but the message warning if it
wasn't found was showing that 0xbeadead was expected.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-26 12:18:21 +01:00
Takashi Sakamoto 2c4842d3b6 ALSA: pcm: add local header file for snd-pcm module
Several files are used to construct PCM core module, a.k.a snd-pcm.
Although available APIs are described in 'include/sound/pcm.h', some of
them are not exported as symbols in kernel space. Such APIs are just for
module local usage.

This commit adds module local header file and move some function prototypes
into it so that scopes of them are controlled properly and developers
get no confusion from unavailable symbols.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-26 08:38:14 +02:00
Takashi Iwai 9027c4639e ALSA: pcm: Call ack() whenever appl_ptr is updated
Although the ack callback is supposed to be called at each appl_ptr or
hw_ptr update, we missed a few opportunities: namely, forward, rewind
and sync_ptr.

Formerly calling ack at rewind may have leaded to unexpected results
due to the forgotten negative appl_ptr update in indirect-PCM helper,
which is the major user of the PCM ack callback.  But now we fixed
this oversights, thus we can call ack callback safely even at rewind
callback -- of course with the proper handling of the error from the
callback.

This patch adds the calls of ack callback in the places mentioned in
the above.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-25 23:34:47 +02:00
Takashi Iwai 3e02c5a60e ALSA: rme32: Deliver indirect-PCM transfer error
Now that the indirect-PCM transfer helper gives back an error, we
should return the error from ack callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-25 23:34:47 +02:00
Takashi Iwai 00277e2b5f ALSA: emu10k1: Deliver indirect-PCM transfer error
Now that the indirect-PCM transfer helper gives back an error, we
should return the error from ack callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-25 23:34:46 +02:00
Takashi Iwai cebf6bfe5e ALSA: cs46xx: Deliver indirect-PCM transfer error
Now that the indirect-PCM transfer helper gives back an error, we
should return the error from ack callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-25 23:34:46 +02:00
Takashi Iwai 0f21e57dec ALSA: mips: Deliver indirect-PCM transfer error
Now that the indirect-PCM transfer helper gives back an error, we
should return the error from ack callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-25 23:34:46 +02:00
Takashi Sakamoto 6dbaf8b913 ALSA: sb: remove needless evaluation in implementation for copy callback
In design of ALSA pcm core, 'struct snd_pcm_ops.copy' is expected to
copy PCM frames, according to frame alignment on intermediate buffer for
userspace and dedicated buffer for data transmission. In this callback,
value of 'channel' argument depends on the frame alignment, which drivers
registers to runtime of PCM substream. When target devices can handle
non-interleaved buffer, this value has positive value, otherwise negative.

ALSA driver for PCM component of EMU8000 chip is programmed with local
macro to switch the frame alignment. The 'copy' operation in
non-interleaved side has evaluation of the 'channel' argument (actually
it's 'voice' argument). This is useless.

This commit remove the evaluation.

[tiwai: the negative channel argument was the inheritance from the old
 code where -1 was meant for interleaved mode.  The mix-up was dropped
 meanwhile, thus it's correct to assume that we receive no longer -1
 there, and it's safe to cleanup the relevant code.

 Also, voice=0 for channel==1 is trivial, and it can be dropped, too.]

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-24 23:49:38 +02:00
Takashi Sakamoto 097a7fe369 ALSA: gus: remove unused local flag
ALSA driver series for devices of Gravis Ultra Sound includes local
variable 'snd_gf1_pcm_use_dma'. Although this is a flag to change
behaviours of local implementations for 'struct snd_pcm_ops.copy' and
'struct snd_pcm_ops.silence', it's invariable during module lifetime.

This commit removes this local variable and the relevant operations.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-24 23:47:42 +02:00
Kuninori Morimoto 96203fb423 ASoC: hdmi-codec: add .get_dai_id support
ALSA SoC needs to know connected DAI ID for probing.
It is not a big problem if device/driver was only for sound,
but getting DAI ID will be difficult if device includes both
Video/Sound, like HDMI.
To solve this issue, this patch adds new .get_dai_id callback
on hdmi_codec_ops

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:45:29 +01:00
Kuninori Morimoto 24069b589b ASoC: hdmi-codec: remove multi detection support
DesignWare HDMI driver (= dw-hdmi) is supporting HDMI sound, and its
probe function was calling sound binding function multiple times as
same HDMI device different port.

Because of this behavior, commit 9731f82d60 ("ASoC: hdmi-codec: enable
multi probe for ...") was added for multi detection case.
But, this DesignWare HDMI detection/bind code was exchanged/adjusted by
commit 69497eb923 ("drm: bridge: dw-hdmi: Implement DRM bridge...").
Now, all DesignWare HDMI sound ports are detected as 1 bindng function.

Because of this, hdmi-codec multi detection support is no longer needed.
Thus, this patch removes
commit 9731f82d60 ("ASoC: hdmi-codec: enable multi probe for ..."),
and its related
commit 340327a62c ("ASoC: hdmi-codec: Fix hdmi_of_xlate_dai_name...")
commit 8480ac5679 ("ASoC: hdmi-codec: remove HDMI device unregister")
commit 0c343a35bf ("ASoC: hdmi-codec: fix spelling mistake: ...)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:45:29 +01:00
Mark Brown e82f1f7907 Merge branch 'topic/of-graph' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-hdmi 2017-05-24 18:45:17 +01:00
Kuninori Morimoto 73b17f1a65 ASoC: simple-card-utils: support snd_soc_get_dai_id()
ALSA SoC needs to know connected DAI ID for detecting.
It is not a big problem if device/driver was only for sound,
but getting DAI ID will be difficult if device includes both
Video/Sound, like HDMI.
To solve this issue, this patch adds new snd_soc_get_dai_id() and
its related .of_xlate_dai_id callback on component driver.
In below case, we can handle Sound port (= port@2) as ID = 0
if .of_xlate_dai_id has its support.

	hdmi {
		port@0 { /* VIDEO */ };
		port@1 { /* VIDEO */ };
		port@2 { /* SOUND */ };
	};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:44:11 +01:00
Mark Brown 7932787f03 Merge branch 'topic/dai-id' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-of-graph 2017-05-24 18:44:06 +01:00
Kuninori Morimoto a180e8b988 ASoC: add snd_soc_get_dai_id() function
ALSA SoC needs to know connected DAI ID for detecting.
It is not a big problem if device/driver was only for sound,
but getting DAI ID will be difficult if device includes both
Video/Sound, like HDMI.
To solve this issue, this patch adds new snd_soc_get_dai_id() and
its related .of_xlate_dai_id callback on component driver.
In below case, we can handle Sound port (= port@2) as ID = 0
if .of_xlate_dai_id has its support.

	hdmi {
		port@0 { /* VIDEO */ };
		port@1 { /* VIDEO */ };
		port@2 { /* SOUND */ };
	};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:37:47 +01:00
Naveen M 0809d9871d ASoC: Intel: Add Kabylake RT5663+MAX98927 machine driver entry
Adds kbl_rt5663_max98927_i2s machine driver entry into machine table

Signed-off-by: Naveen M <naveen.m@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:27:54 +01:00
Naveen M ec040dd5ef ASoC: Intel: Add Kabylake Realtek Maxim machine driver
This patch adds Kabylake I2S machine driver which uses codecs
MAX98927 as speakers and RT5663 as headset, configured to ssp0
& ssp1 respectively.

Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:27:50 +01:00
Naveen M 54746dabf7 ASoC: Improve machine driver selection based on quirk data
Use quirk function to select the correct machine driver
by checking all codecs instead of only one based on quirk data.

Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:27:47 +01:00
Naveen M 7827d66946 ASoC: Move quirk to identify correct machine driver
sst_acpi_mach has a quirk field to handle board specific quirks.
Patch moves quirk call to sst_acpi_find_machine() instead of calling
it in respective driver

Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:27:43 +01:00
Naveen M 915ae2b9f0 ASoC: Intel: Create a helper to search for matching machine
Create a helper function to search for a matching machine
based on HID. No functional change

Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:27:39 +01:00
Naveen M 9bf70cd4cd ASoC: Intel: Convert skl machine data to C99 style
C99 style struct initialization helps in readability as well as
initialization of variables not specified as NULL.
Patch modifies all skl machine data.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:27:33 +01:00
Naveen M edc692e505 ASoC: Intel: Convert atom machine data to C99 style
C99 style struct initialization helps in readability as well as
initialization of variables not specified as NULL.
Patch modifies all atom machine data.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:27:28 +01:00
Shreyas NC 133e6e5c27 ASoC: Intel: Skylake: Support for multiple data blocks
Module init params are additional data block in the module private data.
Skylake driver doesn't yet have support to parse multiple data blocks if
it appears in private data. Add support for parsing of multiple data
blocks and module init params.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:25:49 +01:00
Shreyas NC 0a71677691 ASoC: Intel: Skylake: Fix to parse consecutive string tkns in manifest
Element size in the manifest should be updated for each token, so that the
loop can parse all the string elements in the manifest. This was not
happening when more than two string elements appear consecutively, as it is
not updated with correct string element size. Fixed with this patch.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:25:25 +01:00
Pardha Saradhi K 5cd1f5c321 ASoC: Intel: Skylake: Fix IPC rx_list corruption
In SKL+ platforms, all IPC commands are serialised, i.e. the driver sends
a new IPC to DSP, only after receiving a reply from the firmware for the
current IPC.

Hence it seems apparent that there is only a single modifier of the IPC RX
List. However, during an IPC timeout case in a multithreaded environment,
there is a possibility of the list element being deleted two times if not
properly protected.

So, use spin lock save/restore to prevent rx_list corruption.

Signed-off-by: Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:25:12 +01:00
Matthias Kaehlcke 9a075265c6 ASoC: Intel: sst: Remove unused function sst_restore_shim64()
Looks like the function has never been used since it was added by commit
b0d94acd63 ("ASoC: Intel: mrfld - add shim save restore"). Removing it
fixes the following warning when building with clang:

sound/soc/intel/atom/sst/sst.c:360:20: error: unused function
    'sst_restore_shim64' [-Werror,-Wunused-function]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:21:55 +01:00
Charles Keepax 177e27133a ASoC: cs4271: Remove unnecessary additional variable definition
The function already defines a ret variable at the top and makes
no particular use of the shadowed definition, as such remove the
redundant definition.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:12:36 +01:00
Matthias Kaehlcke 140385d87a ASoC: cht_bsw_max98090_ti: Remove unused function cht_get_codec_dai()
Looks like the function has never been used since it was added by commit
17119a4657 ("ASoC: Intel: Add Cherrytrail & Braswell machine driver
cht_bsw_max98090_ti"). Removing it fixes the following warning when
building with clang:

sound/soc/intel/boards/cht_bsw_max98090_ti.c:42:35: error: unused
    function 'cht_get_codec_dai' [-Werror,-Wunused-function]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:12:04 +01:00
Kuninori Morimoto 7819a942de ASoC: rsnd: SSI PIO adjust to 24bit mode
commit 90431eb49b ("ASoC: rsnd: don't use PDTA bit for 24bit on SSI")
fixups 24bit mode data alignment, but PIO was not cared.
This patch fixes PIO mode 24bit data alignment

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:11:47 +01:00
Takashi Iwai 4efda5f213 ASoC: Fix use-after-free at card unregistration
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>
2017-05-24 18:11:08 +01:00
Richard Fitzgerald f6db09488f ASoC: wm_adsp: Remove unused member of struct wm_coeff_ctl_ops
The xinfo member of struct wm_coeff_ctl_ops is never used.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:10:51 +01:00
Richard Fitzgerald 6298117a5c ASoC: wm_adsp: Fix type warning in sprintf
The shift member of struct soc_mixer_control is unsigned int.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 18:10:51 +01:00
Icenowy Zheng b08a20f58d ASoC: sun8i-codec-analog: split out mbias
Allwinner V3s features an analog codec without MBIAS pin.

Split out this part, in order to prepare for the V3s analog codec.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 17:53:40 +01:00
Julian Scheel 7ac45d1635 ASoC: simple-card: Fix misleading error message
In case cpu could not be found the error message would always refer to
/codec/ not being found in DT. Fix this by catching the cpu node not found
case explicitly.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-24 17:43:21 +01:00
Takashi Sakamoto 4e361d3c96 ALSA: control: remove entry limitation for list operation
In current implementation of ALSA control core, list operation has
a limitation to handle 16384 entries at once. This seems due to
allocation in kernel space to copy data from user space.

With a commit 53e7bf4525 ("ALSA: control: Simplify snd_ctl_elem_list()
implementation"), for the operation, ALSA control core copies data
into user space directly. No need to care of kernel spaces anymore.

This commit purges the limitation.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-24 10:18:28 +02:00
Adam Thomson 679d026932 ASoC: da7218: Fix incorrect usage of bitwise '&' operator for SRM check
In the SRM lock check section of code the '&' bitwise operator is
used as part of checking lock status. Functionally the code works
as intended, but the conditional statement is a boolean comparison
so should really use '&&' logical operator instead. This commit
rectifies this discrepancy.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-23 12:23:08 +01:00
Alexander Tsoy 1fc2e41f7a ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430
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>
2017-05-23 07:54:59 +02:00
Takashi Iwai ffb73b08e7 ALSA: info: Use kvzalloc() for a temporary write buffer
We used to use kmalloc (more exactly, krealloc()) for creating and
growing the temporary buffer for text proc write.  It can grow up to
16kB, and it's already a bit doubtful whether it's always safe to use
kmalloc().  With the recent addition of kvmalloc(), we can have a
better chance for succeed of memory allocation, so let's switch to
that new API.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-23 07:04:06 +02:00
Takashi Iwai c2c86a9717 ALSA: pcm: Remove set_fs() in PCM core code
PCM core code has a few usages of set_fs(), mostly for two codepaths:
- The DELAY ioctl call from pcm_compat.c
- The ioctl wrapper in kernel context for PCM OSS and other

This patch removes the set_fs() usage in these places by a slight code
refactoring.  For the former point, snd_pcm_delay() is changed to
return the  value directly instead of putting the value to the given
address.  Each caller stores the result in an appropriate manner.

For fixing the latter, snd_pcm_lib_kernel_ioctl() is changed to call
the functions directly as well.  For achieving it, now the function
accepts only the limited set of ioctls that have been used, so far.
The primary user of this function is the PCM OSS layer, and the only
other user is USB UAC1 gadget driver.  Both drivers don't need the
full set of ioctls.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-23 07:04:05 +02:00
Takashi Iwai 53e7bf4525 ALSA: control: Simplify snd_ctl_elem_list() implementation
This patch simplifies the code of snd_ctl_elem_list() in the following
ways:

- Avoid a vmalloc() temporary buffer but do copy in each iteration;
  the vmalloc buffer was introduced at the time we took the spinlock
  for the ctl element management.

- Use the standard list_for_each_entry() macro

- Merge two loops into one;
  it used to be a loop for skipping until offset becomes zero and
  another loop to copy the data.  They can be folded into a single
  loop easily.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-23 07:03:55 +02:00
Takashi Iwai ba90d6a6b0 ALSA: hda - Provide dual-codecs model option for a few Realtek codecs
Recently some laptops and mobos are equipped with the dual Realtek
codecs that require special quirks.  For making the debugging easier,
add the model "dual-codecs" to be passed via module option.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-22 16:38:47 +02:00
Takashi Iwai 63691587f7 ALSA: hda - Apply dual-codec quirk for MSI Z270-Gaming mobo
MSI Z270-Gamin mobo has also two ALC1220 codecs like Gigabyte AZ370-
Gaming mobo.  Apply the same quirk to this one.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-22 16:36:00 +02:00
Takashi Sakamoto a02cb8f8de ALSA: firewire: remove support for 16 bit PCM samples in playback substream
In IEC 61883-6, AM824 is described as format of data block. In this
format, one data block consists of several data channels, which is aligned
to 32 bit. One data channel has 8 bit label field and 24 bit data field.
PCM frames are transferred in Multi Bit Linear Audio (MBLA) data channel.
This channel can include 16/20/24 bit PCM sample.

As long as I know, models which support IEC 61883-1/6 doesn't allow to
switch bit length of PCM sample in MBLA data channel. They always
transmit/receive PCM frames of 24 bit length. This can be seen for the
other models which support protocols similar to IEC 61883-1/6.

On the other hand, current drivers for these protocols supports 16 bit
length PCM sample in playback substream. In this case, PCM sample is put
into the MBLA data channel with 8 bit padding in LSB side. Although 16
bit PCM sample is major because it's in CD format, this doesn't represent
device capability as is.

This commit removes support for 16 bit PCM samples in playback substream.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-22 16:24:08 +02:00
Bhumika Goyal 665170f731 ALSA: mixart: constify snd_kcontrol_new structures
Declare snd_kcontrol_new structures as const as they are only passed an
argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-21 09:08:15 +02:00
Bhumika Goyal 30b5817e09 ALSA: cs46xx: constify snd_kcontrol_new structures
Declare snd_kcontrol_new structures as const as they are only passed an
argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-21 09:08:10 +02:00
Bhumika Goyal 6ba1ad386c ALSA: ice1712: constify snd_kcontrol_new structures
Declare snd_kcontrol_new structures as const as they are only passed an
argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-21 09:08:04 +02:00
Bhumika Goyal 3a84d6c940 ALSA: sound/isa: constify snd_kcontrol_new structures
Declare snd_kcontrol_new structures as const as they are only passed an
argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-21 09:07:56 +02:00
Takashi Iwai e0327a0f21 ALSA: pcm: Simplify forward/rewind codes
Factor out the common codes in snd_pcm_*_forward() and *_rewind()
functions to simplify the codes.  No functional changes.

Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-21 08:58:30 +02:00
Takashi Iwai f839cc1cbd ALSA: pcm: Use a common helper for PCM state check and hwsync
The mostly same codes for checking the current PCM state and calling
hwsync are found in a few places.  This patch simplifies them by
creating a common helper function.

It also fixes a couple of cases where we missed the proper state check
(e.g. PAUSED state wasn't handled in rewind and snd_pcm_hwsync()),
too.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-21 08:57:31 +02:00
Kuninori Morimoto 7fa72cca39 ASoC: rsnd: add HDMI output support
Renesas R-Car Gen3 can output HDMI sound if SSIU/SSI are connected to
R-Car built-in HDMI device (R-Car Gen3 built-in HDMI device will be
controlled by DRM/KMS driver).
If SSIx was connected to HDMI0/1 on DT, SSI driver will detect it
automatically by this patch.
Note is that now Renesas R-Car sound driver is assuming that it is
using OF-graph base simple card for HDMI sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 18:36:25 +01:00
Kuninori Morimoto 4d4b334bda ASoC: rsnd: add support graph base DT phase 2
To enable OF-graph base DT on rsnd driver, and to keep compatible
previous normal sound card style, it need to support both
"rcar_sound,dai" and "ports" (or "port") on DT.

This patch parses both style.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 18:36:25 +01:00
Kuninori Morimoto 11d0f8ed6d ASoC: rsnd: add support graph base DT phase 1
To enable OF-graph base DT on rsnd driver, and to keep compatible
previous normal sound card style, it need to support both
"rcar_sound,dai" and "ports" (or "port") on DT.

This patch modify rsnd_dai_of_node() to parse
"rcar_sound,dai" and "ports" (or "port") as phase 1. It can detect
graph base style, but do nothing at this point.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 18:36:25 +01:00
olivier moysan e7cc49b8ad ASoC: stm32: Add full duplex support to i2s
This patch allows to use i2s interface either as single
audio path (rx or tx), or bidirectional audio path.
This patch is added separately, as the driver does not
follow recommended use of the interface, to support this
configuration.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 18:34:43 +01:00
olivier moysan e4e6ec7b12 ASoC: stm32: Add I2S driver
Add I2S ASoC driver for STM32.
This version of the driver supports only
exclusive playback and capture interface.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 18:34:43 +01:00
Stefan Agner f746aa5e86 ASoC: simple-card: fix mic jack initialization
Initialize asoc_simple_card_init_mic with the correct struct
asoc_simple_jack.

Fixes: 9eac361877 ("ASoC: simple-card: add new asoc_simple_jack and use it")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:34:04 +01:00
Kuninori Morimoto 1f8754d4da ASoC: rsnd: don't call free_irq() on Parent SSI
If SSI uses shared pin, some SSI will be used as parent SSI.
Then, normal SSI's remove and Parent SSI's remove
(these are same SSI) will be called when unbind or remove timing.
In this case, free_irq() will be called twice.
This patch solve this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:32:09 +01:00
Charles Keepax 486fb95903 ASoC: cs35l35: Correctly handle 0 for bst_ipk
Zero is a totally valid value to specify for the bst_ipk, as such we
should append CS35L35_VALID_PDATA to ensure that it actually makes it
into the register value.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:31:34 +01:00
Brian Austin b7c752d68a ASoC: cs35l35: Add Boost Inductor Calculation
Add the Boost Inductor parameters based off the size of the inductor
on the HW setup

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:31:34 +01:00
Colin Ian King a619f049f2 ASoC: audio-graph-card: fix spelling mistake: "missmatch" -> "mismatch"
Trivial fix to spelling mistake in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:28:28 +01:00
Kuninori Morimoto ecea931350 ASoC: audio-graph-card: tidyup return method from probe()
Current return method from probe() is very confusable.
This patch tidyup it to normal return method

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:28:18 +01:00
Kuninori Morimoto c73df77d72 ASoC: simple-scu-card: tidyup return method from probe()
Current return method from probe() is very confusable.
This patch tidyup it to normal return method

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:26:48 +01:00
Kuninori Morimoto c6d112e442 ASoC: simple-card: tidyup return method from probe()
Current return method from probe() is very confusable.
This patch tidyup it to normal return method

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:26:48 +01:00
Adam Thomson 0e54153b66 ASoC: da7213: Update driver to use device_property* FW functions
The driver now supports ACPI based initialisation as well as DT
and old pdata methods. However the FW data handling still uses
DT specific calls to read firmware data (of_property*) so for
ACPI based initialisation the FW data will only be set to default
values. This patch updates the FW handling to use device_property*
calls instead so that both ACPI and DT are handled as expected.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19 17:01:58 +01:00
Arnd Bergmann dcab5fb7a5 ALSA: pcm/oss: mark snd_pcm_plug_slave_format arg as const
Only one of the two declarations has the const modifier in the
argument list, so we get a warning when CONFIG_SND_PCM_OSS_PLUGINS
is disabled:

sound/core/oss/pcm_oss.c: In function 'snd_pcm_oss_change_params':
sound/core/oss/pcm_oss.c:898:47: error: passing argument 2 of 'snd_pcm_plug_slave_format' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

This makes the two declarations match again.

Fixes: e76bf3c4b4 ("ALSA: pcm/oss: refer to parameters instead of copying to reduce usage of kernel stack")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-18 16:39:08 +02:00
Arnd Bergmann 9aee03f39c ALSA: pcm: use "do {} while (0)" for empty macro
Recent compilers produce a harmless warning for the new pcm_call_notify()
macro when CONFIG_SND_PCM_OSS is disabled:

sound/core/pcm.c: In function 'snd_pcm_free':
sound/core/pcm.c:905:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

This turns the empty macro into a 'do {} while (0)' statement to avoid
the warning.

Fixes: 58f30d650c ("ALSA: pcm: Build pcm notifier code conditionally")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-18 16:38:49 +02:00
Quentin Schulz 61abce1312 ASoC: atmel-classd: sync regcache when resuming
The PM functions used in this driver are the ones defined in
sounc/soc/soc-core.c.

When suspending (using snd_soc_suspend), the regcache is marked dirty
but is never synced on resume.

Sync regcache on resume of Atmel ClassD device.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:50:35 +01:00
Oder Chiou 6d3edf866f ASoC: rt5514: Add ACPI match ID
This patch adds the ACPI match ID for rt5514 codec.

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:50:17 +01:00
Kuninori Morimoto 90431eb49b ASoC: rsnd: don't use PDTA bit for 24bit on SSI
Current SSI uses PDTA bit which indicates data that Input/Output
data are Right-Aligned. But, 24bit sound should be Left-Aligned
in this HW. Because Linux is using Right-Aligned data, and HW uses
Left-Aligned data, current 24bit data is missing lower 8bit.
To fix this issue, this patch removes PDTA bit, and shift 8bit
in necessary module

Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:49:45 +01:00
Takashi Iwai cd187753dc ASoC: atmel: Use IS_ENABLED()
Simplify the ifdef conditions with IS_ENABLED() macro.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:44:29 +01:00
Geert Uytterhoeven 3048e76c93 ASoC: fsi: Move inline fsi_stream_is_play() before use
With gcc 4.1.2:

    sound/soc/sh/fsi.c:304: warning: ‘fsi_stream_is_play’ declared inline after being called
    sound/soc/sh/fsi.c:304: warning: previous declaration of ‘fsi_stream_is_play’ was here

Move fsi_stream_is_play() up to fix this, removing the need for a
forward declaration as well.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:36:05 +01:00
Wei Yongjun 18fe786976 ASoC: rt5665: make local symbol rt5665_i2c_driver static
Fixes the following sparse warnings:

sound/soc/codecs/rt5665.c:4928:19: warning:
symbol 'rt5665_i2c_driver' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:31:22 +01:00
Kuninori Morimoto 374503c610 ASoC: rsnd: check src mod pointer for rsnd_mod_id()
Without this patch, gcc 4.9.x says

    sound/soc/sh/rcar/cmd.c: In function 'rsnd_cmd_init':
    sound/soc/sh/rcar/cmd.c:85:14: warning: array subscript is below array\
	bounds [-Warray-bounds]
	data = path[rsnd_mod_id(src)] |

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:30:47 +01:00
Kuninori Morimoto 2adcea7e22 ASoC: rsnd: need to call nolock_stop if nolock_start was failed
rsnd_dai_call() is counting the called number of start/stop functions.
nolock_stop should be called if nolock_start was failed.
Otherwise, nolock_start doesn't called in 2nd play.
This patch solved this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:28:30 +01:00
Kuninori Morimoto 1f6bbe64ab ASoC: rsnd: remove error pointer for adg->clkout[i]
commit d7f298197a
("ASoC: rcar: fixup of_clk_add_provider() usage for multi clkout")
added adg->clkout[i] = ERR_PTR(-ENOENT),
but, adg->clkout[i] are assumed NULL or clk pointer.
This patch fix it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:26:28 +01:00
Kuninori Morimoto 9654f5eba9 ASoC: rsnd: clkout-lr-asynchronous is AUDIO_CLKOUT related property
clkout-lr-asynchronous is AUDIO_CLKOUT related property, thus, it
should be handled by rsnd_adg_get_clkout().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:26:28 +01:00
Kuninori Morimoto 607ee05828 ASoC: rsnd: remove mismatch explain comment from src.c
Before, src.c cares SRC and SSIU, but now SSIU is cared by ssiu.c by
commit c7f69ab536 ("ASoC: rsnd: use mod base common method on SSIU").
This patch removes mismatched explanation for SRC/SSIU from src.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:26:28 +01:00
Kuninori Morimoto a9b10dddd6 ASoC: rsnd: remove un-used OUF_SRCO/I macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:26:28 +01:00
Colin Ian King 0c343a35bf ASoC: hdmi-codec: fix spelling mistake: "deteced" -> "detected"
Trivial fix to spelling mistake in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:24:10 +01:00
Kuninori Morimoto 2692c1c63c ASoC: add audio-graph-card support
OF-graph base DT binding are used on V4L2, and ALSA SoC is using
different style of DT today. Now ALSA SoC supports simple-card driver
for generic/simple sound card.
In the future, V4L2 / ALSA will support HDMI, and then, DT bindings
between V4L2 / ALSA should be merged.
This patch adds new Audio Graph Card which is OF-graph base of
simple-card

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:21:21 +01:00
Kuninori Morimoto 1689333f83 ASoC: simple-card-utils: add asoc_simple_card_parse_graph_dai()
simple-card already has asoc_simple_card_parse_dai(),
but graph base parsing needs graph specific version of it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:21:20 +01:00
Kuninori Morimoto dedfaa1eed ASoC: simple-card-utils: enable "label" on asoc_simple_card_parse_card_name
Current asoc_simple_card_parse_card_name() detects [prefix]name,
but in generally, we uses "label" for user visible names.
This patch enables it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:21:20 +01:00
Kuninori Morimoto 5711c97920 ASoC: soc-core: enable "dai-format" on snd_soc_of_parse_daifmt()
Current snd_soc_of_parse_daifmt() detects [prefix]format, but
"format" was unclear in some case. This patch checks "dai-format"
first, and try to check "[prefix]format" if "dai-format" was not
exist.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:21:19 +01:00
Geert Uytterhoeven b98ae9ad55 ASoC: rt5665: Fix uninitialized warning in rt5665_i2s_pin_event()
With gcc 4.1.2:

    sound/soc/codecs/rt5665.c: In function ‘rt5665_i2s_pin_event’:
    sound/soc/codecs/rt5665.c:2610: warning: ‘mask1’ may be used uninitialized in this function
    sound/soc/codecs/rt5665.c:2610: warning: ‘val2’ may be used uninitialized in this function
    sound/soc/codecs/rt5665.c:2610: warning: ‘val1’ may be used uninitialized in this function

The first one is currently a false positive, as rt5665_i2s_pin_event()
is never called with snd_soc_dapm_widget.shift set to a value not
handled by the switch() statement.  But that may change, so
preinitialize mask1 to fix this, like is already done for mask2.

The last two are false-positives, the compiler is just not smart enough
to notice the mask and val variables are always used together.

Fixes: 9b5d3865b3 ("ASoC: rt5665: set i2s pin share configuration")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17 10:11:45 +01:00
Takashi Sakamoto b46fe5d960 ALSA: pcm: constify function local and read-only table
In a function snd_pcm_hw_params_choose(), target parameters are arranged
into a table. Though each entry of this table is read-only, they don't
have const qualifier.

This commit adds the qualifier.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:25:26 +02:00
Takashi Sakamoto e76bf3c4b4 ALSA: pcm/oss: refer to parameters instead of copying to reduce usage of kernel stack
Some functions in compatibility layer for Open Sound System interface has
local variable to copy some parameters in runtime of PCM substream, while
this can be replaced with reference of pointers to parameter itself. This
brings an advantage to reduce usage of kernel stack.

This commit applies this idea.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:25:01 +02:00
Takashi Sakamoto b55f9fdcd3 ALSA: pcm: use helper function to refer parameter as read-only
ALSA pcm core has hw_param_interval_c() to pick up parameter with const
qualifier for safe programming.

This commit applies it to the cases.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:24:39 +02:00
Takashi Sakamoto 8b674308a2 ALSA: pcm: add const qualifier for read-only table for sampling rate
There's a read-only table for each sampling rate, while it doesn't have
const qualifier and can be modified.

This commit add the qualifier. As a result, a symbol for the table
moves from .data section to .rodata.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:24:24 +02:00
Takashi Iwai a96801b504 Merge branch 'topic/avr32-removal' into for-next 2017-05-17 07:13:29 +02:00
Takashi Iwai 29b59b3548 ALSA: Enable build with m68k
By some reason in the ancient history, we disabled the build of ALSA
drivers for m68k.  Since we'd like to move sound/oss/dmasound stuff
into ALSA for the complete drop of the legacy OSS stuff, let's try to
start building with m68k.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:14 +02:00
Takashi Iwai d42fe63d58 ALSA: emu10k1: Get rid of set_fs() usage
Instead of set_fs() hackery, do the straight memcpy() by passing a
flag indicating the kernel space operation.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:13 +02:00
Takashi Iwai 3ac8226fc8 ALSA: opl3: Kill unused set_fs()
snd_enter_user() and snd_leave_user() that call set_fs() are the dead
code in opl3 driver.  Let's rip them off.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:12 +02:00
Takashi Iwai 88c125b633 ALSA: hda - Remove superfluous header inclusions
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:12 +02:00
Takashi Iwai f0049e166b ALSA: hda - Fix a typo in comment
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:11 +02:00
Takashi Iwai 99b5c5bb9a ALSA: hda - Remove the use of set_fs()
set_fs() is used in HD-audio vmaster code to retrieve the TLV data of
each slave kctl.  Since the slave is supposed to be a standard amp
kctl, we can call directly the supposed tlv callback instead of the
indirect call, so that we can remove the set_fs() hack.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:10 +02:00
Takashi Iwai 3db9e970e3 ALSA: hda - Remove the generic bind ctl helpers
Now all the users of this workaround code is gone, and we can finally
remove the legacy codes from the core HD-audio module.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:10 +02:00
Takashi Iwai 698f5ee33b ALSA: hda - Move bind-mixer switch codes to generic parser
The generic parser is the only user of the bind-mixer controls, so we
can move the code there and clean up the core helper.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:09 +02:00
Takashi Iwai a717777dbf ALSA: hda - Simplify bound-beep mute control for ALC268
The beep mute switch for ALC268 needs to touch two NIDs, and we used
to apply the bind-mixer stuff.  But the use case for ALC268 is fairly
easy to convert to an open-code in a shorter form.  Since this is the
only user of the bind-ctls, we can clean up the common helper codes
later.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:08 +02:00
Takashi Iwai 6670117067 ALSA: cs4281: Fix the leftover comment
The comment at endif line was forgotten to be corrected when the
condition was converted to IS_REACHABLE().  Fix it, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:07 +02:00
Takashi Iwai a0af56de2c ALSA: sb: Use IS_REACHABLE()
Replace the complex ifdef conditions with IS_REACHABLE() macro.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:06 +02:00
Takashi Iwai 2e2d4cb450 ALSA: opl4: Use IS_REACHABLE()
Rewrite the complex ifdef condition with IS_REACHABLE().
The ifdef in opl4_local.h was without defined(MODLE) check, but this
is likely the oversight.  Use IS_REACHABLE() here as well.

Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:05 +02:00
Takashi Iwai 88faa38435 ALSA: cmi8238: Use IS_ENABLED()
Simplify the ifdef conditions with IS_ENABLED() macro.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:05 +02:00
Takashi Iwai 58f30d650c ALSA: pcm: Build pcm notifier code conditionally
The PCM notifier code is used only by OSS emulation layer, so we can
build it conditionally for reducing the size.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:03 +02:00
Takashi Iwai 239480ab92 ALSA: ak411x: Use array instead of offsetof()
The ak4113, ak4114 and ak4117 i2c drivers have some tricky codes to
access the struct fields in the callback.  This can be simplified by
replacing the struct fields with the array.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:13:03 +02:00
Takashi Iwai 2e0de6ea95 ALSA: vxpocket: Use container_of()
The vxpocket driver is using the explicit cast from the parent class
pointer, but it'll be broken when the structure field randomization is
applied.  Use container_of() in a modern manner, instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-17 07:12:57 +02:00
Takashi Iwai fa16b69f12 ALSA: hda - No loopback on ALC299 codec
ALC299 has no loopback mixer, but the driver still tries to add a beep
control over the mixer NID which leads to the error at accessing it.
This patch fixes it by properly declaring mixer_nid=0 for this codec.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195775
Fixes: 28f1f9b26c ("ALSA: hda/realtek - Add new codec ID ALC299")
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-16 09:11:33 +02:00
Andy Shevchenko 020c5260c2 ALSA: atmel: Remove AVR32 bits from the driver
AVR32 is gone. Now it's time to clean up the driver by removing
leftovers that was used by AVR32 related code.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-15 17:07:00 +02:00
Ville Syrjälä 668e3b014a drm/i915: Fix runtime PM for LPE audio
Not calling pm_runtime_enable() means that runtime PM can't be
enabled at all via sysfs. So we definitely need to call it
from somewhere.

Calling it from the driver seems like a bad idea because it
would have to be paired with a pm_runtime_disable() at driver
unload time, otherwise the core gets upset. Also if there's
no LPE audio driver loaded then we couldn't runtime suspend
i915 either.

So it looks like a better plan is to call it from i915 when
we register the platform device. That seems to match how
pci generally does things. I cargo culted the
pm_runtime_forbid() and pm_runtime_set_active() calls from
pci as well.

The exposed runtime PM API is massive an thorougly misleading, so
I don't actually know if this is how you're supposed to use the API
or not. But it seems to work. I can now runtime suspend i915 again
with or without the LPE audio driver loaded, and reloading the
LPE audio driver also seems to work.

Note that powertop won't auto-tune runtime PM for platform devices,
which is a little annoying. So I'm not sure that leaving runtime
PM in "on" mode by default is the best choice here. But I've left
it like that for now at least.

Also remove the comment about there not being much benefit from
LPE audio runtime PM. Not allowing runtime PM blocks i915 runtime
PM, which will also block s0ix, and that could have a measurable
impact on power consumption.

Cc: stable@vger.kernel.org
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes: 0b6b524f39 ("ALSA: x86: Don't enable runtime PM as default")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-2-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 183c00350c)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2017-05-15 14:44:11 +03:00
Takashi Iwai 5f976f5891 ALSA: vx222: Use container_of()
The vx222 driver is using the explicit cast from the parent class
pointer, but it'll be broken when the structure field randomization is
applied.  Use container_of() in a modern manner, instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-15 11:21:05 +02:00
Johan Hovold 6c1df23273 ALSA: us122l: enable compile testing
This USB driver currently depends on X86 for some undocumented reason.
Since it compiles just fine for arm, we can at least enable compile
testing.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-15 11:02:14 +02:00
Johan Hovold 5c7e7d586a ALSA: us122l: clean up US144 handling
Use the device-id table and a private flag to determine the device type
(US122 or US144) rather than spreading product-id conditionals
throughout the driver.

This USB driver currently depends on X86 (why?), but we should still add
the missing endianness conversions when accessing the USB
device-descriptor fields.

Compile-tested only.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-15 11:02:08 +02:00
Johan Hovold f83914fdfc ALSA: usb-audio: fix Amanero Combo384 quirk on big-endian hosts
Add missing endianness conversion when using the USB device-descriptor
bcdDevice field when applying the Amanero Combo384 (endianness!) quirk.

Fixes: 3eff682d76 ("ALSA: usb-audio: Support both DSD LE/BE Amanero firmware versions")
Cc: Jussi Laako <jussi@sonarnerd.net>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-15 11:01:37 +02:00
Bard Liao 30b7d88de0 ASoC: rt5665: add ADC STO2 ASRC support
"ADC Stereo2 Filter" is with ASRC supported.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:14:52 +09:00
Oder Chiou d60bc8d6c6 ASoC: rt5514: Add more width and channels support in the TDM mode
This patch adds more width and channels support in the TDM mode.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:14:33 +09:00
John Hsu fa10143027 ASoC: nau8824: TDM support
Support TDM format for NAU88L24.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: John Hsu <supercraig0719@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:14:10 +09:00
Colin Ian King 3c0a98c595 ASoC: Intel: sst: fix spelling mistake: "allocationf" -> "allocation"
Trivial fix to spelling mistake in dev_err message. Also replace "fail"
with "failure".

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:09:13 +09:00
Tomas Vilda 51827c41c9 ASoC: tlv320dac31xx: Fix mistype in tlv320dac31xx codec
Signed-off-by: Tomas Vilda <tomas.vilda@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:08:16 +09:00
Takashi Sakamoto 65db85fba1 ASoC: intel: atom: localize variable without external linkage
A driver for Intel SST driver for old atom platform includes a variable
which has no external linkage. These functions should have static
qualifier.

This commit adds the qualifier to localize the variable. This issue is
detected by sparse:

sst.c:261:1: warning: symbol 'dev_attr_firmware_version' was not declared. Should it be static?

Cc: Sebastien Guiriec <sebastien.guiriec@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:00:44 +09:00
Takashi Sakamoto 2a54e845f6 ASoC: hisilicon: localize functions without external linkage
A driver for hi6210 sound interface on hi6220 boards includes some
functions which has no external linkage. These functions should have
static qualifier.

This commit adds the qualifier to localize the functions. This issue is
detected by sparse:

hi6210-i2s.c💯5: warning: symbol 'hi6210_i2s_startup' was not declared. Should it be static?
hi6210-i2s.c:178:6: warning: symbol 'hi6210_i2s_shutdown' was not declared. Should it be static?
hi6210-i2s.c:527:27: warning: symbol 'hi6210_i2s_dai_init' was not declared. Should it be static?

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 19:00:18 +09:00
Takashi Sakamoto 9f3b777f1d ASoC: codecs: msm8916: fix invalid cast to bool type
A function snd_soc_update_bits() is an application of
regmap_update_bits_base(). This function takes some arguments for bitmask
and new value, thus the arguments should be a type which has width.
However bool is used to variable for the argument. This brings truncation
and results in invalid operation.

This commit fixes this bug by using unsigned int type, instead of bool.
This bug is detected by sparse:

smsm8916-wcd-analog.c:809:43: warning: odd constant _Bool cast (40 becomes 1)
smsm8916-wcd-analog.c:814:43: warning: odd constant _Bool cast (40 becomes 1)

Fixes: 585e881e5b ("ASoC: codecs: Add msm8916-wcd analog codec")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:58:03 +09:00
Adam Thomson 14f814fbed ASoC: da7213: Fix incorrect usage of bitwise '&' operator for SRM check
In the SRM lock check section of code the '&' bitwise operator is
used as part of checking lock status. Functionally the code works
as intended, but the conditional statement is a boolean comparison
so should really use '&&' logical operator instead. This commit
rectifies this discrepancy.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:53:37 +09:00
Yifeng Li fe0dfd6358 rt286: add Thinkpad Helix 2 to force_combo_jack_table
Thinkpad Helix 2 is a tablet PC, the audio is powered by Core M
broadwell-audio and rt286 codec. For all versions of Linux kernel,
the stereo output doesn't work properly when earphones are plugged
in, the sound was coming out from both channels even if the audio
contains only the left or right channel. Furthermore, if a music
recorded in stereo is played, the two channels cancle out each other
out, as a result, no voice but only distorted background music can be
heard, like a sound card with builtin a Karaoke sount effect.

Apparently this tablet uses a combo jack with polarity incorrectly
set by rt286 driver. This patch adds DMI information of Thinkpad Helix 2
to force_combo_jack_table[] and the issue is resolved. The microphone
input doesn't work regardless to the presence of this patch and still
needs help from other developers to investigate.

This is my first patch to LKML directly, sorry for CC-ing too many
people here.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=93841
Signed-off-by: Yifeng Li <tomli@tomli.me>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:53:00 +09:00
Subhransu S. Prusty c0116be3d1 ASoC: Intel: Skylake: Fix typo for token d0i3 caps
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:49:17 +09:00
Vinod Koul ab1b732d53 ASoC: Intel: Skylake: Move i915 registration to worker thread
The i915 component framework expects the caller to be invoking
snd_hdac_i915_init() from a thread context. Otherwise it results in
lockups on drm side.

So move the registering of component interface and probing of codecs on
this bus to a worker thread.

init_failed in skl structure is not used currently, so renamed to
init_done and used to track the initialization done in worker thread.

Reported-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Sodhi, VunnyX <vunnyx.sodhi@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:48:57 +09:00
Kuninori Morimoto ec185f9540 ASoC: ak4613: disable asymmetric audio interface format
Asymmetric audio interface formats exist in ak4613 by same
register settings.

	Capture		Playback
	24bit LEFT_J	16bit RIGHT_J
	24bit LEFT_J	20bit RIGHT_J
	24bit LEFT_J	24bit RIGHT_J
	24bit LEFT_J	24bit LEFT_J
	24bit I2S	24bit I2S

These asymmetric formats makes driver / behavior difficult.
It is not HW limitation, but SW limitation. To makes code reading
easy, this patch removes asymmetric format support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:38:54 +09:00
Arnd Bergmann 27a655c4bd ASoC: rt5665: fix gcc-7 warning
gcc-7 warns that there is a duplicate 'const' specifier in some
variables that are declared using the SOC_ENUM_SINGLE_DECL macro:

sound/soc/codecs/rt5665.c:915:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_01_adc_enum,
sound/soc/codecs/rt5665.c:918:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_23_adc_enum,
sound/soc/codecs/rt5665.c:921:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_45_adc_enum,
sound/soc/codecs/rt5665.c:924:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_67_adc_enum,
...

This removes one to fix the 68 warnings in this file

Fixes: 33ada14a26 ("ASoC: add rt5665 codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:37:01 +09:00
Arnd Bergmann 03ba791df9 ASoC: rt5514: fix gcc-7 warning
gcc-7 warns that there is a duplicate 'const' specifier in some
variables that are declared using the SOC_ENUM_SINGLE_DECL macro:

sound/soc/codecs/rt5514.c:398:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(
sound/soc/codecs/rt5514.c:405:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier]
 static const SOC_ENUM_SINGLE_DECL(

This removes one to fix the warning.

Fixes: 4a6180ea73 ("ASoC: rt5514: add rt5514 codec driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:36:39 +09:00
Peter Ujfalusi e4798d2654 ASoC: davinci-mcasp: Support for one channel (mono) audio
Mono audio can be achieved by configuring McASP to transmit/receive only
during one timeslot. McASP will still going to generate clocks for the
other slot(s), but will only use the single slot to transmit/receive.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14 18:22:12 +09:00
Linus Torvalds deac8429d6 sound fixes for 4.12-rc1
This contains a one-liner change that has a significant impact:
 disabling the build of OSS.  It's been unmaintained for long time,
 and we'd like to drop the stuff.  Finally, as the first step, stop
 the build.  Let's see whether it works without much complaints.
 
 Other than that, there are two small fixes for HD-audio.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEECxfAB4MH3rD5mfB6bDGAVD0pKaQFAlkVr2YOHHRpd2FpQHN1
 c2UuZGUACgkQbDGAVD0pKaQPqRAAoTbIYoB30Wzrg/CraNwTC0ks0pVF1Pjk6mQF
 2phnpwbUZ/Hj2bD+4ydlaeNO93pXJHlyvoQwfxlb/tJEg8pVZ2PwyLZ/nfKAGDHg
 BJHpGuv3CUvrU/OzZ2xXGfKeiMibhE7Bfjnl/hriztiCNdeEVE6tQU5hRczSUzk8
 zgo3fmDsmP4NZqBR9DnrfTsti+HWcclAYKbxaHPxOfVOkKpd5waVQu4AAU5JgBhE
 mifvey0QaRUhpDs8ETlDZhvLJICbB6Ybb2l2hK+HyQBwSOSUjHNBXlnsBXpeXUVJ
 Ay/hJ4/u0PfeNafxZm66fTEHHTvyXCiCfjStKvIqGkjkAgI73r2H5qrdk4FhyFDI
 ovOGMR8j5YKH4smcU13Yx8qoQqmpjNJiL1eplFsRv+BImiIAADH8AMhdKySOQa9/
 wmw6qWcwo+LHkxu+l+FCjaQlsZbRhaBmYRnSG4A0IU/lTWhcFk0BYa98Hj/TpjoB
 Yo1JmUhYW80h424p0eqV/vl/VDCiUpMct4YcvK3nNDi/1uuLC8qC8jr+qH8Bssg8
 9xZjaXDKf3Hf2x7r++kU2xjb1NEWH5WMBFzpXEuN6I+nY/BJG5i/JrXlvWBAG+qZ
 Cn3rOAE2ACM9Vs6wtIhaDU7aMoaCb/GlkkmcF7y3XRSmUF53yVICoCNLZ1zFuJrh
 Pr2CjJ4=
 =Na0H
 -----END PGP SIGNATURE-----

Merge tag 'sound-fix-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This contains a one-liner change that has a significant impact:
  disabling the build of OSS. It's been unmaintained for long time, and
  we'd like to drop the stuff. Finally, as the first step, stop the
  build. Let's see whether it works without much complaints.

  Other than that, there are two small fixes for HD-audio"

* tag 'sound-fix-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  sound: Disable the build of OSS drivers
  ALSA: hda: Fix cpu lockup when stopping the cmd dmas
  ALSA: hda - Add mute led support for HP EliteBook 840 G3
2017-05-12 12:10:38 -07:00
Takashi Iwai 31cbee6a56 sound: Disable the build of OSS drivers
OSS drivers are left as badly unmaintained, and now we're facing a
problem to clean up the hackish set_fs() usage in their codes.  Since
most of drivers have been covered by ALSA, and the others are dead old
and inactive, let's leave them RIP.

This patch is the first step: disable the build of OSS drivers.
We'll eventually drop the whole codes and clean up later.

Note that sound/oss/dmasound is still kept, since it's a completely
different implementation of OSS, and it doesn't suffer from set_fs()
hack.  Moreover, the build of ALSA is disabled on M68K by some reason,
thus disabling it shall result in a regression.  This one will be
disabled / removed once when we add the support in ALSA side.

Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-12 09:57:20 +02:00
Linus Torvalds 291b38a756 Annotation of module parameters that specify device settings
-----BEGIN PGP SIGNATURE-----
 
 iQIVAwUAWPiW6vSw1s6N8H32AQLOrw/+NTqGf7bjq+64YKS6NfR0XDgE+wNJltGO
 ck7zJW3NHIg76RNu8s0I9xg5aVmwizz3Z5DGROZquaolnezux4tQihZ3AFyxIzLc
 +Y3WHYagcML7yFfjl/WznCLRD5EW3yPln4lCvQO0nW/xICRYeRI057JaIbi2Dtek
 BhcXt3c4AjXDLdYJkgtHV3p2R2mt8hcdFdWqqx6s7JaIThZNRGNzxAgtbcB9k5IW
 HVG9ZEIL73VBYWHrYivzjHYF5rBnNCPt87eOwDQeTOSkhv8te+u9k+bH8vxZw1T0
 XUtDrLBndKiuVo2GUfLkkF8LItx3Q9eLCJYy0joaIliyPqTEsPx9KjQ+Af0cxS9s
 ZPCZ5SYf96stKmDeL5xaMfrAmeyVHJ4lc4JTOqdzbIT8blsOSfYO/03p0ALShSDv
 /RQLaKGlf8Bjoy8PwKFcXb4sIDufcd/U1Av/EMFXxOfgN/u2JUkGKq6EaIM5B68L
 fHPje+aR9VNELPmPjwNOWtmN4I79EH3EItQf7zv0KG+UeKhcHLx/EAcSJ3ZRKEkH
 Lathg7pPOEJGArPiVO79TZzBG01ADn1aiwv65XObMzNZ+54xI/mN/Y1DNF/kL5jU
 XzvNzEjFt8mwMIZGVNdAt4+pDyMfIZGZSyUkSRKFnaQZMIvQrfQIU9RLBYLX5eOx
 +/p0VkIwDpg=
 =lbS7
 -----END PGP SIGNATURE-----

Merge tag 'hwparam-20170420' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs

Pull hw lockdown support from David Howells:
 "Annotation of module parameters that configure hardware resources
  including ioports, iomem addresses, irq lines and dma channels.

  This allows a future patch to prohibit the use of such module
  parameters to prevent that hardware from being abused to gain access
  to the running kernel image as part of locking the kernel down under
  UEFI secure boot conditions.

  Annotations are made by changing:

        module_param(n, t, p)
        module_param_named(n, v, t, p)
        module_param_array(n, t, m, p)

  to:

        module_param_hw(n, t, hwtype, p)
        module_param_hw_named(n, v, t, hwtype, p)
        module_param_hw_array(n, t, hwtype, m, p)

  where the module parameter refers to a hardware setting

  hwtype specifies the type of the resource being configured. This can
  be one of:

        ioport          Module parameter configures an I/O port
        iomem           Module parameter configures an I/O mem address
        ioport_or_iomem Module parameter could be either (runtime set)
        irq             Module parameter configures an I/O port
        dma             Module parameter configures a DMA channel
        dma_addr        Module parameter configures a DMA buffer address
        other           Module parameter configures some other value

  Note that the hwtype is compile checked, but not currently stored (the
  lockdown code probably won't require it). It is, however, there for
  future use.

  A bonus is that the hwtype can also be used for grepping.

  The intention is for the kernel to ignore or reject attempts to set
  annotated module parameters if lockdown is enabled. This applies to
  options passed on the boot command line, passed to insmod/modprobe or
  direct twiddling in /sys/module/ parameter files.

  The module initialisation then needs to handle the parameter not being
  set, by (1) giving an error, (2) probing for a value or (3) using a
  reasonable default.

  What I can't do is just reject a module out of hand because it may
  take a hardware setting in the module parameters. Some important
  modules, some ipmi stuff for instance, both probe for hardware and
  allow hardware to be manually specified; if the driver is aborts with
  any error, you don't get any ipmi hardware.

  Further, trying to do this entirely in the module initialisation code
  doesn't protect against sysfs twiddling.

  [!] Note that in and of itself, this series of patches should have no
      effect on the the size of the kernel or code execution - that is
      left to a patch in the next series to effect. It does mark
      annotated kernel parameters with a KERNEL_PARAM_FL_HWPARAM flag in
      an already existing field"

* tag 'hwparam-20170420' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: (38 commits)
  Annotate hardware config module parameters in sound/pci/
  Annotate hardware config module parameters in sound/oss/
  Annotate hardware config module parameters in sound/isa/
  Annotate hardware config module parameters in sound/drivers/
  Annotate hardware config module parameters in fs/pstore/
  Annotate hardware config module parameters in drivers/watchdog/
  Annotate hardware config module parameters in drivers/video/
  Annotate hardware config module parameters in drivers/tty/
  Annotate hardware config module parameters in drivers/staging/vme/
  Annotate hardware config module parameters in drivers/staging/speakup/
  Annotate hardware config module parameters in drivers/staging/media/
  Annotate hardware config module parameters in drivers/scsi/
  Annotate hardware config module parameters in drivers/pcmcia/
  Annotate hardware config module parameters in drivers/pci/hotplug/
  Annotate hardware config module parameters in drivers/parport/
  Annotate hardware config module parameters in drivers/net/wireless/
  Annotate hardware config module parameters in drivers/net/wan/
  Annotate hardware config module parameters in drivers/net/irda/
  Annotate hardware config module parameters in drivers/net/hamradio/
  Annotate hardware config module parameters in drivers/net/ethernet/
  ...
2017-05-10 19:13:03 -07:00
Jeeja KP 960013762d ALSA: hda: Fix cpu lockup when stopping the cmd dmas
Using jiffies in hdac_wait_for_cmd_dmas() to determine when to time out
when interrupts are off (snd_hdac_bus_stop_cmd_io()/spin_lock_irq())
causes hard lockup so unlock while waiting using jiffies.

---<-snip->---
<0>[ 1211.603046] NMI watchdog: Watchdog detected hard LOCKUP on cpu 3
<4>[ 1211.603047] Modules linked in: snd_hda_intel i915 vgem
<4>[ 1211.603053] irq event stamp: 13366
<4>[ 1211.603053] hardirqs last  enabled at (13365):
...
<4>[ 1211.603059] Call Trace:
<4>[ 1211.603059]  ? delay_tsc+0x3d/0xc0
<4>[ 1211.603059]  __delay+0xa/0x10
<4>[ 1211.603060]  __const_udelay+0x31/0x40
<4>[ 1211.603060]  snd_hdac_bus_stop_cmd_io+0x96/0xe0 [snd_hda_core]
<4>[ 1211.603060]  ? azx_dev_disconnect+0x20/0x20 [snd_hda_intel]
<4>[ 1211.603061]  snd_hdac_bus_stop_chip+0xb1/0x100 [snd_hda_core]
<4>[ 1211.603061]  azx_stop_chip+0x9/0x10 [snd_hda_codec]
<4>[ 1211.603061]  azx_suspend+0x72/0x220 [snd_hda_intel]
<4>[ 1211.603061]  pci_pm_suspend+0x71/0x140
<4>[ 1211.603062]  dpm_run_callback+0x6f/0x330
<4>[ 1211.603062]  ? pci_pm_freeze+0xe0/0xe0
<4>[ 1211.603062]  __device_suspend+0xf9/0x370
<4>[ 1211.603062]  ? dpm_watchdog_set+0x60/0x60
<4>[ 1211.603063]  async_suspend+0x1a/0x90
<4>[ 1211.603063]  async_run_entry_fn+0x34/0x160
<4>[ 1211.603063]  process_one_work+0x1f4/0x6d0
<4>[ 1211.603063]  ? process_one_work+0x16e/0x6d0
<4>[ 1211.603064]  worker_thread+0x49/0x4a0
<4>[ 1211.603064]  kthread+0x107/0x140
<4>[ 1211.603064]  ? process_one_work+0x6d0/0x6d0
<4>[ 1211.603065]  ? kthread_create_on_node+0x40/0x40
<4>[ 1211.603065]  ret_from_fork+0x2e/0x40

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100419
Fixes: 38b19ed7f8 ("ALSA: hda: fix to wait for RIRB & CORB DMA to set")
Reported-by: Marta Lofstedt <marta.lofstedt@intel.com>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
CC: stable <stable@vger.kernel.org> # 4.7
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-10 08:47:17 +02:00
Laura Abbott 7f80f51358 alsa: use set_memory.h header
set_memory_* functions have moved to set_memory.h.  Switch to this
explicitly.

Link: http://lkml.kernel.org/r/1488920133-27229-14-git-send-email-labbott@redhat.com
Signed-off-by: Laura Abbott <labbott@redhat.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-05-08 17:15:14 -07:00
Stephen Boyd ad61dd303a scripts/spelling.txt: add regsiter -> register spelling mistake
This typo is quite common.  Fix it and add it to the spelling file so
that checkpatch catches it earlier.

Link: http://lkml.kernel.org/r/20170317011131.6881-2-sboyd@codeaurora.org
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-05-08 17:15:13 -07:00
Florin Tudorache c3123d6adb ALSA: hda - Add mute led support for HP EliteBook 840 G3
Signed-off-by: Florin Tudorache <florin_tudorache@live.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-08 10:56:30 +02:00
Linus Torvalds 221656e7c4 sound updates for 4.12-rc1
It was a relatively calm development cycle, and no scaring changes are
 seen in both core and driver sides.  Here are some highlights:
 
 ASoC:
 - A new API for hooking up jacks more generically and easily
 - Card longname is set based on DMI for a unique UCM profile
 - Lots of Intel driver fixes: Atom, Broxton, Skylake and newer chips
 - New drivers for Cirrus CS35L35, DIO DIO2125, Everest ES7132,
   HiSilicon hi6210, Maxim MAX98927, MT2701 systems with WM8960, Nuvoton
   NAU8824, Odroid systems, ST STM32 SAI controllers and x86 systems with
   DA7213
 
 HD-audio:
 - Many new quirks to support headset for various devices (mostly ASUS
   ones) as usual
 - Support for dual codecs on some Gigabyte mobos and Lenovo laptop
 - Improvement on PCM position reporting for Skylake and newer
 
 FireWire:
 - New drivers for MOTU and RME Fireface series
 - Updates for Digidesign Digi00x and TASCAM series
 - Support for tracepoints
 
 Others:
 - USB-audio: improved support for quirk_alias option
 - Cleanups, constification allover the places
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEECxfAB4MH3rD5mfB6bDGAVD0pKaQFAlkIphEOHHRpd2FpQHN1
 c2UuZGUACgkQbDGAVD0pKaQwjg//axvFHHVIJGkwL628pfWSVJN7+gTlKkeBPBcn
 NtaOOC7aM5IhkvYGxrq5e55cRFDMt4tvVloGLXu593gzDoN0JYUSCVYcctqklKa8
 nbHeasZgnVwmQHf/44oajiT++UElxH/i4q/kz91ZuYmNVUgh6syH3o04T9UBZA6k
 rxv4MbMctUf1SYwbZVMzPLWXsSCwmaWsUimhi9WiDRzSE1bGI46nJtPbDF5jXhlR
 83Dsp1lp5tQXXAeYksjx+yUtQMRpY85zsQj1NJ/izrD1fjWnXquaRlDZwcIOWCio
 3Vz87liQyIEldY7FHL64igo8SIMeypPhRUFfxugSn9iTqeuWaXFyJNQwo0aENDZH
 RMUmqAutiik2MEXMN0fAAgj3GcxbSVgYK/EfmzHNlrDAtdbgBm+ArIhS67Ue9vPi
 emb6+/STUI7rmH8+RFBvQ/Xz3mpa791z+jVuidTKoEgYJ5/M1Ql8Ucoja74UXj4m
 QjNe+CBO6GXcAOlBNeMZ7PMpQrR14Hl386fusLG2JXRLR8p0SmO4Klt8PrBy/Obh
 4bE0/EWK/e5XbXVX+8QyDOtt9cFsAYZJqbpDr9Enft3LJcid6gmiJZGuZ1i+Iv1d
 L2lYkFQkLI/bjf5xGsamK2pB9xQzOSa7u6Q+q4iBXuVYjDpoKz59l6siwRuuJLMX
 c+QfQgY=
 =8RhW
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "It was a relatively calm development cycle, and no scaring changes are
  seen in both core and driver sides. Here are some highlights:

  ASoC:
   - A new API for hooking up jacks more generically and easily

   - Card longname is set based on DMI for a unique UCM profile

   - Lots of Intel driver fixes: Atom, Broxton, Skylake and newer chips

   - New drivers for Cirrus CS35L35, DIO DIO2125, Everest ES7132,
     HiSilicon hi6210, Maxim MAX98927, MT2701 systems with WM8960,
     Nuvoton NAU8824, Odroid systems, ST STM32 SAI controllers and x86
     systems with DA7213

  HD-audio:
   - Many new quirks to support headset for various devices (mostly ASUS
     ones) as usual

   - Support for dual codecs on some Gigabyte mobos and Lenovo laptop

   - Improvement on PCM position reporting for Skylake and newer

  FireWire:
   - New drivers for MOTU and RME Fireface series

   - Updates for Digidesign Digi00x and TASCAM series

   - Support for tracepoints

  Others:
   - USB-audio: improved support for quirk_alias option

   - Cleanups, constification allover the places"

* tag 'sound-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (299 commits)
  ASoC: codec: wm8960: Relax bit clock computation when using PLL
  ASoC: codec: wm9860: avoid maybe-uninitialized warning
  ASoC: nau8824: leave Class D gain at chip default
  ASoC: nau8824: rename controls to match DAPM controls
  ASoC: Intel: Skylake: Return negative error code
  ASoC: Intel: Skylake: Fix unused variable warning
  ASoC: Intel: Skylake: fix uninitialized pointer use
  ASoC: sti: Fix error handling if of_clk_get() fails
  ASoC: cs4271: configure reset GPIO as output
  ASoC: dwc: Disallow building designware_pcm as a module
  ALSA: ali5451: fix spelling mistake in "ali_capture_preapre"
  ASoC: stm32: add SAI driver
  ASoC: stm32: add bindings for SAI
  ASoC: Intel: Skylake: Add loadable module support on KBL platform
  ASoC: Intel: Skylake: Modify load_lib_ipc arguments for a nowait version
  ASoC: Intel: Skylake: Register dsp_fw_ops for kabylake
  ASoC: Intel: Skylake: Modify arguments to reuse module transfer function
  ASoC: Intel: Skylake: Commonize library load
  ASoC: Intel: Skylake: Move sst common initialization to a helper function
  ASoC: nau8824: new driver
  ...
2017-05-03 11:58:59 -07:00
Ville Syrjälä 8a2d6ae1f7 ALSA: x86: Register multiple PCM devices for the LPE audio card
Now that everything is in place let's register a PCM device for
each port of the display engine. This will make it possible to
actually output audio to multiple displays at the same time. And
it avoids modesets on unrelated displays from clobbering up the
ELD and whatnot for the display currently doing the playback.

v2: Add a PCM per port instead of per pipe
v3: Fix off by one error with port numbers (Pierre-Louis)
    Fix .notify_audio_lpe() prototype (Pierre-Louis)

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-12-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:24:00 +03:00
Ville Syrjälä b4eb0d522f ALSA: x86: Split snd_intelhad into card and PCM specific structures
To allow multiple PCM devices to be registered for the LPE audio card,
split the private data into card and PCM specific chunks. For now we'll
stick to just one PCM device as before.

v2: Rework to do a pcm device per port instead of per pipe

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-11-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:23:56 +03:00
Ville Syrjälä bb4ac5a0ec ALSA: x86: Prepare LPE audio ctls for multiple PCMs
In preparation for register a PCM device for each pipe adjust
link up the ctl elements with the corresponding PCM device.

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-10-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:21:44 +03:00
Ville Syrjälä a8562e4dec drm/i915: Clean up the LPE audio platform data
Split the LPE audio platform data into a port specific
chunk and device specific chunk. Eventually we'll have
a port specific chunk for each port, but for now we'll
stick to just one.

We'll also get rid of the intel_hdmi_lpe_audio_eld structure
which doesn't seem to have any real reason to exist.

v2: Organize per port instead of per pipe

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-9-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:21:26 +03:00
Ville Syrjälä 265fa2e18f drm/i915: Remove hdmi_connected from LPE audio pdata
We can determine that the pipe was shut down from pipe<0, so there's
no point in duplicating that information as 'hdmi_connected'.

v2: Use pipe<0 instead of port<0 as we'll want to do per-port
    PCM devices later
    Initialize pipe to -1 to inidicate inactive initial state

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-7-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:20:32 +03:00
Ville Syrjälä c98ec5ba6c drm/i915: Replace tmds_clock_speed and link_rate with just ls_clock
There's no need to distinguish between the DP link rate and HDMI TMDS
clock for the purposes of the LPE audio. Both are actually the same
thing more or less, which is the link symbol clock. So let's just
call the thing ls_clock and simplify the code.

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-6-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:20:26 +03:00
Ville Syrjälä d220559580 drm/i915: Remove the unused pending_notify from LPE platform data
The pending_notify flag in the LPE audio platform data is pointless,
actually unused. So let's kill it off.

v2: Fix typo in patch subject

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-5-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:19:39 +03:00
Ville Syrjälä 8d5c30308d ALSA: x86: Clear the pdata.notify_lpe_audio pointer before teardown
Clear the notify function pointer in the platform data before we tear
down the driver. Otherwise i915 would end up calling a stale function
pointer and possibly explode.

Cc: stable@vger.kernel.org
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-3-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:19:07 +03:00
Ville Syrjälä 183c00350c drm/i915: Fix runtime PM for LPE audio
Not calling pm_runtime_enable() means that runtime PM can't be
enabled at all via sysfs. So we definitely need to call it
from somewhere.

Calling it from the driver seems like a bad idea because it
would have to be paired with a pm_runtime_disable() at driver
unload time, otherwise the core gets upset. Also if there's
no LPE audio driver loaded then we couldn't runtime suspend
i915 either.

So it looks like a better plan is to call it from i915 when
we register the platform device. That seems to match how
pci generally does things. I cargo culted the
pm_runtime_forbid() and pm_runtime_set_active() calls from
pci as well.

The exposed runtime PM API is massive an thorougly misleading, so
I don't actually know if this is how you're supposed to use the API
or not. But it seems to work. I can now runtime suspend i915 again
with or without the LPE audio driver loaded, and reloading the
LPE audio driver also seems to work.

Note that powertop won't auto-tune runtime PM for platform devices,
which is a little annoying. So I'm not sure that leaving runtime
PM in "on" mode by default is the best choice here. But I've left
it like that for now at least.

Also remove the comment about there not being much benefit from
LPE audio runtime PM. Not allowing runtime PM blocks i915 runtime
PM, which will also block s0ix, and that could have a measurable
impact on power consumption.

Cc: stable@vger.kernel.org
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes: 0b6b524f39 ("ALSA: x86: Don't enable runtime PM as default")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-2-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 16:18:23 +03:00
Takashi Iwai a5c3b32a11 ASoC: Updates for v4.12
A quiet release for the core, but lots of new drivers this time around:
 
  - A new, generalized, API for hooking up jacks which makes it easier to
    write generic machine drivers for simple cases.
  - Continuing fixes for issues with the x86 CPU drivers.
  - New drivers for Cirrus CS35L35, DIO DIO2125, Everest ES7132,
    HiSilicon hi6210, Maxim MAX98927, MT2701 systems with WM8960, Nuvoton
    NAU8824, Odroid systems, ST STM32 SAI controllers and x86 systems with
    DA7213
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlkH9Q4THGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0D24B/4oQ67H01Tcq0ghrIsr/UNQnPi+ywx2
 e5nkWNvWTM7gSUDOFjmD3ZM07Gf66IIyiFFSt6w93/lDQaOcGgsmBo9tnujR7ytQ
 XXUiE1bvx7liZ09/2Rq7DyDXTpYcFAbxLdWt8uGs72misj0XrVToVFJhl5YcMRBE
 qnbV1woxQwIvJ5m+GmbW2NZ8bRCnnsMQbBWCIWOtvSPhtZQlQ+m7waYTVn3/ieGR
 cWIHwY4lSZycqaYDWZ+RPFipcAwzKTNt0MiXoCI02EX95275AbIHdWAgrVta04Al
 muWP1XTkufO73NFqfvEF+Rrpi69pRCNhAS7TJY++d1moKCYgSpG8bAvD
 =W3eF
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v4.12

A quiet release for the core, but lots of new drivers this time around:

 - A new, generalized, API for hooking up jacks which makes it easier to
   write generic machine drivers for simple cases.
 - Continuing fixes for issues with the x86 CPU drivers.
 - New drivers for Cirrus CS35L35, DIO DIO2125, Everest ES7132,
   HiSilicon hi6210, Maxim MAX98927, MT2701 systems with WM8960, Nuvoton
   NAU8824, Odroid systems, ST STM32 SAI controllers and x86 systems with
   DA7213
2017-05-02 08:25:25 +02:00
Takashi Iwai d7dc450d5a Merge branch 'for-next' into for-linus
For 4.12 merge.
2017-05-02 08:24:42 +02:00
Linus Torvalds 85724edecb LED updates for 4.12
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJZB3/ZAAoJEL1qUBy3i3wm79YP/0lw2TXXpyrVImo9WjR7SUEB
 XJCQdjvmbxVfPhyb5qzUIRLImQj4RPUzQ/qwnXmj9wmAKd8tlV/3ldg/xopDZXUd
 XbDrvzsALIXryh6Ajfx4IMRoI7gQcQM82PBETNej2dS+1d1EUwAgoLQm99D6Q66Y
 mtxdHsgZZkC/yENoFg4C+RS1+29Mb9lCfIJyug/Ram2aytHqkVfHpMQpp233UWgb
 kkssbvMGCZJWgCS582w+S2MLFsStb1WYiDZcQt5SJSCnzzkvMEbuwHshL+5mQZpT
 wquY5rgqIkRPt98In+Qj/rMnXetFzbczdIUEtbyyC+PRPElYgQIehzsS8cdaPSCS
 98LruhiRoTeYO1gooeGhgUjZkTDH7xOXsDpvCCXlvcwFCCjoYoKHI6Ti/krWEgo5
 RAMz5BRGHvGVEAit6faGbpUT0L643g4onT52e+omcfyvzOmOsGO4BN69O9IrvTvd
 Jxbcj4Zh0uMZyeBvX2L4cg/9BYROhAvGXiuDr8JwOqvCOwCGrTffrFWCb0hOFGZB
 /JeCyplCDpLHRu4ybPtE1Ele1ylnbJ9ywCoN+VZkpsIpRD+OK4XHiKFjnt55TVXY
 GDt75r7oeahPXF9/sD31qzxrKCpBw/wkyEB62AxwbBWF9xo2fAv3q7mNGMQztkUy
 rKgb4bGIRbGFuevXoo9j
 =gJJi
 -----END PGP SIGNATURE-----

Merge tag 'leds_for_4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds

Pull LED updates from Jacek Anaszewski:
 "New drivers:

   - add LED support for MT6323 PMIC

   - add LED support for Motorola CPCAP PMIC

  New features and improvements:

   - add LED trigger for all CPUs aggregated which is useful on tiny
     boards with more CPU cores than LED pins

   - add OF variants of LED registering functions as a preparation for
     adding generic support for Device Tree parsing

   - dell-led improvements and cleanups, followed by moving it to the
     x86 platform driver subsystem which is a more appropriate place for
     it

   - extend pca9532 Device Tree support by adding the LEDs
     'default-state' property

   - extend pca963x Device Tree support by adding nxp,inverted-out
     property for inverting the polarity of the output

   - remove ACPI support for lp3952 since it relied on a non-official
     ACPI IDs"

* tag 'leds_for_4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
  leds: pca9532: Extend pca9532 device tree support
  leds: cpcap: new driver
  mfd: cpcap: Add missing include dependencies
  leds: lp3952: Use 'if (ret)' pattern
  leds: lp3952: Remove ACPI support for lp3952
  leds: mt6323: Fix an off by one bug in probe
  dt-bindings: leds: Add document bindings for leds-mt6323
  leds: Add LED support for MT6323 PMIC
  leds: gpio: use OF variant of LED registering function
  leds: core: add OF variants of LED registering functions
  platform/x86: dell-wmi-led: fix coding style issues
  dell-led: move driver to drivers/platform/x86/dell-wmi-led.c
  dell-led: remove code related to mic mute LED
  platform/x86: dell-laptop: import dell_micmute_led_set() from drivers/leds/dell-led.c
  ALSA: hda - rename dell_led_set_func to dell_micmute_led_set_func
  ALSA: hda - use dell_micmute_led_set() instead of dell_app_wmi_led_set()
  dell-led: remove GUID check from dell_micmute_led_set()
  leds/trigger/cpu: Add LED trigger for all CPUs aggregated
2017-05-01 13:12:49 -07:00
Mark Brown 20d5c84bef Merge remote-tracking branches 'asoc/topic/wm8960', 'asoc/topic/wm8978' and 'asoc/topic/zte-tdm' into asoc-next 2017-04-30 22:16:48 +09:00
Mark Brown 258ced9d08 Merge remote-tracking branches 'asoc/topic/uda1380', 'asoc/topic/unregister', 'asoc/topic/ux500', 'asoc/topic/wm5100' and 'asoc/topic/wm8903' into asoc-next 2017-04-30 22:16:41 +09:00
Mark Brown 7b7b384957 Merge remote-tracking branches 'asoc/topic/tegra', 'asoc/topic/tlv320aic23', 'asoc/topic/topology', 'asoc/topic/twl6040' and 'asoc/topic/txx9' into asoc-next 2017-04-30 22:16:37 +09:00
Mark Brown 65fd5252b4 Merge remote-tracking branches 'asoc/topic/sta529', 'asoc/topic/sti', 'asoc/topic/stm', 'asoc/topic/sunxi' and 'asoc/topic/tas2552' into asoc-next 2017-04-30 22:16:31 +09:00
Mark Brown ae17a14f14 Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/simple', 'asoc/topic/sirf' and 'asoc/topic/ssm4567' into asoc-next 2017-04-30 22:16:26 +09:00
Mark Brown fc180c0eaf Merge remote-tracking branches 'asoc/topic/rockchip', 'asoc/topic/rt5514', 'asoc/topic/rt5645' and 'asoc/topic/rt5677' into asoc-next 2017-04-30 22:16:21 +09:00
Mark Brown 757fc30a1a Merge remote-tracking branches 'asoc/topic/nau8824', 'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/qcom' into asoc-next 2017-04-30 22:16:18 +09:00
Mark Brown ccf9fc86d6 Merge remote-tracking branches 'asoc/topic/max9878', 'asoc/topic/max98927', 'asoc/topic/mtk' and 'asoc/topic/nau8540' into asoc-next 2017-04-30 22:16:04 +09:00
Mark Brown 50946b2aec Merge remote-tracking branches 'asoc/topic/fsl-ssi', 'asoc/topic/hi6220' and 'asoc/topic/imx' into asoc-next 2017-04-30 22:16:01 +09:00
Mark Brown 0f57c12ab4 Merge remote-tracking branches 'asoc/topic/es7134', 'asoc/topic/es8328', 'asoc/topic/fsl', 'asoc/topic/fsl-asrc' and 'asoc/topic/fsl-esai' into asoc-next 2017-04-30 22:15:55 +09:00
Mark Brown 99dd3c53f6 Merge remote-tracking branches 'asoc/topic/cs35l35', 'asoc/topic/cs53l30', 'asoc/topic/da7213', 'asoc/topic/dio2125' and 'asoc/topic/dwc' into asoc-next 2017-04-30 22:15:50 +09:00
Mark Brown 2f42a77661 Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/ak4613', 'asoc/topic/au1761' and 'asoc/topic/blackfin' into asoc-next 2017-04-30 22:15:45 +09:00
Mark Brown cce9b271e5 Merge remote-tracking branch 'asoc/topic/rt5665' into asoc-next 2017-04-30 22:15:43 +09:00
Mark Brown 245e302a4d Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next 2017-04-30 22:15:42 +09:00
Mark Brown 0c2964cb38 Merge remote-tracking branch 'asoc/topic/intel' into asoc-next 2017-04-30 22:15:41 +09:00
Mark Brown d872f04606 Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2017-04-30 22:15:40 +09:00
Mark Brown 9dfc53942d Merge remote-tracking branch 'asoc/fix/cs4271' into asoc-linus 2017-04-30 22:15:37 +09:00
Mark Brown d0a906d3a1 Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus 2017-04-30 22:15:36 +09:00
Mark Brown ec7f9844ef ASoC: Fixes for v4.11
A few last minute fixes for v4.11, the STI fix is relatively large but
 driver specific and has been cooking in -next for a little while now:
 
  - A fix from Takashi for some suspend/resume related crashes in the
    Intel drivers.
  - A fix from Mousumi Jana for issues with incorrectly created
    enumeration controls generated from topology files which could cause
    problems for userspace.
  - Fixes from Arnaud Pouliquen for some crashes due to races with the
    interrupt handler in the STI driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlj/auUTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0JEJB/9fZoEPm2Flfp9d4tXDmNihyv/STARr
 UbIIBxJUsDG2U6nMxv1kTKRk/9puuzDfNjt4giiLyMNDMbh4G5QRbgMF53ryeTuM
 8Nqq6PEvhZ4/YftOnh4uD4PmsVKTV8OauQDzZquLPB9/lRF6wLvSskSfZXTsYbv9
 Oem4Sop1XzXt68cUIcMHQlwXrhxIaQUHiOS8QfhQXNw1y5xgGB5Rj0ak5fWdn+KY
 6j10ldQgrwYSCx4zbqLsS6Fjlo2zdUj/Rn7fQrarzsjQtrZq+k6iYvAWAblkMhWi
 7hL/RK4U0konSeo12ftIESDpZFjW2Yi9Q74+4i6soEYbOVTzMam+XMo+
 =qmpO
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v4.11-rc7' into asoc-linus

ASoC: Fixes for v4.11

A few last minute fixes for v4.11, the STI fix is relatively large but
driver specific and has been cooking in -next for a little while now:

 - A fix from Takashi for some suspend/resume related crashes in the
   Intel drivers.
 - A fix from Mousumi Jana for issues with incorrectly created
   enumeration controls generated from topology files which could cause
   problems for userspace.
 - Fixes from Arnaud Pouliquen for some crashes due to races with the
   interrupt handler in the STI driver.

# gpg: Signature made Wed 26 Apr 2017 00:27:33 KST
# gpg:                using RSA key ADE668AA675718B59FE29FEA24D68B725D5487D0
# gpg:                issuer "broonie@kernel.org"
# gpg: key 0D9EACE2CD7BEEBC: no public key for trusted key - skipped
# gpg: key 0D9EACE2CD7BEEBC marked as ultimately trusted
# gpg: key CCB0A420AF88CD16: no public key for trusted key - skipped
# gpg: key CCB0A420AF88CD16 marked as ultimately trusted
# gpg: key 162614E316005C11: no public key for trusted key - skipped
# gpg: key 162614E316005C11 marked as ultimately trusted
# gpg: key A730C53A5621E907: no public key for trusted key - skipped
# gpg: key A730C53A5621E907 marked as ultimately trusted
# gpg: key 276568D75C6153AD: no public key for trusted key - skipped
# gpg: key 276568D75C6153AD marked as ultimately trusted
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" [ultimate]
# gpg:                 aka "Mark Brown <broonie@debian.org>" [ultimate]
# gpg:                 aka "Mark Brown <broonie@kernel.org>" [ultimate]
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>" [ultimate]
# gpg:                 aka "Mark Brown <broonie@linaro.org>" [ultimate]
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>" [ultimate]
2017-04-30 22:15:35 +09:00
Daniel Baluta 82bab88910 ASoC: codec: wm8960: Relax bit clock computation when using PLL
Bitclk is derived from sysclk using bclk_divs.
Sysclk can be derived in two ways:
	(1) directly from MLCK
	(2) MCLK via PLL

Commit 3c01b9ee2a ("ASoC: codec: wm8960: Relax bit clock
computation")
relaxed bitclk computation when sysclk is directly derived from MCLK.

Lets do the same thing when sysclk is derived via PLL.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 22:14:32 +09:00
Daniel Baluta 66772eda0e ASoC: codec: wm9860: avoid maybe-uninitialized warning
The new PLL configuration code triggers a harmless warning:

sound/soc/codecs/wm8960.c: In function 'wm8960_configure_clocking':
sound/soc/codecs/wm8960.c:735:3: error: 'best_freq_out' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
   wm8960_set_pll(codec, freq_in, best_freq_out);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/codecs/wm8960.c:699:12: note: 'best_freq_out' was declared
here

Fix this by reworking the code such that:

1) When there is no PLL freq available return -EINVAL and make
sure *bclk_idx, *dac_idx, *sysclk_idx are initialized with
invalid values.

2) When there is a PLL freq available initialize *bclk_idx,
*dac_idx and *sysclk_idx with correct values and immediately
return the freq available.

Fixes: 84fdc00d51 ("ASoC: codec: wm9860: Refactor PLL out freq search")
Fixes: 303e8954af ("ASoC: codec: wm8960: Stop when a matching PLL freq is found")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 22:14:27 +09:00
John Hsu c869ce5aaf ASoC: nau8824: leave Class D gain at chip default
Remove initial configuration of Class D gain for 1R and 2L.
Leave them at the chip default.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: John Hsu <supercraig0719@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 21:52:39 +09:00
John Hsu 25535f7e0b ASoC: nau8824: rename controls to match DAPM controls
Rename the name of kcontrols to match up the DAPM
widget controls.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: John Hsu <supercraig0719@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 21:52:33 +09:00
Guneshwor Singh 081dc8ab46 ASoC: Intel: Skylake: Return negative error code
skl_tplg_add_pipe() returned EEXIST instead of negative EEXIST, so fix that
and handle the return value as well.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 21:50:28 +09:00
Vinod Koul 9ed4aefe6f ASoC: Intel: Skylake: Fix unused variable warning
With compiler option W=1, we have one more warning in the driver for
'set but unused variable', so remove the unused variable to fix it.

sound/soc/intel/skylake/skl-pcm.c: In function ‘skl_platform_open’:
sound/soc/intel/skylake/skl-pcm.c:954:26: warning: variable ‘runtime’ set but not used [-Wunused-but-set-variable]
  struct snd_pcm_runtime *runtime;

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 21:50:14 +09:00
Arnd Bergmann 351d74e4d7 ASoC: Intel: Skylake: fix uninitialized pointer use
The error handling in bxt_sst_dsp_init() got changed in a way that
it now derefences an uninitialized pointer when printing a warning
about the device not being found:

sound/soc/intel/skylake/bxt-sst.c: In function 'bxt_sst_dsp_init':
sound/soc/intel/skylake/bxt-sst.c:567:14: error: 'skl' may be used uninitialized in this function [-Werror=maybe-uninitialized]

As we do have a valid device pointer available at the call site,
let's use that instead.

Fixes: 9fe9c71192 ("ASoC: Intel: Skylake: Move sst common initialization to a helper function")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 21:46:49 +09:00
Dan Carpenter 65ed0a8d1f ASoC: sti: Fix error handling if of_clk_get() fails
We intended to return here.  The current code has a static checker
warning because we set "ret" but don't use it.

Fixes: 76c2145ded ("ASoC: sti: Add CPU DAI driver for playback")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 21:30:52 +09:00
Alexander Sverdlin 49b2e27ab9 ASoC: cs4271: configure reset GPIO as output
During reset "refactoring" the output configuration was lost.
This commit repairs sound on EDB93XX boards.

Fixes: 9a397f4 ("ASoC: cs4271: add regulator consumer support")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org> # 4.6+
2017-04-30 21:28:22 +09:00
Jose Abreu c9afc1834e ASoC: dwc: Disallow building designware_pcm as a module
Designware PCM is an extension to Designware I2S and they are dependent
on each other. For this reason, make Designware PCM a boolean which will
compile with Desigwnare I2S module. The name of the module is not changed
but the name of the files need to be changed.

Also, without this commit we get errors when probbing designware_i2s module
because of unspecified license:

designware_pcm: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
designware_pcm: Unknown symbol __rcu_read_lock (err 0)
designware_pcm: Unknown symbol devm_snd_soc_register_platform (err 0)
designware_pcm: Unknown symbol synchronize_rcu (err 0)
designware_pcm: Unknown symbol __rcu_read_unlock (err 0)
designware_pcm: Unknown symbol snd_soc_set_runtime_hwparams (err 0)

So, this is really needed as a fix.

Fixes: 79361b2b98 ("ASoC: dwc: Add PIO PCM extension")
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30 20:27:04 +08:00
Colin Ian King 0997e378be ALSA: ali5451: fix spelling mistake in "ali_capture_preapre"
trivial fix to spelling mistake in dev_warn message,
"ali_capture_preapre" should be "ali_capture_prepare"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-30 08:21:48 +02:00
olivier moysan 3e086edfe0 ASoC: stm32: add SAI driver
This patch implements SAI ASoC driver for STM32.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 16:45:54 +01:00
Sodhi, VunnyX b6726009af ASoC: Intel: Skylake: Add loadable module support on KBL platform
Kabylake platform expects modules in a library manifest. After loading
base firmware library manifest is loaded using load library IPC. This is
followed by module load using load multiple modules IPC.

Signed-off-by: Sodhi, VunnyX <vunnyx.sodhi@intel.com>
Signed-off-by: G Kranthi <gudishax.kranthikumar@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 15:47:53 +01:00
Subhransu S. Prusty 100e7f396d ASoC: Intel: Skylake: Modify load_lib_ipc arguments for a nowait version
Kabylake uses code loader dma and wait on notification instead of ipc
reply for load library ipc status. So modify the argument of
skl_sst_ipc_load_library to check on flag to wait for ipc reply.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 15:47:49 +01:00
Subhransu S. Prusty 89b0d8a5ba ASoC: Intel: Skylake: Register dsp_fw_ops for kabylake
For audio kabylake is same as skylake except the module load approach.
This patch registers different dsp_fw_ops for kabylake and next patch
adds the module load support for kabylake.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 15:47:45 +01:00
G Kranthi 4e0277d226 ASoC: Intel: Skylake: Modify arguments to reuse module transfer function
Kabylake also uses code loader dma for module load and library load.
skl_transfer_module can be reused. Modify the arguments to include
library index to be passed to lib load ipc and module/lib check to use
correct ipc for lib/module load.

Signed-off-by: G Kranthi <gudishax.kranthikumar@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 15:47:41 +01:00
Subhransu S. Prusty ebe8907687 ASoC: Intel: Skylake: Commonize library load
request firmware, strip extended manifest and release library changes
are common to kabylake and APL.

So move these common code to utils to be reused in later patches for
kabylake library load.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 15:47:37 +01:00
G Kranthi 9fe9c71192 ASoC: Intel: Skylake: Move sst common initialization to a helper function
Some skl sst context are not dependent of platform and initializing them
independently for each platform can lead to errors. So optimize by
moving them to a helper function and platform specific init code can
call this.

Signed-off-by: G Kranthi <gudishax.kranthikumar@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 15:47:28 +01:00
John Hsu dfeabded04 ASoC: nau8824: new driver
Add driver for NAU88L24.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: John Hsu <supercraig0719@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 15:44:52 +01:00
Kailang Yang ca169cc2f9 ALSA: hda/realtek - Add Dual Codecs support for Lenovo P520/420
Lenovo P520/420 build with two codecs.
ALC233 for front panel.
ALC662 for rear panel.
This patch will rename capture name for slove conflicts.
And create a card longname for UCM profile.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-26 12:13:37 +02:00
Takashi Iwai d4a2fbcee0 ASoC: Fixes for v4.11
A few last minute fixes for v4.11, the STI fix is relatively large but
 driver specific and has been cooking in -next for a little while now:
 
  - A fix from Takashi for some suspend/resume related crashes in the
    Intel drivers.
  - A fix from Mousumi Jana for issues with incorrectly created
    enumeration controls generated from topology files which could cause
    problems for userspace.
  - Fixes from Arnaud Pouliquen for some crashes due to races with the
    interrupt handler in the STI driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlj/auUTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0JEJB/9fZoEPm2Flfp9d4tXDmNihyv/STARr
 UbIIBxJUsDG2U6nMxv1kTKRk/9puuzDfNjt4giiLyMNDMbh4G5QRbgMF53ryeTuM
 8Nqq6PEvhZ4/YftOnh4uD4PmsVKTV8OauQDzZquLPB9/lRF6wLvSskSfZXTsYbv9
 Oem4Sop1XzXt68cUIcMHQlwXrhxIaQUHiOS8QfhQXNw1y5xgGB5Rj0ak5fWdn+KY
 6j10ldQgrwYSCx4zbqLsS6Fjlo2zdUj/Rn7fQrarzsjQtrZq+k6iYvAWAblkMhWi
 7hL/RK4U0konSeo12ftIESDpZFjW2Yi9Q74+4i6soEYbOVTzMam+XMo+
 =qmpO
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v4.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v4.11

A few last minute fixes for v4.11, the STI fix is relatively large but
driver specific and has been cooking in -next for a little while now:

 - A fix from Takashi for some suspend/resume related crashes in the
   Intel drivers.
 - A fix from Mousumi Jana for issues with incorrectly created
   enumeration controls generated from topology files which could cause
   problems for userspace.
 - Fixes from Arnaud Pouliquen for some crashes due to races with the
   interrupt handler in the STI driver.
2017-04-25 17:43:56 +02:00
Fabio Estevam 12dc0f3b1e ASoC: tas2552: Propagate the error code in suspend/resume
tas2552_suspend() and tas2552_resume() currently always return success,
even though they may fail.

Fix this behaviour by always propagating the error code.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25 16:40:17 +01:00
Pierre-Louis Bossart cb67d76516 ASoC: bytcr_rt5640: log quirk configuration errors
Now that quirks can be overridden with a module parameter,
log errors so that non-sensical quirks introduced by mistake
are identified.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25 16:39:42 +01:00
Takashi Iwai 0b2c9f88b9 ASoC: bytcr_rt5640: Fix a typo and quirk parameter type
The previous patch for adding the quirk module option had a typo in
its info print, which results in a weird output.  Also, the parameter
type should be rather unsigned int instead of signed int.

Fixes: 9f2cf73ed6 ("ASoC: bytcr_rt5640: Allow quirk set via module option")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-25 16:39:42 +01:00
Mark Brown dc9617cb81 Merge remote-tracking branches 'asoc/fix/intel', 'asoc/fix/topology' and 'asoc/fix/sti' into asoc-linus 2017-04-25 16:25:07 +01:00
Takashi Iwai 6e4cac23c5 ASoC: intel: Fix PM and non-atomic crash in bytcr drivers
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+
2017-04-25 15:54:30 +01:00
Colin Ian King fd9f069d87 ASoC: wm5100: fix spelling mistake: "micropone" -> "microphone"
Trivial fix to spelling mistake in dev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-24 18:48:40 +01:00
Takashi Iwai 9f2cf73ed6 ASoC: bytcr_rt5640: Allow quirk set via module option
The bytcr-rt5640 driver has a few quirk setups depending on the board,
where the quirk value is set by DMI matching.  When you have a new
device to add the support, you often experience to try the different
quirk by trial-and-error.  Or, you may have a development model that
still has no proper DMI string.  In either case, you'd need to compile
the driver at each time.

This patch introduces a module option to override the quirk value on
the fly.  User can boot like snd-soc-sst-bytcr-rt5640.quirk=0x4004 to
override the default value without recompilation.  It's a raw value,
so user needs to check the source code for the meaning of each bit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-24 18:48:07 +01:00
Takashi Iwai 861886d338 ASoC: Call snd_soc_set_dmi_name() unconditionally
Since recently UCM can pick up a configuration specific to the board
via card longname field, and we introduced a helper function
snd_soc_set_dmi_name() for that.  So far, it was used only in one
place (sound/soc/intel/boards/broadwell.c), but it should be more
widely applied.

This patch puts a big hammer for that: it lets snd_soc_register_card()
calling snd_soc_set_dmi_name() unconditionally, so that all x86
devices get the better longname string.  This would have no impact for
other systems without DMI support, as snd_soc_set_dmi_name() is no-op
on them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-24 18:47:17 +01:00
Takashi Iwai 1f5a4535db ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()
For systems without DMI, it makes no sense to have the code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-24 18:47:10 +01:00
Fabio Estevam 8f7206d69a ASoC: imx-wm8962: Remove global variables
Currently the following variables are global:
- card_priv, sample_rate and sample_format

,which is not a good idea as it prevents the usage of multiple
instances.

Make sample_rate and sample_format part of the imx_priv structure
and allocate imx_priv via the standard devm_kzalloc() mechanism
inside the probe function.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-24 18:45:18 +01:00
Takashi Iwai 610793fe2b Merge branch 'topic/hda-dual-codecs' into for-next 2017-04-24 09:24:15 +02:00
Sylwester Nawrocki aba611fc4c ASoC: samsung: Add Odroid ASoC machine driver
This dedicated driver allows to support SoC specific clock
settings and helps to ensure proper number of channels gets
negotiated in multicodec system configurations.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 18:27:58 +01:00
Linus Walleij 97c52eb969 ASoC: qcom: move clock names into LPASS variant struct
The clock names for the two supported codecs are either
"mi2s-*" name variants generated by code. This naming scheme
does not work for platforms like MSM8660 which has I2S channels
named CODEC_I2S_SPKR (rather than just "MI2S tertiary" and other
repetitive names) and consequently have clocks named
"codec-i2s-spkr-osr-clk" and similar.

Skip the runtime generation of clock names and replace it with
name lookup tables encoded into the variant data.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 18:07:45 +01:00
Charles Keepax 06bdf385f6 ASoC: cs35l35: Allow user to configure IMON SCALE
On the chip the IMON signal is a full 24-bits however normally only
some of the bits will be sent over the bus. The chip provides a field
to select which bits of the IMON will be sent back, this is the only
feedback signal that has this feature.

Add an additional entry to the cirrus,imon device tree property to
allow the IMON scale parameter to be passed.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 18:01:38 +01:00
Dan Carpenter 550b349af0 ASoC: Intel: Skylake: Fix a couple user after free bugs
We need to use the _safe() version of list_for_each_entry() here because
of the kfree(modules).

Fixes: b8c722ddd5 ("ASoC: Intel: Skylake: Add support for deferred DSP module bind")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 18:00:33 +01:00
Stefan Agner 24dbd9edb6 ASoC: fsl_asrc_dma: use correct direction enum type
The direction argument is of type enum dma_transfer_direction, and
not enum dma_data_direction. The enumeration values are the same
so this did not had an effect in practise.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 17:59:34 +01:00
Arnd Bergmann 362c59436c ASoC: mediatek: add I2C dependency for CS42XX8
We should not select drivers that depend on I2C when that is disabled,
as it results in a build error:

warning: (SND_SOC_MT2701_WM8960) selects SND_SOC_WM8960 which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && I2C)
sound/soc/codecs/wm8960.c:1469:1: error: data definition has no type or storage class [-Werror]
sound/soc/codecs/wm8960.c:1469:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]

Fixes: 8625c1dbd8 ("ASoC: mediatek: Add mt2701-wm8960 machine driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 17:58:34 +01:00
Dan Carpenter e6a33532af ASoC: Intel: Skylake: Uninitialized variable in probe_codec()
My static checker complains that if snd_hdac_bus_get_response() returns
-EIO then "res" is uninitialized.  Fix this by initializing it to -1 so
that the error is handled correctly.

Fixes: d8c2dab838 ("ASoC: Intel: Add Skylake HDA audio driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 17:57:38 +01:00
Marek Vasut e8dffe6c20 ASoC: rsnd: Fix possible NULL pointer dereference
25165f79ad
("ASoC: rsnd: enable clock-frequency for both 44.1kHz/48kHz")
supports both 44.1kHz/48kHz clock-frequency settings for ADG
which will be used for AUDIO_OLKOUTn.
But some board doesn't need it, thus, it is not mandatory.

But, above patch didn't care about the case of "clock-frequency" DT
property was not present.
This patch ignores ADG settings if AUDIO_OLKOUTn was not used.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
[Kuninori: tidyup not to break non AUDIO_OLKOUTn case]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 17:51:48 +01:00
kbuild test robot 75f9e4adb5 ASoC: rsnd: fix semicolon.cocci warnings
sound/soc/sh/rcar/adg.c:462:54-55: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-21 16:30:35 +01:00
Takashi Iwai 56798e6b3a ALSA: hda - Use a helper function for renaming kctl names
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-21 10:52:59 +02:00
Takashi Iwai 7beb3a6e93 ALSA: hda - Support Gigabyte Gaming board with dual Realtek codecs
This patch adds some workarounds to make Gigabyte GA-AX370 Gaming 5
board working without the conflicts of kctls, etc.  In general, the
dual codec configs result in the conflicts of the following stuff:
- Master controls
- Capture controls
- Analog loopback controls
In addition, the auto-mute and the auto-mic can't work well among
multiple codecs.

The current "solution" is to disable all these features, and use UCM
for a better PulseAudio management.  For a dedicated UCM profile, the
patch overrides the card longname so that the system an get a unique
profile path.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195305
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-21 10:52:46 +02:00
Mikhail Paulyshka fc7438b1eb ALSA: hda - Fix headset microphone detection for ASUS N551 and N751
Headset microphone does not work out of the box on ASUS Nx51
laptops. This patch fixes it.

Patch tested on Asus N551 laptop. Asus N751 part is not tested, but
according to [1] this laptop uses the same audiosystem.

1. https://bugzilla.kernel.org/show_bug.cgi?id=117781

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195437
Signed-off-by: Mikhail Paulyshka <me@mixaill.tk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-21 08:52:42 +02:00
Takashi Sakamoto e3a973c69b ALSA: fireface: obsolete usage of ktime_set() for zero assignment
In development period for Linux v4.10, ktime_t became an alias of s64,
instead of union. I forgot it. We can just assign zero, instead of usage
of ktime_set(0, 0).

Fixes: 1917429578 ("ALSA: fireface: add transaction support")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-20 15:00:54 +02:00
David Howells 6192c41fc6 Annotate hardware config module parameters in sound/pci/
When the kernel is running in secure boot mode, we lock down the kernel to
prevent userspace from modifying the running kernel image.  Whilst this
includes prohibiting access to things like /dev/mem, it must also prevent
access by means of configuring driver modules in such a way as to cause a
device to access or modify the kernel image.

To this end, annotate module_param* statements that refer to hardware
configuration and indicate for future reference what type of parameter they
specify.  The parameter parser in the core sees this information and can
skip such parameters with an error message if the kernel is locked down.
The module initialisation then runs as normal, but just sees whatever the
default values for those parameters is.

Note that we do still need to do the module initialisation because some
drivers have viable defaults set in case parameters aren't specified and
some drivers support automatic configuration (e.g. PNP or PCI) in addition
to manually coded parameters.

This patch annotates drivers in sound/pci/.

Suggested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jaroslav Kysela <perex@perex.cz>
cc: Takashi Iwai <tiwai@suse.com>
cc: alsa-devel@alsa-project.org
2017-04-20 12:02:32 +01:00
David Howells 232b0b0829 Annotate hardware config module parameters in sound/oss/
When the kernel is running in secure boot mode, we lock down the kernel to
prevent userspace from modifying the running kernel image.  Whilst this
includes prohibiting access to things like /dev/mem, it must also prevent
access by means of configuring driver modules in such a way as to cause a
device to access or modify the kernel image.

To this end, annotate module_param* statements that refer to hardware
configuration and indicate for future reference what type of parameter they
specify.  The parameter parser in the core sees this information and can
skip such parameters with an error message if the kernel is locked down.
The module initialisation then runs as normal, but just sees whatever the
default values for those parameters is.

Note that we do still need to do the module initialisation because some
drivers have viable defaults set in case parameters aren't specified and
some drivers support automatic configuration (e.g. PNP or PCI) in addition
to manually coded parameters.

This patch annotates drivers in sound/oss/.

Suggested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jaroslav Kysela <perex@perex.cz>
cc: Takashi Iwai <tiwai@suse.com>
cc: Andrew Veliath <andrewtv@usa.net>
cc: alsa-devel@alsa-project.org
2017-04-20 12:02:32 +01:00
David Howells e992ef5705 Annotate hardware config module parameters in sound/isa/
When the kernel is running in secure boot mode, we lock down the kernel to
prevent userspace from modifying the running kernel image.  Whilst this
includes prohibiting access to things like /dev/mem, it must also prevent
access by means of configuring driver modules in such a way as to cause a
device to access or modify the kernel image.

To this end, annotate module_param* statements that refer to hardware
configuration and indicate for future reference what type of parameter they
specify.  The parameter parser in the core sees this information and can
skip such parameters with an error message if the kernel is locked down.
The module initialisation then runs as normal, but just sees whatever the
default values for those parameters is.

Note that we do still need to do the module initialisation because some
drivers have viable defaults set in case parameters aren't specified and
some drivers support automatic configuration (e.g. PNP or PCI) in addition
to manually coded parameters.

This patch annotates drivers in sound/isa/.

Suggested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jaroslav Kysela <perex@perex.cz>
cc: Takashi Iwai <tiwai@suse.com>
cc: alsa-devel@alsa-project.org
2017-04-20 12:02:32 +01:00
David Howells b11ce420c5 Annotate hardware config module parameters in sound/drivers/
When the kernel is running in secure boot mode, we lock down the kernel to
prevent userspace from modifying the running kernel image.  Whilst this
includes prohibiting access to things like /dev/mem, it must also prevent
access by means of configuring driver modules in such a way as to cause a
device to access or modify the kernel image.

To this end, annotate module_param* statements that refer to hardware
configuration and indicate for future reference what type of parameter they
specify.  The parameter parser in the core sees this information and can
skip such parameters with an error message if the kernel is locked down.
The module initialisation then runs as normal, but just sees whatever the
default values for those parameters is.

Note that we do still need to do the module initialisation because some
drivers have viable defaults set in case parameters aren't specified and
some drivers support automatic configuration (e.g. PNP or PCI) in addition
to manually coded parameters.

This patch annotates drivers in sound/drivers/.

Suggested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
cc: Jaroslav Kysela <perex@perex.cz>
cc: alsa-devel@alsa-project.org
2017-04-20 12:02:32 +01:00
Arnd Bergmann fa8323bf49 ALSA: firewire-motu: mark trace helpers as __maybe_unused
Two functions were introduced for the purpose of tracing but cause warnings
when tracing is disabled:

sound/firewire/motu/amdtp-motu.c:284:13: error: 'copy_message' defined but not used [-Werror=unused-function]
 static void copy_message(u64 *frames, __be32 *buffer, unsigned int data_blocks,
sound/firewire/motu/amdtp-motu.c:271:13: error: 'copy_sph' defined but not used [-Werror=unused-function]
 static void copy_sph(u32 *frames, __be32 *buffer, unsigned int data_blocks,

Marking them as __maybe_unused will do the right thing here.

Fixes: 17909c1b30 ("ALSA: firewire-motu: add tracepoints for SPH in IEC 61883-1 fashion")
Fixes: c6b0b9e65f ("ALSA: firewire-motu: add tracepoints for messages for unique protocol")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-20 12:50:45 +02:00
Kuninori Morimoto 25165f79ad ASoC: rsnd: enable clock-frequency for both 44.1kHz/48kHz
Current clock-frequency allows only 1 clock, but ADG can
handle both 44.1kHz/48kHz base clocks. This patch enables these.

On Salvator-X board, AUDIO_CLKOUT which is generated by ADG
is connected to ak4613 MCKI, and it should be synchronized with
LRCK. Thus, we need both 44.1kHz/48kHz base clock-frequency.
Otherwise, either one sounds strange in high frequency sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-19 17:32:46 +01:00
Kuninori Morimoto 9ca5e57d78 ASoC: rsnd: rsnd_mod_make_sure() is not under DEBUG
rsnd_mod_make_sure() will be used any situation,
thus, under DEBUG is not realistic.
This patch move it to non DEBUG area

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-19 17:32:46 +01:00
Kuninori Morimoto 4898b61e40 ASoC: ak4613: use snd_soc_update_bits() to avoid Reserve bit on I/O CTRL
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-19 17:23:47 +01:00
Jerónimo Borque 5cd5b1bdfb ALSA: hda - Add HP ZBook 15u G3 Conexant CX20724 GPIO mute leds
The HP ZBook 15u G3 has a Conexant CX20724 with mute led on GPIO1 and
mic mute led on GPIO2.
Adding CXT_FIXUP_MUTE_LED_GPIO inspired on patch_realtek's one.

Signed-off-by: Jerónimo Borque <jeronimo@borque.com.ar>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-19 18:00:56 +02:00
Charles Keepax fbeea237af ASoC: cs35l35: Correct some register defaults
Correct some minor errors in the register defaults.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-18 18:59:18 +01:00
Colin Ian King d7766aa57a ASoC: topology: use j for internal loop counter
Currently variable i is being for 2 nested for loops. Fix this by
using integer loop counter j for the inside for loop.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-18 18:53:40 +01:00
Nicole Faerber 67e03ff3f3 ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirk
The Thinkpad Tablet tablet has a similar audio setup as the Intel Braswell
platform.
A quirk is needed to detect the platform and setup the platform data
properly:

Manufacturer: LENOVO
        Product Name: 20C1CTO1WW
        Version: ThinkPad 10

Manufacturer: LENOVO
	Product Name: 20C3001VHH
	Version: ThinkPad 10

Manufacturer: LENOVO
	Product Name: 20C10024GE
	Version: ThinkPad Tablet B

Manufacturer: LENOVO
    	Product Name: 20359
    	Version: Lenovo Miix 2 10

Signed-off-by: Nicole Faerber <nicole.faerber@id3p.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-18 18:19:04 +01:00
Pierre-Louis Bossart beb5989a8c ASoC: Intel: Atom: update Thinkpad 10 quirk
There are multiple skews of the same Lenovo audio hardware
based on the Realtek RT5670 codec.

Manufacturer: LENOVO
        Product Name: 20C1CTO1WW
        Version: ThinkPad 10

Manufacturer: LENOVO
	Product Name: 20C3001VHH
	Version: ThinkPad 10

Manufacturer: LENOVO
	Product Name: 20C10024GE
	Version: ThinkPad Tablet B

Manufacturer: LENOVO
	Product Name: 20359
	Version: Lenovo Miix 2 10

For all these devices, the same quirk is used to force
the machine driver to be based on RT5670 instead of RT5640
as indicated by the BIOS.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96691
Tested-by: Nicole Faerber <nicole.faerber@dpin.de>
Tested-by: Viacheslav Ostroukh <v.dev@ostroukh.me>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-18 18:19:04 +01:00
John Hsu babd658503 ASoC: nau8540: fix tab conversion problem
Fix the tab converting to space problem.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-18 18:05:19 +01:00
Mauro Carvalho Chehab a5f8661df0 ALSA: usb-audio: replace /proc/bus/usb by /dev/bus/usb
The /proc/bus/usb devices don't exist anymore, since when we
got rid of usbfs. Those devices are now seen at
/dev/bus/usb.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-17 10:23:55 +02:00
Douglas Anderson 7952b4baff ASoC: rt5514: Unconfuse the rt5514 at probe / resume time
The rt5514 can get confused and incorrectly detect a start bit if the
SCL/SDA lines happen to both go low and then high again.  This
situation has been seen to happen at reboot time and is also
theoretically possible during suspend/resume if the rt5514 keeps power
but we shut down the i2c connection.

When this happens the rt5514 is confused about the state of the i2c
bus and won't recognize its own address.  That will lead to the rt5514
incorrectly NAKing the first transfer.

A single i2c transfer to any address should be enough to get the
rt5514 out of this funky state.

It is currently believed that this problem should be fixed in the
rt5514 driver itself because it seems that the i2c controller in the
rt5514 is easily confused.  Most i2c devices wouldn't detect a start
bit in this case.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14 18:11:37 +01:00
Douglas Anderson 0a78b248c3 ASoC: rt5514: Avoid relying on uninitialized "val" value
In rt5514_i2c_probe() if the regmap_read(RT5514_VENDOR_ID2) fails then
"val" may be left as uninitialized.  Current code relies on "val" not
being RT5514_DEVICE_ID, but that's potentially unsafe.

Let's check for errors from regmap_read() and also explicitly init the
value do we're not passing a possibly uninitialized int to printk.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14 18:11:37 +01:00
Douglas Anderson d0c02e14e4 ASoC: rt5514: Mark rt5514_i2c_driver as static
There's no reason for rt5514_i2c_driver to be non-static.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-14 18:11:37 +01:00
Takashi Sakamoto ae369e559f ALSA: firewire-tascam: support drain callback for MIDI playback substream
ALSA driver for TASCAM FireWire series transfers MIDI messages in system
workqueue. In current design of the driver, applications should wait for
sequence of transmission when they close ALSA rawmidi character devices.
However, when considering design of rawmidi interface, it's preferable
to wait in drain ioctl.

This commit adds support for the drain ioctl to wait for the end of
the transmission.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:43 +02:00
Takashi Sakamoto 1f94205d22 ALSA: firewire-tascam: move message parameters for async midi port
Units on TASCAM FireWire series handle MIDI messages with support for
running status. Drivers for the series should remember current running
status and transfer valid MIDI messages. For this purpose, current
ALSA driver for the series has some members in its top-level structure.
This is due to better abstraction of async midi port. Nowadays, the
abstraction was localized just for the driver.

This commit moves the members to structure for async midi port.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:40 +02:00
Takashi Sakamoto 3e7dc65ca0 ALSA: firewire-tascam: initialize parameters at open of rawmidi character devices
In current design of ALSA driver for TASCAM FireWire series, initialization
of members in asymc midi port structure is done at device probing. Some of
the members should be initialized every time to use rawmidi devices because
they're changed in sequence of transmission for MIDI messages.

This commit adds a new function to initialize them. Invariant parameters
during object lifetime are kept as is.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:38 +02:00
Takashi Sakamoto 98a00d3602 ALSA: firewire-tascam: use fixed-length array for message cache to async midi port
ALSA driver for TASCAM FireWire series internally allocates 4 byte buffer
for asynchronous transaction to transfer MIDI messages. However, the buffer
can be allocated with memory object of parent structure.

This commit adds 4 byte array as a member of the structure and obsoletes
the redundant allocation. This is deallocated with memory object of parent
structure.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:36 +02:00
Takashi Sakamoto 27badc4c10 ALSA: firewire-tascam: use the same address for asynchronous transaction for MIDI message
Units on TASCAM FireWire series receive MIDI messages by asynchronous
transactions on IEEE 1394 bus. Although the transaction is sent to a
certain register, current ALSA driver for this series has a redundant design.

This commit use the same address for the transaction.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:33 +02:00
Takashi Sakamoto 38d5826142 ALSA: firewire-tascam: send fixed-length transaction for async midi port
TASCAM FireWire series uses asynchronous transactions with fixed length
payload for MIDI messaging. On the other hand, ALSA driver for the series
has a redundant design to handle different length of payload.

This commit removes the redundant abstraction.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:31 +02:00
Takashi Sakamoto 9bae2150d0 ALSA: firewire-tascam: remove callback function from async midi port
As a result of localization of async midi port, ALSA driver for TASCAM
FireWire series can call helper function directly instead of callback
registration.

This commit removes the redundant design.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:29 +02:00
Takashi Sakamoto 531f471834 ALSA: firewire-lib/firewire-tascam: localize async midi port
In Linux kernel 4.4, firewire-lib got a feature called as 'async midi port'
for transmission of MIDI message via IEEE 1394 asynchronous communication,
however actual consumer of this feature is ALSA driver for TASCAM FireWire
series only. When adding this feature, I assumed that ALSA driver for
Digi00x might also be a consumer, actually it's not.

This commit moves the feature from firewire-lib to firewire-tascam module.
Two minor kernel APIs are removed.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 14:50:26 +02:00
Takashi Iwai 1900d947b5 Merge branch 'for-linus' into for-next
Back-merge to prepare for applying more FireWire updates.
2017-04-14 09:01:04 +02:00
Takashi Sakamoto 1e0f8f68f7 ALSA: usb-line6: constify snd_kcontrol_new strucutre array
In kernel APIs of ALSA control interface, drivers can create a control
element set by a call of snd_ctl_new1() with a template. This template
is known to have const qualifier in general cases.

This commit adds the qualifier to template array, for safer program and
runtime. Application of this change moves the symbol from .data section
to .rodata section.

Cc: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 08:57:56 +02:00
Takashi Sakamoto dfb00a5693 ALSA: firewire-lib: fix inappropriate assignment between signed/unsigned type
An abstraction of asynchronous transaction for transmission of MIDI
messages was introduced in Linux v4.4. Each driver can utilize this
abstraction to transfer MIDI messages via fixed-length payload of
transaction to a certain unit address. Filling payload of the transaction
is done by callback. In this callback, each driver can return negative
error code, however current implementation assigns the return value to
unsigned variable.

This commit changes type of the variable to fix the bug.

Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: <stable@vger.kernel.org> # 4.4+
Fixes: 585d7cba5e ("ALSA: firewire-lib: add helper functions for asynchronous transactions to transfer MIDI messages")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-14 08:57:25 +02:00
Takashi Iwai 4e7655fd4f ALSA: seq: Don't break snd_use_lock_sync() loop by timeout
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 2d7d54002e ("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>
2017-04-13 14:13:25 +02:00
Ander Conselvan De Oliveira a87a4d23e8 ALSA: hda: Move common haswell init to a helper
Geminilake vendor nid is different from other Skylake variants, but rest
of the initialization code is same.

So a variable is added in hdmi_spec to store the platform specific vendor
nid and move the initialization code to a helper function to be used by
both platform specific init.

Fixes: 126cfa2f5e ("ALSA: hda: Add Geminilake HDMI codec ID")
Signed-off-by: Ander Conselvan De Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Jaikrishna Nemallapudi <jaikrishnax.nemallapudi@intel.com>
Cc: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-13 10:23:22 +02:00
Jeeja KP b8c722ddd5 ASoC: Intel: Skylake: Add support for deferred DSP module bind
Module at the end of DSP pipeline that needs to be connected to a module
in another pipeline are represented as a PGA(leaf node) and in PGA event
handler these modules are bound/unbounded. Modules other than PGA leaf
can be connected directly or via switch to a module in another pipeline.
Example: reference path.

To support the deferred DSP module bind, following changes are done:
o When the path is enabled, the destination module that needs to be
bound may not be initialized. If the module is not initialized, add
these modules in a deferred bind list.
o When the destination module is initialized, check for these modules
in deferred bind list. If found, bind them.
o When the destination module is deleted, Unbind the modules.
o When the source module is deleted, remove the entry from the deferred
bind list.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-12 16:57:52 +01:00
Fabio Estevam f2a3ee0125 ASoC: fsl_esai: Remove unneeded definition
There is no need for defining FSL_ESAI_RATES locally as the standard
SNDRV_PCM_RATE_8000_192000 definition can be used instead.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-12 16:44:50 +01:00
Bhumika Goyal 49c41e1f23 ALSA: line6: constify snd_kcontrol_new structures
Declare snd_kcontrol_new strcutures as const as they are only passed as
an argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const too.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-12 15:35:16 +02:00
Bhumika Goyal 8fdaebbb83 ALSA: usb-audio: constify snd_kcontrol_new structures
Declare snd_kcontrol_new strcutures as const as they are only passed as
an argument to the function snd_ctl_new1. This argument is of type const,
so snd_kcontrol_new structures having this property can be made const too.
Done using Coccinelle:

@r disable optional_qualifier@
identifier x;
position p;
@@
static struct snd_kcontrol_new x@p={...};

@ok@
identifier r.x;
position p;
@@
snd_ctl_new1(&x@p,...)

@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p

@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct snd_kcontrol_new x;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-12 15:34:44 +02:00
Takashi Sakamoto f91c9d7610 ALSA: firewire-lib: cache maximum length of payload to reduce function calls
During packet streaming, maximum length of payload for isochronous packet
is invariable, therefore no need to recalculate. Current ALSA IEC 61883-1/6
engine calls a function to calculate it 8,000 or more times per second
for incoming packet processing.

This commit adds a member to have maximum length of payload into 'struct
amdtp_stream', to reduces the function calls. At first callback from
isochronous context, the length is calculated and stored for later
processing.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-12 15:34:21 +02:00
Subhransu S. Prusty 12ee4022f6 ALSA: hda: Add Geminilake id to SKL_PLUS
Geminilake is Skylake family platform. So add it's id to skl_plus check.

Fixes: 126cfa2f5e ("ALSA: hda: Add Geminilake HDMI codec ID")
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Cc: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-12 07:16:48 +02:00
Takashi Iwai b7c5ac88e8 Merge branch 'for-linus' into for-next 2017-04-12 07:16:07 +02:00
John Stultz e6d56d21bd ASoC: hisilicon: Use devm_snd_soc_register_component
Per feedback from Mark Brown, this patch updates the hi6210-i2s
driver to use devm_snd_soc_register_component which simplifies
the logic a bit.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11 21:20:55 +01:00
John Stultz 16c1c089b2 ASoC: hisilicon: Address style nit to use break in final default of switch statement
Mark Brown suggested a style change to use break in the final
default of a switch statement, so this patch addresses that.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11 21:20:51 +01:00
John Stultz da13d7462b ASoC: hisilicon: Add error returns even for cases that shouldn't happen.
This patch addresses feedback from Mark Brown, adding a few
extra error returns in cases that shouldn't happen

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11 21:20:44 +01:00
Fabio Estevam 6f2daf82fa ASoC: tas2552: Return the real error code
In the case of error in tas2552_codec_probe() we should better
propagate the real error code instead of always returning '-EIO'.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11 19:35:58 +01:00
Mousumi Jana b6e38b2944 ASoC: topology: Fix to store enum text values
Add missing enum texts store in soc_enum.

Signed-off-by: Mousumi Jana <mousumix.jana@intel.com>
Signed-off-by: Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>
Signed-off-by: Kranthikumar, GudishaX <gudishax.kranthikumar@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11 19:35:28 +01:00
Bard Liao 97c415a6f6 ASoC: rt5665: move rt5665_set_jack_detect to .set_jack
Now, we can use .set_jack callback function on codec level. So we
don't need export rt5665_set_jack_detect.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-11 17:05:20 +01:00
Mark Brown b8d4f7a30b Merge branch 'topic/jack' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rt5665 2017-04-11 16:58:30 +01:00
Takashi Sakamoto c6b0b9e65f ALSA: firewire-motu: add tracepoints for messages for unique protocol
MOTU units transfer/receive messages in each data block of their
isochronous packet payload. A part of content in the message is cleard for
MIDI message transmission, while the rest is unknown yet. Additional
features are required to assist users and developers to reveal the
details.

This commit adds tracepoints for the purpose. The tracepoints are designed
for MOTU's protocol version 2 and 3 (Protocol version 1 is not upstreamed
yet). In the tracepoints, events are probed to gather first two 24 bit
data chunks of each data block. The chunks are formatted into elements
of 64 bit array with padding in MSB.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-11 08:30:47 +02:00
Takashi Sakamoto 17909c1b30 ALSA: firewire-motu: add tracepoints for SPH in IEC 61883-1 fashion
Unique protocol is used for MOTU FireWire series. In this protocol,
data block format is not compliant to AM824 in IEC 61883-1/6. Each of
the data block consists of 24 bit data chunks, except for a first
quadlet. The quadlet is used for source packet header (SPH) described
in IEC 61883-1.

The sequence of SPH seems to represent presentation timestamp
corresponding to included data. Developers have experienced that invalid
sequence brings disorder of units in the series.

Unfortunately, current implementation of ALSA IEC 61883-1/6 engine and
firewire-motu driver brings periodical noises to the units at sampling
transmission frequency based on 44.1 kHz. The engine generates the SPH with
even interval and this mechanism seems not to be suitable to the units.
Further work is required for this issue and infrastructure is preferable
to assist the work.

This commit adds tracepoints for the purpose. In the tracepoints, events
are probed to gather the SPHs from each data blocks.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-11 08:30:45 +02:00
Takashi Sakamoto b164d2fd6e ALSA: firewire_lib: add tracepoints for packets without CIP headers
Unique protocol is used for RME Fireface series. In this protocol,
payload format for isochronous packet is not compliant to CIP in
IEC 61883-1/6. The packet includes data blocks just with data channels,
without headers and any metadata.

In previous commits, ALSA IEC 61883-1/6 engine supports this protocol.
However, tracepoints are not supported yet, unlike implementation for
IEC 61883-1/6 protocol. This commit adds support of tracepoints for
the protocol.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-11 08:30:43 +02:00
Fabio Estevam 570c70a60f ASoC: sgtl5000: Allow LRCLK pad drive strength to be changed
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>
2017-04-10 20:21:46 +01:00
Bard Liao d7344010d1 ASoC: jack: add snd_soc_codec_set_jack
There are many codecs with the capability of jack detection. Usually,
we create a jack on machine driver but there is no common function for
machine driver to deliver the jack pointer to codec driver.
snd_soc_codec_set_jack can be used for delivering the jack pointer to
codec driver and enable the jack detection function. To make it work,
codec driver need to define a callback function to receive the jack
pointer and do all necessary procedure for enabling jack detection.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-10 19:46:09 +01:00
Andy Green 0bf750f4cb ASoC: hisilicon: Add hi6210 i2s audio driver
Add driver for hi6210 i2s controller found on hi6220 boards.

Signed-off-by: Andy Green <andy.green@linaro.org>
[jstultz: Forward ported to mainline, fairly major rework
 based on suggestions from Mark Brown]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-10 19:40:13 +01:00
Fabio Estevam c6682fedee ASoC: fsl_ssi: Use the tolower() function
Code can be simplified by using the standard tolower() funtion.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-10 18:49:17 +01:00
Fabio Estevam 580556774a ASoC: fsl_ssi: Remove FSLSSI_I2S_RATES definition
The comment for the FSLSSI_I2S_RATES definition states that the
driver currently only supports I2S slave mode, which is no longer
correct.

As FSLSSI_I2S_RATES is the same as the standard SNDRV_PCM_RATE_CONTINUOUS,
just remove its definition and its comments to make the code simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-10 18:48:49 +01:00
Takashi Iwai 7480316c26 ALSA: hda - Allow to enable/disable vmaster build explicitly
Another preliminary patch for the dual-codec support: since the
support of vmaster over multiple codecs is difficult, simply disable
it by a new flag to hda_codec struct.  A new user hint is added as
well for consistency.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-10 17:45:27 +02:00
Takashi Iwai 9f3dadb156 ALSA: hda - A new flag to enforce prefix to each pin
This is a preliminary patch for a smooth multi-codec support, and it
introduces a new flag, force_pin_prefix, to struct hda_codec.
This flag is used to force to add the pin location prefix to each
input pin.  For example, when there is only one microphone pin,
usually the auto-parser assigns the string "Mic".  With this flag on,
it'll be like "Front Mic".  Also, the creation of "Master" or "PCM"
playback volume for a single pin is suppressed, too.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195305
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-10 17:44:39 +02:00
Takashi Iwai ff21b250e9 Merge branch 'for-linus' into for-next 2017-04-10 17:12:01 +02:00
Libin Yang 1f9d3d9869 ALSA: hda - set intel audio clock to a proper value
On some Intel platforms, the audio clock may not be set correctly
with initial setting. This will cause the audio playback/capture
rates wrong.

This patch checks the audio clock setting and will set it to a
proper value if it is set incorrectly.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188411

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-04-07 10:39:21 +02:00