1
0
Fork 0
Commit Graph

29880 Commits (8963106eabdc56911e9b65258eb5e9a6b7b3dfda)

Author SHA1 Message Date
Daniel Mack 737e370a57
ASoC: pxa-ssp: allow more flexible setup order
The pxa-ssp driver currently assumes that .set_fmt() is called before
.set_clkdiv(), .set_pll() etc.

Commit a8bd0ee558 ("ASoC: raumfeld: Use static DAI format setup") broke
support for Raumfeld hardware (and possible other PXA based ones) because
it effectively changed the order of these calls. Also, as the call to
.set_fmt() is now done at probe time, the port clock is not yet enabled.

To fix this, strip all hardware register access code from the .set_fmt()
callback and memorize the desired value, so we can use it from the
.hw_params() callback. Also make the .set_fmt() callback less destructive
by reading all registers that it writes to in the beginning and only
masking out the bits that it possibly fiddles with.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-22 11:57:16 +01:00
Yisheng Xie 2cc47d31eb ALSA: oxfw: use match_string() helper
match_string() returns the index of an array for a matching string,
which can be used intead of open coded variant.

Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-22 09:25:42 +02:00
Takashi Iwai 96382b4f56 Merge branch 'topic/xen' into for-next
Merge Xen para-virtualized frontend driver from Oleksandr Andrushchenko.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-21 22:21:58 +02:00
Srinivas Kandagatla a6f933f63f
ASoC: qcom: apq8096: Add db820c machine driver
This patch adds support to DB820c machine driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:43:12 +01:00
Srinivas Kandagatla 2a9e92d371
ASoC: qdsp6: q6asm: Add q6asm dai driver
This patch adds support to q6asm dai driver which configures Q6ASM streams
to pass pcm data.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:43:02 +01:00
Srinivas Kandagatla 24c4cbcfac
ASoC: qdsp6: q6afe: Add q6afe dai driver
This patch adds support to q6afe backend dais driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:42:54 +01:00
Srinivas Kandagatla c8add3fd49
ASoC: qdsp6: q6routing: Add support to MI2S Mixers
This patch add support to MI2S mixers required to select path between
ASM stream and AFE ports.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:42:24 +01:00
Srinivas Kandagatla 794fe03938
ASoC: qdsp6: q6routing: Add support to all SLIMBus Mixers
This patch adds support to SLIMBus related mixers to control mux between
ASM stream and AFE port.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:42:07 +01:00
Srinivas Kandagatla e3a33673e8
ASoC: qdsp6: q6routing: Add q6routing driver
This patch adds support to q6 routing driver which configures route
between ASM and AFE module using ADM apis.

This driver uses dapm widgets to setup the matrix between AFE ports and
ASM streams.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:41:48 +01:00
Srinivas Kandagatla 68fd8480bb
ASoC: qdsp6: q6asm: Add support to audio stream apis
This patch adds support to open, write and media format commands
in the q6asm module.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:41:24 +01:00
Srinivas Kandagatla a2a5d30218
ASoC: qdsp6: q6asm: Add support to memory map and unmap
This patch adds support to memory map and unmap regions commands in
q6asm module.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:41:00 +01:00
Srinivas Kandagatla a13e872314
ASoC: qdsp6: q6asm: Add q6asm driver
This patch adds basic support to Q6 ASM (Audio Stream Manager) module on
Q6DSP. ASM supports up to 8 concurrent streams. each stream can be setup
as playback/capture. ASM provides top control functions like
Pause/flush/resume for playback and record. ASM can Create/destroy encoder,
decoder and also provides POPP dynamic services.

This patch adds support to basic features to allow hdmi playback.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:40:35 +01:00
Srinivas Kandagatla 7b20b2be51
ASoC: qdsp6: q6adm: Add q6adm driver
This patch adds support to Q6ADM (Audio Device Manager) module in
q6dsp. ADM performs routing between audio streams and AFE ports.
It does Rate matching for streams going to devices driven by
different clocks, it handles volume ramping, Mixing with channel
and bit-width. ADM creates and destroys dynamic COPP services
for device-related audio processing as needed.

This patch adds basic support to ADM.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:40:24 +01:00
Mukunda, Vijendar ccfbb4f572
ASoC: amd: dma driver changes for bt i2s instance
With in ACP, There are three I2S controllers can be
configured/enabled ( I2S SP, I2S MICSP, I2S BT).
Default enabled I2S controller instance is I2S SP.
This patch provides required changes to support I2S BT
controller Instance.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:19:45 +01:00
Akshu Agrawal 839a12c799
ASoC: AMD: Add const to snd_soc_ops instances
Marking snd_soc_ops instances const

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:19:32 +01:00
Akshu Agrawal 6e55407495
ASoC: AMD: Fix clocks in CZ DA7219 machine driver
System clock on the platform is 25Mhz and not 24Mhz.

PLL_OUT for da7219 codec to use DA7219_PLL_FREQ_OUT_98304
as it is for 48KHz SR.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:19:16 +01:00
Akshu Agrawal e9716ff3dc
ASoC: AMD: Move clk enable from hw_params/free to startup/shutdown
hw_param can be called multiple times and thus we can have
more clk enable. The clk may not get diabled due to refcounting.
startup/shutdown ensures single clk enable/disable call.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:19:11 +01:00
Mukunda, Vijendar cac6f59717
ASoC: amd: memory release for rtd structure
rtd structure freed early may result in kernel panic in dma close
call back. moved releasing memory for rtd structure to the end of
dma close callback.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:19:04 +01:00
Mukunda, Vijendar 18e8a40dd3
ASoC: amd: sram bank update changes
Added sram bank variable to audio_substream_data structure.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:18:45 +01:00
Mukunda, Vijendar e188c525b9
ASoC: amd: pte offset related dma driver changes
Added pte offset variable in audio_substream_data structure.
Added Stoney related PTE offset macros in acp header file.
Modified hw_params callback to assign the pte offset value
based on asic_type.
PTE Offset macros used to calculate no of PTE entries
need to be programmed when memory allocated for audio buffer.
Depending upon allocated audio buffer size, PTE offset values
will change.
Compared to CZ, Stoney has SRAM memory limitation i.e 48k
It is required to define separate PTE Offset macros for
Stoney.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 16:18:29 +01:00
Srinivas Kandagatla a4ae3af59b
ASoC: qdsp6: q6afe: Add support to MI2S sysclks
This patch adds support to LPASS Bit clock, LPASS Digital
core clock and OSR clock. These clocks are required for both
MI2S and PCM setup.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 15:31:01 +01:00
Srinivas Kandagatla d383914572
ASoC: qdsp6: q6afe: Add support to MI2S ports
This patch adds support to 4 MI2S ports on LPASS.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 15:31:00 +01:00
Srinivas Kandagatla 4d430d5a0e
ASoC: qdsp6: qdafe: Add SLIMBus port Support
This patch adds support to 6 SLIMBus AFE ports, which are used as
backend dais.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 15:30:59 +01:00
Srinivas Kandagatla 7fa2d70f97
ASoC: qdsp6: q6afe: Add q6afe driver
This patch adds support to Q6AFE (Audio Front End) module on Q6DSP.

AFE module sits right at the other end of cpu where the codec/audio
devices are connected.

AFE provides abstraced interfaces to both hardware and virtual devices.
Each AFE tx/rx port can be configured to connect to one of the hardware
devices like codec, hdmi, slimbus, i2s and so on. AFE services include
starting, stopping, and if needed, any configurations of the ports.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 15:30:58 +01:00
Daniel Mack 637917b1ef
ASoC: core: fix return code in error message
Log the correct error code in case the .open() call to a component fails.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 11:55:03 +01:00
Colin Ian King 7608102ee6
ASoC: intel: skylake: fix spelling mistake: "Homogenous" -> "Homogeneous"
Trivial fix to spelling mistake in snprintf literal string

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-21 11:54:54 +01:00
Takashi Sakamoto d0aa590962 ALSA: dice: add stream format parameters for TC Electronic Digital Konnekt x32
TC Electronic Digital Konnekt x32 is an application of WaveFront DiceII STD
and doesn't support TCAT extended application protocol. For such devices,
ALSA dice driver needs to have hard-coded parameters for stream formats.

