Commit graph

30215 commits

Author SHA1 Message Date
Fabio Estevam
6b24e03ecf
ASoC: imx-sgtl5000: Switch to SPDX identifier
Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24 16:59:07 +01:00
Fabio Estevam
ad47191a72
ASoC: fsl_utils: Switch to SPDX identifier
Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24 16:59:03 +01:00
Fabio Estevam
2ba2805368
ASoC: fsl_asrc: Switch to SPDX identifier
Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24 16:58:59 +01:00
Fabio Estevam
aa624a0a92
ASoC: fsl-asoc-card: Switch to SPDX identifier
Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24 16:58:55 +01:00
Srinivas Kandagatla
467b061f1a
ASoC: core: add support to snd_soc_dai_get_channel_map()
On Qualcomm platforms, specifically with SLIMbus interfaced codecs,
the codec slim channel numbers are passed to DSP while configuring
the slim audio path. Having get_channel_map() would allow dais to
share such information across multiple dais.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24 12:06:43 +01:00
Oder Chiou
d96f8bd28c
ASoC: rt5514: Fix the issue of the delay volume applied
The patch fixes the issue of the delay volume applied.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24 11:57:05 +01:00
Arnd Bergmann
a241c3d95b
ASoC: meson: axg-spdifout: select SND_PCM_IEC958
When CONFIG_SND_PCM_IEC958 is disabled, we get a link error for the
new driver:

sound/soc/meson/axg-spdifout.o: In function `axg_spdifout_hw_params':
axg-spdifout.c:(.text+0x650): undefined reference to `snd_pcm_create_iec958_consumer_hw_params'

The other users use 'select', so we should do the same here.

Fixes: 53eb4b7aaa ("ASoC: meson: add axg spdif output")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24 11:56:28 +01:00
Daniel Mack
a8e43c21a8
ASoC: pxa: remove clock divider and pll setup from zylonite and magician
The SSP DAI now handles the clocking setup itself, all it needs is the
master clock frequency. Remove the code from Zylonite and Magician
platforms.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 17:41:26 +01:00
Jerome Brunet
7864a79f37
ASoC: meson: add axg sound card support
Add the axg sound card to handle the specifities of the axg audio
sub system.

This card is required to:
 * setup the dpcm links specific to the AXG (with a cpu sound dai)
 * handle the 4 lanes masks of the tdm interfaces
 * add the loopback link when a tdm pad interface has a playback
   stream
 * handle multi-codec links

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 17:40:12 +01:00
Jerome Brunet
cbdfab3b67
ASoC: export snd_soc_of_get_slot_mask
Amlogic's axg card driver can't use snd_soc_of_parse_tdm_slot()
directly because it needs to handle 4 mask for each direction.
Yet the parsing of each mask is the same, so export
snd_soc_of_get_slot_mask() to reuse the the existing code.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 17:39:26 +01:00
Jerome Brunet
13a22e6a98
ASoC: meson: add tdm input driver
Add Amlogic's axg TDM input driver which take the TDM signal of 4 input
lanes and push the decoded audio samples to TODDR fifo

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 17:39:04 +01:00
Jerome Brunet
c41c2a355b
ASoC: meson: add tdm output driver
Add Amlogic's axg tdm output driver which pulls data from FRDDR fifo
and produce the TDM signals for 4 output lanes.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 17:38:55 +01:00
Jerome Brunet
d60e4f1e4b
ASoC: meson: add tdm interface driver
Add Amlogic's axg TDM interface driver. This driver manages the format
and clocks provided on the pads.

On this SoC, each stream direction provides 4 serial lanes. This makes
a maximum of 8 channels in i2s modes and 128 channels in DSP modes.

While each lanes operate on the same slot number (same bit clock), they
may have different TDM masks. This requires to provide a function to let
the card set the 4 masks, in lieu of the usual set_tdm_slots() callback
of the dai driver.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 17:38:33 +01:00
Jerome Brunet
1a11d88f49
ASoC: meson: add tdm formatter base driver
Add Amlogic's axg TDM core driver. On this SoC, tdm is bit more
complex than usual, mainly because the different TDM input decoders can
be attached to any of TDM pad interface, including the output pads.

For the this, TDM on this SoC is modeled like this:
- TDM interface provides the DAIs the codecs will be attached to.
  The main responsibility of this driver is to manage the pad format
  and the TDM clock rates.
- TDM Formatters: These are the entities which are actually dealing with
  the TDM signal. TDMOUT produce a TDM signal from the audio sample
  provided by FRDDR using the clocks provided the TDM interface. TDMIN
  feeds TODDR with audio sample using the clocks and TDM signal provided
  by the TDM Interface.
- TDM Streams: This provides the link between 1 DAI stream of the TDM
  interface and one (or more) TDM formatters.

This driver provides the TDM formatter and TDM stream operations.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 17:38:27 +01:00
Marcel Ziswiler
2ec4248635
ASoC: tegra: improve goto error label
While the two error labels "err" and "err_clk_put" goto the same place
it is rather confusing that the earlier one is certainly used later
again.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-20 13:18:32 +01:00
Hans de Goede
9ee6f8a8cb
ASoC: Intel: bytcr_rt5640: Add quirk for the "Connect Tablet 9" tablet
Add a quirk for the "Connect Tablet 9" tablet, this tablet has a
mono-speaker. Otherwise it works fine with the defaults.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 18:08:26 +01:00
Hans de Goede
06aa6e5127
ASoC: Intel: bytcr_rt5651: Add quirk table entries for various devices
Add quirk table entries for the following tablets:

ITWorks TW701
Ployer Momo7w
Trekstor win7
Yours 8"

These all use the default settings, except that they only have a single
speaker and thus need the mono-speaker quirk.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 16:04:41 +01:00
Hans de Goede
a0d1d867c2
ASoC: Intel: bytcr_rt5651: Add mono speaker quirk
During my initial round of bytcr_rt5651 long-name patches I did not include
a difference for mono vs stereo speaker setups in the longname because it
seems that all 5651 devices with only a single speaker do some mixing of
left + right on the PCB.

However further testing has shown that while this works great when only
playing audio on the left or right channel, the output becomes garbled
when using both channels at once. Something which does not happen when
using the Stereo DAC MIXL / MIXR switches to mix the channels together
inside the codec and then only outputting on a single channel.

So we need to have separate UCM profiles and thus separate long-names
for devices with a mono speaker vs stereo speakers. Just as we already
have for the bytcr_rt5640 case.

This commit adds a new BYT_RT5651_MONO_SPEAKER quirk and adds "stereo-spk"
or "mono-spk" to the long-name based on this and enables this mapping on
devices with a mono speaker.

