1
0
Fork 0
Commit Graph

26492 Commits (2021d5b7d9f404bcb91301ececdf09a68b856ad7)

Author SHA1 Message Date
Takashi Iwai f3d83317a6 Revert "ALSA: line6: Only determine control port properties if needed"
This reverts commit f6a0dd107a.

The commit caused a regression on LINE6 Transport that has no control
caps.  Although reverting the commit may result back in a spurious
error message for some device again, it's the simplest regression fix,
hence it's taken as is at first.  The further code fix will follow
later.

Fixes: f6a0dd107a ("ALSA: line6: Only determine control port properties if needed")
Reported-by: Igor Zinovev <zinigor@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-07 09:37:11 +01:00
Arnd Bergmann 245c5c7b08 ASoC: fix ES8328_I2C/SPI dependencies
The two front-ends to the codec can now be selected individually, but fail to
build when the bus support is missing:

sound/built-in.o: In function `es8328_spi_probe':
es8328-spi.c:(.text+0x125854): undefined reference to `__devm_regmap_init_spi'
sound/built-in.o: In function `es8328_spi_driver_init':
es8328-spi.c:(.init.text+0x3589): undefined reference to `__spi_register_driver'

Related to this, the added dependency on SND_SOC_ES8328 breaks:

warning: (SND_SOC_ALL_CODECS) selects SND_SOC_ES8328_I2C which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && SND_SOC_ES8328 && I2C)

This adds the respective Kconfig dependencies and changes SND_SOC_ES8328 to a hidden
symbol that is selected implicitly by the two more specific options, as we do for
some other codecs. We have to remove the 'depends on' for SND_SOC_IMX_ES8328 in the
same step to avoid a recursive dependency.

Fixes: aa00f2c8af ("ASoC: Allow to select ES8328_I2C and ES8328_SPI directly")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-06 16:30:55 +00:00
Takashi Iwai 37a7ea4a9b ALSA: seq: Don't handle loop timeout at snd_seq_pool_done()
snd_seq_pool_done() syncs with closing of all opened threads, but it
aborts the wait loop with a timeout, and proceeds to the release
resource even if not all threads have been closed.  The timeout was 5
seconds, and if you run a crazy stuff, it can exceed easily, and may
result in the access of the invalid memory address -- this is what
syzkaller detected in a bug report.

As a fix, let the code graduate from naiveness, simply remove the loop
timeout.

BugLink: http://lkml.kernel.org/r/CACT4Y+YdhDV2H5LLzDTJDVF-qiYHUHhtRaW4rbb4gUhTCQB81w@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-06 15:09:48 +01:00
Takashi Iwai e1b239f371 ALSA: x86: Refactor PCM process engine
This is again a big rewrite of the driver; now it touches the code to
process PCM stream transfers.

The most fundamental change is that the driver may support more than
four periods.  Instead of keeping the same index between both the ring
buffer (with the fixed four buffer descriptors) and the PCM buffer
periods, we keep difference indices for both (bd_head and pcm_head
fields).  In addition, when the periods are more than four, we need to
track both head and next indices.  That is, we now have three indices:
bd_head, pcm_head and pcm_filled.

Also, the driver works better for periods < 4, too: the remaining BDs
out of four are marked as invalid, so that the hardware skips those
BDs in its loop.

By this flexibility, we can use even ALSA-lib dmix plugin, which
requires 16 periods as default.

The buffer size could be up to 20bit, so the max buffer size was
increased accordingly.  However, the buffer pre-allocation is kept as
the old value (600kB) as default.  The reason is the limited number of
BDs: since it doesn't suffice for the useful SG page management that
can fit with the usual page allocator like some other drivers, we have
to still allocate continuous pages, hence we shouldn't take too big
memories there.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-06 12:21:10 +01:00
Takashi Iwai b556290f9a ALSA: x86: Unify local function prefix
Use had_ prefix consistently to all local helper functions, as well as
had_pcm_ for PCM ops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-05 08:49:35 +01:00
Takashi Iwai f4566aa112 ALSA: x86: Minor cleanup of reset buffer procedure
The procedure to reset buffer pointers is performed in two places and
still open-coded.  Simplify the helper function and use it
consistently.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-05 08:49:02 +01:00
Takashi Iwai 83af57dd51 ALSA: x86: Don't check connection in lowlevel accessors
The lowlevel register read/write don't have to be careful about the
connection state.  It should be checked in the caller side instead.
By dropping the check, we can simplify the code, and readability.

This patch also refacors the functions slightly: namely,
- drop the useless always-zero return values
- fold the inline functions to the main accessor functions themselves
- move the DP audio hack for AUD_CONFIG to the caller side
- simplify snd_intelhad_eanble_audio() and drop the unused
  had_read_modify()

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-05 08:47:25 +01:00
Takashi Iwai 412bbe7d5b ALSA: x86: Explicit specify 32bit DMA
LPE audio is capable only up to 32bit address, as it seems.
Then we should limit the DMA addresses accordingly via dma-mapping
API.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-05 08:46:45 +01:00
Subhransu S. Prusty 0cf5a17159 ASoC: Intel: Skylake: Report Platform ID info from NHLT
This patch create entry in sysfs file system to report the
platform_id = "pci-id-oem_id-oem_table_id-oem_revision"
for board identification.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Sodhi, VunnyX <vunnyx.sodhi@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 17:14:45 +01:00
Romain Perier eaae2ea735 ASoC: rockchip: Add machine driver for RK3288 boards that use analog/HDMI
The driver is used for Rockchip rk3288-based boards using a configurable
analog output (can be an headphone) and the built-in HDMI audio output
that is part of the RK3288 SoCs and use the Alsa HDMI codec driver. For
some rk3288-based boards the analog output and the hdmi audio are plugged
on the same i2s line, so we have to do the same in the driver by using a
DAI link CPU to multicodecs. This configuration can be found for example
on the Radxa Rock2 or the Firefly-RK3288.

This commit is based on the initial work that was done by Sjoerd Simons
<sjoerd.simons@collabora.com> with some improvements.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:17:44 +01:00
Romain Perier aa00f2c8af ASoC: Allow to select ES8328_I2C and ES8328_SPI directly
Currently, we have to select these symbols explictly via Kconfig, from
another entry. If we plan to use generic audio drivers like
simple-audio-card, the user need to be able to enable these symbols
directly via the menuconfig.

This commit also fixes unmet dependencies to SND_SOC_IMX_ES8328 caused
by these changes.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:16:32 +01:00
Romain Perier b9b044e296 ASoC: es8328: Add support for slave mode
Currently, the function that changes the DAI format only supports master
mode. Trying to use a slave mode exits the function with -EINVAL and
leave the codec misconfigured. This commits adds support for enabling
the slave mode.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:16:31 +01:00
Jeeja KP ba21034677 ASoC: Intel: bxt: add channel map support in bxt_da7219_max98357a machine
HDMI registers channel map controls per PCM. As PCMs are not
registered during dai_link init callback, store the pcm ids and
codec DAIs during this init callback.

Register for late probe and call the jack_init API which also
registers channel map in the late probe callback handler.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:10:23 +01:00
Jeeja KP 6d707a74a7 ASoC: Intel: bxt: Add route change to da7219_max98357a machine
To support MST moved pin to port, this changes the routes based on
port. So change the route in bxt_da7219_max98357a machine.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:08:06 +01:00
Jeeja KP 111c2ae1fb ASoC: Intel: Skylake: Add route change to rt286 machine
To support MST moved pin to port, this changes the routes based on
port. So change the route in skl_rt286 machine.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:08:02 +01:00
Jeeja KP 51e0f3c825 ASoC: Intel: bxt: add channel map support in rt298 machine
HDMI registers channel map controls per pcm. As PCMs are not
registered during dai_link init callback, store the pcm ids and
codec DAIs during this init callback.