This commit adds stream format parameters for this model. Unfortunately, at
sampling transmission frequencies of 88.2/96.0kHz, I confirmed that current
ALSA dice driver doesn't drive the device appropriately due to detecting
packet discontinuities.

$ journalctl
kernel: snd_dice fw1.0: Detect discontinuity of CIP: 90 80

At the frequencies, the device transfers 16 data blocks per packet and 16
data channels per data block, as a result one packet includes 1032 bytes
if it's not NODATA. However, as long as I checked, the device often
postpone packet transmission and continue with truncated payload than
metadata in isochronous packet header. Below is a sample of sequence I got.

sec cycle bytes       CIP1       CIP2
 37  3314  1032 0x01100090 0x900449E2
 37  3315     8 0x011000A0 0x9004FFFF
 37  3316  1032 0x011000A0 0x900461E2
 37  3317  1032 0x011000B0 0x900475E2
 37  3318  1032 0x011000C0 0x900489E2
 37  3319     8 0x011000D0 0x9004FFFF
 37  3320  1032 0x011000D0 0x9004A1E2
 37  3321  1032 0x011000E0 0x9004B5E2
 37  3322  1032 0x011000F0 0x9004C9E2
 37  3323     8 0x01100000 0x9004FFFF
 37  3324  1032 0x01100000 0x9004E1E2
 37  3325  1032 0x01100010 0x9004F5E2
 37  3326  1032 0x01100020 0x900409E2
 37  3327     8 0x01100030 0x9004FFFF
 37  3328  1032 0x01100030 0x900421E2
 37  3329  1032 0x01100040 0x900435E2
 37  3330  (skip)
 37  3331  (skip)
 37  3332  (skip)
 37  3333  (skip)
 37  3334  (skip)
 37  3335  (skip)
 37  3336  (skip)
 37  3337  (skip)
 37  3338  (skip)
 37  3339  (skip)
 37  3340  (skip)
 37  3341  (skip)
 37  3342  (skip)
 37  3343  (skip)
 37  3344  (skip)
 37  3345  (skip)
 37  3346  (skip)
 37  3347  (skip)
 37  3348  (skip)
 37  3349  (skip)
 37  3350  (skip)
 37  3351  (skip)
 37  3352  (skip)
 37  3353  (skip)
 37  3354  (skip)
 37  3355  (skip)
 37  3356  (skip)
 37  3357  (skip)
 37  3358  (skip)
 37  3359  (skip)
 37  3360  (skip)
 37  3361  (skip)
 37  3362  (skip)
 37  3363  (skip)
 37  3364  (skip)
 37  3365  (skip)
 37  3366  (skip)
 37  3367  1032 0x01100050 0x900461E1
 37  3368  1032 0x01100060 0x900475E1
 37  3369  1032 0x01100070 0x9004A1E1
 37  3370  1032 0x01100080 0x9004A1E1 but content of payload is truncated.
 37  3371  (skip)
 37  3371  1032 0x01100080 0x9004B5E0 detect discontinuity
 37  3372  1032 0x01100090 0x9004C9E0
 37  3373  1032 0x011000A0 0x9004E1E0
 37  3374  1032 0x011000B0 0x9004F5E0
 37  3375  1032 0x011000C0 0x900409E0
 37  3376  1032 0x011000D0 0x900421E0
 37  3377  1032 0x011000E0 0x900435E0
 37  3378  1032 0x011000F0 0x900449DF
 37  3379     8 0x01100000 0x9004FFFF
 37  3380  1032 0x01100000 0x900461DF
 37  3381  1032 0x01100010 0x900475DF
 37  3382  1032 0x01100020 0x900489DF
 37  3383     8 0x01100030 0x9004FFFF
 37  3384  1032 0x01100030 0x9004A1DF
 37  3385  1032 0x01100040 0x9004B5DF
 37  3386  1032 0x01100050 0x9004C9DF
 37  3387     8 0x01100060 0x9004FFFF

I cannot confirm this quirks with Windows driver. ALSA dice driver has a
cause if assumed differences between these two drivers are ways of
timestampling to RX packets from the drivers to the device. I've already
reported timestamping quirk of Dice-based devices and this might bring
this issue.

[alsa-devel] Dice packet sequence quirk and ALSA firewire stack in Linux 4.6
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-May/107715.html

Well, nevertheless, I enable ALSA dice driver to work at the frequencies.
This may brings inconvenience to users but I expect developers and users
to fix it.

$ cd linux-firewire-utils/src
$ python2 crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  040423bb  bus_info_length 4, crc_length 4, crc 9147
404  31333934  bus_name "1394"
408  e0ff8112  irmc 1, cmc 1, isc 1, bmc 0, pmc 0, cyc_clk_acc 255,
               max_rec 8 (512), max_rom 1, gen 1, spd 2 (S400)
40c  00016604  company_id 000166     |
410  0c232c28  device_id 040c232c28  | EUI-64 000166040c232c28

               root directory
               -----------------------------------------------------------------
414  0006b6cb  directory_length 6, crc 46795
418  03000166  vendor
41c  8100000a  --> descriptor leaf at 444
420  17000030  model
424  8100000f  --> descriptor leaf at 460
428  0c0087c0  node capabilities per IEEE 1394
42c  d1000001  --> unit directory at 430

               unit directory at 430
               -----------------------------------------------------------------
430  000476c2  directory_length 4, crc 30402
434  12000166  specifier id
438  13000001  version
43c  17000030  model
440  81000010  --> descriptor leaf at 480

               descriptor leaf at 444
               -----------------------------------------------------------------
444  0006c490  leaf_length 6, crc 50320
448  00000000  textual descriptor
44c  00000000  minimal ASCII
450  54432045  "TC E"
454  6c656374  "lect"
458  726f6e69  "roni"
45c  63000000  "c"

               descriptor leaf at 460
               -----------------------------------------------------------------
460  000772b4  leaf_length 7, crc 29364
464  00000000  textual descriptor
468  00000000  minimal ASCII
46c  44696769  "Digi"
470  74616c4b  "talK"
474  6f6e6e65  "onne"
478  6b747833  "ktx3"
47c  32000000  "2"

               descriptor leaf at 480
               -----------------------------------------------------------------
480  000772b4  leaf_length 7, crc 29364
484  00000000  textual descriptor
488  00000000  minimal ASCII
48c  44696769  "Digi"
490  74616c4b  "talK"
494  6f6e6e65  "onne"
498  6b747833  "ktx3"
49c  32000000  "2"

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-21 11:33:37 +02:00
Pierre-Louis Bossart b84f48d181
ASoC: pcm512x: Add ACPI support
HID is assumed to be made of TI PCI ID (0x104C) + part number, so all
four 104C5121, 104C5122, 104C5141 104C5142 are valid.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-18 17:46:03 +01:00
Andy Shevchenko 3a4f4f2963
ASoC: rt5677: Convert I2C driver to ->probe_new()
There is no platform code that uses i2c module table.
Remove it altogether and adjust ->probe() to be ->probe_new().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-18 16:50:49 +01:00
Dan Carpenter ed1812c44c ALSA: dice: fix a bounds check in snd_dice_detect_tcelectronic_formats()
The "entry" pointer is always non-NULL so this test for out of bounds
won't work.

Fixes: f1f0f330b1 ("ALSA: dice: add parameters of stream formats for models produced by TC Electronic")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 13:38:34 +02:00
Marco Felsch d460a2ea24
ASoC: ssm2305: fix header layout
Make C-header and SPDX-License-Identifier header uniform.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-18 11:20:11 +01:00
Colin Ian King 57b70db28b
ASoC: wm2200,wm5100: fix spelling mistake: "Coefficeints" -> "Coefficients"
Trivial fix to spelling mistakes in SND_SOC_BYTES literal strings

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-18 10:14:39 +01:00
Colin Ian King ecd6331370
ASoC: wm8904: fix spelling mistake: "Caputure" -> "Capture"
Trivial fix to spelling mistake in SOC_ENUM literal string

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-18 10:11:10 +01:00
Takashi Iwai ed14d9ae53 Merge branch 'topic/timer-fixes' into for-next
Pull the fixes for possible races in the resolution callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 08:55:36 +02:00
Melvin Vermeeren 7c1543f6b5 ALSA: dice: add stream format parameters for Mytek devices
--nextPart3916812.EicPReet6m
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