Changing the long-name like this is ok for now, since I'm still working
on the UCM profiles, so they are not in upstream alsa-lib yet.

This brings the long-name naming scheme fully in sync with the bytcr_rt5640
case, which is good from a consistency pov.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 16:04:35 +01:00
Hans de Goede
ac275ee5aa
ASoC: Intel: bytcr_rt5651: Add IN2 input mapping
During the recent cleanup series 3 of the 6 input mappings where removed
from the bytcr_rt5651 machine driver because testing showed that none of
them were used.

However some devices do actually have their internal mic on IN2 (and
only IN2, not IN1 and IN2), this did not show during previous tests
due to a bug in the userspace UCM input device switching code.

This commit re-adds the IN2 mapping for devices with the internal mic.
on IN2 and the headser mic on IN3 and enables this mapping on devices
with their internal mic on IN2.

This commit also changes the default internal mic input to IN2, because
all my 7 test devices have their mic there.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 16:04:32 +01:00
Hans de Goede
8627fb257e
ASoC: Intel: bytcr_rt5651: Set OVCD limit for VIOS LTH17 to 2000uA
With the default over current detect limit of 1500uA headsets on often
get detected as headphones on the VIOS LTH17 and even when detected as
headset the OVCD current triggers often while plugged in, resulting in
false-positive button press detection.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 16:04:28 +01:00
Hans de Goede
0a3badd141
ASoC: Intel: bytcr_rt5651: Fix using the wrong GPIO for the ext-amp on some boards
Some boards have I2cSerialBusV2, GpioIo, GpioInt as ACPI resources, other
boards may  have I2cSerialBusV2, GpioInt, GpioIo instead. We want the
GpioIo one for the ext-amp-enable-gpio.

So far we've been assuming that the GpioIo one always comes first, this
commit adds code to detect which one comes first and to add the right
gpio-mapping.

This fixes sound not working on the Vios LTH17 laptop.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 16:04:13 +01:00
Hans de Goede
eea1662525
ASoC: rt5651: Add IN3 Boost volume control
Add a mixer control for the IN3 Boost volume, IN3 is used for the headset
mic on most devices, so this is necessary to control the headset mic
volume.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 16:02:55 +01:00
Richard Fitzgerald
d52ed4b0bc
ASoC: wm_adsp: Parse HOST_BUFFER controls
Currently the compressed streams in DSP firmwares are
identified essentially by looking at a fixed location inside
the firmware. This is fragile and also limits things to a
single compressed stream.

Here a new form of firmware parameter is added, the HOST_BUFFER
which identifies a compressed stream from meta-data in the
firmware file. This is more robust and allows for the possiblity
of using multiple streams per core in the future. Currently the
implementation is still limited to a single stream and will
use the first HOST_BUFFER parameter encountered. If there aren't
any HOST_BUFFER parameters it will fall back to the legacy way
of finding the host buffer.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 15:11:56 +01:00
Richard Fitzgerald
3bbc2705a3
ASoC: wm_adsp: Allow up to 8 channels for voice control
Newer voice control firmwares can capture multiple audio channels.
Allow up to 8 channels for future-proofing.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 15:11:55 +01:00
Charles Keepax
b7ede5af62
ASoC: wm_adsp: Take prefix into account in control name length
Currently when creating ALSA control names for the DSP the length of any
prefix applied to the CODEC is not taken into account. Whilst this is
mostly harmless it does result in ALSA doing the truncation of the
control names and printing a warning. It is better to have the driver do
the truncation so it can truncate from the start of parameter name
itself to give a greater chance of the result maintain a unique name.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 15:11:54 +01:00
Charles Keepax
517ee74e1b
ASoC: wm_adsp: Correct algorithm list allocation size
Commit 6396bb2215 ("treewide: kzalloc() -> kcalloc()") was
overlooked when doing some refactoring to the algorithm list
handling, which lead to twice as much buffer being allocated
as required for reading the algorithm list. A kcalloc is no
longer appropriate since the allocation size is now in bytes
not registers, as such change back to kzalloc.

Fixes: 7f7cca08ab ("ASoC: wm_adsp: Simplify handling of alg offset and length")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 15:11:53 +01:00
Stuart Henderson
868e49a4a0
ASoC: wm_adsp: Ensure DSP boot work complete before preloader_put return
All controls derived from the loaded firmware should be created prior
to returning from the preloader's put function, such that they are
immediately available to user-space.

Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-19 15:09:41 +01:00
Jerome Brunet
53eb4b7aaa
ASoC: meson: add axg spdif output
Add support for the spdif output serializer of the axg SoC family

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:39 +01:00
Jerome Brunet
7ed4877b40
ASoC: meson: add axg toddr driver
Add the capture memory interface of Amlogic's axg SoCs.
TDM, SPDIF or PDM input devices place audio samples inside this FIFO.
The FIFO content is then pushed to DDR

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:37 +01:00
Jerome Brunet
57d552e3ea
ASoC: meson: add axg frddr driver
Add the playback memory interface of Amlogic's axg SoCs.
This device pulls data from DDR to an internal FIFO.
This FIFO is then used to feed TDM and SPDIF Output devices.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:37 +01:00
Jerome Brunet
6dc4fa179f
ASoC: meson: add axg fifo base driver
Amlogic's axg SoCs have two types of fifos which are the memory
interfaces of the audio subsystem. FRDDR provides the playback
interface while TODDR provides the capture interface.

The way these fifos operate is very similar. Only a few settings
are specific to each.

They implement the same pcm driver here and the specifics of each
will be dealt with the related DAI driver.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:36 +01:00
Sriram Periyasamy
bf270262b7
ASoC: hdac_hdmi: Add documentation for power management
Add documentation for power management of HDAC HDMI codec device for
various scenarios such as S0/S3, probe and playback use case.

Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:34 +01:00
Srinivas Kandagatla
90ae7105ea
ASoC: qcom: apq8096: remove component framework related code
Now that the component framework is integrated into the ASoC core,
remove any redundant code in this driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:30 +01:00
Srinivas Kandagatla
791940779d
ASoC: qdsp6: q6routing: remove component framework related code
Now that the component framework is integrated into the ASoC core,
remove any redundant code in this driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:26 +01:00
Srinivas Kandagatla
f924e4fd89
ASoC: qdsp6: q6asm-dai: remove component framework related code
Now that the component framework is integrated into the ASoC core,
remove any redundant code in this driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:23 +01:00
Srinivas Kandagatla
605fcb6991
ASoC: qdsp6: q6afe-dai: remove component fw related code
Now that the component framework is integrated into the ASoC core,
remove any redundant code in this driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:19 +01:00
Srinivas Kandagatla
bb4b894add
ASoC: core: add support to card re-bind using component framework
This patch aims at achieving dynamic behaviour of audio card when
the dependent components disappear and reappear.