Register for late probe and call the jack_init API which registers
channel map in the late probe callback handler.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:08:01 +01:00
Jeeja KP ab1eea19d0 ASoC: hdac_hdmi: Move channel info from pin to PCM structure
Channel info is part of the pcm parameter and channel map control is
created for each pcm. So move channel info to pcm instead of pin
structure and the mutex lock to pcm.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:07:03 +01:00
John Hsu c1644e3de4 ASoC: nau8540: new codec driver
Add codec driver of NAU85L40

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 12:37:26 +01:00
Daniel Baluta d6075c2601 ASoC: Drop unnecessary debugfs ifdef
This is a relict of 6553bf06a3 ("ASoC: Don't try to register debugfs
entries if the parent does not exist").

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 11:56:45 +01:00
Takashi Iwai c1a7c40cff Merge branch 'topic/intel-lpe-audio' into for-next
Lots of cleanups and refactoring of Intel LPE audio driver.
2017-02-03 17:46:28 +01:00
Takashi Iwai 91b0cb0cc0 ALSA: x86: Rename drv_status to connected
After the rewrite of the runtime PM code, we have only two driver
status: CONNECTED and DISCONNECTED.  So it's clearer to use a boolean
flag, and name it easier one, "connected".

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:38:02 +01:00
Takashi Iwai 73997b050c ALSA: x86: Yet more tidy-up and clean-ups
- Add a few more comments to functions.

- Move the initialization of some PCM state variables to open and
  prepare callbacks, where these are clearer places.

- Remove superfluous NULL checks.

- Get rid of the bogus drv_status change to CONNECTED at close;
  this doesn't make any sense.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:37:50 +01:00
Takashi Iwai 44684f61b2 ALSA: x86: Simplify comments
It's a stand-alone small driver code, and we don't have to describe
too much formalized comments in kernel-doc style for local functions
at all.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:37:41 +01:00
Takashi Iwai 36ed34662f ALSA: x86: Set CA bits for DisplayPort too
This is a guess work.  Usually the DP audio info frame is just 8-bit
shifted from HDMI AI, so let's try to put CA in DIP frame 2 [24-31].

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:37:34 +01:00
Takashi Iwai 4aedb9465f ALSA: x86: Create ELD control element
Like other drivers, expose the ELD bytes via a control element so that
user-space can parse it.

For the simplicity, the code to register the ctl elements is
refactored using an array.  Also, since ELD ctl read copies the bytes
also during disconnection, clear the ELD bytes at hot-unplug, in order
to avoid the leak of the previous bogus ELD.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:37:23 +01:00
Takashi Iwai 03c3437755 ALSA: x86: Clean up unused defines and inclusions
Many defines and constants are left unused.  Clean them up.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:37:13 +01:00
Takashi Iwai 7ceba75f21 ALSA: x86: Reduce redundant register field names
Currently each register definition contains the own prefix in the
union struct itself; for example, union aud_ch_status_0 has
status_0_regx and status_0_regval fields.  These are simply
superfluous, since usually the type of the variable is seen in its
declaration or in its name.

In this patch, we cut off these prefixes.  Now all register
definitions have regx and regval fields consistently, instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:37:02 +01:00
Takashi Iwai df0435db1d ALSA: x86: Use the standard ELD bytes definitions
We have some constants defined in drm/drm_edid.h, and clean up our own
definitions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:36:53 +01:00
Takashi Iwai f69bd104b5 ALSA: x86: Move stream status into pcm_stream_info
The only remaining field in struct had_stream_data is stream_type that
holds the current stream status.  Such information fits better in
struct pcm_stream_info, so move it as a boolean "running" field to be
clearer.

This allows us to get rid or had_stream_data definition and
references.

Also, the superfluous status check get removed in a couple of places
where we can call PCM helpers in anyway.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:36:35 +01:00
Takashi Iwai 182cdf23db ALSA: x86: Implement runtime PM
Although the driver has some PM callbacks, it doesn't do it right:
- the suspend callback doesn't handle to suspend the running PCM,
- the runtime PM ops are missing,
- pm_runtime_get_sync() isn't used at the right place.

This patch covers the above and provides the basic runtime PM
functionality.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:36:26 +01:00
Takashi Iwai 313d9f28c1 ALSA: x86: Properly manage PCM substream lifetype
The PCM substream is referred not only in the PCM callbacks but also
in the irq handler and in the hotplug/unplug codes.  The latter code
paths don't take the PCM lock, thus the PCM may be released
unexpectedly while calling PCM helper functions or accessing
pcm->runtime fields.

This patch implements a simple refcount to assure the PCM substream
accessibility while the other codes are accessing.  It needed some
code refactoring in the relevant functions for avoiding the doubly
spinlocks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:36:13 +01:00
Takashi Iwai 7d9e79869b ALSA: x86: Drop unused fields from pcm_stream_info
The struct pcm_stream_info contains a few unused or useless fields.
str_id is always zero, buffer_ptr is volatile, never read, and sfreq
is nowhere referred.  Kill them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:35:56 +01:00
Takashi Iwai fa5dfe6a01 ALSA: x86: Drop redundant had_stream_pvt
The had_stream_pvt struct assigned to PCM runtime private data tracks
merely the stream running status, and the very same information is
carried by had_stream->stream_type.  Kill it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:35:42 +01:00
Takashi Iwai 0e9c67d7c8 ALSA: x86: Drop superfluous state field
The state field keeps the connection state and it's basically as same
as drv_status field.  Drop this redundancy.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:35:35 +01:00
Takashi Iwai d0e9b1a23c ALSA: x86: Drop flag_underrun field
The flag_underrun flag is used to indicate to escalate the XRUN
reporting at the next position inquiry, but there is a much simpler
method to achieve it: just call snd_pcm_stop_xrun().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:35:17 +01:00
Takashi Iwai 8f8d1d7fe0 ALSA: x86: Fix racy access to chmap
The access to chmap can be racy against the hotplug process, where it
recreates the chmap on the fly.  For protecting against it, a mutex is
introduced in this patch.  It's also used for protecting the change /
reference of eld and state fields, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:35:07 +01:00
Takashi Iwai bcce775ca8 ALSA: x86: Remove superfluous irqsave flags
We don't need to use irqsave/irqrestore versions for each spin lock,
but judge the context properly and use the simpler versions.

Also add some (still simplistic) comments to functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:34:59 +01:00
Takashi Iwai 4a5ddb2cb1 ALSA: x86: Constfy tables
Some tables can be defined as const.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:34:52 +01:00
Takashi Iwai 4151ee845a ALSA: x86: Remove _v[12] suffices
Although we dropped the most of the obsoleted *_v1 definitions and
codes, some codes still keep the _v1 or _v2 suffices.  Now they are
ripped off.

The only thing to be done carefully here is the definition of control
offsets.  The original code defines enum hdmi_ctrl_reg_offset_v1 and
a few new elements just for v2 on its top.  After this cleanup, we
remove the old AUD_HDMI_STATUS and AUD_HDMIW_INFOFR definitions and
replace with the v2 values.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:34:40 +01:00
Takashi Iwai 2e52f5e518 ALSA: x86: Tidy up codes
Clean up codes, fix indentations, correct comments, etc.
No functional change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:34:28 +01:00
Takashi Iwai 79f439ea40 ALSA: x86: Drop had_get_hwstate()
The helper function isn't clearer than the plain condition check
"if (drv_status == HDA_DRV_DISCONNECTED)".  By expanding this, the
compiler could even catch the possible uninitialized cases, so we
could fix them, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:34:17 +01:00
Takashi Iwai caa2a61a70 ALSA: x86: Remove superfluous check at resume
The had_get_hwstate() is identical with drv_status==DISCONECTED, which
was already checked before the call.  And, returning an error at
resume is simply bad.  That is, we should just kill this check.

Also, spewing an error at resume for drv_status!=SUSPENDED is also
annoying, as this is the normal case when the suspend was called
without the monitor connection.  Make it debug, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:34:09 +01:00
Takashi Iwai 99b2ab9d3a ALSA: x86: Fix sleep-in-atomic via i915 notification
i915 notification is executed in a spinlock, thus it must not sleep;
i.e. we can't use kmalloc with GFP_KERNEL or such.

For making it working properly, move the notification handler in a
work, and handle it gracefully.  We have already such a work, and it
was used just at the start.  This can be re-used in a more generic
hotplug handling.

Also, the patch adds the proper call of cancel_work_sync() to the
destructor.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:34:03 +01:00
Takashi Iwai f6a82a0c01 ALSA: x86: Drop superfluous PCM private_free
snd_pcm_lib_preallocate_free_for_all() doesn't have to be called from
each driver as it's called in the PCM core.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:33:55 +01:00
Takashi Iwai e9d65abfa6 ALSA: x86: Drop unused fields from snd_intelhad struct
Also change the flag_underrun to bool to be clearer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:33:28 +01:00
Takashi Iwai df76df12f1 ALSA: x86: Remove indirect call of snd_pcm_period_elapsed()
Again another indirect call...  Let's straighten it up.
Also define the had_stream field with a proper type instead of a void
pointer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:33:13 +01:00
Takashi Iwai e29c0f9672 ALSA: x86: Fix for CONFIG_PM=n
The direct access to power.runtime_status is taboo, let's use a helper
macro to avoid the compile error with CONFIG_PM=n.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:32:57 +01:00
Takashi Iwai c75b047624 ALSA: x86: Replace pr_xxx() with dev_xxx()
dev_xxx() helpers give a tidier output in general.

While we're at it, remove many useless debug prints (e.g. the ones at
each function entry), replace some too verbose errors with debugs, and
use WARN_ON() for some serious errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:32:22 +01:00
Takashi Iwai 372d855f87 ALSA: x86: Fold intel_hdmi_audio_if.c into main file
As the very last step, we fold intel_hdmi_audio_if.c into the main
file, intel_hdmi_audio.c.  This is merely a cleanup, and no functional
change.

By this move, we can mark all functions and variables as static, which
allows the compiler more optimizations.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:31:54 +01:00
Takashi Iwai da86480974 ALSA: x86: Flatten two abstraction layers
This is the final stage for a big clean-up series.  Here we flatten
the two layers into one.  Formerly, the implementation was split to
HDMI "shell" that talks with the platform device, and HDMI audio part
that communicates via caps and other event handlers.  All these would
be good if there were multiple instantiations or if there were data
protection.  But neither are true in our case.  That said, it'll be
easier to have a flat driver structure in the end.

In this patch, the former struct hdmi_lpe_audio_ctx is forged into the
existing struct snd_intelhad.  The latter has already a few members
that are basically the copy from the former.  Only a few new members
for the lowlevel I/O are added by this change.

Then, the had_get_caps() and had_set_caps() are simply replaced with
the direct calls to copy the data in the struct fields.  Also, the
had_event_handler() calls are replaced with the direct call for each
event as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:31:35 +01:00
Takashi Iwai eeb756c5bf ALSA: x86: Drop unused hdmi_audio_query()
It's used nowhere.  Kill it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:31:26 +01:00
Takashi Iwai 36ec0d99bb ALSA: x86: Call snd_card_register() at the end
The card registration should be done at the last stage of the probe
procedure.  Otherwise user-space may access to the device before the
whole initialization is done.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:31:15 +01:00
Takashi Iwai 301cf8a955 ALSA: x86: Check platform_data earlier
Just a minor optimization; check the presence of platform_data earlier
in the probe function before actually starting allocation, which makes
the error path easier.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:31:06 +01:00
Takashi Iwai c415022e48 ALSA: x86: Drop superfluous CHT PCI ID check
Since the config base offset is now set per pipe id, we don't have to
check Cherry Trail PCI IDs any longer.  Currently it's used only for
debug prints.  Let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:30:58 +01:00
Takashi Iwai 5647aec266 ALSA: x86: Embed snd_intelhad into snd_card
Instead of allocating snd_intelhad struct, use the card's private_data
and embed it.  It simplifies the code a lot.