Mytek manufactures some equipment with DICE-based firewire ports. These
devices contain old versions of DICE firmware which lacks detailed
stream format reporting for all sampling clock modes.

Building upon the recent work by Takashi Sakamoto, hard-coded parameters
are added for the Stereo 192 DSD-DAC. When the device vendor and model
match the coded parameters are copied into the stream format cache.

Signed-off-by: Melvin Vermeeren <mail@mel.vin>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 08:53:51 +02:00
Takashi Iwai 9d4d207d13 ALSA: timer: Assure timer resolution access always locked
There are still many places calling the timer's hw.c_resolution
callback without lock, and this may lead to some races, as we faced in
the commit a820ccbe21 ("ALSA: pcm: Fix UAF at PCM release via PCM
timer access").

This patch changes snd_timer_resolution() to take the timer->lock for
avoiding the races.  A place calling this function already inside the
lock (from the notifier) is replaced with the
snd_timer_hw_resolution() accordingly, as well as wrapping with the
lock around another place calling snd_timer_hw_resolution(), too.

Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 08:49:13 +02:00
Takashi Iwai 21244e3d6a ALSA: seq: Avoid open-code for getting timer resolution
Instead of open-coding for getting the timer resolution, use the
standard snd_timer_resolution() helper.

The original code falls back to the callback function when the
resolution is zero, but it must be always so when the callback
function is defined.  So this should be no functional change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 08:49:13 +02:00
Takashi Iwai fdcb5761c1 ALSA: timer: Simplify timer hw resolution calls
There multiple open-codes to get the hardware timer resolution.
Make a local helper function snd_timer_hw_resolution() and call it
from all relevant places.

There is no functional change by this, just a preliminary work for the
following timer resolution hardening patch.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 08:49:12 +02:00
Ben Hutchings 3ae1809725 ALSA: timer: Fix pause event notification
Commit f65e0d2998 ("ALSA: timer: Call notifier in the same spinlock")
combined the start/continue and stop/pause functions, and in doing so
changed the event code for the pause case to SNDRV_TIMER_EVENT_CONTINUE.
Change it back to SNDRV_TIMER_EVENT_PAUSE.

Fixes: f65e0d2998 ("ALSA: timer: Call notifier in the same spinlock")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 08:43:59 +02:00
Ruslan Bilovol 6cd17ea70b ALSA: usb: stream: fix potential memory leak during uac3 interface parsing
UAC3 channel map is created during interface parsing,
and in some cases was not freed in failure paths.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-18 08:40:40 +02:00
Takashi Iwai 11d42c8103 ALSA: emu10k1: Rate-limit error messages about page errors
The error messages at sanity checks of memory pages tend to repeat too
many times once when it hits, and without the rate limit, it may flood
and become unreadable.  Replace such messages with the *_ratelimited()
variant.

Bugzilla: http://bugzilla.opensuse.org/show_bug.cgi?id=1093027
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-17 20:02:23 +02:00
Bard Liao 81dd1c5dcf
ASoC: rt5670: improve PLL function's stability
Set PR-38 register to 0x1fe1 will make PLL function more stable.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 18:10:41 +01:00
Marco Felsch 74f24d8728
ASoC: ssm2305: Add amplifier driver
The ssm2305 is a simple Class-D audio amplifier. A application can
turn on/off the device by a gpio. It's also possible to hardwire the
shutdown pin.

Tested on a i.MX6 based custom board.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 18:09:44 +01:00
Colin Ian King bf8b47fe20 ALSA: emu10k1: fix spelling mistake: "Caputre" -> "Capture"
Trivial fix to spelling mistakes in audigy_outs arrays.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-17 10:06:02 +02:00
Srinivas Kandagatla b73e93e183
ASoC: qdsp6: q6core: Add q6core driver
This patch adds support to core apr service, which is used to query
status of other static and dynamic services on the dsp.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Acked-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 15:49:38 +09:00
Pravin Shedge 3439a083a1
ASoC: zte: remove duplicate includes
These duplicate includes have been found with scripts/checkincludes.pl but
they have been removed manually to avoid removing false positives.

Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 15:46:22 +09:00
Vishal Thanki 096a8f835e
ASoC: davinci-mcasp: Only disable inactive serializer
As a side effect of the following commit, the active TX
serializer may get disabled which may result in distorted
audio output.

ASoC: davinci-mcasp: Add support for multichannel playback
(2952b27e2e)

For example, if a 4 channel I2S playback with two TX serializers
is activated. Later on, if a recording of 2 channels, with only 1 RX
serializer is started, which will also disable one of the TX
serializer because max_active_serializers is only calculated for
RX (recording) stream. This patch fixes this issue.

Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 15:46:22 +09:00
Hans de Goede 063422ca2a
ASoC: Intel: bytcr_rt5640: Set card long_name based on quirks
Many X86 devices using a BYT SoC + RT5640 codec are cheap devices with
generic DMI strings, causing snd_soc_set_dmi_name() to fail to set a
long_name, making it impossible for userspace to have a correct UCM
profile which only uses inputs / outputs which are actually hooked up
on the device.

Our quirks already specify which input the internal mic is connected to
and if a single (mono) speaker is used or if the device has stereo
speakers.

This commit sets a long_name based on the quirks so that userspace can
have UCM profiles doing the right thing based on the long_name.

Note that if we ever encounter the need for a special UCM profile for
some device we can add a quirk to set a specific long_name for the
device,

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-05-17 15:47:28 +09:00
Hans de Goede ec8e8418ff
ASoC: Intel: bytcr_rt5640: Add quirks for various devices
Even with our recently tweaked defaults, quite a few bytcr_rt5640 devices
still need quirks to be fully functional. This commits adds quirks where
necessary for the 16 bytcr_rt5640 devices I have access to.

The quirks are added for the following reasons:

1) Devices with only one speaker need the mono quirk to avoid driving an
unused and potentially short-circuited output. 8 of my sample of 16 devs
are mono, 4 of these would work with the defaults if it were not for their
mono speaker.

2) Devices using a different input for the internal mic then the default,
this is the case for 6 of my sample of 16 devices.

3) BYTCR devices without an ACPI channel map, which do not work with the
default of SSP0-AIF2, this is the case for 2 of my sample of 16 devices.

4) Devices which need non-default jack-detect settings, this is the case
for 6 of my sample of 16 devices.

This commit add quirks for the following devices:

Acer Iconia Tab 8 W1-810
Chuwi Vi8
HP Pavilion X2 10-n000nd
HP Stream 7
I.T. Works TW891
Lamina I8270
MSI S100
Pipo W4
PoV-mobii-800w (v2.0)
PoV-mobii-800w (v2.1)
Toshiba Click Mini L9W-B

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-05-17 15:47:20 +09:00
Hans de Goede 6d1bfcc5e7
ASoC: Intel: bytcr_rt5640: Use dmi_first_match() for DMI quirk handling
Use dmi_first_match() instead of dmi_check_system() + callbacks, this
avoid the need to initialize dmi_system_id.callback for each
byt_rt5640_quirk_table entry.

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-05-17 15:47:15 +09:00
Hans de Goede 3c0d011608
ASoC: Intel: bytcr_rt5640: Sort DMI quirk list alphabetically
As we add more quirks it is useful to have some sort of order in the
quirk list, sort it alphabetically.

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-05-17 15:47:11 +09:00
Hans de Goede 56ff440945
ASoC: Intel: bytcr_rt5640: Add default jack-detect settings
Out of the 11 BYTCR devices which I have access to for testing, 6 use
JD1IN4P for jack-detect, 2 use JD1IN4P non-inverted and the other 3 use
JD2IN4N, the ones not using JD1IN4P are all also special in other ways and
need a DMI quirk regardless.