With this patch the card is removed if any of the dependent component
is removed and card is added back if the dependent component comes back.
All this is done using component framework and matching based on
component name.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-18 13:08:15 +01:00
Takashi Iwai
a57942bfdd ALSA: hda: Make audio component support more generic
This is the final step for more generic support of DRM audio
component.  The generic audio component code is now moved to its own
file, and the symbols are renamed from snd_hac_i915_* to
snd_hdac_acomp_*, respectively.  The generic code is enabled via the
new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
kept as the super-class.

Along with the split, three new callbacks are added to audio_ops:
pin2port is for providing the conversion between the pin number and
the widget id, and master_bind/master_unbin are called at binding /
unbinding the master component, respectively.  All these are optional,
but used in i915 implementation and also other later implementations.

A note about the new snd_hdac_acomp_init() function: there is a slight
difference between this and the old snd_hdac_i915_init().  The latter
(still) synchronizes with the master component binding, i.e. it
assures that the relevant DRM component gets bound when it returns, or
gives a negative error.  Meanwhile the new function doesn't
synchronize but just leaves as is.  It's the responsibility by the
caller's side to synchronize, or the caller may accept the
asynchronous binding on the fly.

v1->v2: Fix missing NULL check in master_bind/unbind

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-17 22:25:48 +02:00
Takashi Iwai
82887c0beb ALSA: hda/i915: Associate audio component with devres
The HD-audio i915 binding code contains a single pointer, hdac_acomp,
for allowing the access to audio component from the master bind/unbind
callbacks.  This was needed because the callbacks pass only the device
pointer and we can't guarantee the object type assigned to the drvdata
(which is free for each controller driver implementation).
And this implementation will be a problem if we support multiple
components for different DRM drivers, not only i915.

As a solution, allocate the audio component object via devres and
associate it with the given device, so that the component callbacks
can refer to it via devres_find().

The removal of the object is still done half-manually via
devres_destroy() to make the code consistent (although it may work
without the explicit call).

Also, the snd_hda_i915_register_notifier() had the reference to
hdac_acomp as well.  In this patch, the corresponding code is removed
by passing hdac_bus object to the function, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-17 22:25:47 +02:00
Takashi Iwai
ae891abe7c drm/i915: Split audio component to a generic type
For allowing other drivers to use the DRM audio component, rename the
i915_audio_component_* with drm_audio_component_*, and split the
generic part into drm_audio_component.h.  The i915 specific stuff
remains in struct i915_audio_component, which contains
drm_audio_component as the base.

The license of drm_audio_component.h is kept to MIT as same as the the
original i915_component.h.

This is a preliminary change for further development, and no
functional changes by this patch itself, merely code-split and
renames.