While we're at it, embed had_stream into snd_intelhad struct instead
of individually allocating, and rename had_pvt_data to a bit more
specific name, had_stream_data.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:30:26 +01:00
Takashi Iwai dae15a9d96 ALSA: x86: Move dma_mask debug print into intel_hdmi_lpe_audio.c
It belongs to the right place.

And, remove a few sanity checks (e.g. NULL card) and debug prints as
well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:29:36 +01:00
Takashi Iwai 0e18060f99 ALSA: x86: Drop unused hw_silence field
It's nowhere used.  Let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:25:43 +01:00
Takashi Iwai 6ddb3ab66f ALSA: x86: Move the global underrun_count to struct snd_intelhad
The last one is in intel_hdmi_audio.c, underrun_count: this can be
embedded in snd_intelhad object.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:25:30 +01:00
Takashi Iwai 7f2e9ab5a2 ALSA: x86: Drop global ELD copy
Similarly like the previous patch, drop the global variable to keep
the ELD copy.  It can be embedded in hdmi_lpe_audio_ctx as well.

And this makes easier to code, it's just a memcpy(), after all.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:25:10 +01:00
Takashi Iwai 055610b002 ALSA: x86: Drop global hlpe_state
Now it's the turn to drop the global hlpe_state variable.  It can be
gracefully embedded in hdmi_lpe_audio_ctx struct.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:24:58 +01:00
Takashi Iwai bf8b24f816 ALSA: x86: Drop the global platform device reference
Instead of referring to the global hlpe_pdev variable, pass the
platform device object to each function properly.  Accessing to the
global object is really ugly and error-prone.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:24:24 +01:00
Takashi Iwai af3e5c9c5d ALSA: x86: Drop unused mid_hdmi_audio_is_busy()
The function is nowhere used.  Kill it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:24:16 +01:00
Takashi Iwai 033e925f68 ALSA: x86: Fix possible stale interrupt calls
Registering the irq handler at the too early place may cause a system
stall because the irq handler may be triggered before the other
initializations.  Move the irq handler registration to the later point.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:23:37 +01:00
Takashi Iwai 437af8f294 ALSA: x86: Call event callback directly
Currently the driver calls the event callback stored in its ctx
pointer, but it's obviously inefficient.  Replace it with the direct
calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:23:15 +01:00
Takashi Iwai dd895f2e9b ALSA: x86: Drop useless mutex at probe
had_mutex is (supposedly) used to protect the concurrent calls of
hdmi_audio_probe().  But we may have only one device at most, so it's
utterly useless.  Drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:23:04 +01:00
Takashi Iwai 45459d1686 ALSA: x86: Handle the error from hdmi_audio_probe() properly
The error from hdmi_audio_probe() wasn't handled properly, and it may
leave some resources leaked or mapped.  Fix it and also clean up the
error paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:22:46 +01:00
Takashi Iwai 79dda75a2c ALSA: x86: Pass snd_intelhad object to helpers
For reducing the global variable reference, keep snd_intelhad object
in the context and pass it to each helper.  It's a preliminary change
for further cleanup.

This also includes the simplification of the probe procedure: the LPE
platform driver directly gets the created snd_intelhad object by
hdmi_audio_probe(), and passes it to each helper and destructor,
hdmi_audio_remove().  The hdmi_audio_probe() function doesn't call the
back-registration any longer, which is fairly useless.  The LPE
platform driver initializes the stuff instead at the right place, and
calls the wq after the object creation in the probe function itself.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:22:16 +01:00
Takashi Iwai 6f9ecc76f4 ALSA: x86: Drop snd_intel_had_interface indirect calls
Yet another indirection is killed: at this time, it's
snd_intel_had_interface.  It contains also the name string, but it's
nowhere used, thus we can kill it, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:21:57 +01:00
Takashi Iwai 9eca88c881 ALSA: x86: Replace indirect query_ops with direct calls
Like the previous patch, this replaces the indirect query_ops calls
via direct function calls.  They are only get_caps and set_caps, so
fairly straightforward at this time.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:21:41 +01:00
Takashi Iwai f23df8071b ALSA: x86: Replace indirect register ops with direct calls
Now about the indirect register ops: they are replaced with direct
calls, too.

The read / write / modify ops are simply replaced with the
corresponding functions.  The difference is that we calculate the
offset inside the function now.  So all the had_config_offset
references in the caller side are dropped.  This also simplifies the
DP-audio check in hdmi_audio_write() and hdmi_audio_rmw().

The hdmi_audio_get_register_base is dropped since it's no longer used
when the base address and config offset are referred in the read/write
functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:21:17 +01:00
Takashi Iwai 76296ef0ec ALSA: x86: Drop indirect calls of had_ops
We have only a single implementation of had_ops, hence there is no
merit to use the indirect calls at all.  Let's replace it with the
direct calls -- which allows the compiler more optimizations.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:20:58 +01:00
Takashi Iwai 4812dcc437 ALSA: x86: Remove v1 ops and structs
The v1 code refers to Medfield/Clovertrail.  It's not used at all in
the current driver, and probably won't be ever.  Let's clean this up,
then we can go to the next stage of cleanup tasks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 17:20:24 +01:00
Takashi Iwai 716733032a ALSA: x86: Don't set PCM state to DISCONNECTED
Theoretically setting the state to SNDRV_PCM_STATE_DISCONNECTED is
correct.  But, unfortunately, PA gets confused by this action, and it
won't re-probe the device after HDMI/DP is re-plugged.  (It reprobes
only when the card itself is recreated.)

As a workaround, set SNDRV_PCM_STATE_SETUP instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-03 16:20:41 +01:00
Mylène Josserand 2ad6f30de7 ASoC: sun4i-i2s: Add quirks to handle a31 compatible
Some SoCs have a reset line that must be asserted/deasserted.
This patch adds a quirk to handle the new compatible
"allwinner,sun6i-a31-i2s" which will deassert the reset
line on probe function and assert it on remove's one.

This new compatible is useful in case of A33 codec driver, for example.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-03 13:02:07 +01:00
Mylène Josserand 36c684936f ASoC: Add sun8i digital audio codec
Add the sun8i audio codec which handles the digital register of
A33 codec.
The driver handles only the basic playback from the DAC to headphones.
All other features (microphone, capture, etc) will be added later.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-03 13:02:06 +01:00
Mylène Josserand bf14da7e55 ASoC: sun8i-codec-analog: Add amplifier event to fix first delay
When playing a sound for the first time, a short delay, where the audio
file is not played, can be noticed.
On a second play (right after), the sound is played correctly.
If we wait a short time (~5 sec which corresponds to the aplay
timeout), the delay is back.

This patch fixes it by using an event on headphone amplifier.
It allows to keep the amplifier enable while playing a sound.
A delay of 700ms allows to wait that the amplifier is powered-up
before playing the sound.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-03 13:02:06 +01:00
Kuninori Morimoto ef30da1c52 ASoC: rsnd: fixup reset timing of sync convert_rate
Sync convert rate settings should be availabled *after* Playing.
Thus, src->sync should be reset first of init function.
Otherwise, it will set remaining settings when it start playing.
This patch fixes it. Thanks to Yokoyama-san

Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-03 12:24:23 +01:00
Takashi Iwai 374a504025 Merge branch 'topic/intel-lpe-audio-dp' into for-next
Merged more patches for Intel LPE audio driver, now to support DP audio.
2017-02-02 18:17:13 +01:00
Pierre-Louis Bossart 77e546b7ba ASoC: cht-bsw-rt5645: fix unused variable compiler warning
Missed unused variable in previous changes, oops.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-01 18:35:50 +00:00
Pierre-Louis Bossart cec55827dd ASoC: rt5645: fix error handling for gpio detection
Optional gpio handling should not cause an error status and prevent
probing if it's missing.  Remove error return for -ENOENT case and
move error message to dev_info

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-01 18:35:06 +00:00
Matt Ranostay 9834ffd1ec ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches
We can get audio errors if hitting deeper idle states on omaps:

[alsa.c:230] error: Fatal problem with alsa output, error -5.
[audio.c:614] error: Error in writing audio (Input/output error?)!

This seems to happen with off mode idle enabled as power for the
whole SoC may get cut off between filling the McBSP fifo using DMA.
While active DMA blocks deeper idle states in hardware, McBSP
activity does not seem to do so.

Basing the QoS latency calculation on the FIFO size, threshold,
sample rate, and channels.

Based on the original patch by Tony Lindgren
Link: https://patchwork.kernel.org/patch/9305867/

Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-01 17:19:53 +00:00
Takashi Iwai b1c01f4df2 drm/i915: Pass platform device to LPE audio notifier
This allows the LPE HDMI driver to clean up its global variable
reference.

Also drop to pass the eld pointer because the connection status and
the ELD bytes can be retrieved from the attached pdata.

Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-01 16:22:28 +01:00
Pierre-Louis Bossart 0843e043cf ALSA: x86: Use config base depending on the pipe
Now the pipe that is being used is passed over i915 notification, we
can re-setup the relevant register offset depending on pipe assignments
during hotplug.
This allows playback on single port machines such Zotac Pi330 or
dual-port machines such as Dell Wyse 3040 box

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-01 16:22:25 +01:00
Pierre-Louis Bossart 964ca8083c ALSA: x86: intel_hdmi: add definitions and logic for DP audio
Imported from legacy patches