All 5 BYT (non CR) devices which I have access to use JD2IN4N.

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-05-17 15:47:03 +09:00
Hans de Goede 96a388feb2
ASoC: Intel: bytcr_rt5640: Unify BYTCR input defaults
Currently we've 2 places with BYTCR defaults: 1. The generic catch-all
DMI_SYS_VENDOR=="Insyde" DMI quirk which selects SSP0-AIF1 for generic
Insyde BYTCR tablets without the ACPI channel package; and 2. the
defaults in the if (is_bytcr) {} code block.

Currently these are not identical, both select IN3 as the internal mic
output, but the "Insyde" DMI quirk leaves out the DIFF_MIC quirk. The
DIFF_MIC quirk should be enabled by default, because enabling diff. input
helps a lot for devices with a differential mic, where as it is a nop on
devices with a normal mic.

This commit adds the DIFF_MIC quirk to the "Insyde" DMI quirk path, by
adding a new BYTCR_INPUT_DEFAULTS define and using that in both code paths
which set BYTCR defaults.

Having a single place where the BYTCR input defaults are defined also
allows defining jack-detect defaults in a single place in a follow-up
commit.

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-05-17 15:46:57 +09:00
Hans de Goede 737c14641a
ASoC: Intel: bytcr_rt5640: Change BYTCR default input to IN3
Out of the 11 BYTCR devices which I have access to for testing,
7 use IN3 for the internal mic and only 1 uses IN1 for the internal mic,
the other 3 use DMIC1.

So IN3 clearly is a better default, using IN3 as default avoids the need
to add DMI quirks for some of these devices.

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-05-17 15:46:43 +09:00
Hans de Goede 7732310839
ASoC: Intel: bytcr_rt5640: Enable jack detection
Add code to support setting jack-detect parameters through quirks and
extend the existing DMI quirk table entries for the Asus T100TA and the
Dell Venue 8 Pro 5830 to enable jack detection.

Tested-by: Hans de Goede <hdegoede@redhat.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-05-17 15:46:37 +09:00
Hans de Goede 6748fb7e77
ASoC: Intel: bytcr_rt5640: Fix Dell Venue 8 5830 Pro quirk
This fixes the following 3 issues:

1) The sys_vendor match should be for "Dell Inc." not "DellInc.",
   without this fixed the quirk never gets applied
2) DMIC1 is used not DMIC2, this was not a problem sofar because for
   regular BYT boards (rather then BYTCR) we default to DMIC1 and because
   of 1. the quirk was not being applied