v1->v2: Use SPDX for drm_audio_component.h, fix remaining i915
        argument in drm_audio_component.h

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-17 22:25:19 +02:00
Agrawal, Akshu
19e023e3be
ASoC: AMD: For capture have interrupts on I2S->ACP channel
Having interrupts enabled for ACP<->SYSMEM DMA transfer, we are in
for an interrupt storm.
For both playback and capture interrupts should be enabled for
I2S<->ACP DMA.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-16 15:30:12 +01:00
Agrawal, Akshu
fa9d2f17c2
ASoC: AMD: Send correct channel for configuring DMA descriptors
Earlier, ch1 was used to define ACP-SYSMEM transfer and ch2 for
ACP-I2S transfer. With recent patches ch1 is used to define channel
order number 1 and ch2 as channel order number 2. Thus,
Playback:
ch1:SYSMEM->ACP
ch2:ACP->I2S
Capture:
ch1:I2S->ACP
ch1:ACP->SYSMEM

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-16 15:30:11 +01:00
Naveen Manohar
8452112baa
ASoC: Intel: Boards: Add GLK Realtek Maxim I2S machine driver
Patch adds Geminilake I2S machine driver which uses following codecs:
RT5682 and MAX98357A.

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-16 15:30:10 +01:00
Russell King
d30e23d699
ASoC: hdmi-codec: fix routing
Commit 943fa02282 ("ASoC: hdmi-codec: Use different name for playback
streams") broke hdmi-codec's routing between it's output "TX" widget
and the S/PDIF or I2S streams by renaming the streams.

Whether an error occurs or not is dependent on whether there is another
widget called "Playback" registered by some other component - if there
is, that widget will be (incorrectly) bound to the HDMI codec's "TX"
output widget.  If we end up connecting "TX" incorrectly, it can result
in components not being started, causing no audio output.

Since the I2S and S/PDIF streams now have different names, we can't
use a static route at component level to describe the relationship, so
arrange to dynamically create the route when the DAI driver is probed.

Fixes: 943fa02282 ("ASoC: hdmi-codec: Use different name for playback streams")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-16 15:30:03 +01:00
Dan Carpenter
090345ce72
ASoC: qdsp6: q6routing: off by one in routing_hw_params()
The data->port_data[] array has AFE_MAX_PORTS elements so the check
should be >= instead of > or we write one element beyond the end of the
array.

Fixes: e3a33673e8 ("ASoC: qdsp6: q6routing: Add q6routing driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-13 16:26:20 +01:00
Dan Carpenter
b8110a87b7
ASoC: qdsp6: q6afe-dai: fix a range check in of_q6afe_parse_dai_data()
The main thing is that the data->priv[] array has AFE_PORT_MAX elements
so the > condition should be >=.  But we may as well check for negative
values as well just to be safe.

Fixes: 24c4cbcfac ("ASoC: qdsp6: q6afe: Add q6afe dai driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-13 16:26:09 +01:00
Jerome Brunet
aefba45539
ASoC: allow soc-core to pick up name prefixes from component nodes
When the component does not match the configuration table provided
by the card, let soc-core check the component node for a name prefix

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-13 16:05:28 +01:00
Takashi Iwai
9a9b13dd27 Merge branch 'topic/hda-core-intel' into topic/hda-acomp 2018-07-12 13:58:07 +02:00
Alastair Bridgewater
c5a59d2477 ALSA: hda/ca0132: Update a pci quirk device name
The PCI subsystem in question for this quirk rule has been
identified as a Gigabyte GA-Z170X-Gaming 7 motherboard.  Set the
device name appropriately.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Reviewed-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-12 09:18:31 +02:00
Alastair Bridgewater
dad59262b7 ALSA: hda/ca0132: Add Recon3Di quirk for Gigabyte G1.Sniper Z97
These motherboards have Sound Core3D and apparently "support"
Recon3Di.  Added to the quirk list as QUIRK_R3DI.

Issue report, PCI Subsystem ID, and testing by a contributor on
IRC who wished to remain anonymous.

Signed-off-by: Alastair Bridgewater <alastair.bridgewater@gmail.com>
Reviewed-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-12 09:18:08 +02:00
Jerome Brunet
baacd8d100
ASoC: dpcm: add rate merge to the BE stream merge
As done for format and channels, add the possibility to merge
the backend rates on the frontend rates.

This useful if the backend does not support all rates supported by the
frontend, or if several backends (cpu and codecs) with different
capabilities are connected to the same frontend.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-11 11:58:41 +01:00
Jerome Brunet
435ffb76f8
ASoC: dpcm: rework runtime stream merge
The goal of this patch is to simplify a bit dpcm runtime stream merge
by removing several local variables.

ATM, merge functions return the BE 'filter' values which should then be
filtered against the FE stream values. This create a lot of local
variable and unnecessary init of min and max.

Instead of this, we can pass the FE stream values directly and let the
BE filtering functions perform the merge 'in-place'

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-11 11:58:37 +01:00
Hans de Goede
caed9d636e
ASoC: Intel: bytcr_rt5651: Reporting button presses
Enable reporting of button presses now that the codec driver recently has
gotten support for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:28 +01:00
Hans de Goede
b91f432cbc
ASoC: Intel: bytcr_rt5651: Disable jack-detect over suspend/resume
Disable jack-detection and thus the codec IRQ over suspend/resume.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:27 +01:00
Hans de Goede
df1569f200
ASoC: rt5651: Add button press support
Enable button press detection for headsets by using the ovcd IRQ to get
notified of button presses.

This is modelled after (almost exactly copied from) the button press code
for the rt5640 which has identical ovcd hardware.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:26 +01:00
Hans de Goede
34c906ddac
ASoC: rt5651: Allow disabling jack-detect by calling set_jack(NULL)
Allow the machine driver to disable jack-detect over a suspend/resume by
calling snd_soc_component_set_jack(NULL).

Note this renames rt5651_set_jack, where all the jack-enable work was done
to rt5651_enable_jack_detect. This function can now no longer fail as it
does not request the IRQ anymore. It can still be passed an invalid jack
source, but that should never happen, so this is now logged and treated as
no jack source.

Cc: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:25 +01:00
Hans de Goede
8d2d7bcdc1
ASoC: rt5651: Fix workqueue cancel vs irq free race on remove
On removal we must free the IRQ *before* cancelling the jack-detect work,
so that the jack-detect work cannot be rescheduled by the IRQ.

Before this commit we were cancelling the jack-detect work from the
driver remove callback, while relying on devm to free the IRQ, which
happens after the remove callback.

This is the wrong order. This commit uses a devm-action to register
a devm callback which cancels the work, before requesting the IRQ
(devm tears things down in reverse order). This also allows us to
remove the now empty remove driver callback.

Cc: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:24 +01:00
Hans de Goede
5f6fb23d2e
ASoC: Intel: bytcr_rt5651: Add support for externar amplifier enable GPIO
The rt5651 does not have a built-in speaker amplifier, so it is often
used together with an external amplifier. On Cherry Trail boards this
external amplifier's enable pin is driven through a GPIO, which is
given as the first GPIO in the ACPI resources of the codec fwnode.

This commit adds support to the bytcr_rt5651 for this GPIO, fixing
the speaker not working on CHT devices with a rt5651 codec.

Cc: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:23 +01:00
Hans de Goede
2c375204bf
ASoC: Intel: bytcr_rt5651: Move getting of codec_dev into probe()
Move the getting of the codec_dev, to add device-props to it, out of
byt_rt5651_add_codec_device_props() and into its caller,
snd_byt_rt5651_mc_probe().

This is a preparation patch for adding support for an external amplifier
enable GPIO, which requires further accesses to the codec_dev.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:17 +01:00
Hans de Goede
fbea16dbc0
ASoC: Intel: bytcr_rt5651: Remove is_valleyview helper
Remove is_valleyview helper, this is not necessary, we can simply call
x86_match_cpu() directly instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:13 +01:00
Hans de Goede
81583afe79
ASoC: Intel: bytcr_rt5640: Add quirk for the Lenovo Miix2 8 tablet
Add a quirk for the Lenovo Miix2 8 tablet, this tablet uses a digital
mic on DMIC1 and has a mono-speaker. The jack-detect uses the default
settings..

Reported-and-tested-by: russianneuromancer@ya.ru
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-10 18:49:10 +01:00
Lars-Peter Clausen
5bea327962
ASoC: adau171x1: Connect playback DAI to the DSP
The playback DAI is connected to the DSP and the DSP might be sourcing
signals from the playback stream. Add a DAPM route between the two to make
sure that the playback DAI is powered up, when the DSP is active.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-09 12:29:03 +01:00
Arnd Bergmann
9d1310daed
ASoC: pxa: make SND_PXA_SOC_SSP depend on PLAT_PXA
For the moment, we can't enable CONFIG_SND_PXA_SOC_SSP unless we are
building for ARM PXA or MMP:

WARNING: unmet direct dependencies detected for PXA_SSP
  Depends on [n]: PLAT_PXA [=n]
  Selected by [y]:
  - SND_PXA_SOC_SSP [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y]

This adds an explicit dependency for it.

Fixes: 0a94cf3457 ("ASoC: pxa: make SND_PXA2XX_SOC_I2S selectable")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-09 12:27:16 +01:00
benjamin.gaignard@linaro.org
8db339d667
ASoC: stm32: replace "%p" with "%pK"
The format specifier "%p" can leak kernel addresses.
Use "%pK" instead.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-09 12:15:30 +01:00
Hui Wang
c6b17f1020 ALSA: hda/realtek - two more lenovo models need fixup of MIC_LOCATION
We have two new lenovo desktop models which need to apply the fixup of
ALC294_FIXUP_LENOVO_MIC_LOCATION, and they have the same pin cfg as
the machine with subsystem id:0x17aa3136, now use the pincfg table
to apply the fixup for them.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-06 12:49:10 +02:00
Gustavo A. R. Silva
f7ddff54d0
ASoC: nau8824: use 64-bit arithmetic instead of 32-bit
Add suffix ULL to constant 256 in order to give the compiler complete
information about the proper arithmetic to use.

Notice that such constant is used in a context that expects an
expression of type u64 (64 bits, unsigned) and the following
expression is currently being evaluated using 32-bit arithmetic:

256 * fs * 2 * mclk_src_scaling[i].param

Addresses-Coverity-ID: 1432039 ("Unintentional integer overflow")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-05 16:09:11 +01:00
Daniel Mack
90eb6b59d3
ASoC: pxa-ssp: add support for an external clock in devicetree
Allow setting a clock called 'extclk' in the device of the ssp-dai
device. If specified, this clock will be set to the mclk rate from the
DAI's .set_sysclk() callback. The DAI will also configure itself to
use that external clock.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-05 11:08:08 +01:00
Andrew Gabbasov
74b37e299f
ASoC: rsnd: cmd: Add missing newline to debug message
To comply with the style of all kernel messages, add newline
to the end of every message.

Fixes: 70fb10529f ("ASoC: rsnd: add MIX (Mixer) support")
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-05 11:08:03 +01:00
Gustavo A. R. Silva
b999a7a9e7
ASoC: fsl_spdif: Use 64-bit arithmetic instead of 32-bit
Add suffix ULL to constant 64 in order to give the compiler complete
information about the proper arithmetic to use.

Notice that such constant is used in a context that expects an
expression of type u64 (64 bits, unsigned) and the following
expression is currently being evaluated using 32-bit arithmetic:

rate[index] * txclk_df * 64

Addresses-Coverity-ID: 1222129 ("Unintentional integer overflow")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-05 11:07:59 +01:00
Srinivas Kandagatla
f1478a1476
ASoC: qdsp6: q6afe-dai: Do not overwrite slim dai num_channels
num_channels for slim dais are aready set int set_channel_map,
do not overwrite them in hw_params.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:40 +01:00
Srinivas Kandagatla
9191ffe2d2
ASoC: qdsp6: q6routing: add slim rx routings
This patch add routings mixer controls for slim rx ports.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:39 +01:00
Srinivas Kandagatla
f03d6b1b4d
ASoC: qdsp6: q6afe-dai: add support to slim tx dais
This patch adds support to SLIMbus TX dais in AFE module.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:38 +01:00
Srinivas Kandagatla
25090bc3f3
ASoC: qdsp6: q6afe: Add missing slimbus capture ports
Existing code already has support for SLIMbus TX and RX, only thing
that was missing from TX side was mapping between virtual to actual
DSP port ids.

This patch adds those mappings.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:37 +01:00
Takashi Iwai
b1625fbb3b
ASoC: stm32: Use snd_pcm_stop_xrun() helper
The XRUN trigger from the driver should be done via
snd_pcm_stop_xrun().  It simplifies the locking as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:36 +01:00
Takashi Iwai
dc865fb9e7
ASoC: sti: Use snd_pcm_stop_xrun() helper
The XRUN trigger from the driver should be done via
snd_pcm_stop_xrun().  It fixes the missing stream locking as a gratis,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:35 +01:00
Takashi Iwai
1a42e7e3af
ASoC: qcom: Use snd_pcm_stop_xrun() helper
The XRUN trigger from the driver should be done via
snd_pcm_stop_xrun().  It fixes the missing stream locking as a gratis,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:34 +01:00
Takashi Iwai
dae35d1f4f
ASoC: davinci: Use snd_pcm_stop_xrun() helper
Replace open-codes with the standard snd_pcm_stop_xrun() helper.
It simplifies codes a lot.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:33 +01:00
Gustavo A. R. Silva
da13ed1d80
ASoC: nau8825: use 64-bit arithmetic instead of 32-bit
Add suffix ULL to constant 256 in order to give the compiler complete
information about the proper arithmetic to use.

Notice that such constant is used in a context that expects an
expression of type u64 (64 bits, unsigned) and the following
expression is currently being evaluated using 32-bit arithmetic:

256 * fs * 2 * mclk_src_scaling[i].param

Addresses-Coverity-ID: 1339616 ("Unintentional integer overflow")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:32 +01:00
Srinivas Kandagatla
5dffc1752c
ASoC: qdsp6: q6asm-dai: do not close port if its not opened
asm ports are open as part of prepare, so for use cases like
"aplay sample.wav" were sample.wav is not present. This would
call port close eventhough port was never opened. DSP would
return errors for such use cases.

Avoid doing this by checking the port state.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:34:48 +01:00
Srinivas Kandagatla
110743189c
ASoC: qdsp6: q6afe-dai: do not close port if its not opened
afe ports are open as part of prepare, so for use cases like
"aplay sample.wav" were sample.wav is not present. This would
call port close eventhough port was never opened. DSP would
return errors for such use cases.

Avoid doing this by checking the port state.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:34:48 +01:00
Liam Girdwood
a655de808c
ASoC: core: Allow topology to override machine driver FE DAI link config.
Machine drivers statically define a number of DAI links that currently
cannot be changed or removed by topology. This means PCMs and platform
components cannot be changed by topology at runtime AND machine drivers
are tightly coupled to topology.

This patch allows topology to override the machine driver DAI link config
in order to reuse machine drivers with different topologies and platform
components. The patch supports :-

1) create new FE PCMs with a topology defined PCM ID.
2) destroy existing static FE PCMs
3) change the platform component driver.
4) assign any new HW params fixups.
5) assign a new card name prefix to differentiate this topology to userspace.