Note: the new code doesn't assume a modified ELD but
an explicit notification that DP is present. It appears
that the i915 code does change the ELD so we could use
the ELD-based tests to check for DP audio

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-01 16:22:24 +01:00
Bjorn Andersson b6e643adfd ASoC: qcom: Drop __func__ usage from log prints
The combination of dev_err() and __func__ make most of these log prints
over 100 chars long. Remove the usage of __func__ to clean the kernel
log and as the usage is not necessary to identify the individual log
prints.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 21:02:00 +00:00
Bjorn Andersson 46dccc3573 ASoC: qcom: lpass-cpu: Remove unnecessary clock checks
Clean up the clock calling code by removing numerous IS_ERR() checks by
just assigning the clock NULL; as this turn all used functions in the
clk API to nops.

Also include the word "optional" in the error message when failing to acquire
the optional osr clocks.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 21:01:56 +00:00
Dan Carpenter fc28ab1882 sound: oss/ad1848: remove some dead code
We never use the irq2dev[] array so we can remove this assignment.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-31 21:41:19 +01:00
Sergej Sawazki c9b0bdc747 ASoC: wm8741: Remove unused WM8741_NUM_RATES macro
This macro is unused since commit e369bd006f ("ASoC: wm8741: Allow master
clock switching").

Signed-off-by: Sergej Sawazki <ce3a@gmx.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:20:49 +00:00
Enric Balletbo i Serra b1b9e0d3d9 ASoC: mt8173-max98090: remove the call to snd_soc_jack_add_pins.
The snd_soc_card_jack_new function can call snd_soc_jack_add_pins for
you, so pass directly the pins struct when you create the new jack.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:19:05 +00:00
Pierre-Louis Bossart 7bde09dfcf ASoC: Intel: cht-bsw-rt5645: fix DAI formats
Remove default and set I2S mode correctly both on codec and
cpu sides

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:14:30 +00:00
Pierre-Louis Bossart bf92c6efc6 ASoC: Intel: add support for ALC3270 codec
Use ACPI ID 10EC3270 to load machine driver for cht-bsw-rt5645
and add reference to 3270 to use the rt5645 mode

Tested on Asus T100HA

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:14:23 +00:00
Pierre-Louis Bossart d74390b5fe ASoC: Intel: cht-bsw-rt5645: select ASRC source based on routing quirk
Some platforms use AIF2, use routing information to set ASRC as needed

Suggested-by: Bard Liao <bardliao@realtek.com>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95681
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:14:07 +00:00
Pierre-Louis Bossart 22af29114e ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing
This driver may be used on Baytrail CR platforms where SSP2 is
not available.

Add quirks and routing detection based on work done for RT5640.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:14:07 +00:00
Pierre-Louis Bossart ff9d1fbb3f ASoc: rt5645: add ACPI ID 10EC3270
ALC3270 is a low-cost version of RT5645, add ACPI ID
to enable probe and use rt5645 codec driver
Tested on Asus T100HA

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:12:36 +00:00
Pierre-Louis Bossart fd0138dc5d ASoC: Intel: Baytrail: add quirk for Lenovo Thinkpad 10
the BIOS reports this codec as RT5640 but it's a rt5670. Use the
quirk mechanism to use the cht_bsw_rt5672 machine driver

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:12:31 +00:00
Pierre-Louis Bossart 42648c2270 ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection
Fix classic issue of having multiple codecs listed in DSDT
but a single one actually enabled. The previous code did
not handle such errors and could also lead to uninitalized
configurations

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:12:31 +00:00
Pierre-Louis Bossart e1d0691454 ASoC: Intel: Atom: add machine driver for baytrail-rt5645 hardware
Use machine driver initially defined for CherryTrail

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:12:31 +00:00
Pierre-Louis Bossart 11ad808986 ASoC: rt5645: add support for RT5648
add ACPI ID 10EC5648 found e.g on Asus X205TA and use
rt5645 driver

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:12:30 +00:00
Pierre-Louis Bossart 93ffeaa8ee ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10
the BIOS incorrectly reports this codec as 5640 but it is
really a rt5670

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:08:25 +00:00
Pierre-Louis Bossart a1a91752cb ASoC: Intel: add support for Realtek 5651 on Cherrytrail
RT5651 is used on some Cherrytrail platforms, add the ACPI
ID in machine table.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156191
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:05:33 +00:00
Alexandrov Stansilav e7974816a8 ASoC: Intel: Atom: Add HP Pavilion x2 10-p000 machine entry
Add machine entry for HP X2 Pavilion 10-p100.
This notebook contains rt5640 codec, but with ACPI ID "10EC3276".

Signed-off-by: Alexandrov Stansilav <neko@nya.ai>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:05:33 +00:00
Alexandrov Stansilav 03200140ee ASoC: rt5640: Add "10EC3276" ACPI ID
Add ACPI ID "10EC3276" for sound card found on notebook HP Pavilion X2 10-p000.
ACPI DSDT Table on this device describes this card as ALC3276, but it is in fact rt5640.

Signed-off-by: Alexandrov Stansilav <neko@nya.ai>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:03:58 +00:00
Pierre-Louis Bossart a50477e55f ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support
The existing code assumes a 19.2 MHz MCLK as the default
hardware configuration. This is valid for CherryTrail but
not for Baytrail.

Add explicit MCLK configuration to set the 19.2 clock on/off
depending on DAPM events.

This is a prerequisite step to enable devices with Baytrail
and RT5645 such as Asus X205TA

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 20:03:56 +00:00
Mark Brown 39d7548568 Merge branch 'fix/intel' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel 2017-01-31 20:03:10 +00:00
Pierre-Louis Bossart f12f5c84e3 ASoC: Intel: atom: fix frame polarity
The current frame sync polarity definitions are inconsistent in the
Atom/DPCM driver, fix to align with regular ASoC definitions and
update code in platform and machine drivers for RT5640 and RT5651.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 19:56:20 +00:00
Pierre-Louis Bossart 3639ac1cd5 ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers
This patch corrects an omission in bytcr_rt5640 and bytcr_rt5651.
All existing machine drivers shall not use .pm_ops to avoid a double
suspend, as initially implemented by 3f2dcbeaeb
("ASoC: Intel: Remove soc pm handling to allow platform driver handle it").

Reported-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 19:56:15 +00:00
Sebastien Guiriec 5b101ab465 ASoC: Intel: Atom: Configure media_loop1 and sprot_loop in stereo
Most of the devices are using stereo speakers so media_loop1 and
sprot_loop default mode should be stereo.

As per default all the routing UCM configuration doesn't enable Post
processing loops it is not impacting curent configurations.

Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 19:45:36 +00:00
Kuninori Morimoto b07609ceca ASoC: soc-core: remove OF adjusting for snd_soc_of_parse_card_name
Because prototype of OF-graph sound card support didn't have Sound Card
node, commit 8f5ebb1bee
("ASoC: soc-core: adjust for graph on snd_soc_of_parse_card_name")
adjusted to it on each functions.

But final discussion result of ALSA SoC / OF-graph ML, OF-graph sound
card has node. Thus, this commit became no longer needed.

This reverts commit 8f5ebb1bee.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-27 11:59:36 +00:00
Kuninori Morimoto 440a3006f1 ASoC: soc-core: remove OF adjusting for snd_soc_of_parse_audio_prefix
Because prototype of OF-graph sound card support didn't have Sound Card
node, commit b6defcca0a
("ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_prefix")
adjusted to it on each functions.

But final discussion result of ALSA SoC / OF-graph ML, OF-graph sound
card has node. Thus, this commit became no longer needed.

This reverts commit b6defcca0a.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-27 11:59:36 +00:00
Kuninori Morimoto 21efde50ca ASoC: soc-core: remove OF adjusting for snd_soc_of_parse_audio_simple_widgets
Because prototype of OF-graph sound card support didn't have Sound Card
node, commit 1ef5bcd57b
("ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_simple_widgets")
adjusted to it on each functions.

But final discussion result of ALSA SoC / OF-graph ML, OF-graph sound
card has node. Thus, this commit became no longer needed.

This reverts commit 1ef5bcd57b.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-27 11:59:36 +00:00
Kuninori Morimoto 2bc644af61 ASoC: soc-core: remove OF adjusting for snd_soc_of_parse_audio_routing
Because prototype of OF-graph sound card support didn't have Sound Card
node, commit 7364c8dc25
("ASoC: soc-core: adjust for graph on snd_soc_of_parse_audio_routing")
adjusted to it on each functions.

But final discussion result of ALSA SoC / OF-graph ML, OF-graph sound
card has node. Thus, this commit became no longer needed.

This reverts commit 7364c8dc25.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-27 11:59:35 +00:00
Shailendra Verma 3f81d9aa80 ASoC: davinci - Fix possible NULL derefrence.
of_match_device could return NULL, and so can cause a NULL
pointer dereference later.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-27 11:58:54 +00:00
Dave Airlie a7e2641aaf Merge tag 'drm-intel-next-2017-01-23' of git://anongit.freedesktop.org/git/drm-intel into drm-next
Final block of feature work for 4.11:

- gen8 pd cleanup from Matthew Auld
- more cleanups for view/vma (Chris)
- dmc support on glk (Anusha Srivatsa)
- use core crc api (Tomue)
- track wedged requests using fence.error (Chris)
- lots of psr fixes (Nagaraju, Vathsala)
- dp mst support, acked for merging through drm-intel by Takashi
  (Libin)
- huc loading support, including uapi for libva to use it (Anusha
  Srivatsa)

* tag 'drm-intel-next-2017-01-23' of git://anongit.freedesktop.org/git/drm-intel: (111 commits)
  drm/i915: Update DRIVER_DATE to 20170123
  drm/i915: reinstate call to trace_i915_vma_bind
  drm/i915: Assert that created vma has a whole number of pages
  drm/i915: Assert the drm_mm_node is allocated when on the VM lists
  drm/i915: Treat an error from i915_vma_instance() as unlikely
  drm/i915: Reject vma creation larger than address space
  drm/i915: Use common LRU inactive vma bumping for unpin_from_display
  drm/i915: Do an unlocked wait before set-cache-level ioctl
  drm/i915/huc: Assert that HuC vma is placed in GuC accessible range
  drm/i915/huc: Avoid attempting to authenticate non-existent fw
  drm/i915: Set adjustment to zero on Up/Down interrupts if freq is already max/min
  drm/i915: Remove the double handling of 'flags from intel_mode_from_pipe_config()
  drm/i915: Remove crtc->config usage from intel_modeset_readout_hw_state()
  drm/i915: Release temporary load-detect state upon switching
  drm/i915: Remove i915_gem_object_to_ggtt()
  drm/i915: Remove i915_vma_create from VMA API
  drm/i915: Add a check that the VMA instance we lookup matches the request
  drm/i915: Rename some warts in the VMA API
  drm/i915: Track pinned vma in intel_plane_state
  drm/i915/get_params: Add HuC status to getparams
  ...
2017-01-27 12:08:32 +10:00
Bhumika Goyal a6f9dec2a9 ALSA: cs46xx: constify snd_pcm_ops structures
Declare snd_pcm_ops structures as const as they are either stored in the
ops field of a snd_pcm_substream structure or passed as an argument to
the function snd_pcm_set_ops. The function argument and the ops field
are of type const, so snd_pcm_ops structures having this property
can be made const too.

File size before: sound/pci/cs46xx/cs46xx_lib.o
   text	   data	    bss	    dec	    hex	filename
  26047	   5304	     16	  31367	   7a87	sound/pci/cs46xx/cs46xx_lib.o

File size after: sound/pci/cs46xx/cs46xx_lib.o
   text	   data	    bss	    dec	    hex	filename
  27335	   4036	     16	  31387	   7a9b	sound/pci/cs46xx/cs46xx_lib.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-26 17:01:48 +01:00
Takashi Iwai e1a063f43a Merge branch 'topic/intel-lpe-audio' into for-next 2017-01-25 22:11:17 +01:00
Julia Lawall 0369d6315b ALSA: x86: hdmi: fix returnvar.cocci warnings
Remove unneeded variable used to store return value.

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

CC: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-25 22:07:38 +01:00
kbuild test robot f0fd4122f0 ALSA: x86: fix resource_size.cocci warnings
sound/x86/intel_hdmi_lpe_audio.c:498:24-27: ERROR: Missing resource_size with res_mmio

 Use resource_size function on resource object
 instead of explicit computation.

Generated by: scripts/coccinelle/api/resource_size.cocci

CC: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-25 14:25:37 +01:00
Jerome Anand 232892fb14 ALSA: x86: hdmi: continue playback even when display resolution changes
When the display resolution changes, the drm disables the
display pipes due to which audio rendering stops. At this
time, we need to ensure the existing audio pointers and
buffers are cleared out so that the playback can restarted
once the display pipe is enabled with a different N/CTS values

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-25 14:24:19 +01:00
Jerome Anand 5dab11d897 ALSA: x86: hdmi: Add audio support for BYT and CHT
Hdmi audio driver based on the child platform device
created by gfx driver is implemented.
This audio driver is derived from legacy intel
hdmi audio driver.

The interfaces for interaction between gfx and audio
are updated and the driver implementation updated to
derive interrupts in its own address space based on
irq chip framework

The changes to calculate sub-period positions was triggered
by David Henningsson <david.henningsson@canonical.com> and is
accomodated in this patch

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-25 14:24:08 +01:00
Jerome Anand 287599cf2d ALSA: add Intel HDMI LPE audio driver for BYT/CHT-T
On Baytrail and Cherrytrail, HDaudio may be fused out or disabled
by the BIOS. This driver enables an alternate path to the i915
display registers and DMA.

Although there is no hardware path between i915 display and LPE/SST
audio clusters, this HDMI capability is referred to in the documentation
as "HDMI LPE Audio" so we keep the name for consistency. There is no
hardware path or control dependencies with the LPE/SST DSP functionality.

The hdmi-lpe-audio driver will be probed when the i915 driver creates
a child platform device.

Since this driver is neither SoC nor PCI, a new x86 folder is added
Additional indirections in the code will be cleaned up in the next series
to aid smoother DP integration

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jerome Anand <jerome.anand@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-25 14:23:46 +01:00
Kuninori Morimoto 31489c0b1d ASoC: cq93vc: remove MFD_DAVINCI_VOICECODEC dependency from CQ0093VC
CQ0093VC is no longer dependent on MFD_DAVINCI_VOICECODEC,
let's remove it. Otherwise, we can't compile it by COMPILE_TEST
on non-DAVINCE platform

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-25 12:38:53 +00:00
Jeeja KP 1011509dfd ASoC: Intel: Skylake: Use set_tdm_slot to set the dma channel
DMA channel(stream tag) used by the HDA link need to programmed in
codec so that codec receives packet from the link associated with the
same channel.

DMA channel is allocated in link BE dai hw_params, the same needs to be
set for the BE codec dai. Instead of using get/set dma_data(), use
dai_ops snd_soc_dai_set_tdm_slot() to set the stream tag.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-24 17:55:16 +00:00
Jeeja KP c9bfb5d74d ASoC: hdac_hdmi: Register widget event handlers
In case of hdmi connect/disconnect or when stream need to be route to
multiple monitors, corresponding port and audio infoframe needs to be
reconfigured. Currently all the configuration are done in DAI ops which
results in silence playback.

So use dapm widget event handlers to program audio infoframe and enable
/disable port configuration when widget is power on/off.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-24 17:55:11 +00:00
Mark Brown dbbc21bbf2 Linux 4.10-rc1
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJYYGCgAAoJEHm+PkMAQRiGjVMH/R1WKLSCVyU2QboSTZVyBGqU
 6E42pMalPNaY72uxf29ZmUzds1uV5KyFn7OntsyD4qc+sQb2wxG5PvMSYAsL7HKN
 lTFiW738zC9Hfx8MzC/fHLGm/7HTHpPFndZJkDOJjIPnS0MeTHAmOFM+RwCRq+px
 5uvRHV4Z8yibHtijET6GqCywV0gw/uyXCi6xJfJNAspnj3hsm3ZXKJ0JPvP2ja+V
 yhdnWYHDEQwRs6FyNtIWnfjH92XilVn4KcOtwnb1pFahALiTmmVqJVMiGartagqJ
 fPRw98B3YHwmZpEc2SDbXaZi36WLu4hcWvvDa22SN/srXwYIzzblEwuNq1+fiBw=
 =X7z+
 -----END PGP SIGNATURE-----

Merge tag 'v4.10-rc1' into asoc-intel

Linux 4.10-rc1
2017-01-24 16:24:18 +00:00
Charles Keepax d589d8b835 ASoC: wm_adsp: Fixup wm_adsp2_boot_work error paths
Currently we are not disabling MEM_ENA on the error path, we should
really do this to unwind the state back to how it was. This patch adds a
clear of MEM_ENA on the error path, again there is no major issues
caused by this minor fix.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-24 12:14:36 +00:00
Charles Keepax e779974b86 ASoC: wm_adsp: Set booted/running flags at the end of bring up
The booted and running flags should really only be set once all the
steps at that power level have been complete. Currently operations can
fail after the flags have been set, which would leave us in an
inconsistent state where the flags are set but the things expected to
reach that level have not happened. Whilst there isn't really any major
impact from this it is best to clean it up.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-24 12:14:36 +00:00
Charles Keepax bb24ee411a ASoC: wm_adsp: Correct some missing locking
The recent refactoring overlooked some places which should be covered by
the pwr_lock, all code that affects or depends on the power status of
the DSP should be covered, this patch adds the missing coverage.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-24 12:14:36 +00:00
Sylwester Nawrocki 9bfa24e909 ASoC: Revert "Drop SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME flag"
This reverts commit c6644119a3 and
restores the ability to specify DMA channel names per DAI dma_data.
Unfortunately the functionality removed in the patch being reverted
cannot be entirely replaced by specifying DMA channel names in struct
snd_dmaengine_pcm_config as that does not cover devices with more than
2 DMA channels.

Together with patch "ASoC: Revert "samsung: Remove unneeded
initialization of chan_name"" this fixes broken sound on the s3c24xx
SoC platforms.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-23 18:16:33 +00:00
Sylwester Nawrocki b8ab0ccc0b ASoC: Revert "samsung: Remove unneeded initialization of chan_name"
This reverts commit cdaf9af1ea
which breaks I2S support on the non-DT Samsung SoC platforms,
since the default "tx", "rx" DMA channel names for playback
and capture streams or custom channel names in struct
snd_dmaengine_pcm_config are supported in the ASoC dmaengine
module only for devicetree booting case.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-23 18:16:33 +00:00
Romain Perier 5f166156db ASoC: es8328-i2c: Add compatible for ES8388
This commit adds a compatible string for everest,es8388. This is
an audio codec that is compatible with es8328.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-23 18:09:21 +00:00
Kuninori Morimoto e984fd61e8 ASoC: simple-card: use devm_get_clk_from_child()
Current simple-card-utils is getting clk by of_clk_get(), but didn't call
clk_free(). Now we can use devm_get_clk_from_child() for this purpose.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-23 17:46:33 +00:00
Kuninori Morimoto 90ffc1ecc5 ASoC: rsnd: fixup for_each_rsnd_mod_array{s} iterator increment
commit 5f222a292 ("ASoC: rsnd: use for_each_rsnd_mod_xxx() ...")
modifies rsnd_dai_call() to use for_each_rsnd_mod_arrays().

Current rsnd is incrementing iterator in rsnd_mod_next(),
but the iterator will indicate +1 position in for_each loop in
this case. Incremental position should be inside for()

Reported-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-23 15:11:42 +00:00
Arnaud Pouliquen cd6111b262 ASoC: hdmi-codec: add channel mapping control
Add user interface to provide channel mapping.
In a first step this control is read only.

As TLV type, the control provides all configuration available for
HDMI sink(ELD), and provides current channel mapping selected by codec
based on ELD and number of channels specified by user on open.
When control is called before the number of the channel is specified
(i.e. hw_params is set), it returns all channels set to UNKNOWN.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-20 15:16:29 +00:00
Arnaud Pouliquen 25f7b701c2 ASoC: core: add optional pcm_new callback for DAI driver
During probe, DAIs can need to perform some actions that requests
the knowledge of the pcm runtime handle.
The callback is called during DAIs linking, after PCM device creation.
For instance this can be used to add relationship between a DAI pcm
control and the pcm device.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-20 15:16:23 +00:00
Sandeep Tayal f6fa11a35c ASoC: hdac_hdmi: use audio component framework to read ELD
With codec read sometimes the pin_sense shows invalid monitor present
and eld_valid. Currently driver polls for few times to get the valid
eld data.

To avoid the latency, Instead of reading ELD from codec, read it
directly from the display driver using audio component framework.
and removed the unused direct codec helper functions.

Signed-off-by: Sandeep Tayal <sandeepx.tayal@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-20 13:36:38 +00:00
Linus Walleij 639467c8f2 ASoC: dapm: fix some pointer error handling
commit 66feeec9322132689d42723df2537d60f96f8e44
"RFC: ASoC: dapm: handle probe deferrals"
forgot a to update some two sites where the call
was used. The static codechecks quickly found them.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-20 13:11:02 +00:00
Marcus Cooper 1bd92af877 ASoC: sun4i-spdif: Add support for the H3 SoC
The H3 SoC uses the same SPDIF block as found in earlier SoCs, but its
TXFIFO is mapped to another address.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-20 13:04:17 +00:00
Yong Zhi 079a248b0e ASoC: Intel: boards: Remove ignore_suspend for WoV streams
When Ref capture is used during S0IX, only the DSP pipelines
are needed, thus remove the ignore_suspend for WoV streams so
that DMA can be suspended, but keep them for WoV endpoints.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-19 17:53:04 +00:00
Jeeja KP 1de777fed5 ASoC: hdac_hdmi: Enable pin and converter in prepare
Instead of enabling pin and cvt in pcm_open(), need to restore pin and
cvt state after system resume to restart the playback which is
paused/stopped before system suspend.
So enable pin and cvt in playback_prepare and call prepare when trigger
cmd is paused/started and resume to reconfigure pin and cvt.

Signed-off-by: Sachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-19 15:43:04 +00:00
Jeeja KP a700a1e65a ASoC: Intel: Skylake: set the resume point to LPIB
In system suspend, the firmware pipelines will be deleted and there
is no need to save the pipeline context. Driver will save the DPIB and
LPIB pointers in suspend.

In system resume, the firmware pipelines will be created again and the
RD/RW pointers in the Firmware buffer points to the base address. So
need to fetch the non-played data again to firmware buffer. LPIB
indicates the HW rendered position.

Instead of setting DPIB as resume point, set it to LPIB to restore from
the HW render position so that DMA would fetch the non-played data one
more time.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-19 15:43:04 +00:00
Jeeja KP 7cbfdf87f4 ASoC: Intel: Skylake: Don't reset pass-through pipe in BE prepare
When pipe is pass-through, BE and FE modules are defined inside
a pipe, reset of pipe will be done in FE DAI prepare. So don't
reset in the BE prepare.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-19 15:43:03 +00:00
Charles Keepax acff07d060 ASoC: arizona: Propagate errors from arizona_spk_init
arizona_spk_init uses snd_soc_dapm_new_control which since
commit 37e1df8c95 ("ASoC: dapm: handle probe deferrals") will
occasionally request a probe deferral. Which means we should propagate the
error out of our driver from it.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-18 16:26:56 +00:00
Kailang Yang 9eb5d0e635 ALSA: hda/realtek - Add support headphone Mic for ALC221 of HP platform
ALC221 HP platform need to support Headphone Mic.
This patch will turn on headphone Mic supported.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-18 11:05:22 +01:00
Mylène Josserand ebad64d193 ASoC: sun4i-i2s: Increase DMA max burst to 8
As done previously for sun4i-codec, the DMA maxburst of 4
is not supported by every SoCs so the DMA controller engine
returns "unsupported value".

As a maxburst of 8 is supported by all variants, this patch
increases it to 8.

For more details, see commit from Chen-Yu Tsai:
commit 730e2dd0cb ("ASoC: sun4i-codec: Increase DMA max burst to 8")

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 18:43:13 +00:00
Jörg Krause bcb8c27082 ASoC: mxs-saif: fix setting master base rate
The SAIF base oversample rates are either 512*fs or 384*fs. An additional
divider exists within the SAIF to generate sub-multiples of these two base
rates if MCLK is required by the codec.

 * The sub-rates for the 512x base rate are: 256x, 128x, 64x, and 32x.
 * The sub-rates for the 384x base rate are: 192x, 96x, and 48x.

Setting the base rate depending on the modulo operation with 32 and 48
give wrong results for some mclk.

If mclk=18.432MHz both modulo operations results in 0. As testing the
result with 32 is done first, a wrong base rate of 512*fs is set instead
of the correct 384*fs.

Fix this by setting the base rate depending on the calculated sub-rate.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 18:19:36 +00:00
Jörg Krause b25658ed7d ASoC: mxs-saif: fix setting SAIF1 register
If SAIF0 is used in master and SAIF1 in slave mode setting the SAIF1
register in mxs_saif_set_dai_fmt() does not have any effect on the
interface as the clk gate needs to be cleared before the register can be
written.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 18:19:36 +00:00
kbuild test robot 13861a44b4 ASoC: rt5659: fix platform_no_drv_owner.cocci warnings
sound/soc/codecs/rt5659.c:4236:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 18:00:55 +00:00
Linus Walleij 37e1df8c95 ASoC: dapm: handle probe deferrals
This starts to handle probe deferrals on regulators and clocks
on the ASoC DAPM.

I came to this patch after audio stopped working on Ux500 ages
ago and I finally looked into it to see what is wrong. I had
messages like this in the console since a while back:

ab8500-codec.0: ASoC: Failed to request audioclk: -517
ab8500-codec.0: ASoC: Failed to create DAPM control audioclk
ab8500-codec.0: Failed to create new controls -12
snd-soc-mop500.0: ASoC: failed to instantiate card -12
snd-soc-mop500.0: Error: snd_soc_register_card failed (-12)!
snd-soc-mop500: probe of snd-soc-mop500.0 failed with error -12

Apparently because the widget table for the codec looks like
this (sound/soc/codecs/ab8500-codec.c):

static const struct snd_soc_dapm_widget ab8500_dapm_widgets[] = {

        /* Clocks */
        SND_SOC_DAPM_CLOCK_SUPPLY("audioclk"),

        /* Regulators */
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-AUD", 0, 0),
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC1", 0, 0),
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC2", 0, 0),
        SND_SOC_DAPM_REGULATOR_SUPPLY("V-DMIC", 0, 0),

So when we call snd_soc_register_codec() and any of these widgets
get a deferred probe we do not get an -EPROBE_DEFER (-517) back as
we should and instead we just fail. Apparently the code assumes
that clocks and regulators must be available at this point and
not defer.

After this patch it rather looks like this:

ab8500-codec.0: Failed to create new controls -517
snd-soc-mop500.0: ASoC: failed to instantiate card -517
snd-soc-mop500.0: Error: snd_soc_register_card failed (-517)!
(...)
abx500-clk.0: registered clocks for ab850x
snd-soc-mop500.0: ab8500-codec-dai.0 <-> ux500-msp-i2s.1 mapping ok
snd-soc-mop500.0: ab8500-codec-dai.1 <-> ux500-msp-i2s.3 mapping ok

I'm pretty happy about the patch as it it, but I'm a bit
uncertain on how to proceed: there are a lot of users of the
external functions snd_soc_dapm_new_control() (111 sites)
and that will now return an occassional error pointer, which
is not handled in the calling sites.

I want an indication from the maintainers whether I should just
go in and augment all these call sites, or if deferred probe
is frowned upon when it leads to this much overhead.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 18:00:11 +00:00
Mengdong Lin 3122c66fd2 ASoC: Intel: Use DMI name for sound card long name in Broadwell machine driver
Intel Broadwell machine driver will call API snd_soc_set_dmi_name() to
use DMI info to make the sound card long name.

For example, here are the changed long name for two Broadwell-based
machines:
Dell XPS-13(2015): DellInc.-XPS139343-01-0310JH
Intel WilsonBeach: Intel Corp.-BroadwellClientplatform-0.1-WilsonBeachSDS

They still share the same card name "broadwell-rt286".

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 17:57:14 +00:00
Liam Girdwood 345233d7c6 ASoC: core: Add API to use DMI name in sound card long name
Intel DSP platform drivers are used by many different devices but are
difficult for userspace to differentiate. This patch adds an API to allow
the DMI name to be used in the sound card long name, thereby helping
userspace load the correct UCM configuration. Usually machine drivers
uses their own name as the sound card name (short name), and leave the
long name and driver name blank. This API will use the DMI info like
vendor, product and board to make up the card long name. If the machine
driver has already explicitly set the long name, this API will do nothing.

This patch also allows for further differentiation as many devices that
share the same DMI name i.e. Minnowboards, UP boards may be configured
with different codecs or firmwares. The API supports flavoring the DMI
name into the card longname to provide the extra differentiation required
for these devices.

For Use Case Manager (UCM) in the user space, changing card long name by
this API is backward compatible, since the card name does not change. For
a given sound card, even if there is no device-specific UCM configuration
file that uses the card long name, UCM will fall back to load the default
configuration file that uses the card name.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 17:57:14 +00:00
Andy Shevchenko 2914266975 ASoC: Intel: remove ignored dependencies
For selected only options the explicit dependencies do not make much sense
becase Kbuild ignores them anyway. Remove them explicitly.

Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 17:46:58 +00:00
Andy Shevchenko ebf79091bf ASoC: Intel: select DW_DMAC_CORE since it's mandatory
Select DW_DMAC_CORE like the rest of glue drivers do, e.g.
drivers/dma/dw/Kconfig.

While here group selectors under SND_SOC_INTEL_HASWELL and
SND_SOC_INTEL_BAYTRAIL.

Make platforms, which are using a common SST firmware driver, to be
dependent on DMADEVICES.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 17:46:47 +00:00
Andy Shevchenko 231a091ef8 ASoC: Intel: rename SND_SST_MFLD_PLATFORM to SND_SST_ATOM_HIFI2_PLATFORM
Rename SND_SST_MFLD_PLATFORM to SND_SST_ATOM_HIFI2_PLATFORM to make it clear
that is not only about Medfield platform.

The new name is derived from Intel Atom and HiFi2. HiFi2 is the DSP version,
it's public information for Intel *Field/*Trail parts, see
https://www.alsa-project.org/main/index.php/Firmware. By combining HiFi2 with
Atom we get a unique non-ambiguous description of the core+DSP hardware for
Intel Medfield through Intel Cherrytrail.

Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 17:46:40 +00:00
Andy Shevchenko dd8275771f ASoC: Intel: remove redundant select SND_SOC_INTEL_SST
SND_SOC_INTEL_SKYLAKE selects SND_SOC_INTEL_SST already. Thus no need to
duplicate. Remove duplications.

Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-17 17:46:37 +00:00
Arnd Bergmann 8b169cb27c ALSA: mips: avoid potential uninitialized variable use
MIPS allmodconfig results in this warning:

sound/mips/hal2.c: In function 'hal2_gain_get':
sound/mips/hal2.c:224:35: error: 'r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
sound/mips/hal2.c:223:35: error: 'l' may be used uninitialized in this function [-Werror=maybe-uninitialized]
sound/mips/hal2.c: In function 'hal2_gain_put':
sound/mips/hal2.c:260:13: error: 'new' may be used uninitialized in this function [-Werror=maybe-uninitialized]
sound/mips/hal2.c:260:13: error: 'old' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Returning an error for all unexpected cases shuts up the warning

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-16 14:33:42 +01:00
Kailang Yang a535ad57d0 ALSA: hda/realtek - New codec support of ALC1220
Add support for new codec of ALC1220.
It's compatible with ALC882 & co.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-16 10:18:38 +01:00
Takashi Iwai 41438f1314 ALSA: hda - Make single_cmd option to stop the fallback mechanism
HD-audio driver has a mechanism to fall back to the single cmd mode as
a last resort if the CORB/RIRB communication goes wrong even after
switching to the polling mode.  The switching has worked in the past
well, but Enrico Mioso reported that his system crashes when this
happens.

Although the actual cause of the crash isn't still fully analyzed yet,
it'd be in anyway good to provide an option to turn off the fallback
mode.  Now this patch extends the behavior of the existing single_cmd
option for that.  Namely,

- The option is changed from bool to bint.
- As default, it is the mode allowing the fallback to single cmd.
- Once when either true/false value is given to the option, the driver
  explicitly turns on/off the single cmd mode, but without the
  fallback.

That is, if you want to disable the fallback, just pass single_cmd=0
option.  Passing single_cmd=1 will keep working like before.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-15 09:09:04 +01:00
Takashi Sakamoto 1753187e28 ALSA: oxfw: enclose identifiers referred by single function for scs1x feature
Some identifiers are referred just by one functions. In this case, they
can be put into the function definition. This brings two merits; readers
can easily follow codes related to the identifiers, developers are free
from name conflict.

This commit moves such identifiers to each function definition.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-14 09:31:57 +01:00
Nicholas Mc Guire 969f751036 ASoC: rt5660: use msleep() for long delay
ulseep_range() uses hrtimers and provides no advantage over msleep()
for larger delays. For this large delay msleep() is preferable.

Link: http://lkml.org/lkml/2017/1/11/377
Fixes: commit 2b26dd4c1f ("ASoC: rt5660: add rt5660 codec driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-12 17:23:29 +00:00
Nicholas Mc Guire 4281fcc02e ASoC: rt5660: remove double const
Drop the const qualifier as it is being added by SOC_ENUM_DOUBLE_DECL()
already which is called by SOC_ENUM_SINGLE_DECL() here.

Fixes: commit 2b26dd4c1f ("ASoC: rt5660: add rt5660 codec driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-12 17:23:28 +00:00
Charles Keepax 8abab35f9a ASoC: Fixup some small kernel-doc typos
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-12 17:23:01 +00:00
Nicholas Mc Guire eae39b5f42 ASoC: rt5659: drop double const
Drop the const qualifier as it is being added by SOC_ENUM_DOUBLE_DECL()
already which is called by SOC_ENUM_SINGLE_DECL() as well as the
double const by calls to SOC_VALUE_ENUM_SINGLE_DECL() via
SOC_VALUE_ENUM_DOUBLE_DECL).

Fixes: commit d3cb2de247 ("ASoC: rt5659: add rt5659 codec driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-12 17:21:54 +00:00
Nicholas Mc Guire 0230f088ad ASoC: rt5659: declare rt5659_i2c_driver static
Declar rt5659_i2c_driver, which is only being passed to
module_i2c_driver(rt5659_i2c_driver), static.

Fixes: commit d3cb2de247 ("ASoC: rt5659: add rt5659 codec driver")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-12 17:21:50 +00:00
Nicholas Mc Guire 11b4ad9631 ASoC: rt5659: use msleep() for long delays
ulseep_range() uses hrtimers and provides no advantage over msleep()
for larger delays. For this large delay msleep() is preferable.

Fixes: commit d3cb2de247 ("ASoC: rt5659: add rt5659 codec driver")
Link: http://lkml.org/lkml/2017/1/11/377
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-12 17:21:45 +00:00
Nicholas Mc Guire 4a312c9c82 ASoC: rt5640: use msleep() for long delays
ulseep_range() uses hrtimers and provides no advantage over msleep()
for larger delays. Fix up the 70/80ms delays here passing the "min"
value to msleep(). This reduces the load on the hrtimer subsystem.

Link: http://lkml.org/lkml/2017/1/11/377
Fixes: commit 246693ba7b ("ASoC: rt5640: change widget sequence for depop")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-12 17:20:59 +00:00
Takashi Iwai f43e5407e4 ALSA: usb: Constify snd_rawmidi_ops
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi,
we can constify the definitions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12 12:50:48 +01:00
Takashi Iwai 57eb67994a ALSA: firewire: Constify snd_rawmidi_ops
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi,
we can constify the definitions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12 12:50:38 +01:00
Takashi Iwai 485885b9d0 ALSA: pci: Constify snd_rawmidi_ops
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi,
we can constify the definitions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12 12:50:26 +01:00
Takashi Iwai 9021b2b8fd ALSA: isa: Constify snd_rawmidi_ops
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi,
we can constify the definitions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12 12:50:16 +01:00
Takashi Iwai c36f486d7b ALSA: drivers: Constify snd_rawmidi_ops
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi,
we can constify the definitions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12 12:50:06 +01:00
Takashi Iwai c62a57004a ALSA: seq: Constify snd_rawmidi_ops
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi,
we can constify the definitions.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12 12:49:55 +01:00
Takashi Iwai 6ba79b8532 ALSA: rawmidi: Add const to snd_rawmidi_ops
Make snd_rawmidi_substream.ops to be a const pointer to be safer and
allow more optimization.  The patches to constify each rawmidi ops
will follow.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-12 12:49:36 +01:00
Libin Yang 9152085def ALSA: hda - add DP MST audio support
This patch adds the DP MST audio support on i915 platform and
it will enable dyn_pcm_assign feature.

DP MST supports several device entry on the same port and each
device entry can map to one pcm stream. For example, on i915,
there are 3 pins, and each pin has 3 device entries. This means
there should be 3x3 pcms. However, there is only 3 pipe lines in
i915. This means 3 pcms are actived at most at the same moment.
We will create 5 pcms (pin number + dev entry num - 1) in this case.
For the details, please refer commit a76056f2e5
("ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug")

Each device entry is a virtual pin. It is described by pin_nid and dev_id
in struct hdmi_spec_per_pin.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1484208294-8637-3-git-send-email-libin.yang@intel.com
2017-01-12 10:06:47 +01:00
Libin Yang 13800f397e ALSA: hda - add DP mst verb support
Add snd_hda_get_dev_select() and snd_hda_set_dev_select() functions
for DP MST audio support.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1484208294-8637-2-git-send-email-libin.yang@intel.com
2017-01-12 10:06:47 +01:00
Takashi Iwai 6cf4569ce3 ASoC: Fixes for v4.10
As well as the usual smattering of driver specific fixes collected since
 the merge window this has one particularly important fix to the core for
 handling of aux_devs which was broken during the merge window by some of
 the componentization refactoring.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlh2as0THGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0LBrB/92Z6gD0GrbQjP6LkMJ0SwmAMjWOOy+
 hDTr8m9CNwSHwQW/L+rAnyS8WBB46jiJ4/mTw6Sz7YIyY0Xdv5RY7IPPuWC92JQd
 jA+0lcfGe0p86ZvVhK2tye+EHTBqKgfIzO2Sl5XNzaQZiw0S8g/FjJIjBABOGkty
 oyK2iYHAW5H7aNVZfoXR9QQBqWniSh5hh06tCDs7Gy90zlKSOoWDUUfux5pubzVR
 mXOxTnie6bU7Rf0IKzdAQ5EI3zt2XT3XtFgv47VYp4bKW8LbkSo8JCVORGymoq+c
 k+Oc8YPbpAY5Jh4tZ9tSup1Ce7DJvE1sf4VOuHkAoXjKO+Pjp+/qTo50
 =KUQm
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v4.10

As well as the usual smattering of driver specific fixes collected since
the merge window this has one particularly important fix to the core for
handling of aux_devs which was broken during the merge window by some of
the componentization refactoring.
2017-01-11 19:49:27 +01:00
Arnd Bergmann 46a049dae7 ALSA: hda/ca0132 - fix possible NULL pointer use
gcc-7 caught what it considers a NULL pointer dereference:

sound/pci/hda/patch_ca0132.c: In function 'dspio_scp.constprop':
sound/pci/hda/patch_ca0132.c:1487:4: error: argument 1 null where non-null expected [-Werror=nonnull]

This is plausible from looking at the function, as we compare 'reply'
to NULL earlier in it. I have not tried to analyze if there are constraints
that make it impossible to hit the bug, but adding another NULL check in
the end kills the warning and makes the function more robust.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-11 17:19:23 +01:00
Harunobu Kurokawa fc1e65c3a8 ASoC: ak4642: Replace mdelay function to msleep
Replace mdelay to msleep to avoid busy loop on ak4642_lout_event().
Otherwise, sometimes playback doesn't work correctly when pulseaudio
was used.

Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-11 12:06:33 +00:00
Lars-Peter Clausen d61b23daf0 ASoC: mpc5200_psc_ac97: Remove unused DAI ID defines
The DAI ID defines are back from the time when DAIs were referenced by a
numerical ID. These days a string is used instead and the defines are
unused. The last user of these defines was removed in commit f0fba2ad1b
("ASoC: multi-component - ASoC Multi-Component Support"). So remove the
defines as well.

This also means the mpc5200_psc_ac97.h file no longer has any content and
can be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-10 18:45:26 +00:00
Jörg Krause dfa5def56f ASoC: wm8731: Adjust clk definitions so that simple card can work
When trying to use simple card with wm8962 the following probe
error happens:

  wm8731 0-001a: simple-card: set_sysclk error

In simple-card.c the snd_soc_dai_set_sysclk() function is called with
clk_id as 0, which is an invalid clock for wm8731.

Adjust the clocks source definitions in wm8731.h so that the simple
card driver can work successfully

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-10 18:06:46 +00:00
Mark Brown 9c1852b459 Linux 4.10-rc1
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJYYGCgAAoJEHm+PkMAQRiGjVMH/R1WKLSCVyU2QboSTZVyBGqU
 6E42pMalPNaY72uxf29ZmUzds1uV5KyFn7OntsyD4qc+sQb2wxG5PvMSYAsL7HKN
 lTFiW738zC9Hfx8MzC/fHLGm/7HTHpPFndZJkDOJjIPnS0MeTHAmOFM+RwCRq+px
 5uvRHV4Z8yibHtijET6GqCywV0gw/uyXCi6xJfJNAspnj3hsm3ZXKJ0JPvP2ja+V
 yhdnWYHDEQwRs6FyNtIWnfjH92XilVn4KcOtwnb1pFahALiTmmVqJVMiGartagqJ
 fPRw98B3YHwmZpEc2SDbXaZi36WLu4hcWvvDa22SN/srXwYIzzblEwuNq1+fiBw=
 =X7z+
 -----END PGP SIGNATURE-----

Merge tag 'v4.10-rc1' into asoc-samsung

Linux 4.10-rc1
2017-01-10 16:39:52 +00:00
Kuninori Morimoto 96241bae08 ASoC: remove snd_soc_platform_trigger()
No one is using snd_soc_platform_trigger().
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-10 12:11:21 +00:00
Mark Brown 42e0ebdef5 Merge remote-tracking branches 'asoc/fix/nau8825', 'asoc/fix/rt5645', 'asoc/fix/tlv320aic3x' and 'asoc/fix/topology' into asoc-linus 2017-01-10 10:47:54 +00:00
Mark Brown 1c681a1921 Merge remote-tracking branches 'asoc/fix/arizona', 'asoc/fix/dpcm', 'asoc/fix/dwc', 'asoc/fix/fsl-ssi' and 'asoc/fix/hdmi-codec' into asoc-linus 2017-01-10 10:47:50 +00:00
Mark Brown df3c63d39d Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus 2017-01-10 10:47:48 +00:00
Mark Brown 7dfe7e18b5 Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus 2017-01-10 10:47:47 +00:00
Mark Brown 01c2a84c49 Merge remote-tracking branch 'asoc/fix/component' into asoc-linus 2017-01-10 10:47:45 +00:00
Dennis Kadioglu 2e40795c3b ALSA: usb-audio: Add a quirk for Plantronics BT600
Plantronics BT600 does not support reading the sample rate which leads
to many lines of "cannot get freq at ep 0x1" and "cannot get freq at
ep 0x82". This patch adds the USB ID of the BT600 to quirks.c and
avoids those error messages.

Signed-off-by: Dennis Kadioglu <denk@post.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-10 11:42:31 +01:00
Chen-Yu Tsai 19426bdedb ASoC: sun4i-codec: Add "Right Mixer" to "Line Out Mono Diff." route
The mono differential output for "Line Out" downmixes the stereo audio
from the mixer, instead of just taking the left channel.

Add a route from the "Right Mixer" to "Line Out Source Playback Route"
through the "Mono Differential" path, so DAPM doesn't shut down
everything if the left channel is muted.

Fixes: 0f909f98d7 ("ASoC: sun4i-codec: Add support for A31 Line Out
		      playback")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09 19:48:35 +00:00
Kuninori Morimoto 10611e1b0b ASoC: remove .bespoke_trigger from snd_soc_platform_driver
No existing platform is using .bespoke_trigger.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09 19:31:21 +00:00
Kuninori Morimoto fcff45f8e0 ASoC: remove .delay from snd_soc_platform_driver
No existing platform is using .delay.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09 19:31:21 +00:00
Jose Abreu e21ab17904 ASoC: dwc: Enable 24 bit sample size in PIO mode
Sample size of 24 bits use in reality 32 bits for storage. We
can safelly enable this sample size and treat the data as
32 bits.

Tested in a x86_64 platform and in ARC AXS101 SDP platform.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09 11:59:09 +00:00
Jose Abreu e2f748e06d ASoC: dwc: Add record capability in PIO mode
Up until now PIO mode offered only playback support. With
this patch we add support for record mode. The PCM was
refactored so that we could reuse the existing infrastructure
without many changes.

We have support for 16 and 32 bits of sample size using
only 2 channels.

Tested in a x86_64 platform and in ARC AXS101 SDP platform.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09 11:59:05 +00:00
Bard Liao da369d0ab5 ASoC: rt5645: set high voltage for capless power
The default capless power mode is low voltage mode. We should set
it to high voltage mode to get fair headphone performance.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09 11:57:43 +00:00
Bard Liao 02c5c03283 ASoC: rt5645: set sel_i2s_pre_div1 to 2
The i2s clock pre-divider 1 is used for both i2s1 and sysclk.
The i2s1 is usually used for the main i2s and the pre-divider
will be set in hw_params function.

However, if i2s2 is used, the pre-divider is not set in the hw_params
function and the default value of i2s clock pre-divider 1 is too high
for sysclk and DMIC usage. Fix by overriding default divider value to 2.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95681
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-09 11:57:27 +00:00
Patrick Lai 9f169b9f52 ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused
When multiple front-ends are using the same back-end, putting state of a
front-end to STOP state upon receiving pause command will result in backend
stream getting released by DPCM framework unintentionally. In order to
avoid backend to be released when another active front-end stream is
present, put the stream state to PAUSED state instead of STOP state.

Signed-off-by: Patrick Lai <plai@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-06 18:19:10 +00:00
Mark Brown 8452a76394 Merge branch 'topic/hda-ext-decouple' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel 2017-01-06 18:17:24 +00:00
Jeeja KP 09a8bf812c ALSA: hda: check stream decoupled register state
Check stream decoupled register value with requested value
before decoupling/coupling the stream.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-06 18:16:10 +00:00
Jeeja KP bc65a326c5 ASoC: Intel: Skylake: Release FW ctx in cleanup
Saved firmware ctx was not never released, so release Firmware
ctx in cleanup routine.

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-01-06 18:14:58 +00:00
Jeeja KP 1448099dd3 ASoC: Intel: bxtn: Use DSP poll API to poll FW status
Use the optimized dsp_register_poll API to poll the DSP firmware
status register rather than open coding it.

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-01-06 18:14:48 +00:00
Jeeja KP 9cc8f9fe0f ASoC: Intel: Common: Update dsp register poll implementation
Poll implementation is not quite accurate, especially for smaller
values of timeout or timeout values close to the actual timeout needed

Use jiffies to set the timeout value and time_before() to get the
accurate time. So update the dsp register poll implementation to
provide accurate timeout using jiffies.

Signed-off-by: Jayachandran B <jayachandran.b@intel.com>
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-01-06 18:14:45 +00:00