3) The Dell Venue 8 5830 Pro only has a single speaker

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-05-17 15:46:33 +09:00
Hans de Goede a3ad29113d
ASoC: Intel: bytcr_rt5640: Use device properties for setting up dmic
Use device-properties for setting up the dmic, based on the
BYT_RT5640_MAP() value, instead of using the codec specific
rt5640_dmic_enable() function for this.  This also removes the need
for the BYT_RT5640_DMIC_EN quirk, which was always set together with
a MAP() quirk of DMIC1_MAP or DMIC2_MAP.

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-05-17 15:46:22 +09:00
Takashi Iwai dc82e52492 ALSA: core: Assure control device to be registered at last
The commit 289ca025ee ("ALSA: Use priority list for managing device
list") changed the way to register/disconnect/free devices via a
single priority list.  This helped to make behavior consistent, but it
also changed a slight behavior change: namely, the control device is
registered earlier than others, while it was supposed to be the very
last one.

I've put SNDRV_DEV_CONTROL in the current position as the release of
ctl elements often conflict with the private ctl elements some PCM or
other components may create, which often leads to a double-free.
But, the order of register and disconnect should be indeed fixed as
expected in the early days: the control device gets registered at
last, and disconnected at first.

This patch changes the priority list order to move SNDRV_DEV_CONTROL
as the last guy to assure the register / disconnect order.  Meanwhile,
for keeping the messy resource release order, manually treat the
control and lowlevel devices as last freed one.

Additional note:
The lowlevel device is the device where a card driver creates at
probe.  And, we still keep the release order control -> lowlevel, as
there might  be link from a control element back to a lowlevel object.

Fixes: 289ca025ee ("ALSA: Use priority list for managing device list")
Reported-by: Tzung-Bi Shih <tzungbi@google.com>
Tested-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-17 08:21:23 +02:00
kbuild test robot bdfe4d9ade
ASoC: rt5663: rt5663_set_jack_detect() can be static
Fixes: 9958e8afbcad ("ASoC: rt5663: Use the set_jack() instead of the export function")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 13:33:24 +09:00
Oder Chiou 37a0491116
ASoC: rt5663: Use the set_jack() instead of the export function
The patch replaces the export function with the new API set_jack().

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 13:33:23 +09:00
Peter Ujfalusi 1cc0fe2479
ASoC: omap: sdma-pcm: Correction for the include files
The sdma-pcm does not need any information from omap-dma.h, it only needs
to include the omap-dmaengine.h - for the omap_dma_filter_fn, but that
might not be needed at all as OMAP1 was converted to dma_slave_map, but
I can not test OMAP1.

Add the linux/device.h include as well for devm_kzalloc()

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 13:28:58 +09:00
Peter Ujfalusi 7bf8ad175a
ASoC: omap: sdma-pcm: Fix modpost warning
WARNING: modpost: missing MODULE_LICENSE() in sound/soc/omap/snd-soc-sdma.o
see include/linux/module.h for more information
WARNING: modpost: missing MODULE_LICENSE() in sound/soc/omap/snd-soc-sdma.o
see include/linux/module.h for more information

Add the missing MODULE_LICENSE.

This patch also going to solve:
snd_soc_sdma: Unknown symbol devm_kmalloc (err 0)
snd_soc_sdma: Unknown symbol omap_dma_filter_fn (err 0)
snd_soc_sdma: Unknown symbol snd_dmaengine_pcm_prepare_slave_config (err 0)
snd_soc_sdma: Unknown symbol devm_snd_dmaengine_pcm_register (err 0)

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-17 13:28:57 +09:00
Takashi Iwai 377a879d98 ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback
retire_capture_urb() may print warning messages when the given URB
doesn't align, and this may flood the system log easily.
Put the rate limit to the message for avoiding it.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1093485
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-16 20:07:18 +02:00
Oleksandr Andrushchenko 1cee559351 ALSA: xen-front: Implement ALSA virtual sound driver
Implement essential initialization of the sound driver:
  - introduce required data structures
  - handle driver registration
  - handle sound card registration
  - register sound driver on backend connection
  - remove sound driver on backend disconnect

Initialize virtual sound card with streams according to the
Xen store configuration.

Implement ALSA driver operations including:
  - manage frontend/backend shared buffers
  - manage Xen bus event channel states

Implement requests from front to back for ALSA
PCM operations.
  - report ALSA period elapsed event: handle XENSND_EVT_CUR_POS
    notifications from the backend when stream position advances
    during playback/capture. The event carries a value of how
    many octets were played/captured at the time of the event.
  - implement explicit stream parameter negotiation between
    backend and frontend: handle XENSND_OP_HW_PARAM_QUERY request
    to read/update configuration space for the parameter given:
    request passes desired parameter interval and the response to
    this request returns min/max interval for the parameter to be used.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-16 12:59:57 +02:00
Oleksandr Andrushchenko d6e0fbb82e ALSA: xen-front: Implement handling of shared buffers
Implement shared buffer handling according to the
para-virtualized sound device protocol at xen/interface/io/sndif.h:
  - manage buffer memory
  - handle granted references
  - handle page directories

[ Fixed missing linux/kernel.h inclusion -- tiwai ]

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-16 12:59:50 +02:00
Oleksandr Andrushchenko 788ef64a2c ALSA: xen-front: Implement Xen event channel handling
Handle Xen event channels:
  - create for all configured streams and publish
    corresponding ring references and event channels in Xen store,
    so backend can connect
  - implement event channels interrupt handlers
  - create and destroy event channels with respect to Xen bus state

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-16 12:58:41 +02:00
Oleksandr Andrushchenko fd3b36045c ALSA: xen-front: Read sound driver configuration from Xen store
Read configuration values from Xen store according
to xen/interface/io/sndif.h protocol:
  - introduce configuration structures for different
    components, e.g. sound card, device, stream
  - read PCM HW parameters, e.g rate, format etc.
  - detect stream type (capture/playback)
  - read device and card parameters

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-16 12:58:39 +02:00
Oleksandr Andrushchenko cc3196ae19 ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver
Introduce skeleton of the para-virtualized Xen sound
frontend driver.

Initial handling for Xen bus states: implement
Xen bus state machine for the frontend driver according to
the state diagram and recovery flow from sound para-virtualized
protocol: xen/interface/io/sndif.h.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-16 12:58:36 +02:00
Takashi Sakamoto 862154bbd7 ALSA: hda/ca0132: constify parameter table for effects
This module has a table for parameters of each effects. This table is
read-only and can have 'const' qualifier.

This commit adds this optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 18:05:30 +02:00
Takashi Sakamoto 0cc1aa7162 ALSA: hda/ca0132: merge strings just for printk
This module has some function-local strings just for printk therefore
it can be merged into format string.

This commit applies this optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 18:05:29 +02:00
Takashi Sakamoto 3a03f83b16 ALSA: hda/ca0132: constify read-only members of string array
This module has some strings just for printk therefore they can be
read-only.

This commit applies this optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 18:05:28 +02:00
Takashi Sakamoto b0eaa0721d ALSA: hda/ca0132: constify templates for control element set
An array of templates for control element set is passed as an
argument for snd_hda_add_new_ctls(). This argument has 'const'
qualifier therefore the passed array can have the qualifier.

This commit adds this optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 18:05:27 +02:00
Jorge Sanjuan 710669455d ALSA: usb-audio: UAC3: Parse Input Terminal number of channels.
Obtain the number of channels for the Input Terminal from the
Logical Cluster Descriptor. This achieves a useful minimal parsing
of this unit so it can be used in other units in the topology.

Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Tested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 07:36:06 +02:00
Jorge Sanjuan 1d38f5d828 ALSA: usb-audio: UAC3 Add support for connector insertion.
This adds support for the UAC3 insertion controls. The status
is reported as a boolean value in the same way it used to do
for UAC2. Hence, the presence of any connector in the response
will make the control saying the jack is connected.

The UAC2 support for this control has been moved to a dedicated
control for connectors as both UAC2 and UAC3 follow a specific
Control Request Parameter Block for this control. This parameter
block for UAC3 could not be read in the same simplistic
manner as in UAC2.

This implementation is not requesting additional information
from the HIGH CAPABILITY Connectors descriptor.

Tested with an UAC3 device with UAC2 as legacy configuration.
The connector status can be read with `amixer` and the interrupt
is also caught with `alsactl monitor`.

Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Tested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 07:35:34 +02:00
Jorge Sanjuan 6cfd839ae7 ALSA: usb-audio: UAC3. Add support for mixer unit.
This adds support for the MIXER UNIT in UAC3. All the information
is obtained from the (HIGH CAPABILITY) Cluster's header. We don't
read the rest of the logical cluster to obtain the channel config
as that wont make any difference in the current mixer behaviour.

The name of the mixer unit is not yet requested as there is not
support for the UAC3 Class Specific String requests.

Tested in an UAC3 device working as a HEADSET with a basic mixer
unit (same as the one in the BADD spec) with no controls.

Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Tested-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 07:32:50 +02:00
Takashi Iwai 8def12d9cd Merge branch 'for-linus' into for-next
Back-merge of UAC3 fixes for applying further enhancements.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 07:30:23 +02:00
Jorge Sanjuan c99f0802e4 ALSA: usb-audio: Use Class Specific EP for UAC3 devices.
bmAtributes offset doesn't exist in the UAC3 CS_EP descriptor.
Hence, checking for pitch control as if it was UAC2 doesn't make
any sense. Use the defined UAC3 offsets instead.

Fixes: 9a2fe9b801 ("ALSA: usb: initial USB Audio Device Class 3.0 support")
Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-15 07:29:10 +02:00
Fengguang Wu c5f13d75fb ALSA: hda/ca0132: fix array_size.cocci warnings
sound/pci/hda/patch_ca0132.c:5062:50-51: WARNING: Use ARRAY_SIZE
sound/pci/hda/patch_ca0132.c:5092:50-51: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

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

Fixes: 47cdf76e44 ("ALSA: hda/ca0132: Add new control changes for SBZ + R3Di")
CC: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-14 21:23:51 +02:00
Takashi Sakamoto 4844f51282 ALSA: isight: use position offset macro of TLV data
A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset
of TLV data. This commit applies a code optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-14 17:48:14 +02:00
Takashi Sakamoto 51cdc8b6a6 ALSA: hda: use position offset macro of TLV data
A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset
of TLV data. This commit applies a code optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-14 17:47:57 +02:00
Takashi Sakamoto 841bdb7c0b ALSA: vmaster: use position offset macro of TLV data
A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset
of TLV data. This commit applies a code optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-14 17:47:48 +02:00
Jeremy Soller 2f0d520a1a ALSA: hda/realtek - Clevo P950ER ALC1220 Fixup
This adds support for the P950ER, which has the same required fixup as
the P950HR, but has a different PCI ID.

Signed-off-by: Jeremy Soller <jeremy@system76.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 18:55:46 +02:00
Federico Cuello 21493316a3 ALSA: usb: mixer: volume quirk for CM102-A+/102S+
Currently it's not possible to set volume lower than 26% (it just mutes).

Also fixes this warning:

  Warning! Unlikely big volume range (=9472), cval->res is probably wrong.
  [13] FU [PCM Playback Volume] ch = 2, val = -9473/-1/1

, and volume works fine for full range.

Signed-off-by: Federico Cuello <fedux@fedux.com.ar>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 18:53:53 +02:00
Hans de Goede c8beccc19b ALSA: hda: Add Lenovo C50 All in one to the power_save blacklist
Power-saving is causing loud plops on the Lenovo C50 All in one, add it
to the blacklist.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1572975
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 16:44:35 +02:00
Alberto Aguirre 16bafa792c ALSA: usb-audio: add boot quirk for Axe-Fx III
Wait for Axe-Fx III to fully bootup before initializing card.

Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 12:41:16 +02:00
Connor McAdams 47cdf76e44 ALSA: hda/ca0132: Add new control changes for SBZ + R3Di
This patch adds new controls to set the effect levels on the R3Di and
SBZ. It also adds vmaster controls to control all surround sound
channels. So that Surround effect switch doesn't conflict with Surround
volume, FX: prefix added to all effect related switches.

Tested-by: Mariusz Ceier <mceier+kernel@gmail.com>
Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:32 +02:00
Connor McAdams e0026d0394 ALSA: hda/ca0132: add ca0132_alt_set_vipsource
Add function to set vipsource on cards that use_alt_controls. Different
sequence. Also, add cvoice_switch_set at end of ca0132_select_in so that
when switching between inputs cvoice state is maintained.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:32 +02:00
Connor McAdams 017310fbe7 ALSA: hda/ca0132: Add DSP Volume set and New mixers for SBZ + R3Di
Adds lookup table for floating point decibel volume, and new functions
to allow for setting the decibel level on the DSP.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:31 +02:00
Connor McAdams 7cb9d94c05 ALSA: hda/ca0132: add alt_select_in/out for R3Di + SBZ
Add functions ca0132_alt_select_out and ca0132_alt_select_in for
switching outputs and inputs for r3di and sbz. Also, add enumerated
controls for selecting output and input source.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:31 +02:00
Connor McAdams 447fd8e9a8 ALSA: hda/ca0132: add the ability to set src_id on scp commands
This patch adds the ability to change the src_id on scp commands, which
is used in the dsp setup of the Recon3Di and the Sound Blaster Z. It
also makes sure to maintain backwards compatibility with the older
dspio_set_uint_param function, and sets it's src to the default 0x20.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:30 +02:00
Connor McAdams 7e6ed62ebe ALSA: hda/ca0132: Add dsp setup + gpio functions for r3di
Adds dsp setup functions for Recon3Di as well as the GPIO functions
specific to it.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:30 +02:00
Connor McAdams 38ba69ffce ALSA: hda/ca0132: add dsp setup related commands for the sbz
Add dsp setup related functions for the Sound Blaster Z, along with
other helper functions.

Also, add sbz_dsp_startup_check, which fixes a bug where the card
sometimes starts up and has no sound.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:29 +02:00
Connor McAdams 009b8f979b ALSA: hda/ca0132: update core functions for sbz + r3di
This patch updates core functions to accommodate the Sound Blaster Z and
Recon3Di by changing which functions they use. It also adds the ability
to enable/disable streams.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:28 +02:00
Connor McAdams e93ac30a32 ALSA: hda/ca0132: add extra init functions for r3di + sbz
This patch adds extra init functions for the Sound Blaster Z and
Recon3Di. It also adds more checks to make sure that the DSP isn't
downloaded twice on startup, by checking if the dsp_state is already set
to DSP_DOWNLOADED. It also adds the ability to re-download the DSP on a
resume.

It also changes the init verbs table to apply to all codecs, and takes
the two specific end verbs and puts them into a separate function in
ca0132_init instead.

GPIO functions are also added.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:28 +02:00
Connor McAdams 2e48b2b7a2 ALSA: hda/ca0132: Add extra exit functions for R3Di and SBZ
This patch adds extra functions for shutdown on the Sound Blaster Z and
Recon3Di. The Recon3Di only has one specific functions, which sets the
GPIO data pins to 0 to prevent a popping noise.

The Sound Blaster Z exit sequence was taken from Windows. Without this
exit function, the card will not reload properly unless the PC has been
shutdown to clear the onboard memory. There are commented out functions
currently in the sbz_exit_chip function that are added in a later patch.

Also, a reboot notify function has been added, to make sure these
functions are ran before a reboot. This helps when using the card
through VFIO in a virtual machine, to make sure the card reloads the DSP
properly.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:27 +02:00
Connor McAdams aa31704fd8 ALSA: hda/ca0132: Add PCI region2 iomap for SBZ
This patch adds iomapping for the region2 section of memory on the SBZ.
This memory region is used in later patches for setting inputs and
outputs. If the mapping fails, the quirk is changed back to QUIRK_NONE
to avoid attempts to write to uninitialized memory.

It also adds a new exit sequence to unmap the iomem for the SBZ.

[ Reordered linux/*.h inclusion in the patch by tiwai ]

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:27 +02:00
Connor McAdams 63177afc98 ALSA: hda/ca0132: Add pincfg for SBZ + R3Di, add fp hp auto-detect
This patch adds an unsolicited response tag for the front headphone
panel which uses the same hp_callback as the rear headphone detection.

This patch also adds pincfgs for the R3Di and SBZ which were taken from
the Windows driver. The pins are also defined in the function
ca0132_config. Both the R3Di and SBZ are also given a max out channel
value of 6 to handle 5.1 surround sound in later patches.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:26 +02:00
Connor McAdams 8a19bceef6 ALSA: hda/ca0132: R3Di and SBZ quirk entires + alt firmware loading
This patch adds PCI quirk ID's for the Sound Blaster Z and Recon3Di.
Only the currently tested ID's have been added.

This patch also adds the ability to load alternative firmwares for each
card, the firmwares can be obtained from within the Windows driver.
The Recon3Di uses "ctefx-r3di.bin" and the Sound Blaster Z uses
"ctefx-sbz.bin". If the alternative firmware for the given quirk is not
found, the original ctefx.bin will be used. This has been confirmed to
work for both the R3Di and the SBZ.

This patch also makes the character array *dirstr a const.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:29:26 +02:00
Wenwen Wang 3f12888dfa ALSA: control: fix a redundant-copy issue
In snd_ctl_elem_add_compat(), the fields of the struct 'data' need to be
copied from the corresponding fields of the struct 'data32' in userspace.
This is achieved by invoking copy_from_user() and get_user() functions. The
problem here is that the 'type' field is copied twice. One is by
copy_from_user() and one is by get_user(). Given that the 'type' field is
not used between the two copies, the second copy is *completely* redundant
and should be removed for better performance and cleanup. Also, these two
copies can cause inconsistent data: as the struct 'data32' resides in
userspace and a malicious userspace process can race to change the 'type'
field between the two copies to cause inconsistent data. Depending on how
the data is used in the future, such an inconsistency may cause potential
security risks.

For above reasons, we should take out the second copy.

Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 09:27:57 +02:00
Ruslan Bilovol 17156f23e9 ALSA: usb: add UAC3 BADD profiles support
Recently released USB Audio Class 3.0 specification
contains BADD (Basic Audio Device Definition) document
which describes pre-defined UAC3 configurations.

BADD support is mandatory for UAC3 devices, it should be
implemented as a separate USB device configuration.
As per BADD document, class-specific descriptors
shall not be included in the Device’s Configuration
descriptor ("inferred"), but host can guess them
from BADD profile number, number of endpoints and
their max packed sizes.

This patch adds support of all BADD profiles from the spec

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Tested-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 08:54:35 +02:00
Hans de Goede a3a956a6dd
ASoC: Intel: bytcr_rt5640: Fix compile error
Fix the compile error introduced by: "ASoC: Intel: bytcr_rt5640:
Configure PLL1 before using it".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-13 11:30:19 +09:00
Colin Ian King 2b8eae7955
ASoC: hisilicon: fix spelling mistake: "uknown" -> "unknown"
Trivial fix to spelling mistake in dev_err message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-13 10:08:11 +09:00
Charles Keepax 89027d9ebb
ASoC: compress: Fix up some trivial formatting issues
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 12:24:31 +09:00
Charles Keepax ca76db6c7e
ASoC: compress: Only assign compr->ops->copy once
There are only one set of ops on the compressed stream so no need to
reassign the copy callback repeatedly, stop after copy is seen to be
necessary.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 12:23:10 +09:00
Srinivas Kandagatla 4dddbddbce
ASoC: qdsp6: q6common: Add qdsp6 helper functions
This patch adds some common helper functions like translating dsp error
to linux error codes and channel mappings etc.

These functions are used in all the following qdsp6 drivers.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org>
Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 12:13:31 +09:00
Vijendar Mukunda 9af8937e55
ASoC: amd: removed separate byte count variables for playback and capture
Removed separate byte count variables for playback and capture.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 12:13:25 +09:00
Vijendar Mukunda 7f00484784
ASoC: amd: added byte count register offset variables to rtd
Added byte count register offset variables to audio_substream_data
structure. Modified dma pointer callback.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 12:13:24 +09:00
Vijendar Mukunda 8769bb55fe
ASoC: amd: dma config parameters changes
Added dma configuration parameters to rtd structure.
Moved dma configuration parameters initialization to
hw_params callback.
Removed hard coding in prepare and trigger callbacks.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 12:13:23 +09:00
Alexander Sverdlin 98e1241c35
ASoC: cirrus: i2s: IRQ-based stream watchdog
I2S controller on EP93xx seems to have undocumented HW issue. According to
"EP93xx User’s Guide", controller can handle underflow and either transmit
last sample or zeroes in such case until FIFO is filled again. In reality
undeflow conditions seem to confuse internal state machine from time to
time and the whole stream gets shifted by one byte (as captured by logic
analyser on the I2S outputs). One could only hear noise instead of original
stream and this continues until the FIFO is disabled and enabled again.

Work this around by watching underflow interrupt and resetting I2S TX
channel + fill FIFO with zero samples until DMA catches up again. This is
a nasty workaround, but it works. Hence, Kconfig option to disable it in
case of problems.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:27:33 +09:00
Alexander Sverdlin cc27062b3e
ASoC: cirrus: i2s: Stop enabling I2S2 and I2S3 FIFOs
The driver never supported more than 2 channels because of
ep93xx_i2s_dma_data[] supporting only 1 DMA channel in each
direction.
Stop enabling two unused I2S controller FIFOs, this will simplify
future interrupt support.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:27:14 +09:00
Hans de Goede 25c8b55007
ASoC: rt5645: Add platform-data for Lenovo Ideapad Mixx 320
The Lenovo Ideapad Mixx 320 has a digital mic connected to DMIC2
add a DMI based quirk pointing to the intel_braswell_platform_data
for devices with a mic on DMIC2.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:26:58 +09:00
Hans de Goede 87927581fc
ASoC: rt5645: Add platform-data for Lenovo Ideapad Mixx 310
The Lenovo Ideapad Mixx 310 has a differential internal analog mic,
add platform-data for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:26:43 +09:00
Peter Ujfalusi cfb53a56d1
ASoC: omap: Delete the obsolete omap-pcm
All DAI drivers are now using the new sdma-pcm platform driver. The
omap-pcm can be removed from the tree, but we need to keep the SND_OMAP_SOC
Kconfig option until the relevant defconfigs are updated to avoid
regression due to missing audio.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:26:25 +09:00
Peter Ujfalusi 077a403d86
ASoC: davinci-mcasp: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver in case of sDMA.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:26:15 +09:00
Hans de Goede 6a7c05e55c
ASoC: Intel: bytcr_rt5640: Use device-property for differential mics
Set the "realtek,in1-differential" or "realtek,in3-differential"
device-property when the BYT_RT5640_DIFF_MIC quirk is set instead of
directly poking the codec registers.

This also fixes the BYT_RT5640_DIFF_MIC quirk not working when
combined with BYT_RT5640_IN3_MAP.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:24:01 +09:00
Hans de Goede bcd9a325f0
ASoC: Intel: bytcr_rt5640: Configure PLL1 before using it
When platform_clock_control() first selects PLL1 as sysclk the PLL_CTRL
registers have not been setup yet and we effectively have an invalid clock
configuration until byt_rt5640_aif1_hw_params() gets called.

Add a new byt_rt5640_prepare_and_enable_pll1() helper and use that from
both platform_clock_control() and byt_rt5640_aif1_hw_params() to fix this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:23:51 +09:00
Hans de Goede b16188a20f
ASoC: rt5640: Add button press support
Enable button press detection for headsets by using the ovcd IRQ to get
notified of button presses.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:23:37 +09:00
Hans de Goede 8210804bcf
ASoC: rt5640: Add jack-detect support
Add jack-detect support, loosely based on earlier work on this by:

Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Francisco mendez <francisco.mendez@intel.com>

Note getting the OVCD to work reliable was sort of finicky, so there are
quite a few comments on this to hopefully avoid people breaking it in the
future.

This (and the follow-up button press support) has been tested on the
following devices:

Acer Iconia Tab 8 W1-810
Asus T100CHI
Asus T100TA
Asus T200TA
Axxo WT1011
Chuwi Vi8
Dell Venue 8 Pro 5830
HP Pavilion X2 10-n000nd
HP Stream 7
I.T. Works TW891
Lamina I8270
MSI S100
Peaq C1010
Pipo W4
PoV MobiiTAB-P800W (v2.0)
Toshiba Click Mini L9W-B

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=196377
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:23:19 +09:00
Hans de Goede fb509fa962
ASoC: rt5640: Allow specifying dmic data pins through device-properties
Allow specifying dmic data pins through device-properties / dt. This will
allow us to stop exporting rt5640_dmic_enable() once all callers of it have
been converted to setting device-properties for this instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:23:06 +09:00
Hans de Goede 988a5e0162
ASoC: rt5640: Move checking of device-properties to component probe callback
On some platforms the platform code may need to add device-properties,
rather then relying only on properties set by the firmware.

This commit moves the parsing of the device-properties from the i2c-driver
probe() function, which may be called at any time, to the component-driver
probe() function, which gets called after the platform code calls
snd_soc_register_card().

This allows the platform code to attach extra device-properties before
the device-properties are parsed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:22:50 +09:00
Hans de Goede 8e3ebf5e8f
ASoC: rt5640: Remove unused rt5640_platform_data
There are no in tree users of platform-data for the rt5640 codec driver,
so lets remove support for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:22:34 +09:00
Hans de Goede 8e7a1f1f17
ASoC: rt5640: Remove is_sys_clk_from_pll, it has ordering issues
is_sys_clk_from_pll() is used as a snd_soc_dapm_route.connected callback,
checking RT5640_GBL_CLK to determine if the sys-clk is PLL1 and thus the
PWR_PLL bit in reg PWR_ANLG2 must be set.

RT5640_GBL_CLK is changed by rt5640_set_dai_sysclk(), which gets called by
the pre_pmu / post_pmd functions of the "Platform Clock" dapm-supply.

This creates an ordering issue, during a dapm transition first all
connected() callbacks are called to build a list of supplies to enable
and then the complete list is walked to enable the supplies. Since the
connected() check happens before enabling any supplies,
is_sys_clk_from_pll() ends up deciding if the PWR_PLL bit should be set
based on the state the "Platform Clock" supply had *before* the transition.
This sometimes results in PWR_PLL being off, even though *after* the
transition PLL1 is configured as sys-clk.

This commit removes is_sys_clk_from_pll() instead simply setting / clearing
PWR_PLL in rt5640_set_dai_sysclk() based on the selected sys-clk, which
fixes this and as a bonus results in a nice cleanup.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:21:42 +09:00
Colin Ian King d165b5a86f
ASoC: zx-i2s: fix spelling mistake: "timeing" -> "timing"
Trivial fix to spelling mistake in dev_err message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-11 11:05:01 +09:00
Mauro Carvalho Chehab 71db1cd7ff Linux 4.17-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAlrvwLAeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGEX4H/iRAefubpMXptH55
 ru/Mr7hsbKtKQOCmH3LuYP2SwSEHclX+kxHfiaIMsBN9iOGWpRJkZVLuOG0Vl0sZ
 d68I5UTEJHPY0FZqOvfXY1sLTfG9jlhQ/SyppVyuL+QbH+cecnWqvkMkwo2p99MJ
 7OZ3wZjSObaJGXEoLUbZrEbTf8PsT8eT7MWMkmOJHO/J8rnnoDKaOiB5fBxhck0M
 xd/FdOYNZhqOfzIMUuLPWPE3THjfJuIQOYsTvEq0lcuAD2ZOesbV5hsGLC1AG6jd
 GaJJKy80mRvPXSLv7GTigBG9zZbs0mszDJeeh0FCjSlc3sjMDZn7A12N1c8AcQ52
 rLmzSQ8=
 =Nmna
 -----END PGP SIGNATURE-----

Merge tag 'v4.17-rc4' into patchwork

Linux 4.17-rc4

* tag 'v4.17-rc4': (920 commits)
  Linux 4.17-rc4
  KVM: x86: remove APIC Timer periodic/oneshot spikes
  genksyms: fix typo in parse.tab.{c,h} generation rules
  kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)
  gcc-plugins: fix build condition of SANCOV plugin
  MAINTAINERS: Update Kbuild entry with a few paths
  Revert "usb: host: ehci: Use dma_pool_zalloc()"
  platform/x86: Kconfig: Fix dell-laptop dependency chain.
  platform/x86: asus-wireless: Fix NULL pointer dereference
  arm64: vgic-v2: Fix proxying of cpuif access
  KVM: arm/arm64: vgic_init: Cleanup reference to process_maintenance
  KVM: arm64: Fix order of vcpu_write_sys_reg() arguments
  MAINTAINERS & files: Canonize the e-mails I use at files
  media: imx-media-csi: Fix inconsistent IS_ERR and PTR_ERR
  tools: power/acpi, revert to LD = gcc
  bdi: Fix oops in wb_workfn()
  RDMA/cma: Do not query GID during QP state transition to RTR
  IB/mlx4: Fix integer overflow when calculating optimal MTT size
  IB/hfi1: Fix memory leak in exception path in get_irq_affinity()
  IB/{hfi1, rdmavt}: Fix memory leak in hfi1_alloc_devdata() upon failure
  ...
2018-05-10 07:19:23 -04:00
Katsuhiro Suzuki 5a748de064
ASoC: uniphier: add digital output volume for UniPhier sound system
This patch adds controllers for digital volume of PCM output. Volume
effects simply linear, not dB scale as follows:
  Gained PCM = Original * 0x4000 / Volume

The value range of volume is from 0x0001 to 0xffff. 0x0000 works as
mute. Initial value is 0x4000 (+0dB).

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:40:39 +09:00
Kuninori Morimoto 0e7b25c673
ASoC: soc-core: remove legacy_dai_naming from snd_soc_register_dais()
We can get legacy dai name flag from component driver.
Thus, there is no need to have its parameter on snd_soc_register_dais().
Let's remove unneeded parameter

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:40:09 +09:00
Kuninori Morimoto 359c71eeac
ASoC: soc-core: remove snd_soc_component_add_unlocked()
There is no user to call snd_soc_component_add_unlocked() anymore.
Let's merge snd_soc_component_add_unlocked() and
snd_soc_component_add().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:40:01 +09:00
Kuninori Morimoto db795f9b92
ASoC: add component_list_show()
commit ef050bece1 ("ASoC: Remove platform code now everything is
componentised") removed platform code, then platform_list_show() was
removed, too. But we want to keep it as component_list_show.
This patch add it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:39:18 +09:00
Kuninori Morimoto 999f7f5af8
ASoC: remove Codec related code
Now no one is using Codec related code.
Let's remove all

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:39:07 +09:00
Kuninori Morimoto 11fb14f8c5
ASoC: remove unneeded .pcm_new/free
commit ef050bece1 ("ASoC: Remove platform code now everything is
componentised") removed platform code, but it didn't remove
.pcm_new/free which existed only for platform.
This patch remove these

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:39:01 +09:00
Kuninori Morimoto 2250e76d78
ASoC: remove .get_regmap
To setup regmap, ALSA SoC has snd_soc_component_init_regmap() and
.get_regmap. But these are duplicated feature.
Now, no one is using .get_regmap, let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:38:52 +09:00
Kuninori Morimoto d1021c8852
ASoC: remove codec reg_cache
Codec reg_cache is legacy feature, almost all driver are now using
common regmap, and very few driver had been used this legacy feature.
Because of this background, it is now implemented on each
driver internally now.
So now, no one is using codec reg_cache. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:38:23 +09:00
Peter Ujfalusi 0198d7bb8a
ASoC: omap-mcbsp: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:22:00 +09:00
Peter Ujfalusi 31d2f5db92
ASoC: omap-mcpdm: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:22:00 +09:00
Peter Ujfalusi 87dbec537b
ASoC: omap-dmic: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:22:00 +09:00
Peter Ujfalusi b1a549c6be
ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:22:00 +09:00
Peter Ujfalusi dde637f2da
ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm
With the generic dmaengine_pcm support the omap-cpm can be replaced with a
much smaller wrapper.

CPU DAI drivers can use the:
int sdma_pcm_platform_register(struct device *dev,
			       char *txdmachan, char *rxdmachan);

To register the platform driver, txdmachan/rxdmachan is only needed to be
provided if the DMA channel names are not standard tx/rx, like in case of
McPDM, or the DAI is only capable of one audio direction (DMIC, HDMI).

This patch only introduces the source file and changes to the
Kconfig/Makefile, but does not change any of the DAI drivers to use it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:22:00 +09:00
Katsuhiro Suzuki e5ba319882
ASoC: uniphier: evea: use DAPM to change source of line-in
This patch replaces mixer switch to DAPM one for changing audio source
of line-in.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:22:00 +09:00
Colin Ian King 2ce7eb2589
ASoC: nau8824: fix spelling mistake: "semaphone" -> "semaphore"
Trivial fix to spelling mistake in dev_warn messages

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 18:22:00 +09:00
Wei Yongjun aaa730ca3f
ASoC: fix return value check in mt6351_codec_driver_probe()
In case of error, the function dev_get_regmap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-09 17:32:05 +09:00
oder_chiou@realtek.com 3e4d08c386
ASoC: rt5663: Optimize the power consumption
The patch optimizes the power consumption.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-05 10:46:33 +09:00
Paul Handrigan 6a6ad7face
ASoC: cs35l35: Add use_single_rw to regmap config
Add the use_single_rw flag to regmap config since the
device does not support bulk transactions over i2c.

Signed-off-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2018-05-05 10:31:11 +09:00
Anna-Maria Gleixner 10aa7cad37 ALSA: pcm: Hide local_irq_disable/enable() and local_irqsave/restore()
The snd_pcm_stream_lock_irq*() functions decouple disabling interrupts
from the actual locking process. This does not work as expected if the
locking primitives are replaced like on preempt-rt.

Provide one function for locking which uses correct locking primitives.

Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-04 18:57:13 +02:00
Ruslan Bilovol eccfc1b868 ALSA: usb: mixer: make string parsing independent of mixer_build state
Functions like snd_usb_copy_string_desc() or
get_term_name() don't actually need mixer_build
state but can use snd_usb_audio structure instead
to get usb device.

This patch has no functional change but prepares
to future UAC3 BADD profiles support which don't
have class-specific descriptors so won't have
mixer_build state.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-04 09:39:38 +02:00
Jorge Sanjuan 3763f61867 ALSA: usb: Only get AudioControl header for UAC1 class.
The control header needs to be read from buffer at this point only
in the case of UAC1 protocol. Move it inside the switch case as other
protocols such as the Basic Audio Device spec will have an empty buffer
that is latter filled as inferred.

Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
[Ruslan: updated with recently added sanity checks]
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-04 09:39:27 +02:00
Ruslan Bilovol eda553f432 ALSA: usb: stream: refactor uac3 audio interface parsing
Offload snd_usb_parse_audio_interface() function
which became quite long after adding UAC3 spec support.

Move class-specific parts of uac3 parsing to separate
function which now produce audioformat structure that
is ready to be fed to snd_usb_add_audio_stream().

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-04 09:39:12 +02:00
Ruslan Bilovol 68faa86364 ALSA: usb: stream: refactor uac1/2 audio interface parsing
Offload snd_usb_parse_audio_interface() function
which became quite long after adding UAC3 spec support.

Move class-specific parts of uac1/2 parsing to separate
function which now produce audioformat structure that
is ready to be fed to snd_usb_add_audio_stream().

This also broke Blue Microphones workaround (which
relies on audioformat decoded from previous altsetting)
into two parts: prepare quirk flag analyzing previous
altsetting then use it with current altsetting.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-04 09:38:50 +02:00
Ruslan Bilovol 4d47fa8447 ALSA: usb: stream: move audioformat alloc/init into separate function
Offload snd_usb_parse_audio_interface() function which
became quite long after adding UAC3 spec support.

Move audioformat allocation and initialization
into separate function, this will make easier
future refactoring.
Attributes left in the original func because it'll
be used for UAC3 BADD profiles suport in the future

There is no functional change.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-04 09:38:44 +02:00
Jean-Jacques Hiblot 396888772a
ASoC: tas6424: Allow disabling auto diagnostics for faster power-on
The TAS6424 incorporates both DC-load and AC-load diagnostics which are
used to determine the status of the load. The DC diagnostics runs when any
channel is directed to leave the Hi-Z state and enter the MUTE or PLAY
state.
The DC diagnostics are turned on by default but, if a fast startup without
diagnostics is required, the diagnostics can be disabled using a dedicated
ALSA control.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-04 08:13:12 +09:00
John Hsu a7ea9385d4
ASoC: nau8810: change input PGA mixer stage
Organize the paths of the mixer, "Input Boost Stage", including
the routes of the mixer. The control is not used correctly before.
Besides, the driver changes the name of the mixer controls.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-04 08:13:06 +09:00