The patch requires no changes to the machine drivers, but does add some
platform component flags that the platform component driver can assign
before loading topologies.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:38:29 +01:00
Codrin Ciubotariu
73ad0df572
ASoC: atmel-i2s: Remove unnecessary audio PLL clock (aclk)
The generated clock (gclk) driver is able to set aclk as its parent and
change its rate alone, if needed. This means that our driver no longer
needs to configure aclk and we can let gclk select and configure its
clock source.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:33:38 +01:00
Jerome Brunet
563c263248
ASoC: es7134: add support for the es7154
Add support for the es7154 which is basically an es7134 with an
embedded power amplifier and lower maximum sample rate

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:32:49 +01:00
Jerome Brunet
30ddfffd10
ASoC: es7134: correct required power supplies
Drop AVDD in favor of PVDD to match the names used in the datasheet
and only claim PVDD on the es7154. The es7134 and es7144 don't have
a separate supply for the digital I/O.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:32:49 +01:00
Daniel Kurtz
df61f9f766
ASoC: AMD: Simplify trigger handler
Now that the I2S channel names are fixed, and DMA data flow order is
consistent (ch1 then ch2), we can simplify channel start order:
start the upstream channel and then the downstream channel for both
playback and capture cases.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:15:32 +01:00
Daniel Kurtz
1a337a1e78
ASoC: AMD: Reset bytescount when starting transaction
The pointer() callback gets its value by reading the I2S BYTE_COUNT
register.  This is a 64-bit runnning transaction counter. If a
transaction was aborted in the middle of a sample buffer, the counter will
stop counting on a number divisible by the buffer size.  Since we actually
use it as a pointer into an aligned buffer, however, we do want to ensure
that it always starts at a number divisible by the buffer size when
starting a transaction, hence we reset it whenever starting a transaction.

To accomplish this, it wasn't necessary to zero bytescount at the
termination of each transaction, so remove this unnecessary code.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:15:30 +01:00
Daniel Kurtz
8c6b964edd
ASoC: AMD: Do not generate interrups for every captured sample
On capture, audio data is first copied from I2S to ACP memory, and then
from ACP to SYSRAM.  The I2S_TO_ACP_DMA interrupt fires on every sample
transferred from I2S to ACP memory.  That is it fires ~48000 times per
second when capturing @ 48 kHz.  Since we don't do anything on this
interrupt anyway, disable it to save quite a few unnecessary interrupts.
The real "work" (calling snd_pcm_period_elapsed()) is done when transfer
from ACP to SYSRAM is complete.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:14:31 +01:00
Daniel Kurtz
55af49ac1b
ASoC: AMD: Fix Capture DMA channel names
On capture, audio data is first copied from I2S to ACP memory, and then
to SYSRAM.  For each step the channel number increases, so the names in
the driver were wrong.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:14:30 +01:00
Daniel Kurtz
715cdce044
ASoC: AMD: Always subtract bytescount
It is always correct to subtract out the starting bytescount value.  Even
in the case of 2^64 byte rollover (292 Million Years in the future
@ 48000 Hz) the math still works out.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:14:29 +01:00
Daniel Kurtz
30896d3619
ASoC: AMD: Always stop ch2 first
Commit 6b116dfb46 ("ASoC: AMD: make channel 1 dma as circular") made
both channels circular, so this comment and logic no longer applies.  Always
stop ch2 (the channel closest to the output) before ch1.  This ensures
that the downstream circular DMA channel does not continue to play/capture
repeated samples after the upstream circular DMA channel has already
stopped.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:14:28 +01:00
Gustavo A. R. Silva
e0431de301
ASoC: pxa-ssp: mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:14:27 +01:00
Jerome Brunet
5f7bdc466c
ASoC: es7241: add es7241 codec support
Add support for the everest es7241 which is a simple 2 channels
analog to digital converter.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:00:30 +01:00
Bard Liao
2daf3d9962
ASoC: rt5682: add button detection mode control
We are currently using power saving mode for button detection.
However, it will impact the headset recording performance.
This patch will switch button detection to normal mode in capture
and switch to power saving mode in the end of capture.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-03 16:00:21 +01:00
Chris Wilson
aaa23f8600 ALSA: hda - Handle pm failure during hotplug
Obtaining the runtime pm wakeref can fail, especially in a hotplug
scenario where i915.ko has been unloaded. If we do not catch the
failure, we end up with an unbalanced pm.

v2 additions by tiwai:
hdmi_present_sense() checks the return value and handle only a
negative error case and bails out only if it's really still suspended.
Also, snd_hda_power_down() is called at the error path so that the
refcount is balanced.

Along with it, the spec->pcm_lock is taken outside
hdmi_present_sense() in the caller side, so that it won't cause
deadlock at reentrace via runtime resume.

v3 fix by tiwai:
Missing linux/pm_runtime.h is included.

References: 222bde0388 ("ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-02 16:14:05 +02:00
Jerome Brunet
424e2b4b35
ASoC: es7134: Add VDD and AVDD power supplies
Add the VDD and AVDD power supplies to the DAPM graph as some board may
need to enable a regulator to turn them on.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 11:07:30 +01:00
Jerome Brunet
a016b11cc4
ASoC: es7134: check if mclk rate is valid
For each supported sample rate, the es7134 can work with several
mclk / sample rate ratio. Check if ratio we get is actually OK.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 11:07:26 +01:00
Jerome Brunet
5650729f9a
ASoC: es7134: remove 64kHz rate from the supported rates
64Khz is actually not supported by the es7134 according to the datasheet

Fixes: 9000b59d7a ("ASoC: es7134: add es7134 DAC driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 11:07:15 +01:00
Daniel Mack
05739375f1
ASoC: pxa-ssp: remove .set_pll() and .set_clkdiv() callbacks
The .set_pll() and .set_clkdiv() callbacks are considered legacy and should
not be used anymore. In order to support PXA boards on DT platforms, remove
them and let the code figure out the correct dividers and PLL base
frequencies itself.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 11:01:21 +01:00
Daniel Mack
1581250119
ASoC: pxa: select SND_PXA2XX_LIB for drivers that depend on it
Commit d767d3ce5c ("ASoC: pxa: provide PCM ops for ssp, i2s and ac97
components") created a build-time dependency to SND_PXA2XX_LIB but
missed to reflect that in Kconfig.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 11:00:52 +01:00
Kuninori Morimoto
1a8f0a3c13
ASoC: ac97: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:56:09 +01:00
Kuninori Morimoto
1356a6071c
ASoC: soc-generic-dmaengine-pcm: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:52 +01:00
Kuninori Morimoto
b3ed4c86a7
ASoC: soc-compress: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:47 +01:00
Kuninori Morimoto
f2b6a1b25f
ASoC: soc-topology: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:42 +01:00
Kuninori Morimoto
c01f3af4d3
ASoC: soc-dapm: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:38 +01:00
Kuninori Morimoto
873486ed4a
ASoC: soc-core: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:32 +01:00
Kuninori Morimoto
7730bb13c7
ASoC: soc-acpi: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:27 +01:00
Kuninori Morimoto
9e14035c7f
ASoC: soc-devres.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:22 +01:00
Kuninori Morimoto
632628df45
ASoC: soc-utils.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:18 +01:00
Kuninori Morimoto
8ab0215c11
ASoC: soc-jack.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:55:12 +01:00
Kuninori Morimoto
ed51758247
ASoC: soc-pcm.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:54:51 +01:00
Kuninori Morimoto
4eef5a90ca
ASoC: soc-ops.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:54:40 +01:00
Kuninori Morimoto
d1aaa2e686
ASoC: soc-io.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:53:55 +01:00
Kuninori Morimoto
ac204c9b03
ASoC: audio-graph-scu-card.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:53:33 +01:00
Kuninori Morimoto
decd896121
ASoC: audio-graph-card.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:53:17 +01:00
Kuninori Morimoto
9afe58f1cb
ASoC: simple-scu-card.c: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:53:06 +01:00
Kuninori Morimoto
d613a7f45e
ASoC: simple-card-utils: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:52:52 +01:00
Kuninori Morimoto
d573454d9b
ASoC: simple-card: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-02 10:52:47 +01:00
KaiChieh Chuang
c1d9b4196b
ASoC: mt6797: sub dai use list_head
Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 13:31:53 +01:00
KaiChieh Chuang
f11c5db770
ASoC: mediatek: sub dai use list_head
use list_head for sub_dais,
since original sub_dais array is sparsely occupied

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 13:31:52 +01:00
Daniel Mack
0a94cf3457
ASoC: pxa: make SND_PXA2XX_SOC_I2S selectable
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:05:26 +01:00
Daniel Mack
c7b4f15ddb
ASoC: pxa: remove bindings from pxa2xx-pcm
This platform is no longer needed on DT boards, so let's remove them to
avoid confusion. DT bindings should use the CPU DAIs (I2S/SSP/AC97)
directly.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:05:25 +01:00
Daniel Mack
d767d3ce5c
ASoC: pxa: provide PCM ops for ssp, i2s and ac97 components
Now that the functions are now available through pxa2xx-lib, hook them up
to pxa-sspi, pxa-ac97 and pxa-i2s. This allows DT platforms to use the DAIs
without a platform driver.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:05:24 +01:00
Daniel Mack
456ec80876
ASoC: pxa2xx-pcm-lib: fix indenting
While at it, also fix some indenting.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:05:05 +01:00
Daniel Mack
7afd1b0b2e
ASoC: pxa: move some functions to pxa2xx-lib
To get rid of some intermediate platform layers, move pxa2xx_soc_pcm_new()
and pxa2xx_pcm_ops in pxa2xx-lib.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:05:04 +01:00
Daniel Mack
a7160670b5
ASoC: pxa: clean up function names in pxa2xx-lib
Clean up the namespace a bit and drop the __ prefix of all functions
exported by pxa2xx-lib. This improves the readability of the code.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:05:03 +01:00
Daniel Mack
95acb005fe
ASoC: fold pxa2xx-pcm into its only user, pxa2xx-ac97
Now that the PXA SSP bits are ported over to generic DMA, the pxa2xx-pcm
code only has a single user left. This patch folds the remaining bits into
its only user and removes the unnecessary glue layer along with its header
file.

The include dependency to linux/dma/pxa-dma.h is also gone now.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:05:03 +01:00
Robert Jarzmik
8f54061d00
ASoC: pxa: remove the dmaengine compat need
As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-29 12:04:28 +01:00
Jerome Brunet
4febced15a
ASoC: dpcm: don't merge format from invalid codec dai
When merging codec formats, dpcm_runtime_base_format() should skip
the codecs which are not supporting the current stream direction.

At the moment, if a BE link has more than one codec, and only one
of these codecs has no capture DAI, it becomes impossible to start
a capture stream because the merged format would be 0.

Skipping invalid codec DAI solves the problem.

Fixes: b073ed4e21 ("ASoC: soc-pcm: DPCM cares BE format")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2018-06-28 11:19:50 +01:00
Jerome Brunet
4f2bd18b19
ASoC: dpcm: extend channel merging to the backend cpu dai
Extend dpcm_merge_chan to also check backend cpu dai channels
capabilities. Apply the same policy as soc_pcm_init_runtime_hw() for
multicodec links and only check cpu dai in this case.

Cc: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-28 11:17:02 +01:00
Dan Carpenter
c54c1c5ee8
ASoC: qdsp6: qdafe: fix some off by one bugs
The > should be >= or we could read one element beyond the end of the
port_maps[] array.

Fixes: 7fa2d70f97 ("ASoC: qdsp6: q6afe: Add q6afe driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-28 11:16:37 +01:00
Jerome Brunet
de15d7ff5b
ASoC: dpcm: improve runtime update predictability
As it is, dpcm_runtime_update() performs the old path and new path
update of a frontend before going on to the next frontend DAI.
Depending the order of the FEs within the rtd list, the result of
the update might be different.

For example:
 * Frontend A connected to backend C, with a 48kHz playback
 * Frontend B connected to backend D, with a 44.1kHz playback
 * FE A appears before FE B in the rtd list of the card.

If we reparent BE C to FE B (disconnecting BE D):
* old path update of FE A will run first, and BE C will get hw_free()
  and shutdown()
* new path update of FE B will run after and BE C, which is stopped,
  so it will be configured at 44.1kHz, as expected

If we reparent BE D to FE A (disconnecting BE C):
* new path update of FE A will run first but since BE D is still running
  at 44.1kHz, it won't be reconfigured (no call to startup() or
  hw_params())
* old path update of FE B runs after, nothing happens
* In this case, we end up with a BE playing at 44.1kHz a stream which is
  supposed to be played at 48Khz (too slow)

To improve this situation, this patch performs all the FE old paths update
before going on to update the new paths. With this, the result should
no longer depend on the order of the FE within the card rtd list.

Please note that there might be a small performance penalty since
dpcm_process_paths() is called twice per stream direction.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-28 11:16:23 +01:00
Rakesh Ughreja
cb04ba3318 ALSA: hdac: add extended ops in the hdac_bus
Add extended ops in the hdac_bus to allow calling the ASoC HDAC library
ops to reuse the legacy HDA codec drivers with ASoC framework.
Extended ops are used by the legacy codec drivers to call into
hdac_hda library, in the subsequent patches..

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28 07:33:29 +02:00
Rakesh Ughreja
6298542fa3 ALSA: hdac: remove memory allocation from snd_hdac_ext_bus_device_init
Remove memory allocation within snd_hdac_ext_bus_device_init, to make
its behaviour identical to snd_hdac_bus_device_init. So that caller
can allocate the parent data structure containing hdac_device.
This API change helps in reusing the legacy HDA codec drivers with
ASoC platform drivers.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28 07:33:29 +02:00
Rakesh Ughreja
24494d3f93 ALSA: hda: split snd_hda_codec_new function
Split snd_hda_codec_new into two separate functions.
snd_hda_codec_device_init allocates memory and registers with bus.
snd_hda_codec_device_new initialializes the fields and performs
snd_device_new. This enables reuse of legacy HDA codec drivers as ASoC
codec drivers.

In addition mark some functions with EXPORT_SYMBOL_GPL so that it can
be called by ASoC wrapper around the legacy HDA driver (hdac_hda).

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28 07:33:29 +02:00
Rakesh Ughreja
f8a7fe1aea ALSA: hdac: ext: add wait for codec to respond after link reset
As per HDA spec section 4.3 - Codec Discovery, the software shall wait
for atleast 521usec for codec to respond after link reset.
With the multi-link capability each link is turned ON/OFF individually.
Link controller drives reset signal when it is turned ON.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28 07:33:29 +02:00
Rakesh Ughreja
e1df9317cb ALSA: hdac: Remove usage of struct hdac_ext_driver, use hdac_driver instead
This patch removes the hdac_ext_driver structure. The legacy and
enhanced HDaudio capabilities can be handled in a backward-compatible
way without separate definitions.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28 07:33:29 +02:00
Rakesh Ughreja
76f56fae1c ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus instead
This patch removes the hdac_ext_bus structure. The legacy and
enhanced HDaudio capabilities can be handled in a backward-compatible
way without separate definitions.

Follow-up patches in this series handle the driver definition.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28 07:33:29 +02:00
Rakesh Ughreja
3787a39852 ALSA: hdac: Remove usage of struct hdac_ext_device and use hdac_device instead
This patch removes the hdac_ext_device structure. The legacy and
enhanced HDaudio capabilities can be handled in a backward-compatible
way without separate definitions.

Follow-up patches in this series handle the bus and driver definitions.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-06-28 07:33:29 +02:00
Jerome Brunet
f516d32262
ASoC: tas517x: add tas5707 support
Add support for the tas5707 audio power amplifier.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:26:41 +01:00
Jerome Brunet
8ed237e83c
ASoC: simple-amplifer: add simple-amplifier compatible
Add simple-audio-amplifier to the list of available compatible

Suggested-by: Nicolò Veronese <nicveronese@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:26:39 +01:00
Jerome Brunet
8d881bb621
ASoC: simple-amplifier: rename dio2125 to simple-amplifer
The dio2125 is simple enough that we can make it a generic component.
Just rename and sed the dio2125 amplifier driver to simple_amplifier.

Suggested-by: Nicolò Veronese <nicveronese@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:26:38 +01:00
Hans de Goede
55d69c0309
ASoC: Intel: bytcr_rt5651: Sort DMI table entries alphabetically
As we get more entries in the DMI quirk table it is nice to have some
sort of ordering in the table, sort it alphabetically.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:11:34 +01:00
Hans de Goede
8f250e7009
ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_HP_LR_SWAPPED quirk
One some models (Chuwi Vi8 Plus, Chuwi Hi8 Pro) the headphone output has
left and right swapped. This can be fixed in with special mixer settings
in the UCM profile, bit this requires these devices loading a different
UCM profile.

This commit adds a BYT_RT5651_HP_LR_SWAPPED quirk for this and postfixes
the longname with "-hp-swapped" if set, so that a different UCM profile
will be loaded.

We can safely do this without causing regressions (UCM profile not found
due to the longname change) as the UCM profiles are not in upstream
alsa-lib yet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:11:29 +01:00
Hans de Goede
8e69cd6400
ASoC: Intel: bytcr_rt5651: Simplify card long-name
Now that the headset-mic is always IN3 there is no reason to have
the headset-mic mapping in the long-name.

This commit simplifies the long name to "bytcr-rt5651-<intmic-map>-mic".

We can safely do this without causing regressions (UCM profile not found
due to the longname change) as the UCM profiles are not in upstream
alsa-lib yet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:11:25 +01:00
Hans de Goede
37c7401e8c
ASoC: Intel: bytcr_rt5651: Fix DMIC map headsetmic mapping
The initial bytcr_rt5651 machine driver commit mapped IN2 as the headset
mic. In retrospect this is not correct as all known boards have the headset
mic on IN3.

This commit fixes the original DMIC mapping to correctly have the headset
mic on IN3.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:11:21 +01:00
Hans de Goede
de23147983
ASoC: Intel: bytcr_rt5651: Fix IN1 map headsetmic mapping
The initial bytcr_rt5651 machine driver commit mapped IN2 as the headset
mic. In retrospect this is not correct as all known boards have the headset
mic on IN3. To workaround this special IN?_HS_IN3 mappings were added.

This commit fixes the original IN1 mapping to correctly have the headset
mic on IN3, moves all users of the IN1_HS_IN3 mapping over to the fixed
IN1_MAP and drops the now no longer needed IN1_HS_IN3 mapping.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:11:15 +01:00
Hans de Goede
fcdf1391ca
ASoC: Intel: bytcr_rt5651: Remove IN2 input mappings
BYT_RT5651_IN2_MAP was introduced in commit 39712db878 ("SoC: intel: byt:
Introduce new custom IN2 map"), uses in commit 2fe30129b0 ("ASoC: intel:
byt: Enable IN2 map quirk for a KIANO laptop"), only to be replaced by a
new BYT_RT5651_IN1_IN2_MAP quirk in commit ea261bd02a ("ASoC: intel:
byt: Introduce new map for dual mics") quickly afterwards, because the
KIANO laptop has 2 internal mics on IN1 and IN2 and the headset mic is
not in IN1 where the BYT_RT5651_IN2_MAP maps it, but on IN3.

Now that the KIANO quirk entry uses BYT_RT5651_IN1_IN2_MAP, there are no
users of BYT_RT5651_IN2_MAP left. This makes sense since the headset mic
seems to always be connected to IN3, so BYT_RT5651_IN2_MAP is not useful.

To deal with BYT_RT5651_IN2_MAP wrongly mapping the headset mic to IN1,
BYT_RT5651_IN2_HS_IN3_MAP was added in commit f026e06317 ("ASoC: Intel:
bytcr_rt5651: Add new IN2_HS_IN3 input map and a quirk using it"). This
was based on the assumption then some devices have the internal mic
connected to IN2 only. Further testing has shown that this is wrong and the
internal mic is always connected to IN1 and sometimes to both IN1 and IN2.

TL;DR: Both BYT_RT5651_IN2_MAP and BYT_RT5651_IN2_HS_IN3_MAP are based on
on wrong assumptions from the past and are no longer useful now, so they
can both be removed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:11:08 +01:00
Hans de Goede
366780df3e
ASoC: Intel: bytcr_rt5651: Fix IN1_IN2_MAP quirk not being logged
Fix the quirk logging code not logging the IN1_IN2_MAP quirk.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:11:03 +01:00
Hans de Goede
10876d24eb
ASoC: Intel: bytcr_rt5651: Change default input map from in2 to in1
Further testing on all 6 model x86 tablets with a rt5651 which I have
access to for testing has shown that their single (mono) microphone is
connected to both IN1 *and* IN2.

The previous default mapping of IN2 was based on testing on the same 6
tablets, where the internal mic works fine with a mapping of IN2. But it
works fine too with a mapping of IN1.

This commit changes the default input mapping to to use IN1 instead of
IN2, to match the mapping used for the other mono devices in the DMI quirk
table. So that we need less different mappings.

The same change is made to the Chuwi Vi8 Plus quirks, which is one of the
6 models tested.

This is a preparation patch for simplifying the maps in a follow-up commit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:10:58 +01:00
Hans de Goede
fc7c460fbb
ASoC: Intel: bytcr_rt5651: Add BYT_RT5651_DEFAULT_QUIRKS define
Almost all boards use the mclk and use the same jack-detect settings, add
a BYT_RT5651_DEFAULT_QUIRKS define for this.

This shaves of some lines and makes it easier to see which settings are
unique to a certain model.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27 12:10:53 +01:00