1
0
Fork 0
Commit Graph

31075 Commits (23b2441b90026ff56b3a4dd9af33a39730cffa21)

Author SHA1 Message Date
Kuninori Morimoto c0ea089dba
ASoC: rsnd: rsnd_mod_name() handles both name and ID
Current rsnd driver is using "%s[%d]" for mod name and ID,
but, this ID portion might confusable.
For example currently, CTU ID is 0 to 7, but using 00 to 13
(= 00, 01, 02, 03, 10, 11, 12, 13) is very best matching to datasheet.

In the future, we will support BUSIFn, but it will be more complicated
numbering. To avoid future confusable code, this patch modify
rsnd_mod_name() to return understandable name.

To avoid using pointless memory, it uses static char and snprintf,
thus, rsnd_mod_name() user should use it immediately, and shouldn't keep
its pointer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:28:00 +00:00
Kuninori Morimoto c16015f36c
ASoC: rsnd: add .get_id/.get_id_sub
ID for CTU and SSIU are confusable.
1 CTU has 4 sub nodes. This means, CTU0 has CTU01 - CTU03, CTU1 has
CTU10 - CTU13. SSIU is more confusable. Gen2 SSIU has BUSIF0-3, Gen3
SSIU has BUSIF0-7, but not for all SSIU.
In rsnd driver, each mod drivers are assuming rsnd_mod_id() returns
main device ID (In CTU case CTU0-1, SSIU case SSIU0-9), not serial
number.
This patch adds new .id/.id_sub to handling more detail ID.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:27:45 +00:00
Kuninori Morimoto 7e7fe06de3
ASoC: rsnd: move .get_status under rsnd_mod_ops
Each mod needs to have .get_status, but current driver is handling it
under rsnd_mod, instead of rsnd_mod_ops.
It is not any make sence. This patch moves it to rsnd_mod_ops, and
tidyup its parameter order to align to other callback functions.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:27:29 +00:00
Kuninori Morimoto 0900d1e648
ASoC: pcm3168a: cleanup hw_constraint for LEFT_J/I2S
hw constraint for LEFT_J/I2S are same, but had duplicated code.
This code cleanup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:27:15 +00:00
Peter Ujfalusi 61f18dc78a
ASoC: omap-mcbsp: On OMAP1 and OMAP2420 only 16bit format is supported
For samples sizes of 20/24/32 bit the DRR2/DXR2 registers must be used to
receive or transmit the most significant part of the 32bit sample.
We can not trick the system by using the DRR2/DXR2 register offset and use
32bit element size since these (and other McBSP) registers are 16bit ones.

We would need support for port_window in cyclic mode from the sDMA driver,
but it is not straight forward as we would need to have the sDMA frame to
cover the 32bit (DRR2+DRR1/DXR2+DXR1), but the frames must cover the ALSA
period to be able to receive periodic interrupts.

Since the 32bit samples are not working (DMA timeout), just remove it in
case we have McBSP with reg_size of 2.

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-11-05 11:26:12 +00:00
Julia Lawall de3636488c
ASoC: AMD: constify regulator_desc structure
The regulator_desc structure can be const as it is only passed as the
second argument of devm_regulator_register and the corresponding
parameter is declared as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:25:57 +00:00
Julia Lawall 704a9fc20b
ASoC: codecs: constify snd_soc_dai_ops structures
The snd_soc_dai_ops structures are only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structures
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:25:42 +00:00
Julia Lawall 7dfcd9d727
ASoC: qdsp6: q6afe-dai: constify snd_soc_dai_ops structures
The snd_soc_dai_ops structures are only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structures
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:23:28 +00:00
Yangtao Li 0b6277e634
ASoC: nau8825: remove unnecessary unlikely()
WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 11:06:31 +00:00
Arnd Bergmann 1539c7f23f
ASoC: Intel: mrfld: fix uninitialized variable access
Randconfig testing revealed a very old bug, with gcc-8:

sound/soc/intel/atom/sst/sst_loader.c: In function 'sst_load_fw':
sound/soc/intel/atom/sst/sst_loader.c:357:5: error: 'fw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (fw == NULL) {
     ^
sound/soc/intel/atom/sst/sst_loader.c:354:25: note: 'fw' was declared here
  const struct firmware *fw;

We must check the return code of request_firmware() before we look at the
pointer result that may be uninitialized when the function fails.

Fixes: 9012c9544e ("ASoC: Intel: mrfld - Add DSP load and management")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 10:38:19 +00:00
Arnd Bergmann 576ce4075b
ASoC: wm97xx: fix uninitialized regmap pointer problem
gcc notices that without either the ac97 bus or the pdata, we never
initialize the regmap pointer, which leads to an uninitialized variable
access:

sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':
sound/soc/codecs/wm9712.c:666:2: error: 'regmap' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Since that configuration is invalid, it's better to return an error
here. I tried to avoid adding complexity to the conditions, and turned
the #ifdef into a regular if(IS_ENABLED()) check for readability.
This in turn requires moving some header file declarations out of
an #ifdef.

The same code is used in three drivers, all of which I'm changing
the same way.

Fixes: 2ed1a8e0ce ("ASoC: wm9712: add ac97 new bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 10:37:39 +00:00
Julia Lawall ff60005e45
ASoC: smd845: constify snd_soc_ops structure
The snd_soc_ops structure can be const as it is only stored in the
ops field of a snd_soc_dai_link structure and this field is const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 10:37:30 +00:00
Colin Ian King 6b27e27729
ASoC: stm32: sai: fix less than zero comparison on unsigned int
Currently, the comparison of div < 0 is always false because div is
an unsigned int. Fix this by making div an int.

Detected by CoverityScan, CID#1475309 ("Unsigned compared against 0")

Fixes: 8307b2afd3 "(ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 10:33:06 +00:00
Vasily Khoruzhick 2f5d94123c
ASoC: sunxi: rename SND_SUNXI_ADDA_PR_REGMAP to SND_SUN8I_ADDA_PR_REGMAP
SND_SUN50I_CODEC_ANALOG selects SND_SUNXI_ADDA_PR_REGMAP which is leftover
of renaming SND_SUNXI_ADDA_PR_REGMAP to SND_SUN8I_ADDA_PR_REGMAP. Replace
it with SND_SUN8I_ADDA_PR_REGMAP to fix possible link errors for some
configurations:

sound/soc/sunxi/sun50i-codec-analog.o: In function `sun50i_codec_analog_probe':
sun50i-codec-analog.c:(.text+0x62): undefined reference to `sun8i_adda_pr_regmap_init'

Fixes: 42371f327d ("ASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls")
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 10:25:16 +00:00
Linus Torvalds 54480aa7fa sound fixes for 4.20-rc1
A few device-specific fixes: a fix for SPDIF on old Creative PCI
 board, and two additional fixes for the recent changes in FireWire
 audio stack.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAlvcJncOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE88qg/9HvBZ5CZPdfxjMTEZ30GobzDGtJ3y8FIJXFg2
 YL/XRyMysyBt6+Ld9ZmqdrvbjU8zsuBw+YZrid/kDDdBITqetNdc/hvRs0Jh6/qy
 S4J6LEJJxQEUefdJiOYvPAqpXZWp/vzDVBE9BejpanxCQnyrklX9KawFDuifP93P
 +EBt0OyiqpmrU8btoaFJEnOaGEIsBFc60ZHK9ubjzfuH/3FooYiWl+fUAuyddAvZ
 TpBNSMaCmiadUc/InbXesnrUgzuoiPxTBQs9ba1PwH/lnoB4pv2B9IMc5wPzuIrT
 PI9JyoVRIRTaNWGqJsr514njEXd+B6laWhcxFgYrM/DdZqq7J2zFzpvKbnMKXadB
 IW8mtffI1ANYc/WyBRqf6tlRa58lQDejwce/xv605fktmok1XNS+9nDIeU+lfU46
 Ed/NONXGXujOTT00l36/cYrC7MPg0XpQuTtM9ngaEoeKMqKVPFxRFH2h75AXxKxN
 mG5n0aRvkufia7vxEE7S+O+fu8pOAswzBd1EGdfWrzgJDs0K5ifjAjYlXKqbhcMU
 ZjpTpIJPm2LlmFK532DcZoTdXp2Z4J5qMza62uykzYzgeTeBC3bBPbBi5Jm/bsPi
 Lqp0VAmdgRWGdPCqoh89SOPlKZ25UxlFzyddA95UVnKDUAl/ECiltUDVmDdtO8r7
 GXzNKBE=
 =lrUL
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "A few device-specific fixes: a fix for SPDIF on old Creative PCI
  board, and two additional fixes for the recent changes in FireWire
  audio stack"

* tag 'sound-fix-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size
  ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops
  ALSA: dice: fix to wait for releases of all ALSA character devices
2018-11-02 11:02:52 -07:00
Ville Syrjälä 0019457e31 ALSA: x86: Rip out the lpe audio runtime suspend/resume hooks
Ever since commit 46e831abe8 ("drm/i915/lpe: Mark LPE audio runtime
pm as "no callbacks"") the runtime suspend/resume hooks are no longer
used. Inline them into the system suspend hooks.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181024154825.18185-2-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Takashi Iwai <tiwai@suse.de>
2018-11-02 18:25:33 +02:00
Ville Syrjälä 8dfb839cfe ALSA: x86: Fix runtime PM for hdmi-lpe-audio
Commit 46e831abe8 ("drm/i915/lpe: Mark LPE audio runtime pm as
"no callbacks"") broke runtime PM with lpe audio. We can no longer
runtime suspend the GPU since the sysfs  power/control for the
lpe-audio device no longer exists and the device is considered
always active. We can fix this by not marking the device as
active.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes: 46e831abe8 ("drm/i915/lpe: Mark LPE audio runtime pm as "no callbacks"")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181024154825.18185-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Takashi Iwai <tiwai@suse.de>
2018-11-02 18:25:33 +02:00
Kuninori Morimoto 3ee9a76a8c
ASoC: rsnd: fixup clock start checker
commit 4d230d1271 ("ASoC: rsnd: fixup not to call clk_get/set under
non-atomic") fixuped clock start timing. But it exchanged clock start
checker from ssi->usrcnt to ssi->rate.

Current rsnd_ssi_master_clk_start() is called from .prepare,
but some player (for example GStreamer) might calls it many times.
In such case, the checker might returns error even though it was not
error. It should check ssi->usrcnt instead of ssi->rate.
This patch fixup it. Without this patch, GStreamer can't switch
48kHz / 44.1kHz.

Reported-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-31 10:30:03 +00:00
Takashi Sakamoto 826b5de90c ALSA: firewire-lib: fix insufficient PCM rule for period/buffer size
In a former commit, PCM constraint based on LCM of SYT_INTERVAL was
obsoleted with PCM rule. However, the new PCM rule brings -EINVAL in
some cases that max/min values of size of buffer/period is not
multiples of one of values of SYT_INTERVAL. For example, pulseaudio
always fail to configure PCM substream.

This commit changes strategy for the PCM rule. Although the buggy rules
had a single dependency (rate from period, period from rate, rate from
buffer, buffer from rate), a revised rule has double dependencies
(period from period/rate, buffer from buffer/rate). A step of value is
calculated with table of SYT_INTERVAL and list of available rates. This
prevents interval template which brings -EINVAL to a call of
snd_interval_refine().

Fixes: 5950229582bc('ALSA: firewire-lib: add PCM rules to obsolete PCM constraints based on LCM of SYT_INTERVAL')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-30 12:22:12 +01:00
Alex Stanoev ac237c28d5 ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops
The Creative Audigy SE (SB0570) card currently exhibits an audible pop
whenever playback is stopped or resumed, or during silent periods of an
audio stream. Initialise the IZD bit to the 0 to eliminate these pops.

The Infinite Zero Detection (IZD) feature on the DAC causes the output
to be shunted to Vcap after 2048 samples of silence. This discharges the
AC coupling capacitor through the output and causes the aforementioned
pop/click noise.

The behaviour of the IZD bit is described on page 15 of the WM8768GEDS
datasheet: "With IZD=1, applying MUTE for 1024 consecutive input samples
will cause all outputs to be connected directly to VCAP. This also
happens if 2048 consecutive zero input samples are applied to all 6
channels, and IZD=0. It will be removed as soon as any channel receives
a non-zero input". I believe the second sentence might be referring to
IZD=1 instead of IZD=0 given the observed behaviour of the card.

This change should make the DAC initialisation consistent with
Creative's Windows driver, as this popping persists when initialising
the card in Linux and soft rebooting into Windows, but is not present on
a cold boot to Windows.

Signed-off-by: Alex Stanoev <alex@astanoev.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-29 16:59:06 +01:00
Takashi Sakamoto aedef16a63 ALSA: dice: fix to wait for releases of all ALSA character devices
In a development period for Linux kernel v4.20, drivers in ALSA firewire
stack were changed to wait for releases of all ALSA character devices at
.remove callback of bus driver. However, ALSA dice driver is partly out
of this change. This bug can bring fault to user process which holds
the last of character device in unplugging.

This commit fixes the driver to wait in the callback.

Fixes: 61ccc6f6b2 ('ALSA: firewire: block .remove callback of bus driver till all of ALSA character devices are released')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-27 16:52:58 +02:00
Linus Torvalds 3acbd2de6b sound updates for 4.20
There have been little changes in ALSA core stuff, but ASoC core still
 kept rolling for the continued restructuring.  The rest are lots of
 small driver-specific changes and some minor API updates.
 Here are highlights:
 
 General:
 - Appropriate fall-through annotations everywhere
 - Some code cleanup in memalloc code, handling non-cacahed pages more
   commonly in the helper
 - Deployment of SNDRV_PCM_INFO_SYNC_APPLPTR flag consistently
 
 Drivers:
 - More HD-audio CA0132 codec improvement for supporting other Creative
   boards
 - Plumbing legacy HD-audio codecs as ASoC BE on Intel SST; this will
   give move support of existing HD-audio devices with DSP
 - A few device-specific HD-audio quirks as usual
 - New quirk for RME CC devices and correction for B&W PX for USB-audio
 - FireWire: code refactoring including devres usages
 
 ASoC Core:
 - Continued componentization works; it's almost done!
 - A bunch of new for_each_foo macros
 - Cleanups and fixes in DAPM code
 
 ASoC Drivers:
 - MCLK support for several different devices, including CS42L51, STM32
   SAI, and MAX98373
 - Support for Allwinner A64 CODEC analog, Intel boards with DA7219 and
   MAX98927, Meson AXG PDM inputs, Nuvoton NAU8822, Renesas R8A7744 and
   TI PCM3060
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAlvRbLkOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9FMg//eGuq13WyoNn4OrgncGdxP4U+Dd3qXj7h6wmo
 af8ZebRSZht5jswJz5TEmYM5zR8jfKfDCN6bDKIV99Ondp9bN1vEqxBa2mUx9T/C
 mhY17dPJX0Fwdk951TkAANfOvIqECjqWj9qMI4QdigfVqVXaIxdPSnA4tKDtq6++
 Ocr4+GtC01Nmd/jWzpC4fDh9k+mwTAG0VZjeLFCjsv61U9DKbic+UcRni7YTvRGg
 pUXWNNUxIa6FMYEpsHClBJkCCUi4+ZT9nQe7Dy/W4lMq0uVBrPBqDYQJKDdjwf4p
 VEptmlhEpMcY/bG1yW7l5YOHgYs8Cx5YYygBag+3YCE6a6KItuxNp9UbgxGqZ7GD
 Svh4vPn8n4+UZfMbS04IlYvJP8bTiIfHRLkUBSHgC2egco0TjDEZiH71ucxFOq9q
 3cVKlSfLvcSMCAnUiDP18EfBq6ayGJmzJsFzU1RZLW/r+RcuMzPuwAbCuC83mlI4
 bobNLXCyEArJlvQyrAAIXrX/j4GhFzheL26hXQ96tQ9Y/nNX9tE/cL8bWtm45i4s
 +EuPnWosfZbo5JtPASosEQhilVrrOK/VmqAA6xHURKxspdqwIVyOvAa6kPLRJx8T
 LvczeX9pK3PwvZhDU+eg+HpcPNSWH8BtPvShutsNd0lp9UGBFeBUB5gc4s0iYqLq
 rMnbzwg=
 =3LrT
 -----END PGP SIGNATURE-----

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

Pull sound updates from Takashi Iwai:
 "There have been little changes in ALSA core stuff, but ASoC core still
  kept rolling for the continued restructuring. The rest are lots of
  small driver-specific changes and some minor API updates. Here are
  highlights:

  General:
  - Appropriate fall-through annotations everywhere
  - Some code cleanup in memalloc code, handling non-cacahed pages more
    commonly in the helper
  - Deployment of SNDRV_PCM_INFO_SYNC_APPLPTR flag consistently

  Drivers:
  - More HD-audio CA0132 codec improvement for supporting other Creative
    boards
  - Plumbing legacy HD-audio codecs as ASoC BE on Intel SST; this will
    give move support of existing HD-audio devices with DSP
  - A few device-specific HD-audio quirks as usual
  - New quirk for RME CC devices and correction for B&W PX for USB-audio
  - FireWire: code refactoring including devres usages

  ASoC Core:
  - Continued componentization works; it's almost done!
  - A bunch of new for_each_foo macros
  - Cleanups and fixes in DAPM code

  ASoC Drivers:
  - MCLK support for several different devices, including CS42L51, STM32
    SAI, and MAX98373
  - Support for Allwinner A64 CODEC analog, Intel boards with DA7219 and
    MAX98927, Meson AXG PDM inputs, Nuvoton NAU8822, Renesas R8A7744 and
    TI PCM3060"

* tag 'sound-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (299 commits)
  ASoC: stm32: sai: fix master clock naming
  ASoC: stm32: add clock dependency for sai
  ALSA: hda/ca0132 - Actually fix microphone issue
  ASoC: sun4i-i2s: move code from startup/shutdown hooks into pm_runtime hooks
  ASoC: wm2000: Remove wm2000_read helper function
  ASoC: cs42l51: fix mclk support
  ASoC: wm_adsp: Log addresses as 8 digits in wm_adsp_buffer_populate
  ASoC: wm_adsp: Rename memory fields in wm_adsp_buffer
  ASoC: cs42l51: add mclk support
  ASoC: stm32: sai: set sai as mclk clock provider
  ASoC: dt-bindings: add mclk support to cs42l51
  ASoC: dt-bindings: add mclk provider support to stm32 sai
  ASoC: soc-core: fix trivial checkpatch issues
  ASoC: dapm: Add support for hw_free on CODEC to CODEC links
  ASoC: Intel: kbl_da7219_max98927: minor white space clean up
  ALSA: i2c/cs8427: Fix int to char conversion
  ALSA: doc: Brush up the old writing-an-alsa-driver
  ASoC: rsnd: tidyup SSICR::SWSP for TDM
  ASoC: rsnd: enable TDM settings for SSI parent
  ASoC: pcm3168a: add hw constraint for capture channel
  ...
2018-10-25 09:00:15 -07:00
kbuild test robot 409fa67a7f
ASoC: stm32: sai: fix noderef.cocci warnings
sound/soc/stm/stm32_sai_sub.c:393:26-32: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

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

Fixes: 8307b2afd3 ("ASoC: stm32: sai: set sai as mclk clock provider")
CC: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-24 11:27:19 +01:00
Takashi Iwai de7d83da84 ASoC: Additional fixes for the next release
A couple of fixes for build bot issues in the STM32 SAI driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlvPB6ETHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0AolB/9nKMIGJqCZWWLh+Rq1dAc1k3+cOkuU
 4Culg5XaTn9uS9Tu5DJKotk8SC4zvblbC4JiQPVisuUm1EY/ADwsu92DeC3xB3w4
 iEyep1H1UzM8um/uuPe0lMWalNBFCsNRih0ZETxLh1ZK2hJlUtCYHz0n5ewmq/6R
 QVdkAtm8oMll1LhTu9x95+ozYp33IxFpDVjSDXDZcWbgg93wBZ6dUMVLeREOK+Vl
 h2H4TVgN/frJyBdKDBItCLVyL9e5ygw6UioEi4vgy08q1Kw01RKmRA86dScgBXaY
 NVCi8OAVqQKoO0j5ChISnJPX3SmVV/5f6K+0x1to5bqfGOwOmoqCbOSB
 =jBs9
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v5.0-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Additional fixes for the next release

A couple of fixes for build bot issues in the STM32 SAI driver.
2018-10-23 20:07:07 +02:00
Linus Torvalds c05f3642f4 Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar:
 "The main updates in this cycle were:

   - Lots of perf tooling changes too voluminous to list (big perf trace
     and perf stat improvements, lots of libtraceevent reorganization,
     etc.), so I'll list the authors and refer to the changelog for
     details:

       Benjamin Peterson, Jérémie Galarneau, Kim Phillips, Peter
       Zijlstra, Ravi Bangoria, Sangwon Hong, Sean V Kelley, Steven
       Rostedt, Thomas Gleixner, Ding Xiang, Eduardo Habkost, Thomas
       Richter, Andi Kleen, Sanskriti Sharma, Adrian Hunter, Tzvetomir
       Stoyanov, Arnaldo Carvalho de Melo, Jiri Olsa.

     ... with the bulk of the changes written by Jiri Olsa, Tzvetomir
     Stoyanov and Arnaldo Carvalho de Melo.

   - Continued intel_rdt work with a focus on playing well with perf
     events. This also imported some non-perf RDT work due to
     dependencies. (Reinette Chatre)

   - Implement counter freezing for Arch Perfmon v4 (Skylake and newer).
     This allows to speed up the PMI handler by avoiding unnecessary MSR
     writes and make it more accurate. (Andi Kleen)

   - kprobes cleanups and simplification (Masami Hiramatsu)

   - Intel Goldmont PMU updates (Kan Liang)

   - ... plus misc other fixes and updates"

* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (155 commits)
  kprobes/x86: Use preempt_enable() in optimized_callback()
  x86/intel_rdt: Prevent pseudo-locking from using stale pointers
  kprobes, x86/ptrace.h: Make regs_get_kernel_stack_nth() not fault on bad stack
  perf/x86/intel: Export mem events only if there's PEBS support
  x86/cpu: Drop pointless static qualifier in punit_dev_state_show()
  x86/intel_rdt: Fix initial allocation to consider CDP
  x86/intel_rdt: CBM overlap should also check for overlap with CDP peer
  x86/intel_rdt: Introduce utility to obtain CDP peer
  tools lib traceevent, perf tools: Move struct tep_handler definition in a local header file
  tools lib traceevent: Separate out tep_strerror() for strerror_r() issues
  perf python: More portable way to make CFLAGS work with clang
  perf python: Make clang_has_option() work on Python 3
  perf tools: Free temporary 'sys' string in read_event_files()
  perf tools: Avoid double free in read_event_file()
  perf tools: Free 'printk' string in parse_ftrace_printk()
  perf tools: Cleanup trace-event-info 'tdata' leak
  perf strbuf: Match va_{add,copy} with va_end
  perf test: S390 does not support watchpoints in test 22
  perf auxtrace: Include missing asm/bitsperlong.h to get BITS_PER_LONG
  tools include: Adopt linux/bits.h
  ...
2018-10-23 13:32:18 +01:00
Ingo Molnar dda93b4538 Merge branch 'x86/cache' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-10-23 12:30:19 +02:00
Olivier Moysan 6be0f96d79
ASoC: stm32: sai: fix master clock naming
Fixes: 8307b2afd3 ("ASoC: stm32: sai: set sai as mclk clock provider")

Fix warning issued by strncat when bound equals to source length.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-23 10:51:45 +01:00
Olivier Moysan e6d7942ce6
ASoC: stm32: add clock dependency for sai
Fixes: 8307b2afd3 ("ASoC: stm32: sai: set sai as mclk clock provider")

Add COMMON_CLK dependency for STM32 SAI,
as it is required by clock provider.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-23 10:51:44 +01:00
Takashi Iwai 5e3cdecf78 ASoC: Updates for v5.0/v4.20
As ever there's a lot of small and driver specific changes going on
 here, but we do also have some relatively large changes in the core
 thanks to the hard work of Charles and Morimoto-san:
 
  - More component transitions from Morimoto-san, I think we're about
    finished with this.  Thanks for all the hard work!
  - Morimoto-san also added a bunch of for_each_foo macros
  - A bunch of cleanups and fixes for DAPM from Charles.
  - MCLK support for several different devices, including CS42L51, STM32
    SAI, and MAX98373.
  - Support for Allwinner A64 CODEC analog, Intel boards with DA7219 and
    MAX98927, Meson AXG PDM inputs, Nuvoton NAU8822, Renesas R8A7744 and
    TI PCM3060.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlvNuPoTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0CsxB/91P2RgcUhBSkPO3jsFSerc+RccqD8j
 XogqjC62V2T3xqVUYtqqLf0dZFKUPFNoFitN2XdNU36H55DVI+3wxxmwObc64RIc
 uB6ptQuwFz7vGeF6r6GWFUAZ7MB518dq/oZYRKrjAW49Lt2YiCD0HJ2gi+0Hm66A
 53I7SLH3Q386UHDd+dl7+9BN7gPt0OIKAdsc/Vq7BDYvP+cNEm+YYjXGwaHjLLEC
 o8vmj8Ny6x0dytdYuQ/XuekBhGopcfqTbWTpTu43/jCd5rumQXQY2g9CC1eRMlEJ
 cm1hOjAErmKkkg2S84B1cMAvK23Szu36sPyeCphSQWOhlL4CFPVyJqic
 =9A07
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v5.0/v4.20

As ever there's a lot of small and driver specific changes going on
here, but we do also have some relatively large changes in the core
thanks to the hard work of Charles and Morimoto-san:

 - More component transitions from Morimoto-san, I think we're about
   finished with this.  Thanks for all the hard work!
 - Morimoto-san also added a bunch of for_each_foo macros
 - A bunch of cleanups and fixes for DAPM from Charles.
 - MCLK support for several different devices, including CS42L51, STM32
   SAI, and MAX98373.
 - Support for Allwinner A64 CODEC analog, Intel boards with DA7219 and
   MAX98927, Meson AXG PDM inputs, Nuvoton NAU8822, Renesas R8A7744 and
   TI PCM3060.
2018-10-22 23:26:37 +02:00
Connor McAdams b5a229350b ALSA: hda/ca0132 - Actually fix microphone issue
This patch fixes the microphone issue for all cards. The previous fix
worked on the ZxR, but not on the AE-5 or Z. This patch has been tested
to work for all cards.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-22 00:14:11 +02:00
Mark Brown 65dfb6d6dd
Merge branch 'asoc-4.20' into asoc-next 2018-10-21 16:59:23 +01:00
Mark Brown 576b354ac2
Merge branch 'asoc-4.19' into asoc-linus 2018-10-21 16:59:19 +01:00
Vasily Khoruzhick 7f91e2af1a
ASoC: sun4i-i2s: move code from startup/shutdown hooks into pm_runtime hooks
startup() and shutdown() hooks are called for both substreams,
so stopping either substream when another is running breaks the
latter.

E.g. playback breaks if capture is stopped when playback is running.

Move code from startup() and shutdown() to resume() and suspend()
hooks respectively to fix this issue

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-21 16:46:32 +01:00
Mark Brown ae2399c48c
Merge remote-tracking branches 'regmap/topic/noinc' and 'regmap/topic/single-rw' into regmap-next 2018-10-21 12:07:26 +01:00
Lucas Tanure c5d09485de
ASoC: wm2000: Remove wm2000_read helper function
The return type "unsigned int" was used by the wm2000_read()
function despite of the aspect that it will eventually return
a negative error code.
The resulting function doesn't add much to the code, so replace
wm2000_read with regmap_read.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-21 12:04:38 +01:00
Olivier Moysan 318e741ee1
ASoC: cs42l51: fix mclk support
The MCLK clock is made optional for cs42l51 codec.
However, ASoC DAPM clock supply widget, expects the clock to be defined
unconditionally.
Register MCLK DAPM conditionally in codec driver,
depending on clock presence in DT.

Fixes: 5e8d63a726 ("ASoC: cs42l51: add mclk support")
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 17:06:07 +01:00
Mark Brown 7ece50c9f7
Merge remote-tracking branch 'asoc/for-4.19' into asoc-4.20 2018-10-19 13:31:41 +01:00
Richard Fitzgerald e3a360b8cd
ASoC: wm_adsp: Log addresses as 8 digits in wm_adsp_buffer_populate
Increase the address value width in the debug log from 4 digits to
8 digits to allow for DSP cores with larger memory address ranges.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 13:30:50 +01:00
Richard Fitzgerald 2a2aefa41c
ASoC: wm_adsp: Rename memory fields in wm_adsp_buffer
The wm_adsp_buffer struct is the control header of a circular
buffer used to transfer data from the firmware over the
control interface to an ALSA compressed stream.

The original names of the fields pointing to the data buffer
were based on ADSP2V2 memory layout where they correspond to
{XM, XM, YM}. But this circular buffer could be used on other
types of DSP core that have different memory region types.
Also the names and description of the size fields were not
very clear. The field names and descriptions have been changed
to be generic and not imply any particular memory types.

This patch updates the wm_adsp driver to the new field names.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 13:30:49 +01:00
Olivier Moysan 5e8d63a726
ASoC: cs42l51: add mclk support
Add MCLK dapm to allow configuration of cirrus CS42l51
codec as a master clock consumer.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 13:12:21 +01:00
Olivier Moysan 8307b2afd3
ASoC: stm32: sai: set sai as mclk clock provider
Add master clock generation support in STM32 SAI.
The master clock provided by SAI can be used to feed a codec.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 13:12:07 +01:00
Marcel Ziswiler 2c7b696a75
ASoC: soc-core: fix trivial checkpatch issues
Fix a few trivial aka cosmetic only checkpatch issues like long lines,
wrong indentations, spurious blanks and newlines, missing newlines,
multi-line comments etc.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 13:09:29 +01:00
Charles Keepax 3c01b0e129
ASoC: dapm: Add support for hw_free on CODEC to CODEC links
Currently, on power down for a CODEC to CODEC DAI link we only call
digital_mute and shutdown. Provide a little more flexibility for drivers
by adding a call to hw_free as well.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 13:08:27 +01:00
Dan Carpenter 9ab2a1bd81
ASoC: Intel: kbl_da7219_max98927: minor white space clean up
I just added a couple missing tabs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 12:39:00 +01:00
Philipp Klocke eb7ebfa3c1 ALSA: i2c/cs8427: Fix int to char conversion
Compiling with clang yields the following warning:

sound/i2c/cs8427.c:140:31: warning: implicit conversion from 'int'
to 'char' changes value from 160 to -96 [-Wconstant-conversion]
    data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
            ~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

Because CS8427_REG_AUTOINC is defined as 128, it is too big for a
char field.
So change data from char to unsigned char, that it can hold the value.

This patch does not change the generated code.

Signed-off-by: Philipp Klocke <philipp97kl@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-18 15:44:08 +02:00
Kuninori Morimoto 2eaa6e2330
ASoC: rsnd: tidyup SSICR::SWSP for TDM
R-Car datasheet is indicating that WS output settings of SSICR::SWSP
is inverted on TDM mode from non TDM mode settings.
But, it is meaning that TDM should use 0 here.
Without this patch, sound input/output 1ch will be 2ch, 2ch will be 3ch
..., be jumbled on I2S + TDM settings. This patch fixup it.
This patch is tested on R-Car H3 ulcb-kf board, SSI3/4 TDM sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 20:01:31 +01:00
Kuninori Morimoto 6817d7593f
ASoC: rsnd: enable TDM settings for SSI parent
Some SSIs are sharing each pins (= WS/CLK pin for playback/capture).
Then, SSI parent needs control WS/CLK setting for SSI slave.
In such case, SSI parent needs TDM settings if SSI slave is working as
TDM mode. But it is not cared in current driver.
It can't capture TDM sound without this patch if SSIs were pin sharing.
This patch is tested on R-Car H3 ulcb-kf board, SSI3/4 with TDM sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 20:01:30 +01:00
Kuninori Morimoto 4e9e07c567
ASoC: pcm3168a: add hw constraint for capture channel
LEFT_J / I2S only can use TDM.
commit 594680ea4a ("ASoC: pcm3168a: add hw constraint for channel")
commit 3809688980 ("ASoC: pcm3168a: add HW constraint for non
RIGHT_J") added channel constraint for it, but, it was only for playback.
This patch adds constraint for capture.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 20:01:29 +01:00
Daniel Mack fce9ec954a
ASoC: sta32x: Add support for XTI clock
The STA32x chips feature an XTI clock input that needs to be stable before
the reset signal is released. Therefore, the chip driver needs to get a
handle to the clock. Instead of relying on other parts of the system to
enable the clock, let the codec driver grab a handle itself.

In order to keep existing boards working, clock support is made optional.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 20:01:25 +01:00
David Lin 1e3cb6c321
ASoC: nau8822: new codec driver
Add driver for NAU88C22.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 19:53:37 +01:00
Marcel Ziswiler a85227da2d
ASoC: tegra_sgtl5000: fix device_node refcounting
Similar to the following:

commit 4321723648 ("ASoC: tegra_alc5632: fix device_node refcounting")

commit 7c5dfd5496 ("ASoC: tegra: fix device_node refcounting")

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 19:51:22 +01:00
Vasily Khoruzhick 7e95aac96b
ASoC: sunxi: allow the sun8i-codec driver to be built on ARM64
Allwinner A64 uses the same digital codec part as in A33, so we need
to build this driver on ARM64 as well.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 11:11:02 +01:00
Vasily Khoruzhick 42371f327d
ASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls
The internal codec on A64 is split into 2 parts. The analog path controls
are routed through an embedded custom register bus accessed through
the PRCM block.

Add an ASoC component driver for it. This should be tied to the codec
audio card as an auxiliary device.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 11:11:01 +01:00
Vasily Khoruzhick 55b407f646
ASoC: sun8i-codec-analog: split regmap code into separate driver
It will be reused by sun50i-codec-analog later.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 11:10:59 +01:00
Vasily Khoruzhick 13c3bf174b
ASoC: sun8i-codec: Don't hardcode BCLK / LRCK ratio
BCLK / LRCK ratio should be sample size * channels, but it was
hardcoded to 32 (0x1 is 32 as per A33 and A64 datasheets).

Calculate it basing on sample size and number of channels.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 11:10:58 +01:00
Marcus Cooper 66ecce3325
ASoC: sun4i-i2s: Add compatibility with A64 codec I2S
The I2S block used for the audio codec in the A64 differs from other 3
I2S modules in A64 and isn't compatible with H3. But it is very similar
to what is found in A10(sun4i). However, its TX FIFO is
located at a different address.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 11:10:57 +01:00
Christoph Hellwig 3b99103849
ASoC: intel: don't pass GFP_DMA32 to dma_alloc_coherent
The DMA API does its own zone decisions based on the coherent_dma_mask.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-17 11:10:48 +01:00
Hans de Goede 5cb6b5fc01 ALSA: hda: Add 2 more models to the power_save blacklist
Power-saving is causing plops on audio start/stop on Dell Precision T3600
laptops and Intel DZ77BH boards, add these to the power_save blacklist.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-16 12:39:00 +02:00
Mac Chiang 6530adeaaf
ASoC: Intel: common: Add Kabylake Dialog+Maxim machine driver entry
This patch adds da7219_max98927 machine driver entry into
machine table

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-15 12:02:37 +01:00
Mac Chiang bca0ac1d96
ASoC: Intel: Boards: Add KBL Dialog Maxim I2S machine driver
This patch adds Kabylake I2S machine driver with:
DA7219 audio codec(SSP1) and MAXIM98927(SSP0) speaker amplifier.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-15 12:02:28 +01:00
Akshu Agrawal 2657c6a903
ASoC: AMD: Add SND_JACK_LINEOUT jack type
Some 3 pole connectors report impedance greater than threshold of
1000Ohm. Thus, da7219 reports them as LINEOUT.
Adding the SND_JACK_LINEOUT type so that we don't fail to detect
any 3 pole jack type.
Also, changing
SND_JACK_HEADPHONE | SND_JACK_MICROPHONE -> SND_JACK_HEADSET

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-15 12:01:32 +01:00
Christoph Hellwig 23fdf223bb ALSA: asihpi: don't pass GFP_DMA32 to dma_alloc_coherent
The DMA API does its own zone decisions based on the coherent_dma_mask.

[ Note: as the driver doesn't set the DMA coherent mask, we can assume
  the default 32bit DMA, hence it should be safe to drop the flag here
  -- tiwai ]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-14 09:40:24 +02:00
Kuninori Morimoto 471a7ba891
ASoC: pcm3168a: add I2S/Left_J TDM support
pcm3168a is supporting TDM on I2S/Left_J, but there is no
settings for it. This patch add it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-12 18:52:08 +02:00
Kuninori Morimoto 594680ea4a
ASoC: pcm3168a: add hw constraint for channel
LEFT_J / I2S only can use TDM.
This patch adds channel constraint for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-12 18:52:07 +02:00
Kuninori Morimoto 3809688980
ASoC: pcm3168a: add HW constraint for non RIGHT_J
RIGHT_J only can handle 16bit data bits.
Current driver just errored if user requests non RIGHT_J
+ 16bit combination. But it is not useful for user.
This patch adds HW constraint for it, and avoid
error on such situation.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-12 18:52:06 +02:00
Daniel Mack 747df19747
ASoC: sta32x: set ->component pointer in private struct
The ESD watchdog code in sta32x_watchdog() dereferences the pointer
which is never assigned.

This is a regression from a1be4cead9 ("ASoC: sta32x: Convert to direct
regmap API usage.") which went unnoticed since nobody seems to use that ESD
workaround.

Fixes: a1be4cead9 ("ASoC: sta32x: Convert to direct regmap API usage.")
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2018-10-12 18:48:40 +02:00
Takashi Iwai 68da4fa51a ALSA: au88xx: Add fall-through annotations
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotation in au88xx driver.

Although the usages in both both functions vortex_adbdma_setbuffers()
and vortex_wtdma_setbuffers() look a bit suspicious, we keep the
behavior as before, just to be safer.  If it were broken, we should
have already received bug reports.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 09:31:34 +02:00
Takashi Iwai 74ce5a46bb ALSA: opti92xx-ad1848: Use the standard fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation
at the right places.  They have to be put right before the next
labels.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 09:31:32 +02:00
Takashi Iwai e8c92251a8 ALSA: seq: oss: Use the standard fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation.
Unfortunately gcc doesn't understand a chattier text.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 09:31:29 +02:00
Takashi Iwai 590b516e25 ALSA: caiaq: Add fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotation in caiaq driver.
Note that this seems necessary to be put exactly before the next
label, so it's outside the ifdef block.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 09:31:26 +02:00
Takashi Iwai 3c4cfa7bf6 ALSA: memalloc: Add fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotation in
snd_dma_alloc_pages().  Note that this seems necessary to be put
exactly before the next label, so it's outside the ifdef block.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 09:31:23 +02:00
Takashi Sakamoto e953c7ecdf ALSA: firewire-motu: add missing entries to Kconfig
MOTU Traveler and Audio Express are supported as well.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 09:25:27 +02:00
Takashi Sakamoto 51e68fb092 ALSA: isight: fix leak of reference to firewire unit in error path of .probe callback
In some error paths, reference count of firewire unit is not decreased.
This commit fixes the bug.

Fixes: 5b14ec25a79b('ALSA: firewire: release reference count of firewire unit in .remove callback of bus driver')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 08:08:04 +02:00
Jeremy Cline e7bb6ad568 ALSA: hda - Add mic quirk for the Lenovo G50-30 (17aa:3905)
The Lenovo G50-30, like other G50 models, has a Conexant codec that
requires a quirk for its inverted stereo dmic.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1249364
Reported-by: Alexander Ploumistos <alex.ploumistos@gmail.com>
Tested-by: Alexander Ploumistos <alex.ploumistos@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-12 08:07:17 +02:00
Ryan Lee a23f5dc844
ASoC: max98373: Sort DHT Rot Pnt Volume in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-11 15:37:39 +01:00
Ryan Lee d34c8f37c7
ASoC: max98373: Sort max98373_bde_gain_tlv in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-11 15:37:38 +01:00
Ryan Lee 6c3beeca42
ASoC: max98373: Sort BDE Limiter Thresh Volume in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-11 15:37:38 +01:00
Ryan Lee 4cbbc91609
ASoC: max98373: Sort Digital Volume in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-11 15:37:36 +01:00
Kuninori Morimoto 8036dbc490
ASoC: audio-graph-card: enable mclk-fs on codec node
Current audio-graph-card is supporting mclk-fs on CPU node
side only. But having Codec node also is good idea.
It will be just ignored if not defined.

"rcpu_ep" is same as "cpu_ep", This patch tidyup it, too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-10 13:28:06 +01:00
Kuninori Morimoto 82ab7e9a4d
ASoC: rsnd: use 32bit TDM width as default
commit fb2815f44a ("ASoC: rsnd: add support for 16/24 bit slot widths")
added TDM width check, and return error if it was not 16/24/32 bit.
But it is too strict. This patch uses 32bit same as default.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-10 13:28:05 +01:00
Arnd Bergmann 9641faa2db
ASoC: max98988: add I2C dependency
max98988 only builds with I2C support enabled, otherwise we get a build error:

sound/soc/codecs/max98088.c:1789:1: error: data definition has no type or storage class [-Werror]
 module_i2c_driver(max98088_i2c_driver);
 ^~~~~~~~~~~~~~~~~
sound/soc/codecs/max98088.c:1789:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]
sound/soc/codecs/max98088.c:1789:1: error: parameter names (without types) in function declaration [-Werror]
sound/soc/codecs/max98088.c:1780:26: error: 'max98088_i2c_driver' defined but not used [-Werror=unused-variable]

Fixes: 24ae67c582 ("ASoC: max98988: make it selectable")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-10 13:27:46 +01:00
Takashi Sakamoto 3babca4555 ALSA: firewire: simplify cleanup process when failing to register sound card
In former commits, .private_free callback releases resources just for
data transmission. This release function can be called without the
resources are actually allocated in error paths.

This commit applies a small refactoring to clean up codes in error
paths.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10 12:11:50 +02:00
Takashi Sakamoto 873608dc6b ALSA: bebob/fireworks: simplify handling of local device entry table
In drivers of ALSA firewire stack, bebob and fireworks drivers have
local device entry table. At present, critical section to operate the
table is from the beginning/end of 'do_registration' call. This can be
more narrow and simplify codes.

This commit applies small refactoring for the above purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10 12:11:47 +02:00
Takashi Sakamoto 5b14ec25a7 ALSA: firewire: release reference count of firewire unit in .remove callback of bus driver
In a previous commit, drivers in ALSA firewire stack blocks .remove
callback of bus driver. This enables to release members of private
data in the callback after releasing device of sound card.

This commit simplifies codes to release the members.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10 12:11:41 +02:00
Takashi Sakamoto 61ccc6f6b2 ALSA: firewire: block .remove callback of bus driver till all of ALSA character devices are released
At present, in .remove callback of bus driver just decrease reference
count of device for ALSA card instance. This delegates release of the
device to a process in which the last of ALSA character device is
released.

On the other hand, the other drivers such as for devices on PCIe are
programmed to block .remove callback of bus driver till all of ALSA
character devices are released.

For consistency of behaviour for whole drivers, this probably confuses
users. This commit takes drivers in ALSA firewire stack to imitate the
above behaviour.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10 12:11:34 +02:00
Hui Wang d06fb562bf ALSA: hda/realtek - Fix the problem of the front MIC on the Lenovo M715
The front MIC on the Lenovo M715 can't record sound, after applying
the ALC294_FIXUP_LENOVO_MIC_LOCATION, the problem is fixed. So add
the pin configuration of this machine to the pin quirk table.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10 08:59:52 +02:00
Takashi Iwai 5b7c5e1f4c ALSA: hda - Fix headphone pin config for ASUS G751
BIOS on ASUS G751 doesn't seem to map the headphone pin (NID 0x16)
correctly.  Add a quirk to address it, as well as chaining to the
previous fix for the microphone.

Reported-by: HÃ¥vard <hovardslill@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-09 16:22:21 +02:00
Connor McAdams 7a2dc84fc4 ALSA: hda/ca0132 - Fix input effect controls for desktop cards
This patch removes the echo cancellation control for desktop cards, and
makes use of the special 0x47 SCP command for noise reduction.

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-10-09 16:20:50 +02:00
Connor McAdams 1502b43278 ALSA: hda/ca0132 - Add error checking in ca0132_build_controls()
This patch adds error checking to functions creating controls inside of
ca0132_build_controls().

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-10-09 16:20:44 +02:00
Connor McAdams ebabde1e18 ALSA: hda/ca0132 - Clean up patch_ca0132()
This patch cleans up the patch_ca0132() function with suggestions from
Takashi Sakamoto.

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-10-09 16:20:38 +02:00
Connor McAdams a88bcc8d96 ALSA: hda/ca0132 - Fix microphone inconsistency issues
This patch fixes microphone inconsistency issues by adding a delay to
each setup_defaults function. Without this, the microphone only works
intermittently.

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-10-09 16:20:24 +02:00
Marco Felsch 24ae67c582
ASoC: max98988: make it selectable
Currently the driver will build only if SND_SOC_ALL_CODECS is set.
Adding a Kconfig menu description to build the driver standalone.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-08 19:46:36 +01:00
Andreas Färber 62a7fc32a6
ASoC: max98088: Add master clock handling
If master clock is provided through device tree, then update
the master clock frequency during set_sysclk.

Cc: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Tushar Behera <trblinux@gmail.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
[m.felsch@pengutronix.de: move mclk request to i2c_probe]
[m.felsch@pengutronix.de: make use of snd_soc_component_get_bias_level()]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-08 19:46:15 +01:00
Daniel Mack 7454a21c13
ASoC: wm8782: add support for regulators
Lookup regulators for Vdd and Vdda during probe, and enable them when the
component is linked.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-08 11:25:57 +01:00
Takashi Iwai 40c516757b ALSA: hda - Add ASUS G751 quirk model entry
Add a corresponding model list entry for ASUS G751 so that user can
test the quirk for another compatible machines more easily.

Reported-and-tested-by: HÃ¥vard <hovardslill@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-07 09:49:24 +02:00
Takashi Iwai 11ba611116 ALSA: hda - Add quirk for ASUS G751 laptop
ASUS G751 requires the extra COEF initialization to make it microphone
working properly.

Reported-and-tested-by: HÃ¥vard <hovardslill@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-07 09:47:30 +02:00
Takashi Iwai 9c6c4d961e
ASoC: topology: Use the standard fall-through annotations
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation.
gcc can't understand the mixed texts, unfortunately.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-05 12:38:22 +01:00
Takashi Iwai e4bfd61571
ASoC: intel: skylake: Add fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotation in Intel SST
skylake driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-05 12:38:21 +01:00
Takashi Iwai 0beeb4baf5
ASoC: rt274: Add fall-through annotations
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotations in rt274 driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-05 12:38:20 +01:00
Takashi Iwai 641f7f2195
ASoC: pcm186x: Use the standard fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation.
Unfortunately gcc doesn't understand the mixed comment lines.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-05 12:38:19 +01:00
Takashi Iwai 7e29317928
ASoC: adau1761: Use the standard fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation
at the right place.  It has to be put right before the next label.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-05 12:38:18 +01:00
Jussi Laako d39f1d68fe ALSA: usb-audio: Add custom mixer status quirks for RME CC devices
Adds several vendor specific mixer quirks for RME's Class Compliant
USB devices. These provide extra status information from the device
otherwise not available.

These include AES/SPDIF rate and status information, current system
sampling rate and measured frequency. This information is especially
useful in cases where device's clock is slaved to external clock
source.

Signed-off-by: Jussi Laako <jussi@sonarnerd.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-05 10:18:59 +02:00
Nicolas Huaman c369c8db15 ALSA: usb-audio: update quirk for B&W PX to remove microphone
A quirk in snd-usb-audio was added to automate setting sample rate to
4800k and remove the previously exposed nonfunctional microphone for
the Bowers & Wilkins PX:
commit 240a8af929
https://lore.kernel.org/patchwork/patch/919689/

However the headphones where updated shortly after that to remove the
unintentional microphone functionality. I guess because of this the
headphones now crash when connecting them via USB while the quirk is
active. Dmesg:

snd-usb-audio: probe of 2-3:1.0 failed with error -22
usb 2-3: 2:1: cannot get min/max values for control 2 (id 2)

This patch removes the microfone and allows the headphones to connect
and work out of the box. It is based on the current mainline kernel
 and successfully applied an tested on my machine (4.18.10.arch1-1).

Fixes: 240a8af929 ("ALSA: usb-audio: Add a quirck for B&W PX headphones")
Signed-off-by: Nicolas Huaman <nicolas@herochao.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 22:52:40 +02:00
Michael Pobega d153135e93 ALSA: hda/sigmatel - Disable automute for Elo VuPoint
The Elo VuPoint 15MX has two headphone jacks of which neither work by
default. Disabling automute allows ALSA to work normally with the
speakers & left headphone jack.

Future pin configuration changes may be required in the future to get
the right headphone jack working in tandem.

Signed-off-by: Michael Pobega <mpobega@neverware.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 21:22:47 +02:00
Takashi Iwai 6aea5702e2 ALSA: rawmidi: A lightweight function to discard pending bytes
For discarding the pending bytes on rawmidi, we process with a loop of
snd_rawmidi_transmit() which is just a waste of CPU power.
Implement a lightweight API function to discard the pending bytes and
the proceed the ring buffer instantly, and use it instead of open
codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 20:13:17 +02:00
Daniel Mack 466dee75b3
ASoC: add fault detect recovery property to DT bindings
The driver already has support for setting the FDRB bit in the CONFA
register through platform data, but there was no property to set it
in the device-tree bindings.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-04 11:41:52 +01:00
Daniel Mack cfe9ee5f2b
ASoC: pxa-ssp: enable and disable extclk if given
If a "extclk" clock is given, enable and disable it when appropriate.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-04 11:41:38 +01:00
Dan Carpenter 8e9f7265ed
ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()
The q6asm_audio_client_alloc() doesn't return NULL, it returns error
pointers.

Fixes: 2a9e92d371 ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-04 11:38:49 +01:00
Takashi Iwai 9c80c5a883
ASoC: intel: skylake: Add missing break in skl_tplg_get_token()
skl_tplg_get_token() misses a break in the big switch() block for
SKL_TKN_U8_CORE_ID entry.
Spotted nicely by -Wimplicit-fallthrough compiler option.

Fixes: 6277e83292 ("ASoC: Intel: Skylake: Parse vendor tokens to build module data")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-04 11:36:35 +01:00
Takashi Sakamoto cd3b7116b5 ALSA: oxfw: use managed-resource to maintain cache of stream formats
ALSA oxfw driver allocates memory objects for cache of stream formats.
The objects are used to maintain packet streaming by components for
ALSA rawMIDI/PCM interface. They can be released as managed-resource
of 'struct snd_card.card_dev'.

This commit uses managed-resource of the sound card device for this
purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 07:54:09 +02:00
Takashi Sakamoto 72bc8c4378 ALSA: oxfw: use managed-resource to maintain model-specific data
ALSA oxfw driver allocates memory objects for data specific to some
models. These objects are used to maintain functionalities specific
to the models for ALSA rawMIDI/control interfaces. They can be
released as managed-resource of 'struct snd_card.card_dev'.

This commit uses managed-resource of the sound card device for this
purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 07:54:08 +02:00
Takashi Sakamoto 784fffbcfe ALSA: fireworks: use managed-resource to maintain response buffer
ALSA fireworks driver allocates memory object to handle response from
target unit. The object is used to initiate transaction unique to
Fireworks board module. This can be released as managed-resource
of 'struct snd_card.card_dev'.

This commit uses managed-resource of the sound card device for this
purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 07:54:07 +02:00
Takashi Sakamoto a3aaf7d2bd ALSA: bebob: use managed-resource to maintain data specific to M-Audio FW-1814/ProjectMix I/O
ALSA bebob driver allocates memory object for data specific to M-Audio
FW-1884/ProjectMix I/O. The object is to maintain format of isochronous
packet payload for packet streaming by components for ALSA rawMIDI/PCM
interfaces. The object can be released as managed-resource of
'struct snd_card.card_dev'.

This commit uses managed-resource of the sound card device for this
purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 07:54:05 +02:00
Takashi Sakamoto 366a20d7a7 ALSA: firewire: use managed-resource of fw unit device for private data
At present, private data of each driver in ALSA firewire stack is
allocated/freed by kernel slab allocator for corresponding unit on
IEEE 1394 bus. In this case, resource-managed slab allocator is
available to release memory object automatically just before releasing
device structure for the unit. This idea can prevent runtime from
memory leak due to programming mistakes.

This commit uses the allocator for the private data. These drivers
already use reference counter to maintain lifetime of device structure
for the unit by a pair of fw_unit_get()/fw_unit_put(). The private data
is safely released in a callback of 'struct snd_card.private_free().

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 07:54:01 +02:00
Takashi Iwai 4a9a72e0db Merge branch 'for-linus' into for-next
Back-merge 4.19-devel branch into 4.20 for applying FireWire patches
cleanly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 07:53:06 +02:00
Kai-Heng Feng 709ae62e8e ALSA: hda/realtek - Cannot adjust speaker's volume on Dell XPS 27 7760
The issue is the same as commit dd9aa335c8 ("ALSA: hda/realtek - Can't
adjust speaker's volume on a Dell AIO"), the output requires to connect
to a node with Amp-out capability.

Applying the same fixup ALC298_FIXUP_SPK_VOLUME can fix the issue.

BugLink: https://bugs.launchpad.net/bugs/1775068
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04 07:50:48 +02:00
Gustavo A. R. Silva 2e75b676c3 ALSA: intel8x0: Fix fall-through annotations
Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-03 17:42:55 +02:00
Gustavo A. R. Silva fe1a10bab2 ALSA: sb8: Fix fall-through annotations
Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02 17:38:40 +02:00
Takashi Sakamoto 5950229582 ALSA: firewire-lib: add PCM rules to obsolete PCM constraints based on LCM of SYT_INTERVAL
In blocking mode of IEC 61883-1/6, when one isochronous packet includes
data for events, the data is for the same number of events as
SYT_INTERVAL decided according to sampling transmission frequency (SFC).

IEC 61883-1/6 engine of ALSA firewire stack applies constraints of
period and buffer size of PCM intermediate buffer of PCM substream.
At present, this constraint is designed to round the size up/down to
32 frames. This value comes from the least common multiple (LCM) of
SYT_INTERVAL. Although this looks to work well, in lower sampling
rate, applications are not allowed to set size of period quite near
period time constraint (at present 5 msec per period).

This commit adds PCM rules for period/buffer size and rate to obsoletes
the constraints based on LCM.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02 17:28:29 +02:00
Connor McAdams 96395e86e3 ALSA: hda/ca0132 - Add ZxR exit commands
This patch adds exit operations for the Sound Blaster ZxR.

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-10-02 17:22:11 +02:00
Connor McAdams d51434d43a ALSA: hda/ca0132 - Add ZxR 600 ohm gain control
This patch adds a control for 600 ohm gain on the Sound Blaster ZxR.

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-10-02 17:21:52 +02:00
Connor McAdams 76dea4dbf0 ALSA: hda/ca0132 - Remove input select enum for ZxR
This patch removes the input select control for the ZxR, as it only has
one input option, rear microphone.

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-10-02 17:21:44 +02:00
Connor McAdams 5584594942 ALSA: hda/ca0132 - Add ZxR input/output select commands
This patch adds commands for selecting input and output on the Sound
Blaster ZxR. The ZxR has no front panel header, and has line-in on the
separate daughter board, so it only does rear-mic.

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-10-02 17:21:30 +02:00
Connor McAdams c25c73e06a ALSA: hda/ca0132 - Add ZxR DSP post-download commands
This patch adds commands for setting up the ZxR after the DSP is
downloaded. The ZxR already shares most of the post-download commands
from the regular Sound Blaster Z.

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-10-02 17:21:16 +02:00
Connor McAdams 2e492b8ee5 ALSA: hda/ca0132 - Add ZxR init commands
This patch adds init commands for the main Sound Blaster ZxR card.

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-10-02 17:21:02 +02:00
Connor McAdams 7675a2a939 ALSA: hda/ca0132 - Add DBpro hda_codec_ops
This patch adds separate hda_codec_ops for the DBPro daughter board, as
it behaves more like a generic HDA codec than the other ca0132 cards,
despite having a ca0132 on board.

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-10-02 17:20:47 +02:00
Connor McAdams 6dcd7244a2 ALSA: hda/ca0132 - Add ZxR pincfg
This patch adds a pincfg for the ZxR, and defines which pins are used
for both.

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-10-02 17:20:31 +02:00
Connor McAdams b29733db3b ALSA: hda/ca0132 - Add ZxR quirks + new quirk check function
This patch adds quirk ID's for the ZxR and it's daughter board, the
DBPro. It also adds a function for determining the quirk for each board
through HDA subsytem ID's instead of PCI subsystem ID's.

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-10-02 17:20:17 +02:00
Connor McAdams 8e6bc6b3aa ALSA: hda/ca0132 - Fix surround sound with output effects
This patch fixes an issue where if surround sound was the selected
output and output effects were enabled, the sound wasn't sent to all
channels correctly.

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-10-02 17:19:54 +02:00
Connor McAdams 4b432ad4ca ALSA: hda/ca0132 - Fix AE-5 control type
This patch corrects the control type of the additional AE-5 controls
added in a previous patch from HDA_INPUT to HDA_OUTPUT.

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-10-02 17:19:17 +02:00
Keyon Jie c32bf867cb ALSA: hda: Fix mismatch for register mask and value in ext controller.
E.g. for snd_hdac_ext_bus_link_power_up(), we should set mask to be
AZX_MLCTL_SPA(it was 0), and AZX_MLCTL_SPA as value to power up it,
here correct it and several similar mismatches.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-02 17:10:48 +02:00
Peter Zijlstra f2c4db1bd8 x86/cpu: Sanitize FAM6_ATOM naming
Going primarily by:

  https://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors

with additional information gleaned from other related pages; notably:

 - Bonnell shrink was called Saltwell
 - Moorefield is the Merriefield refresh which makes it Airmont

The general naming scheme is: FAM6_ATOM_UARCH_SOCTYPE

  for i in `git grep -l FAM6_ATOM` ; do
	sed -i  -e 's/ATOM_PINEVIEW/ATOM_BONNELL/g'		\
		-e 's/ATOM_LINCROFT/ATOM_BONNELL_MID/'		\
		-e 's/ATOM_PENWELL/ATOM_SALTWELL_MID/g'		\
		-e 's/ATOM_CLOVERVIEW/ATOM_SALTWELL_TABLET/g'	\
		-e 's/ATOM_CEDARVIEW/ATOM_SALTWELL/g'		\
		-e 's/ATOM_SILVERMONT1/ATOM_SILVERMONT/g'	\
		-e 's/ATOM_SILVERMONT2/ATOM_SILVERMONT_X/g'	\
		-e 's/ATOM_MERRIFIELD/ATOM_SILVERMONT_MID/g'	\
		-e 's/ATOM_MOOREFIELD/ATOM_AIRMONT_MID/g'	\
		-e 's/ATOM_DENVERTON/ATOM_GOLDMONT_X/g'		\
		-e 's/ATOM_GEMINI_LAKE/ATOM_GOLDMONT_PLUS/g' ${i}
  done

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: dave.hansen@linux.intel.com
Cc: len.brown@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-10-02 10:14:32 +02:00
YueHaibing 06da26e5ce
ASoC: qcom: qdsp6: remove duplicated include
Remove duplicated includes linux/of_platform.h
and linux/wait.h

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-27 23:25:03 +01:00
Arnd Bergmann 18380dcc52
ASoC: wm9712: fix unused variable warning
The 'ret' variable is now only used in an #ifdef, and causes a
warning if it is declared outside of that block:

sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':
sound/soc/codecs/wm9712.c:641:6: error: unused variable 'ret' [-Werror=unused-variable]

Fixes: 2ed1a8e0ce ("ASoC: wm9712: add ac97 new bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-27 23:22:54 +01:00
Arnd Bergmann 53c156ab9d
ASoC: atmel: add SND_SOC_I2C_AND_SPI dependency
Selecting SND_SOC_WM8731 is only allowed when all its dependencies
are already there:

WARNING: unmet direct dependencies detected for SND_SOC_WM8731
  Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_I2C_AND_SPI [=m]
  Selected by [y]:
  - SND_SOC_MIKROE_PROTO [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_ATMEL_SOC [=y] && OF [=y]
  Selected by [m]:
  - SND_AT91_SOC_SAM9X5_WM8731 [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_ATMEL_SOC [=y] && (ARCH_AT91 [=y] || COMPILE_TEST [=y]) && ATMEL_SSC [=y] && SND_SOC_I2C_AND_SPI [=m]
  - SND_SOC_ALL_CODECS [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && COMPILE_TEST [=y] && SND_SOC_I2C_AND_SPI [=m]

Fixes: a45f8853a5 ("ASoC: Add driver for PROTO Audio CODEC (with a WM8731)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-27 23:22:40 +01:00
Arnd Bergmann bec5ecdf41
ASoC: pxa: avoid AC97_BUS build warning
Selecting AC97_BUS_NEW from SND_PXA2XX_SOC_AC97 leads to a Kconfig
warning if any other driver selects AC97_BUS:

WARNING: unmet direct dependencies detected for AC97_BUS_COMPAT
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && AC97_BUS_NEW [=y] && !AC97_BUS [=y]
  Selected by [y]:
  - SND_SOC_WM9713 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && AC97_BUS_NEW [=y]

I don't know if that combination is supposed to work.
Assuming it is not, this adds a dependency on all users
for PXA to avoids the combination.

Fixes: 1c8bc7b3de ("ASoC: pxa: switch to new ac97 bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-27 23:22:26 +01:00
Matthias Kaehlcke 42cfb412e2
ASoC: soc-utils: Rename dummy_dma_ops to snd_dummy_dma_ops
The symbols 'dummy_dma_ops' is declared with different data types by
sound/soc/soc-utils.c and arch/arm64/include/asm/dma-mapping.h. This
leads to conflicts when soc-utils.c (indirectly) includes dma-mapping.h:

sound/soc/soc-utils.c:282:33: error: conflicting types for 'dummy_dma_ops'
  static const struct snd_pcm_ops dummy_dma_ops = {
                                  ^
...
arch/arm64/include/asm/dma-mapping.h:27:33: note: previous declaration of 'dummy_dma_ops' was here
  extern const struct dma_map_ops dummy_dma_ops;
                                  ^

Rename the symbol in soc-utils.c to 'snd_dummy_dma_ops' to avoid the
conflict.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-27 23:15:46 +01:00
Andreas Färber 85aa0fe73e
ASoC: max98088: add OF support
MAX98088 is an older version of the MAX98089 device.

Signed-off-by: Andreas Färber <afaerber@suse.de>
[m.felsch@pengutronix.de: add CONFIG_OF compile switch]
[m.felsch@pengutronix.de: adapt commit message]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-25 10:24:44 -07:00
Matt Flax b0ef5011b9
ASoC: cs4265: Add a MIC pre. route
The cs4265 driver is missing a microphone preamp enable.
This patch enables/disables the microphone preamp when mic
selection is made using the kcontrol.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-25 10:18:38 -07:00
Kuninori Morimoto 15a0c64572
ASoC: add for_each_component_dais() macro
To be more readable code, this patch adds
new for_each_component_dais() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-21 10:12:44 -07:00
Kuninori Morimoto 368dee9459
ASoC: add for_each_component() macro
To be more readable code, this patch adds
new for_each_component() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-21 10:12:43 -07:00
Dmytro Prokopchuk 624d1a7cd8
ASoC: rsnd: fixup SSI clock during suspend/resume modes
Prepare <-> Cleanup functions pair has balanced calls.
But in case of suspend mode no call to rsnd_soc_dai_shutdown()
function, so cleanup isn't called. OTOH during resume mode
function rsnd_soc_dai_prepare() is called, but calling
rsnd_ssi_prepare() is skipped (rsnd_status_update() returns zero,
bacause was not cleanup before).
We need to call rsnd_ssi_prepare(), because it enables SSI clocks
by calling rsnd_ssi_master_clk_start().

This patch allows to call prepare/cleanup functions always.

Signed-off-by: Dmytro Prokopchuk <dmytro.prokopchuk@globallogic.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
[kuninori: adjusted to upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-21 10:03:54 -07:00
zhong jiang c78d42c7fb
ASoC: qcom: qdsp6: remove duplicated include from q6adm.c
We include wait.h twice in q6adm.c. it is unnecessary. hence remove
it.  Further, order the include files as alphabet.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-21 09:22:10 -07:00
Kuninori Morimoto 0310820c27
ASoC: tidyup for_each_card_prelinks() dai_link
commit 7fe072b4df ("ASoC: add for_each_card_prelinks() macro")
added new for_each_card_prelinks() macro, but it had typo.
This patch fixup it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-21 09:21:03 -07:00
Oder Chiou fc795bf722
ASoC: rt5663: Remove the boost volume in the beginning of playback
The patch removes the boost volume in the beginning of playback while the
DAC volume set to lower.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:33:06 -07:00
Kuninori Morimoto 8d6258a4dd
ASoC: add for_each_dpcm_be() macro
To be more readable code, this patch adds
new for_each_dpcm_be() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:31:20 -07:00
Kuninori Morimoto d2e24d6465
ASoC: add for_each_dpcm_fe() macro
To be more readable code, this patch adds
new for_each_dpcm_fe() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:31:19 -07:00
Kuninori Morimoto 1a1035a985
ASoC: add for_each_comp_order() macro
To be more readable code, this patch adds
new for_each_comp_order() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:31:18 -07:00
Kuninori Morimoto f70f18f7d4
ASoC: add for_each_card_components() macro
To be more readable code, this patch adds
new for_each_card_components() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:22:58 -07:00
Kuninori Morimoto bcb1fd1fcd
ASoC: add for_each_card_rtds() macro
To be more readable code, this patch adds
new for_each_card_rtds() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:21:28 -07:00
Kuninori Morimoto 98061fdbfc
ASoC: add for_each_card_links() macro
To be more readable code, this patch adds
new for_each_card_links() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:20:02 -07:00
Kuninori Morimoto 7fe072b4df
ASoC: add for_each_card_prelinks() macro
To be more readable code, this patch adds
new for_each_card_prelinks() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:18:34 -07:00
Kuninori Morimoto 6d11b12879
ASoC: rename for_each_rtd_codec_dai_reverse to rollback
commit 0b7990e389 ("ASoC: add for_each_rtd_codec_dai() macro")
added for_each_rtd_codec_dai_reverse(). but _rollback() is better
naming than _reverse(). This patch rename it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:17:05 -07:00
Kuninori Morimoto 7afecb3073
ASoC: convert for_each_rtd_codec_dai() for missing part
commit 0b7990e389 ("ASoC: add for_each_rtd_codec_dai() macro")
added for_each_rtd_codec_dai(), but it didn't convert few loop
which is not using "rtd". This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-20 10:11:12 -07:00
Connor McAdams edb1b3abdb ALSA: hda/ca0132 - Add AE-5 exit function
This patch adds exit commands for the AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:20:39 +02:00
Connor McAdams 212de2e741 ALSA: hda/ca0132 - Add AE-5 specific controls
This patch adds controls for the AE-5's headphone gain setting, and the
DAC's interpolation filter setting.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:20:34 +02:00
Connor McAdams f231daaf51 ALSA: hda/ca0132 - Add input selection commands for AE-5
This patch adds the input selection commands for the Sound BlasterX
AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:20:28 +02:00
Connor McAdams 2283c85b4a ALSA: hda/ca0132 - Add output set commands for AE-5
This patch adds output selection commands for the AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:20:22 +02:00
Connor McAdams 746fc9deb4 ALSA: hda/ca0132 - Clean up ca0132_alt_out_select
This patch cleans up ca0132_alt_out_select by moving the card specific
output commands into a separate function. As more cards are added, the
function ca0132_alt_out_select is going to get more bloated with these,
so moving into a separate function tries to keep that from happening.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:19:01 +02:00
Connor McAdams 415cd8447c ALSA: hda/ca0132 - Add DSP setup functions for AE-5
This patch adds DSP setup functions for the AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:17:06 +02:00
Connor McAdams 6ef0e91ec4 ALSA: hda/ca0132 - Merge post-dsp functions + cleanup
This patch cleans up some of the formatting of the post-dsp load setup
functions, and also merges some of the sub functions into individual
ones.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:17:05 +02:00
Connor McAdams 7a928186b3 ALSA: hda/ca0132 - Change firmware name and usage
The Recon3D, AE-5, Z and ZxR all share the same firmware file. Rename
this from the specific "ctefx-sbz.bin" to "ctefx-desktop.bin" and set
the AE-5 and Recon3D to use it as well.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:17:04 +02:00
Connor McAdams 03c9b6b1e0 ALSA: hda/ca0132 - Add AE-5 regular init setup
This patch adds AE-5 specific stuff to the ca0132_alt_init function.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:17:03 +02:00
Connor McAdams b9b413450c ALSA: hda/ca0132 - Add AE-5 pre-init and ca0113 functions
This patch adds AE-5 pre-init functions that happen before the main
ca0132_alt_init, and gives functions related to the ca0113 a ca0113
prefix instead of ca0132. It also adds functions to write to the 8051's
SFRs, and to write the special ca0113 commands for the AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:17:02 +02:00
Connor McAdams ce7154480c ALSA: hda/ca0132 - Change ca0132_mmio_init for AE-5
This patch adds the unique writes for the AE-5 on startup to
ca0132_mmio_init. The other cards share some addresses written to, but
use different values.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:17:00 +02:00
Connor McAdams 88268ce8a6 ALSA: hda/ca0132 - Set AE-5 bools and select mixer
This patch sets the bool values for the AE-5, as well as selects the
mixer it will use.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:16:59 +02:00
Connor McAdams d06feaf02f ALSA: hda/ca0132 - Add pincfg for AE-5
This patch adds the pincfg for the Sound BlasterX AE-5, and cleans up
the function it's assigned in.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:16:58 +02:00
Connor McAdams f62764638a ALSA: hda/ca0132 - Add quirk for Sound BlasterX AE-5
This patch adds the PCI subsys ID quirk for the Sound BlasterX AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:16:57 +02:00
Connor McAdams bf85a91c2f ALSA: hda/ca0132 - Define new verbs and control params
This patch defines some new verbs found from reverse engineering of the
onboard 8051 CPU, and a control param found there as well. This clears
up usage of these verbs in other parts of the driver, and removes their
usage where they're now known to be unnecessary.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:16:56 +02:00
Nick Simonov e53134fefd ALSA: xen-front: Refine indentations and constify snd_pcm_ops
snd_pcm_ops are not supposed to change. So mark the
non-const structs as const. Also, refine indentation
to ncrease readability.

Signed-off-by: Nick Simonov <nicksimonovv@gmail.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 09:14:52 +02:00
Takashi Iwai b3a5402cbc ALSA: hda: Fix the audio-component completion timeout
The timeout of audio component binding was incorrectly specified in
msec, not in jiffies, which results in way too shorter timeout than
expected.

Along with fixing it, add the information print about the binding
failure to show the unexpected situation more clearly.

Fixes: a57942bfdd ("ALSA: hda: Make audio component support more generic")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-20 08:36:03 +02:00
Linus Walleij 65ba4dd520
ASoC: rt5677-spi: Drop unused GPIO include
This SPI driver does not use the legacy GPIO header so
just delete it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 12:49:33 -07:00
Shuming Fan 37efe23dcc
ASoC: rt5682: Minor code modification
Minor code changes are:
 - improve the readability in patch list
 - add i2c remove function
 - regmap_register_patch changes to regmap_multi_reg_write

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 10:38:34 -07:00
Akshu Agrawal c50535ed6a
ASoC: AMD: Fix capture unstable in beginning for some runs
alsa_conformance_test -C hw:0,4 -p 1024 --debug
would sometime show:
TIME_DIFF(s)    HW_LEVEL       READ              RATE
0.000095970         1024       1024    10670001.041992
0.042609555         1024       2048       24032.168372
0.021330364         1024       3072       48006.681930
0.021339559         1024       4096       47985.996337
The issue is that in dma pointer function we can have stale value
of the register for current descriptor of channel.
The register retains the number of the last descriptor that
was transferred.

Fix ensures that we report position, 0, till the one period worth of
data is transferred.  After one period of data, in handler of period
completion interrupt we update the config and correct value of descriptor
starts reflecting.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 10:31:50 -07:00
Shuming Fan 28b20dde5e
ASoC: rt5682: Fix the boost volume at the begining of playback
This patch fixed the boost volume at the begining of playback
while DAC volume set to lower level.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 10:30:40 -07:00
Shuming Fan afd603e4de
ASoC: rt5682: Update calibration function
The ADC/DAC path should open while calibration process.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 10:30:30 -07:00
Mark Brown 90fbeb0cab
Merge branch 'asoc-4.19' into asoc-4.20 for rt5682 deps. 2018-09-18 10:30:14 -07:00
Shuming Fan 3f24f37adb
ASoC: rt5682: Remove HP volume control
This patch removed Headphone Playback Volume control.
Due to codec settings, we don't want the user to change HP analog gain.
The user could use DAC1 Playback Volume control to
change playback volume.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 10:29:47 -07:00
Shuming Fan bf0fa00fd8
ASoC: rt5682: Improve HP performance
We change the settings while HP power-up for better performance.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 10:28:38 -07:00
zhong jiang 29ca7d32d7
ASoC: remove redundant include
module.h already contained moduleparam.h,  so it is safe to remove
the redundant include.

The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-18 10:28:29 -07:00
Oder Chiou fbb673f7c6
ASoC: rt5514-spi: Get the period_bytes in the copy work to make sure the value correctly
The value of period_bytes will get the zero before the hw_params() is not
run completely. Move the function snd_pcm_lib_period_bytes() to copy work,
and make sure that is not zero.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 10:48:40 -07:00
Kuninori Morimoto be6ac0a9ce
ASoC: soc-core: add snd_soc_is_matching_component()
To find (CPU/)Codec/Platform, we need to find component first
(= on CPU/Codec/Platform), and find DAI from it (= CPU/Codec).
These are similar operation but difficult to be simple,
and has many duplicate code to finding component.
This patch adds new snd_soc_is_matching_component(),
and reduce duplicate codes.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 10:46:08 -07:00
Kuninori Morimoto 4a9ed39477
ASoC: soc-core: manage platform name under snd_soc_init_platform()
Now "platform" is controlled by snd_soc_dai_link_component,
thus its "name" can be initialized in snd_soc_init_platform(),
instead of soc_bind_dai_link() local.
This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 10:46:06 -07:00
YueHaibing 24b7a0aa1a
ASoC: qdsp6: q6asm-dai: remove duplicated include from q6asm-dai.c
Remove duplicated include.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 10:32:05 -07:00
Gustavo A. R. Silva 982e386379
ASoC: hisilicon: fix fall-through annotations
Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 10:30:23 -07:00
Takashi Iwai 196f4eeeb7 ASoC: Fixes for v4.19
This is the usual set of small fixes scatterd around various drivers,
 plus one fix for DAPM and a UAPI build fix.  There's not a huge amount
 that stands out here relative to anything else.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAluf2AQTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0BojB/9ZpiRgSSjKTFSmGgu3OFI7Nvj63ruB
 hxOnwOc8Bea8tZtpzgEcx/aLZ1sbWVT4uRUYZv0Tf6UJtuOQagbJDEUkUdRitKtX
 1khSMyKFlAa7cIbv19ZOMCN0pjcs7hlHCPryT8AyCWCWN8yPdlUsDqWfyfUoq56r
 qpdu/OQ4E9VvS8OcX1gPjcop3gE/fYEoU+mbUpr0KYUXaroEzJm85tOqpGYk4+XW
 GCNUR19vNRJr5G6ANqIx96JOlgF5nRZu7aOfvLceiWH5BgPdW3iNRAJkPmKCIHwb
 a1+X21eCC7Ec2/7bQmR5Aoxz1yqzhngrevSFNLrqXFZmMmNrEfkfdCrJ
 =gVzO
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v4.19

This is the usual set of small fixes scatterd around various drivers,
plus one fix for DAPM and a UAPI build fix.  There's not a huge amount
that stands out here relative to anything else.
2018-09-17 18:59:21 +02:00
Gustavo A. R. Silva 597d18325a
ASoC: es8328: Fix fall-through annotations
Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-17 09:55:48 -07:00
Takashi Sakamoto c3b55e2ec9 ALSA: fireworks: fix memory leak of response buffer at error path
After allocating memory object for response buffer, ALSA fireworks
driver has leak of the memory object at error path.

This commit releases the object at the error path.

Fixes: 7d3c1d5901aa('ALSA: fireworks: delayed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-17 13:41:14 +02:00
Takashi Sakamoto 1064bc685d ALSA: oxfw: fix memory leak of discovered stream formats at error path
After finishing discover of stream formats, ALSA OXFW driver has memory
leak of allocated memory object at error path.

This commit releases the memory object at the error path.

Fixes: 6c29230e2a ('ALSA: oxfw: delayed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-17 13:40:47 +02:00
Takashi Sakamoto ce925f088b ALSA: oxfw: fix memory leak for model-dependent data at error path
After allocating model-dependent data, ALSA OXFW driver has memory leak
of the data at error path.

This commit releases the data at the error path.

Fixes: 6c29230e2a ('ALSA: oxfw: delayed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-17 13:40:09 +02:00
Takashi Sakamoto b1fbebd416 ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at error path
After allocating model-dependent data for M-Audio FW1814 and ProjectMix
I/O, ALSA bebob driver has memory leak at error path.

This commit releases the allocated data at the error path.

Fixes: 04a2c73c97eb('ALSA: bebob: delayed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-17 13:36:54 +02:00
Gustavo A. R. Silva 05e2ec3b00 ALSA: atiixp: fix fall-through annotations
Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-14 15:27:04 +02:00
Takashi Iwai 37a3a98ef6 ALSA: hda - Enable runtime PM only for discrete GPU
The recent change of vga_switcheroo allowed the runtime PM for
HD-audio on AMD GPUs, but this also resulted in a regression.  When
the HD-audio controller driver gets runtime-suspended, HD-audio link
is turned off, and the hotplug notification is ignored.  This leads to
the inconsistent audio state (the connection isn't notified and ELD is
ignored).

The best fix would be to implement the proper ELD notification via the
audio component, but it's still not ready.  As a quick workaround,
this patch adds the check of runtime_idle and allows the runtime
suspend only when the vga_switcheroo is bound with discrete GPU.
That is, a system with a single GPU and APU would be again without
runtime PM to keep the HD-audio link for the hotplug notification and
ELD read out.

Also, the codec->auto_runtime_pm flag is set only for the discrete GPU
at the time GPU gets bound via vga_switcheroo (i.e. only dGPU is
forcibly runtime-PM enabled), so that APU can still get the ELD
notification.

For identifying which GPU is bound, a new vga_switcheroo client
callback, gpu_bound, is implemented.  The vga_switcheroo simply calls
this when GPU is bound, and tells whether it's dGPU or APU.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200945
Fixes: 07f4f97d7b ("vga_switcheroo: Use device link for HDA controller")
Reported-by: Jian-Hong Pan <jian-hong@endlessm.com>
Tested-by: Jian-Hong Pan <jian-hong@endlessm.com>
Acked-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-13 17:58:30 +02:00
Takashi Sakamoto 498fe23aad ALSA: oxfw: fix memory leak of private data
Although private data of sound card instance is usually allocated in the
tail of the instance, drivers in ALSA firewire stack allocate the private
data before allocating the instance. In this case, the private data
should be released explicitly at .private_free callback of the instance.

This commit fixes memory leak following to the above design.

Fixes: 6c29230e2a ('ALSA: oxfw: delayed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-13 15:15:39 +02:00
Takashi Sakamoto 8d28277c06 ALSA: firewire-tascam: fix memory leak of private data
Although private data of sound card instance is usually allocated in the
tail of the instance, drivers in ALSA firewire stack allocate the private
data before allocating the instance. In this case, the private data
should be released explicitly at .private_free callback of the instance.

This commit fixes memory leak following to the above design.

Fixes: b610386c8a ('ALSA: firewire-tascam: deleyed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-13 15:14:39 +02:00
Takashi Sakamoto a49a83ab05 ALSA: firewire-digi00x: fix memory leak of private data
Although private data of sound card instance is usually allocated in the
tail of the instance, drivers in ALSA firewire stack allocate the private
data before allocating the instance. In this case, the private data
should be released explicitly at .private_free callback of the instance.

This commit fixes memory leak following to the above design.

Fixes: 86c8dd7f4d ('ALSA: firewire-digi00x: delayed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-13 15:12:57 +02:00
Takashi Iwai 7064f376d4 ALSA: intel8x0m: Register irq handler after register initializations
The interrupt handler has to be acquired after the other resource
initialization when allocated with IRQF_SHARED.  Otherwise it's
triggered before the resource gets ready, and may lead to unpleasant
behavior.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-13 07:58:43 +02:00
Mark Brown d9b84a1589
ALSA: hda: Fix implicit definition of pci_iomap() on SH
Include asm/io.h directly so we've got a definition of pci_iomap(), the
current set of includes do this implicitly on most architectures but not
on SH.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 12:43:38 +01:00
Yu Zhao 75383f8d39
sound: don't call skl_init_chip() to reset intel skl soc
Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
1) sets bus->chip_init to prevent multiple entrances before device
is stopped; 2) enables interrupt.

We shouldn't use it for the purpose of resetting device only because
1) when we really want to initialize device, we won't be able to do
so; 2) we are ready to handle interrupt yet, and kernel crashes when
interrupt comes in.

Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
device properly.

Fixes: 60767abcea ("ASoC: Intel: Skylake: Reset the controller in probe")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 11:22:09 +01:00
Yu Zhao b61749a89f
sound: enable interrupt after dma buffer initialization
In snd_hdac_bus_init_chip(), we enable interrupt before
snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has
been acquired and irq handler uses the dma buffer, kernel may crash
when interrupt comes in.

Fix the problem by postponing enabling irq after dma buffer
initialization. And warn once on null dma buffer pointer during the
initialization.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 11:21:55 +01:00
Yu Zhao 542cedec53
Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation"
This reverts commit 12eeeb4f47.

The patch doesn't fix accessing memory with null pointer in
skl_interrupt().

There are two problems: 1) skl_init_chip() is called twice, before
and after dma buffer is allocate. The first call sets bus->chip_init
which prevents the second from initializing bus->corb.buf and
rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables
interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers.
There is a small window which skl_interrupt() can be called if irq
has been acquired. If so, it crashes when using null dma buffer
pointers.

Will fix the problems in the following patches. Also attaching the
crash for future reference.

[   16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
<snipped>
[   16.950903] Call Trace:
[   16.950906]  <IRQ>
[   16.950918]  skl_interrupt+0x19e/0x2d6 [snd_soc_skl]
[   16.950926]  ? dma_supported+0xb5/0xb5 [snd_soc_skl]
[   16.950933]  __handle_irq_event_percpu+0x27a/0x6c8
[   16.950937]  ? __irq_wake_thread+0x1d1/0x1d1
[   16.950942]  ? __do_softirq+0x57a/0x69e
[   16.950944]  handle_irq_event_percpu+0x95/0x1ba
[   16.950948]  ? _raw_spin_unlock+0x65/0xdc
[   16.950951]  ? __handle_irq_event_percpu+0x6c8/0x6c8
[   16.950953]  ? _raw_spin_unlock+0x65/0xdc
[   16.950957]  ? time_cpufreq_notifier+0x483/0x483
[   16.950959]  handle_irq_event+0x89/0x123
[   16.950962]  handle_fasteoi_irq+0x16f/0x425
[   16.950965]  handle_irq+0x1fe/0x28e
[   16.950969]  do_IRQ+0x6e/0x12e
[   16.950972]  common_interrupt+0x7a/0x7a
[   16.950974]  </IRQ>
<snipped>
[   16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08
[   16.951036] ---[ end trace 58bf9ece1775bc92 ]---

Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation")
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 11:19:43 +01:00
Kuninori Morimoto a7c439d612
ASoC: soc-core: remove dai->driver NULL check
It is strange if it has "dai" but doesn't have "dai->driver".
And more over "dai->driver->xxx" is used everywhere without
"dai->driver" pointer NULL checking.
It got Oops already if "dai->driver" was NULL.
Let's remove un-needed "dai->driver" NULL check.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 11:12:27 +01:00
Srinivas Kandagatla e894efef9a
ASoC: core: add support to card rebind
Current behaviour of ASoC core w.r.t to component removal is that it
unregisters dependent sound card totally. There is no support to
rebind the card if the component comes back.
Typical use case is DSP restart or kernel modules itself.

With this patch, core now maintains list of cards that are unbind due to
any of its depended components are removed and card not unregistered yet.
This list is cleared when the card is rebind successfully or when the
card is unregistered from machine driver.

This list of unbind cards are tried to bind once again after every new
component is successfully added, giving a fair chance for card bind
to be successful.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 11:09:04 +01:00
zhong jiang e1e38ea14e
ASoC: remove unneeded static set .owner field in platform_driver
platform_driver_register will set the .owner field. So it is safe
to remove the redundant assignment.

The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-12 10:52:25 +01:00
Katsuhiro Suzuki 24d6638302
ASoC: rockchip: add missing INTERLEAVED PCM attribute
This patch adds SNDRV_PCM_INFO_INTERLEAVED into PCM hardware info.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11 19:19:53 +01:00
Kuninori Morimoto 4f1b327e65
ASoC: soc-core: remove unused num_dai_links
ALSA SoC is counting card->dai_link_list user,
but no-one is using it.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11 17:18:39 +01:00
Kuninori Morimoto 2eda3cb108
ASoC: soc-core: avoid nested code on soc_remove_dai()
Nested code is not readable.
This patch avoid it on soc_remove_dai().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11 17:18:23 +01:00
Kuninori Morimoto a6ebf4c977
ASoC: rt5668: remove empty rt5668_i2c_remove()
rt5668_i2c_remove() is empty, and no longer needed.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11 16:57:39 +01:00
Anders Roxell 5b03006d5c ALSA: hda: fix unused variable warning
When CONFIG_X86=n function azx_snoop doesn't use the variable chip it
only returns true.

sound/pci/hda/hda_intel.c: In function ‘dma_alloc_pages’:
sound/pci/hda/hda_intel.c:2002:14: warning: unused variable ‘chip’ [-Wunused-variable]
  struct azx *chip = bus_to_azx(bus);
              ^~~~

Create a inline function of azx_snoop.

Fixes: a41d122449 ("ALSA: hda - Embed bus into controller object")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-11 16:46:42 +02:00
Rohit kumar ae7d1247d8
ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()
In functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(),
if the result of (min + max) is negative, then fls() returns
signed integer with value as 32. This leads to signed integer
overflow as complete operation is considered as signed integer.

UBSAN: Undefined behaviour in sound/soc/soc-ops.c:382:50
signed integer overflow:
-2147483648 - 1 cannot be represented in type 'int'
Call trace:
[<ffffff852f746fe4>] __dump_stack lib/dump_stack.c:15 [inline]
[<ffffff852f746fe4>] dump_stack+0xec/0x158 lib/dump_stack.c:51
[<ffffff852f7b5f3c>] ubsan_epilogue+0x18/0x50 lib/ubsan.c:164
[<ffffff852f7b6840>] handle_overflow+0xf8/0x130 lib/ubsan.c:195
[<ffffff852f7b68f0>] __ubsan_handle_sub_overflow+0x34/0x44 lib/ubsan.c:211
[<ffffff85307971a0>] snd_soc_get_volsw_sx+0x1a8/0x1f8 sound/soc/soc-ops.c:382

Typecast the operation to unsigned int to fix the issue.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-11 11:58:52 +01:00
Mark Brown 54a3da1c10
Merge branch 'asoc-4.19' into asoc-4.20 Cirrus conflict 2018-09-10 18:55:12 +01:00
Robert Jarzmik 1c8bc7b3de
ASoC: pxa: switch to new ac97 bus support
Switch to the new ac97 bus support in sound/ac97 instead of the legacy
snd_ac97 one.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 18:47:58 +01:00
Akshu Agrawal 8dcb0c90c6
ASoC: AMD: Fix simultaneous playback and capture on different channel
If capture and playback are started on different channel (I2S/BT)
there is a possibilty that channel information passed from machine driver
is overwritten before the configuration is done in dma driver.
Example:
113.597588: cz_max_startup: ---playback sets BT channel
113.597694: cz_dmic1_startup: ---capture sets I2S channel
113.597979: acp_dma_hw_params: ---configures capture for I2S channel
113.598114: acp_dma_hw_params: ---configures playback for I2S channel

This is fixed by having 2 separate instance for playback and capture.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 18:46:09 +01:00
Willy Tarreau 49434c6c57 ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO
snd_emu10k1_fx8010_ioctl(SNDRV_EMU10K1_IOCTL_INFO) allocates
memory using kmalloc() and partially fills it by calling
snd_emu10k1_fx8010_info() before returning the resulting
structure to userspace, leaving uninitialized holes. Let's
just use kzalloc() here.

BugLink: http://blog.infosectcbr.com.au/2018/09/linux-kernel-infoleaks.html
Signed-off-by: Willy Tarreau <w@1wt.eu>
Cc: Jann Horn <jannh@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-10 17:18:28 +02:00
Sébastien Szymanski 90a3b7f8ab
ASoC: cs4265: fix MMTLR Data switch control
The MMTLR bit is in the CS4265_SPDIF_CTL2 register at address 0x12 bit 0
and not at address 0x0 bit 1. Fix this.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2018-09-10 15:49:02 +01:00
Charles Keepax e36a1d0d24
ASoC: dapm: Add missing return value check for snd_soc_dapm_new_dai
snd_soc_dapm_new_dai may return an error pointer and currently this
isn't checked for in dapm_connect_dai_link_widgets. Add code to check
the return value and not add routes in that case.

Fixes: 778ff5bb86 ("ASoC: dapm: Move connection of CODEC to CODEC DAIs")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:43:50 +01:00
zhong jiang ca92cc4636
ASoC: skl-topology: Use kmemdup to replace kzalloc + memcpy
kmemdup has implemented the function that kzalloc() + memcpy() will
do. and we prefer to kmemdup rather than the open coded implementation.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:20:20 +01:00
zhong jiang 18fbe800e6
ASoC: q6core: Use kmemdup to replace kzalloc + memcpy
kmemdup has implemented the function that kzalloc() + memcpy() will
do. and we prefer to use the kmemdup rather than the open coded implementation.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:20:16 +01:00
Kuninori Morimoto fb77436a44
ASoC: txx9: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:14:47 +01:00
Kuninori Morimoto afa88ee37b
ASoC: sh: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:14:38 +01:00
Kuninori Morimoto 642a722d31
ASoC: omap: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:14:23 +01:00
Kuninori Morimoto bfacaa8c89
ASoC: nuc900: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:14:14 +01:00
Kuninori Morimoto 007ac42db9
ASoC: tscs454: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:13:58 +01:00
Kuninori Morimoto 4fe1984ebc
ASoC: rt5668: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:13:43 +01:00
Kuninori Morimoto 10ccaa39d7
ASoC: hdac_hda: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:13:27 +01:00
Kuninori Morimoto 570f75b935
ASoC: bcm: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:13:12 +01:00
Kuninori Morimoto e14614dc51
ASoC: atmel_ssc_dai: use devm_snd_soc_register_component()
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 15:10:50 +01:00
Akshu Agrawal 2a665dba01
ASoC: AMD: Ensure reset bit is cleared before configuring
HW register descriptions says:
"DMA Channel Reset...Software must confirm that this bit is
cleared before reprogramming any of the channel configuration registers."
There could be cases where dma stop errored out leaving dma channel
in reset state. We need to ensure that before the start of another dma,
channel is out of the reset state.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 12:20:52 +01:00
Dan Carpenter 0712e0288b
ASoC: qdsp6: q6asm-dai: clean up a return
Smatch complains that if both "psubstream" and "csubstream" are NULL
then "ret" is uninitialized.  That probably can't happen, but it's
cleaner to just return zero anyway so let's do that.

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-09-10 11:46:39 +01:00
Dan Carpenter 2e558a8127
ASoC: dapm: Fix a couple uninitialized ret variables
Smatch complains that these variables could be uninitialized.  The first
one in snd_soc_dai_link_event() is probably a false positive, because
probably we know the lists are not empty.  I would normally ignore the
warning, but GCC complains here as well so I just silenced the warning.
The "ret" in snd_soc_dapm_new_dai() does need to be initialized or it
leads to a bogus dereference in the caller.

Fixes: 3bbf5d34fd ("ASoC: dapm: Move error handling to snd_soc_dapm_new_control_unlocked")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-10 11:41:40 +01:00
Takashi Sakamoto 36f3a6e02c ALSA: fireface: fix memory leak in ff400_switch_fetching_mode()
An allocated memory forgets to be released.

Fixes: 76fdb3a9e1 ('ALSA: fireface: add support for Fireface 400')
Cc: <stable@vger.kernel.org> # 4.12+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-10 09:08:14 +02:00
Takashi Sakamoto 493626f2d8 ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming DMA mapping
When executing 'fw_run_transaction()' with 'TCODE_WRITE_BLOCK_REQUEST',
an address of 'payload' argument is used for streaming DMA mapping by
'firewire_ohci' module if 'size' argument is larger than 8 byte.
Although in this case the address should not be on kernel stack, current
implementation of ALSA bebob driver uses data in kernel stack for a cue
to boot M-Audio devices. This often brings unexpected result, especially
for a case of CONFIG_VMAP_STACK=y.

This commit fixes the bug.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=201021
Reference: https://forum.manjaro.org/t/firewire-m-audio-410-driver-wont-load-firmware/51165
Fixes: a2b2a7798fb6('ALSA: bebob: Send a cue to load firmware for M-Audio Firewire series')
Cc: <stable@vger.kernel.org> # v3.16+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-10 09:07:29 +02:00
Ricardo Biehl Pasquali 64b6acf60b ALSA: pcm: Update hardware pointer before start capture
This ensures the transfer loop won't waste a run to read
the few frames (if any) between start and hw_ptr update.
It will wait for the next interrupt with wait_for_avail().

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-10 09:06:55 +02:00
Grant Grundler 3004136b90
ASoC: max98373: usleep_range() needs include/delay.h
Commit ca917f9fe1 added use of usleep_range() but not
the corresponding "include <linux/delay.h>". The result is
with Chrome OS won't build because warnings are forced
to be errors:
mnt/host/source/src/third_party/kernel/v4.4/sound/soc/codecs/max98373.c:734:2: error: implicit declaration of function 'usleep_range' [-Werror,-Wimplicit-function-declaration]
        usleep_range(10000, 11000);
        ^

Including delay.h "fixes" this.

Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07 17:04:10 +01:00
David Frey 1c96a2f67c
regmap: split up regmap_config.use_single_rw
Split regmap_config.use_single_rw into use_single_read and
use_single_write. This change enables drivers of devices which only
support bulk operations in one direction to use the regmap_bulk_*()
functions for both directions and have their bulk operation split into
single operations only when necessary.

Update all struct regmap_config instances where use_single_rw==true to
instead set both use_single_read and use_single_write. No attempt was
made to evaluate whether it is possible to set only one of
use_single_read or use_single_write.

Signed-off-by: David Frey <dpfrey@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07 13:03:55 +01:00
Yong Zhi 3b857472f3
ASoC: Intel: hdac_hdmi: Limit sampling rates at dai creation
Playback of 44.1Khz contents with HDMI plugged returns
"Invalid pipe config" because HDMI paths in the FW
topology are configured to operate at 48Khz.

This patch filters out sampling rates not supported
at hdac_hdmi_create_dais() to let user space SRC
to do the converting.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07 13:03:05 +01:00
Charles Keepax fc269c0396
ASoC: dapm: Avoid uninitialised variable warning
Commit 4a75aae17b ("ASoC: dapm: Add support for multi-CODEC
CODEC to CODEC links") adds loops that iterate over multiple
CODECs in snd_soc_dai_link_event. This also introduced a compiler
warning for a potentially uninitialised variable in the case
no CODECs are present. This should never be the case as the
DAI link must by definition contain at least 1 CODEC however
probably best to avoid the compiler warning by initialising ret
to zero.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-07 11:35:08 +01:00
Colin Ian King 9ab708aef6
ASoC: sgtl5000: avoid division by zero if lo_vag is zero
In the case where lo_vag <= SGTL5000_LINE_OUT_GND_BASE, lo_vag
is set to zero and later vol_quot is computed by dividing by
lo_vag causing a division by zero error.  Fix this by avoiding
a zero division and set vol_quot to zero in this specific case
so that the lowest setting for i is correctly set.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06 12:07:39 +01:00
Kuninori Morimoto dabdbe3ae0
ASoC: rsnd: don't use %p for dev_dbg()
rsnd driver sometimes want to know which address is used when debugging.
But it will indicate "(____ptrval____)" if it used "%p" on dev_dbg().
Let's use "%pa" or "%px" for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06 11:13:43 +01:00
Kuninori Morimoto 6c92d5a274
ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER
Current rsnd driver will fallback to PIO mode if it can't get DMA
handler. But, DMA might return -EPROBE_DEFER when probe timing.
This driver always fallback to PIO mode especially from
commit ac6bbf0cdf ("iommu: Remove IOMMU_OF_DECLARE") because
of this reason.

The DMA driver will be probed later, but sound driver might be
probed as PIO mode in such case. This patch fixup this issue.
Then, -EPROBE_DEFER is not error. Thus, let's don't indicate error
message in such case.
And it needs to call rsnd_adg_remove() individually if probe failed,
because it registers clk which should be unregister.

Maybe PIO fallback feature itself is not needed,
but let's keep it so far.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06 11:13:24 +01:00
Kuninori Morimoto 69235ccf49
ASoC: rsnd: adg: care clock-frequency size
ADG has buffer over flow bug if DT has more than 3 clock-frequency.
This patch fixup this issue, and uses first 2 values.

	clock-frequency = <x y>;	/* this is OK */
	clock-frequency = <x y z>;	/* this is NG */

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06 11:12:52 +01:00
Kuninori Morimoto 501683d0cd
ASoC: rsnd: gen: use tab instead of white-space
commit 8c9d750333 ("ASoC: rsnd: ssiu: Support BUSIF
other than BUSIF0") added new SSIU registers.
But it is using white-space for it.
This patch fixup it to use tab.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06 11:12:30 +01:00
Colin Ian King c24fb71fa4
ASoC: hdac_hdmi: remove redundant check for !port condition
The !port check is redundant as it being performed in the following
check. Remove it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-06 11:12:26 +01:00
Charles Keepax 243bcfafcd
ASoC: dapm: Move CODEC to CODEC params from the widget to the runtime
Larger CODECs may contain many several hundred widgets and which set of
parameters is selected only needs to be recorded on a per DAI basis. As
such move the selected CODEC to CODEC link params to be stored in the
runtime rather than the DAPM widget, to save some memory.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-05 17:11:32 +01:00
Charles Keepax 4a75aae17b
ASoC: dapm: Add support for multi-CODEC CODEC to CODEC links
Currently multi-CODEC is not supported on CODEC to CODEC links.
There are common applications where this would be useful, such
as connecting two mono amplifiers to an audio CODEC. Adding
support simply requires an update of snd_soc_dai_link_event
to loop over the attached CODEC DAIs.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-05 17:11:29 +01:00
Charles Keepax 778ff5bb86
ASoC: dapm: Move connection of CODEC to CODEC DAIs
Currently, snd_soc_dapm_connect_dai_link_widgets connects up the routes
representing normal DAIs, however CODEC to CODEC links are hooked up
through separate infrastructure in soc_link_dai_widgets. Improve the
consistency of the code by using snd_soc_dapm_connect_dai_link for both
types of DAIs.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-05 17:11:25 +01:00
Charles Keepax 94e630a35d
ASoC: dapm: Cosmetic tidy up of snd_soc_dapm_new_control
Move the function snd_soc_dapm_new_control to be next to
snd_soc_dapm_new_controls and add some kernel doc for it.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-05 17:11:21 +01:00
Charles Keepax 3bbf5d34fd
ASoC: dapm: Move error handling to snd_soc_dapm_new_control_unlocked
Currently DAPM has a lot of similar code to handle errors from
snd_soc_dapm_new_control_unlocked, and much of this code does
not really accurately reflect what the function returns.

Firstly, most places will check for a return value of
-EPROBE_DEFER and silence any error messages in that case. The
one notable exception here being dapm_kcontrol_data_alloc
which does currently print any error messages in the case
of snd_soc_dapm_new_control_unlocked returning NULL or an
error. Additionally the error prints being silenced in these
case are redundant as snd_soc_dapm_new_control_unlocked can
only return -EPROBE_DEFER or NULL when failing.

Secondly, most places will treat a return value of NULL as
an -ENOMEM.  This is not correct either since any error except
EPROBE_DEFER will cause a return value of NULL from
snd_soc_dapm_new_control_unlocked.

Centralise this handling and the error messages within
snd_soc_dapm_new_control_unlocked and update the callers
to simply check IS_ERR and return. Note that this update is
slightly simpler in the case of dapm_kcontrol_data_alloc where
that is fairly close to the handling that was already in place.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-05 17:11:17 +01:00
Takashi Iwai 70f7922c25 Merge branch 'topic/pcm-indirect-fixes' into for-next
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-04 20:23:40 +02:00
Kuninori Morimoto 0b7990e389
ASoC: add for_each_rtd_codec_dai() macro
ALSA SoC snd_soc_pcm_runtime has snd_soc_dai array for codec_dai.
To be more readable code, this patch adds
new for_each_rtd_codec_dai() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-04 16:59:11 +01:00
Kuninori Morimoto 3db769f177
ASoC: add for_each_link_codecs() macro
ALSA SoC snd_soc_dai_link has snd_soc_dai_link_component array
for codecs.
To be more readable code, this patch adds
new for_each_link_codecs() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-04 16:59:11 +01:00
Andrew F. Davis 18d545bb25
ASoC: tlv320aic31xx: Add overflow detection support
Similar to short circuit detection, when the ADC/DAC is saturated and
overflows poor audio quality can result and should be reported to the
user. This device support Automatic Dynamic Range Compression (DRC)
to reduce this but it is not enabled currently in this driver.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-04 16:50:51 +01:00
Takashi Iwai d873d5ea89 ALSA: mips: Cleanup indirect PCM helper usages
We shouldn't set up the indirect PCM parameters at trigger but they
should be set at prepare.  Also, remove a useless debug message, too.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-04 12:13:46 +02:00
Takashi Iwai b81e7732ce ALSA: cs46xx: Use SNDRV_PCM_INFO_SYNC_APPLPTR info flag
The recently introduced PCM info flag assures the call of ack ops at
each applptr change, and this is mandatory for the indirect PCM
helpers.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-04 12:13:40 +02:00
Takashi Iwai 10a23f614d ALSA: emu10k1: Use SNDRV_PCM_INFO_SYNC_APPLPTR info flag
The recently introduced PCM info flag assures the call of ack ops at
each applptr change, and this is mandatory for the indirect PCM
helpers.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-04 12:13:34 +02:00
Takashi Iwai dc0d1c4519 ALSA: mips: Use SNDRV_PCM_INFO_SYNC_APPLPTR info flag
The recently introduced PCM info flag assures the call of ack ops at
each applptr change, and this is mandatory for the indirect PCM
helpers.

Also, with the proper ack callback, we need no longer prefill at
trigger start.  The relevant code can be killed.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-04 12:13:27 +02:00
Takashi Iwai 38ce57ad16 ALSA: rme32: Use SNDRV_PCM_INFO_SYNC_APPLPTR info flag
The recently introduced PCM info flag assures the call of ack ops at
each applptr change, and this is mandatory for the indirect PCM
helpers.

Also, with the proper ack callback, we need no longer prefill at
trigger start.  The relevant code can be killed.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-04 12:13:09 +02:00
Keyon Jie f7c50fa636 ALSA: hda: Fix several mismatch for register mask and value
E.g. for snd_hdac_ext_link_clear_stream_id(), we should set (1 << stream)
as mask, and 0 as value, here correct it and several similar mismatches.

And, here also remove unreadable register_mask usage for those mask value
updating.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-03 23:47:40 +02:00
Rob Herring b917d58dcf ALSA: aoa: Convert to using %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-03 23:41:57 +02:00
Jon Hunter e03546ddd3
ASoC: core: Don't schedule DAPM work if already in target state
When dapm_power_widgets() is called, the dapm_pre_sequence_async() and
dapm_post_sequence_async() functions are scheduled for all DAPM contexts
(apart from the card DAPM context) regardless of whether the DAPM
context is already in the desired state. The overhead of this is not
insignificant and the more DAPM contexts there are the more overhead
there is.

For example, on the Tegra124 Jetson TK1, when profiling the time taken
to execute the dapm_power_widgets() the following times were observed.

  Times for function dapm_power_widgets() are (us):
     Min 23, Ave 190, Max 434, Count 39

Here 'Count' is the number of times that dapm_power_widgets() has been
called. Please note that the above time were measured using ktime_get()
to log the time on entry and exit from dapm_power_widgets(). So it
should be noted that these times may not be purely the time take to
execute this function if it is preempted. However, after applying this
patch and measuring the time taken to execute dapm_power_widgets() again
a significant improvement is seen as shown below.

  Times for function dapm_power_widgets() are (us):
     Min 4, Ave 16, Max 82, Count 39

Therefore, optimise the dapm_power_widgets() function by only scheduling
the dapm_pre/post_sequence_async() work if the DAPM context is not in
the desired state.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 15:18:43 +01:00
Codrin Ciubotariu a45f8853a5
ASoC: Add driver for PROTO Audio CODEC (with a WM8731)
Add support for the MikroElektronika PROTO audio codec board.

URL to the audio chip:
http://www.mikroe.com/add-on-boards/audio-voice/audio-codec-proto/

Signed-off-by: Florian Meier <florian.meier@koalo.de>
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:41:26 +01:00
Kuninori Morimoto 6ab6a2474e
ASoC: rsnd: merge .nolock_start and .prepare
Main purpose of .nolock_start is we need to call
some function without spinlock.
OTOH we have .prepare which main purpose is
called under atomic context.
Then, it is called without spinlock.

In summary, our main callback init/quit, and start/stop
are called under "atomic context and with spinlock".
And some function need to be called under
"non-atomic context or without spinlock".
Let's merge .nolock_start and prepare to be more clear code.
Then, let's rename nolock_stop to cleanup

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:43 +01:00
Mark Brown d47f9580a6
Merge branch 'asoc-4.19' into asoc-4.20 for rcar dep 2018-09-03 14:37:28 +01:00
Jiada Wang 2e66d523cd
ASoC: rsnd: ssiu: Support to init different BUSIF instance
Currently ssiu's .init is only called once during audio stream.
But SSIU with different BUSIF, shall be initialized each time,
even they are used in the same audio stream.

This patch introduces ssiu_status for BUSIF0 to BUSIF7 in rsnd_ssiu,
to make sure same .init for different BUSIF can always be executed.

To avoid the first stopped stream to stop the whole SSIU,
which may still has other BUSIF instance running, use usrcnt to count
the usage of SSIU, only the last user of SSIU can stop the whole SSIU.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:19 +01:00
Jiada Wang 8c9d750333
ASoC: rsnd: ssiu: Support BUSIF other than BUSIF0
Currently only BUSIF0 is supported by SSIU, all register setting
is done only for BUSIF.

Since BUSIF1 ~ BUSIF7 has been supported, so also support
these BUSIF from SSIU.

One note is that we can't support SSI9-4/5/6/7 so far,
because its address is out of calculation rule.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:19 +01:00
Jiada Wang 92c7d384ff
ASoc: rsnd: dma: Calculate PDMACHCRE with consider of BUSIF
PDMACHCR setting for SSI only considers BUSIF0 so far.
But BUSIF1 ~ BUSIF7 also maybe used, in the future.

This patch updates table gen2_id_table_ssiu, to also consider
BUSIF number used by SSI.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[kuninori: adjust to upstreaming]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:18 +01:00
Jiada Wang 5e45a6fab3
ASoc: rsnd: dma: Calculate dma address with consider of BUSIF
DMA address calculated by rsnd_dma_addr() only considers BUSIF0 so far.
But BUSIF1 ~ BUSIF7 also maybe used, in the future.

This patch updates DMA address calculations, to also consider
BUSIF number used by SSI.

One note is that we can't support SSI9-4/5/6/7 so far,
because its address is out of calculation rule.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[kuninori: adjust to upstreaming]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:17 +01:00
Jiada Wang 599da084e0
ASoC: rsnd: ssi: Check runtime channel number rather than hw_params
The number of channel handled by SSI maybe differs from the one set
in hw_params, currently SSI checks hw_params's channel number,
and constrains to use same channel number, when it is being
used by multiple clients.

This patch corrects to check runtime channel number rather
than channel number set in hw_params.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[kuninori: adjust to upstreaming]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:16 +01:00
Jiada Wang 0e289012b4
ASoC: rsnd: ssi: Fix issue in dma data address assignment
Same SSI device may be used in different dai links,
by only having one dma struct in rsnd_ssi, after the first
instance's dma config be initilized, the following instances
can no longer configure dma, this causes issue, when their
dma data address are different from the first instance.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:15 +01:00
Jiada Wang b735662fa4
ASoC: rsnd: remove is_play parameter from hw_rule function
Currently rsnd_dai_stream *io is set to either &rdai->playback or
&rdai->capture based on whether it is a playback or capture stream,
in __rsnd_soc_hw_rule_* functions, but this is not necessary,
rsnd_dai_stream *io handler can be get from rule->private.

This patch removes 'is_play' parameter from hw_rule function.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:14 +01:00
Dragos Tarcatu ba5d553b7b
ASoC: rsnd: add support for 8 bit S8 format
This patch adds support for SNDRV_PCM_FMTBIT_S8 format.

Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:13 +01:00
Dragos Tarcatu 3791b3ee4b
ASoC: rsnd: add support for the DSP_A/DSP_B formats
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:13 +01:00
Dragos Tarcatu fb2815f44a
ASoC: rsnd: add support for 16/24 bit slot widths
The slot width (system word length) was fixed at 32 bits.
This patch allows also setting it to 16 or 24 bits.

Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:12 +01:00
Jiada Wang b5c0886898
ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime()
Add warning message to rsnd_kctrl_accept_runtime(), when kctrl
update is rejected due to corresponding dai-link is idle.
So that user can notice the reason of kctrl update failure.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[kuninori: adjust to upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:37:11 +01:00
Jiada Wang 4d230d1271
ASoC: rsnd: fixup not to call clk_get/set under non-atomic
Clocking operations clk_get/set_rate, are non-atomic,
they shouldn't be called in soc_pcm_trigger() which is atomic.

Following issue was found due to execution of clk_get_rate() causes
sleep in soc_pcm_trigger(), which shouldn't be blocked.

We can reproduce this issue by following
	> enable CONFIG_DEBUG_ATOMIC_SLEEP=y
	> compile, and boot
	> mount -t debugfs none /sys/kernel/debug
	> while true; do cat /sys/kernel/debug/clk/clk_summary > /dev/null; done &
	> while true; do aplay xxx; done

This patch adds support to .prepare callback, and moves non-atomic
clocking operations to it. As .prepare is non-atomic, it is always
called before trigger_start/trigger_stop.

	BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
	in_atomic(): 1, irqs_disabled(): 128, pid: 2242, name: aplay
	INFO: lockdep is turned off.
	irq event stamp: 5964
	hardirqs last enabled at (5963): [<ffff200008e59e40>] mutex_lock_nested+0x6e8/0x6f0
	hardirqs last disabled at (5964): [<ffff200008e623f0>] _raw_spin_lock_irqsave+0x24/0x68
	softirqs last enabled at (5502): [<ffff200008081838>] __do_softirq+0x560/0x10c0
	softirqs last disabled at (5495): [<ffff2000080c2e78>] irq_exit+0x160/0x25c
	Preemption disabled at:[ 62.904063] [<ffff200008be4d48>] snd_pcm_stream_lock+0xb4/0xc0
	CPU: 2 PID: 2242 Comm: aplay Tainted: G B C 4.9.54+ #186
	Hardware name: Renesas Salvator-X board based on r8a7795 (DT)
	Call trace:
	[<ffff20000808fe48>] dump_backtrace+0x0/0x37c
	[<ffff2000080901d8>] show_stack+0x14/0x1c
	[<ffff2000086f4458>] dump_stack+0xfc/0x154
	[<ffff2000081134a0>] ___might_sleep+0x57c/0x58c
	[<ffff2000081136b8>] __might_sleep+0x208/0x21c
	[<ffff200008e5980c>] mutex_lock_nested+0xb4/0x6f0
	[<ffff2000087cac74>] clk_prepare_lock+0xb0/0x184
	[<ffff2000087cb094>] clk_core_get_rate+0x14/0x54
	[<ffff2000087cb0f4>] clk_get_rate+0x20/0x34
	[<ffff20000113aa00>] rsnd_adg_ssi_clk_try_start+0x158/0x4f8 [snd_soc_rcar]
	[<ffff20000113da00>] rsnd_ssi_init+0x668/0x7a0 [snd_soc_rcar]
	[<ffff200001133ff4>] rsnd_soc_dai_trigger+0x4bc/0xcf8 [snd_soc_rcar]
	[<ffff200008c1af24>] soc_pcm_trigger+0x2a4/0x2d4

Fixes: e7d850dd10 ("ASoC: rsnd: use mod base common method on SSI-parent")
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[Kuninori: tidyup for upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2018-09-03 14:28:59 +01:00
Takashi Iwai 5a7b44a8df ALSA: rawmidi: Initialize allocated buffers
syzbot reported the uninitialized value exposure in certain situations
using virmidi loop.  It's likely a very small race at writing and
reading, and the influence is almost negligible.  But it's safer to
paper over this just by replacing the existing kvmalloc() with
kvzalloc().

Reported-by: syzbot+194dffdb8b22fc5d207a@syzkaller.appspotmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-03 15:16:43 +02:00
Andrew F. Davis 80863ee222
ASoC: tlv320aic31xx: Add short circuit detection support
These devices support detecting and reporting short circuits across
the output stages. Add support for reporting these issue. Do this
by registering an interrupt if available and enabling this error
to trigger that interrupt in the device.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 14:04:03 +01:00
Randy Dunlap 63a886f38d
ASoC: fix soc-core.c kernel-doc warning
Fix kernel-doc warning:

../sound/soc/soc-core.c:2918: warning: Excess function parameter 'legacy_dai_naming' description in 'snd_soc_register_dais'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 12:18:09 +01:00
Srinivas Kandagatla 7aa09ff243
ASoC: q6routing: initialize data correctly
Some of the router data fields are left as default zeros which are
valid dai ids, so initialize these to invalid value of -1.

Without intializing these correctly get_session_from_id() can return
incorrect session resulting in not closing the opened copp and messing
up with the copp ref count.

Fixes: e3a33673e8 ("ASoC: qdsp6: q6routing: Add q6routing driver")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-09-03 12:17:32 +01:00
Andrew F. Davis 5fb6589acc
ASoC: tas6424: Add channel fault reporting
The TAS6426 has a register that reports channel faults such as
overcurrent and continuous DC output. Add reporting of this here.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 16:23:54 +01:00
Mark Brown 4c11d76758
Merge branch 'asoc-4.19' into asoc-4.20 tas dependency 2018-08-31 16:23:43 +01:00
Andrew F. Davis d40e3e9e44
ASoC: tas6424: Save last fault register even when clear
When there is no fault bit set in a fault register we skip the fault
reporting section for that register. This also skips over saving that
registers value. We save the value so we will not double report an
error, but if an error clears then returns we will also not report it
as we did not save the all cleared register value. Fix this by saving
the fault register value in the all clear path.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2018-08-31 16:23:25 +01:00
Andrew F. Davis 919869214b
ASoC: tas6424: Print full register name in error message
The current short version of the register name may be
ambiguous when another fault register detection is added.
Use the full name.

While here fix comment about clearing faults, the CLEAR_FAULT
register actually only clears sticky bits, which are only
warnings, fault bits can only cleared by resolving the fault.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 16:23:05 +01:00
Kuninori Morimoto c2f0898b86
ASoC: simple-card-util: remove dai_link compatible code for platform
Now no simple/audio cards are using legacy dai_link style for platform.
Let's remove compatible code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:59:02 +01:00
Kuninori Morimoto 77b9b84132
ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-scu-card for platform.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:58 +01:00
Kuninori Morimoto 46c73187f2
ASoC: audio-graph-card: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-card for platform.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:54 +01:00
Kuninori Morimoto 24f3bead9b
ASoC: simple-scu-card: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-scu-card for platform.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:50 +01:00
Kuninori Morimoto e58f41e411
ASoC: simple-card: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for platform.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:46 +01:00
Kuninori Morimoto 868cdb4690
ASoC: simple-card-util: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card-util for platform.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:43 +01:00
Kuninori Morimoto daecf46ee0
ASoC: soc-core: use snd_soc_dai_link_component for platform
Current struct snd_soc_dai_link is supporting multicodec,
and it is supporting legacy style of
	codec_name
	codec_of_node
	code_dai_name
This is handled as single entry of multicodec.

We don't have multicpu support yet, but in the future we will.
In such case, we can use snd_soc_dai_link_component for both
cpu/codec. Then the code will be more simple and readble.

As next step, we want to use it for platform, too.
This patch adds snd_soc_dai_link_component style for platform.
We might have multiplatform support in the future, but we
don't know yet. To avoid un-known issue / complex code,
this patch supports just single-platform as 1st step.

If we could use snd_soc_dai_link_component for all CPU/Codec/Platform,
we will switch to new style, and remove legacy code.
This is prepare for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:39 +01:00
Kuninori Morimoto 2967e5ea19
ASoC: simple-card-util: remove dai_link compatible code for codec
Now no simple/audio cards are using legacy dai_link style for codec.
Let's remove compatible code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:35 +01:00
Kuninori Morimoto 04f7267aa8
ASoC: audio-graph-scu-card: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-scu-card for codec.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:31 +01:00
Kuninori Morimoto 1340739d4d
ASoC: audio-graph-scu-card: use simple_dai_props
audi-graph-card and audio-graph-scu-card are very similar driver,
but using different feature. Thus we are keeping synchronization
on these 2 drivers style, because it is easy to confirm / check.

Current big difference between these 2 drivers are "dai_props" on
graph_card_data (= priv).
It will be difficult to keep synchronize if we will add new feature
on audio-graph-scu-card. Thus, this patch synchronize it.

[audio-graph]
struct graph_card_data {
	...
	struct graph_dai_props {
		...
	} *dai_props;
	...
};

[audio-graph-scu]
struct graph_card_data {
	...
	struct asoc_simple_dai *dai_props;
	...
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:27 +01:00
Kuninori Morimoto 8e6746db2e
ASoC: audio-graph-card: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for audio-graph-card for codec.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:23 +01:00
Kuninori Morimoto 2289cc1c78
ASoC: simple-scu-card: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-scu-card for codec.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:19 +01:00
Kuninori Morimoto 5ece10ab99
ASoC: simple-scu-card: use simple_dai_props
simple-card and simple-scu-card are very similar driver,
but using different feature. Thus we are keeping synchronization
on these 2 drivers style, because it is easy to confirm / check.

Current big difference between these 2 drivers are "dai_props" on
simple_card_data (= priv).
It will be difficult to keep synchronize if we will add new feature
on simple-scu-card. Thus, this patch synchronize it.

[simple]
struct simple_card_data {
	...
	struct simple_dai_props {
		...
	} *dai_props;
	...
};

[simple scu]
struct simple_card_data {
	...
	struct asoc_simple_dai *dai_props;
	...
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:15 +01:00
Kuninori Morimoto 710af9196c
ASoC: simple-card: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for codec.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:11 +01:00
Kuninori Morimoto e664de680b
ASoC: simple_card_utils: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.

If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple_card_utils for codec.

[current]
struct snd_soc_dai_link {
	...
	*cpu_name;
	*cpu_of_node;
	*cpu_dai_name;

	*codec_name;
	*codec_of_node;
	*codec_dai_name;
	*codecs;
	num_codecs;

	*platform_name;
	*platform_of_node;
	...
}

[in the future]
struct snd_soc_dai_link {
	...
	*cpus
	num_cpus;

	*codecs;
	num_codecs;

	*platform;
	...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:58:07 +01:00
Matt Flax f853d6b3ba
ASoC: cs4265: Add a S/PDIF enable switch
This patch adds a S/PDIF enable switch as a SOC_SINGLE.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:57:24 +01:00
Matt Flax be47e75eb1
ASoC: cs4265: Add native 32bit I2S transport
The cs4265 uses 32 bit transport on the I2S bus. This patch enables native
32 bit mode for machine drivers which use this sound card driver.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:57:07 +01:00
Matt Flax 6f18bcdaa2
ASoC: cs4265: SOC_SINGLE register value error fix
The cs4265 driver declares the "MMTLR Data Switch" register setting with
a 0 register value rather then the 0x12 register (CS4265_SPDIF_CTL2).
This incorrect value causes alsamixer to fault with the output :
cannot load mixer controls: Input/output error

This patch corrects the register value. alsamixer now runs.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:57:03 +01:00
Andreas Dannenberg db658f40ca
ASoC: codecs: tas5720: add TAS5722 TDM slot width setting support
Unlike the TAS5720, the TAS5722 can be configured to utilize 16-bit wide
slots in TDM mode. This can help easing audio clocking/frequency
requirements.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:56:50 +01:00
Andreas Dannenberg ec94c177bf
ASoC: codecs: tas5720: add TAS5722 specific volume control
The TAS5722 supports modifying volume in 0.25dB steps (as opposed to
0.5dB steps on the TAS5720). Introduce a custom mixer control that
allows taking advantage of this finer output volume granularity.

Also add custom getters/setters for access as the TAS5722 digital volume
controls are split over two registers.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 15:56:46 +01:00
Peter Ujfalusi 5fcb457ac2
ASoC: davinci-mcasp: Add support for FIFO usage caused delay reporting
McASP have write and read FIFO, each 64 words deep.

From the WFIFOS/RFIFOS registers we can read the amount of data currently
in the FIFO which can be directly reported as delay.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-31 11:31:03 +01:00
Takashi Iwai 56e91b1268 ALSA: Move hda_codec.h to include/sound
For easier sharing with ASoC.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAluIAxkTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0NVNB/0cE/j09cyBR80x5gvnFE3Z5NEPNPLP
 yl7sD93xFP6iww3CGJjXgxxDTh2sf7Sro4hcR9ZdD9zSSQ1qMVVY28MJ1YUsbFPu
 TeUkqRFNPjgOpSmwK7T5QpVbIvdTZmmht8umgQ2+Y4vsGu1aKZf80ZT2n/2mjTOe
 bEYfpyjP5V1aVL8JcX4TN3hbGZ2Pth5m404Qe0pkIdv4qqLx2edphJQ7ecU8w3kK
 vTg1gfo7j9CKx7rzHZei/cvA3qXl/g9oufHAfpJDrlYFz6N35qwpA5UCyXqcFVo2
 kZtyFbaBAvBjnhVyMNkdG7PvBMlL6HMLxN3fJbMLPPS30/+IuAsHXkZY
 =wtBB
 -----END PGP SIGNATURE-----

Merge tag 'hda-codec-h-move' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ALSA: Move hda_codec.h to include/sound

For easier sharing with ASoC.
2018-08-30 16:55:38 +02:00
Pierre-Louis Bossart be57bfffb7
ALSA: hda: move hda_codec.h to include/sound
As suggested by Takashi, move this header file to make it easier
to include from e.g. the Intel Skylake driver in follow-up patches

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-30 15:45:10 +01:00
Takashi Iwai 1603764396 ALSA: hda - Fix cancel_work_sync() stall from jackpoll work
On AMD/ATI controllers, the HD-audio controller driver allows a bus
reset upon the error recovery, and its procedure includes the
cancellation of pending jack polling work as found in
snd_hda_bus_codec_reset().  This works usually fine, but it becomes a
problem when the reset happens from the jack poll work itself; then
calling cancel_work_sync() from the work being processed tries to wait
the finish endlessly.

As a workaround, this patch adds the check of current_work() and
applies the cancel_work_sync() only when it's not from the
jackpoll_work.

This doesn't fix the root cause of the reported error below, but at
least, it eases the unexpected stall of the whole system.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200937
Cc: <stable@vger.kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-30 15:21:57 +02:00
Takashi Iwai 3a182c8489 ALSA: hda - Clean up jackpoll_ms option handling
Currently the jackpoll_ms option value is passed indirectly by
referring to an array in chip->jackpoll_ms although each card needs to
see only the assigned value.  Also, the sanity check is done at each
time in get_jackpoll_interval() although basically jackpoll_ms option
is a read-only, hence we need to evaluate only once at probe time.

This patch is the code simplification about the above points: the jack
polling interval is directly set to chip->jackpoll_interval so that it
can be simply copied to each codec.

No functional change but only code reduction.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-30 08:05:58 +02:00
Jerome Brunet 2cfc123eea
ASoC: meson: add axg pdm input
Add pdm input driver for the device found on the amlogic AXG SoC family

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-29 16:04:17 +01:00
Jerome Brunet cb06a037f8
ASoC: dmic: add DT module alias
Before this patch the only alias provided by the dmic module is:
alias:          platform:dmic-codec

Device instantiated from DT will not probe automatically with this

After this patch, here is the new alias list:
alias:          platform:dmic-codec
alias:          of:N*T*Cdmic-codecC*
alias:          of:N*T*Cdmic-codec

Now the dmic codec probes automatically when instantiated from DT.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-29 16:04:16 +01:00
Jerome Brunet 26bcf1c368
ASoC: dmic: add Kconfig prompt for the generic dmic codec.
Add Kconfig prompt for the generic digital mic to make it configurable
through menuconfig

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-29 16:04:15 +01:00
Robert Rosengren dba508b5ab
ASoC: adau17x1: Unused exported functions changed to internal
adau17x1_setup_firmware and adau17x1_has_dsp is only used internally, so
making them static instead of exported.

Signed-off-by: Robert Rosengren <robertr@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-29 12:39:19 +01:00
Kirill Marinushkin 080aaf1089
ASoC: pcm3060: Improve legibility of if-statements
Modified some if-statements to make them more clear

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-29 12:31:07 +01:00
Kirill Marinushkin aec785f6a0
ASoC: pcm3060: Improve stylistics of file comments
Modified the complete file comments in C++ style, to make them look more
intentional

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-29 12:31:03 +01:00
Peter Rosin 1b3b798152
ASoC: atmel: tse850: switch to SPDX license identifier
Convert to // comments in the leading comment, drop the boilerplate
license text and use the correct MODULE_LICENSE.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:51:48 +01:00
Akshu Agrawal a1b1e9880f
ASoC: AMD: Change MCLK to 48Mhz
25Mhz MCLK which was earlier used was of spread type.
Thus, we were not getting accurate rate. The 48Mhz system
clk is of non-spread type and we are changing to it to get
accurate rate.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:51:25 +01:00
Akshu Agrawal c736cbd3a6
ASoC: AMD: Set constraints for DMIC and MAX98357a codec
We support dual channel, 48Khz. This constraint was set only for
da7219. It is being extended to DMIC and MAX98357a.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:51:20 +01:00
Kirill Marinushkin 6ee47d4a8d
ASoC: pcm3060: Add codec driver
This commit adds support for TI PCM3060 CODEC.
The technical documentation is available at [1].

[1] http://ti.com/product/pcm3060

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: M R Swami Reddy <mr.swami.reddy@ti.com>
Cc: Vishwas A Deshpande <vishwas.a.deshpande@ti.com>
Cc: Kevin Cernekee <cernekee@chromium.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:41:24 +01:00
Hans de Goede f8fc397e13
ASoC: Intel: cht-bsw-rt5672: Add key-mappings for the headset buttons
Having the headset buttons send BTN_0, BTN_1 and BTN_2 events is not
really useful. Add mappings to PLAYPAUSE VOLUME_UP and VOLUME_DOWN like
we do in other Intel machine drivers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:38:10 +01:00
Hans de Goede 2ca426a24d
ASoC: Intel: common: Add quirk for Thinkpad 8 tablet
The Thinkpad 8 tablet uses 10EC5640 as ACPI HID, but it has a rt5670 codec
add a quirk for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:37:48 +01:00
Hans de Goede 818838e6bf
ASoC: rt5670: Add quirk for Thinkpad 8 tablet
The Thinkpad 8 needs a quirk for jack-detect and the internal mic to
work correctly.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:37:05 +01:00
Danny Smith b0f2d65129
ASoC: adau17x1: Implemented safeload support
Safeload support has been implemented which is used
when updating for instance filter parameters using
alsa controls. Without safeload support audio can
become distorted during update.

Signed-off-by: Danny Smith <dannys@axis.com>
Signed-off-by: Robert Rosengren <robertr@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:34:37 +01:00
Danny Smith 5ea752c6ef
ASoC: sigmadsp: safeload should not have lower byte limit
Fixed range in safeload conditional to allow safeload to up to 20 bytes,
without a lower limit.

Signed-off-by: Danny Smith <dannys@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:19:20 +01:00
Rakesh Ughreja 6bae5ea949
ASoC: hdac_hda: add asoc extension for legacy HDA codec drivers
This patch adds a kernel module which is used by the legacy HDA
codec drivers as library. This implements hdac_ext_bus_ops to enable
the reuse of 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: Mark Brown <broonie@kernel.org>
2018-08-28 20:18:13 +01:00
Rakesh Ughreja 00deadb5d8
ASoC: Intel: Skylake: use hda_bus instead of hdac_bus
Use hda_bus instead of hdac_bus in the SKL ASoC platform driver to enable
reuse of legacy HDA codec 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: Mark Brown <broonie@kernel.org>
2018-08-28 20:18:12 +01:00
Rakesh Ughreja 3d17871349
ASoC: Intel: Skylake: add HDA BE DAIs
Add support for HDA BE DAIs in SKL platform driver.

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: Mark Brown <broonie@kernel.org>
2018-08-28 20:18:11 +01:00
Rakesh Ughreja 9cdae4352c
ASoC: Intel: Skylake: use HDAudio if ACPI enumeration fails
When no I2S based codec entries are found in the BIOS, check if there are
any HDA codecs detected on the bus. Based on the number of codecs found
take appropriate action in machine driver. If there are two HDA codecs
i.e. iDisp + HDA found on the bus, register DAIs and DAI links for both.
If only one codec i.e. iDisp is found then load only iDisp machine driver.

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: Mark Brown <broonie@kernel.org>
2018-08-28 20:18:09 +01:00
Rakesh Ughreja 7c33b5f169
ASoC: Intel: Boards: Machine driver for SKL+ w/ HDAudio codecs
Add machine driver for Intel platforms (SKL/KBL/BXT/APL) with
HDA and iDisp codecs. This patch adds support for only iDisp (HDMI/DP)
codec. In the following patches support for HDA codecs will be added.

This should work for other Intel platforms as well e.g. GLK,CNL
however this series is not tested on all the platforms.

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: Mark Brown <broonie@kernel.org>
2018-08-28 20:18:08 +01:00
Pierre-Louis Bossart 8dce1d026d
ASoC: Intel: common: add table for HDA-based platforms
Expose a table containing machine driver information for HDAudio-based
platforms handled by ASoC on Intel hardware.

We only set constant values that are valid across multiple
platforms. The firmware name used by the DSP will be set dynamically
for each platform.

The table is made of a single entry for now, if we need more
complicated set-up where HDAudio is mixed with ACPI-enumerated devices
(I2C, SoundWire) then we'd expect the differentiation to be handled
through information provided by the BIOS (as done for KBL
Chromebooks).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:18:07 +01:00
Pierre-Louis Bossart b4af16d617
ALSA: hda: move hda_codec.h to include/sound
As suggested by Takashi, move this header file to make it easier
to include from e.g. the Intel Skylake driver in follow-up patches

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:18:06 +01:00
Pierre-Louis Bossart 960cdd50ca
ASoC: wm8804: Add ACPI support
HID made of either Wolfson/CirrusLogic PCI ID + 8804 identifier.

This helps enumerate the HifiBerry Digi+ HAT boards on the Up2 platform.

The scripts at https://github.com/thesofproject/acpi-scripts can be
used to add the ACPI initrd overlays.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:11:37 +01:00
Shuming Fan 513792c255
ASoC: rt5682: Update calibration function
New calibration sequence allows rt5682 do calibration without
MCLK.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:02:46 +01:00
Shuming Fan 7509487785
ASoC: rt5682: Change DAC/ADC volume scale
The step of DAC/ADC volume scale changes from 0.375dB to 0.75dB

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2018-08-28 20:02:13 +01:00
Ryan Lee ca917f9fe1
ASoC: max98373: Added 10ms sleep after amp software reset
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 20:02:01 +01:00
Jerome Brunet 302df2694b
ASoC: meson: axg-tdm: restrict formats depending on slot width
Restrict the formats possible on the TDM interface depending on the width
of the TDM slot and let dpcm merging do the rest.

Fixes: d60e4f1e4b ("ASoC: meson: add tdm interface driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:53:35 +01:00
Jerome Brunet dadfab7272
ASoC: meson: axg-fifo: report interrupt request failure
Return value of request_irq() was irgnored. Fix this and report
the failure if any

Fixes: 6dc4fa179f ("ASoC: meson: add axg fifo base driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:53:34 +01:00
Jerome Brunet ac16df938e
ASoC: meson: imply clock and reset controllers
Add audio clock controller and ARB reset controller module
implication for the device using them

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:53:11 +01:00
Charles Keepax e33ffbd9cd
ASoC: dpcm: Properly initialise hw->rate_max
If the CPU DAI does not initialise rate_max, say if using
using KNOT or CONTINUOUS, then the rate_max field will be
initialised to 0. A value of zero in the rate_max field of
the hardware runtime will cause the sound card to support no
sample rates at all. Obviously this is not desired, just a
different mechanism is being used to apply the constraints. As
such update the setting of rate_max in dpcm_init_runtime_hw
to be consistent with the non-DPCM cases and set rate_max to
UINT_MAX if nothing is defined on the CPU DAI.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:35:49 +01:00
Charles Keepax a5cd7e9cf5
ASoC: dapm: Don't fail creating new DAPM control on NULL pinctrl
devm_pinctrl_get will only return NULL in the case that pinctrl
is not built into the kernel and all the pinctrl functions used
by the DAPM core are appropriately stubbed for that case. There
is no need to error out of snd_soc_dapm_new_control_unlocked
if pinctrl isn't built into the kernel, so change the
IS_ERR_OR_NULL to just an IS_ERR.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:35:24 +01:00
Charles Keepax d78b1e43e2
ASoC: dapm: Remove clock framework ifdefs
The clock code now has stub functions defined in its header files so
the ifdefs around clocking code should no longer be necessary.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:35:22 +01:00
Rob Herring 5d585e1e75
ASoC: Convert to using %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:07:00 +01:00
Mark Brown 6e2d6b2728 Linux 4.19-rc1
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAluDF64eHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGoX0H/3Vc+MxU4CdAr8s6
 HhAHALmNwgvmYraEzsjGCSqtMXX0H7ni3XonWjm66WMigQi9ypESJgTFGryLECO3
 csLk+BSVWF/L0zliA+orsywMkTRiwwbLsU0gC1Af/pIs3HwuydPAUVuk2cU4eaoh
 sVXpiKopA4FifUuar8mMNhvMbggOYMZ3fdMqhGXTQBcsCPgX6DRB8I9wAN1ONfLU
 bx5ZPrcn4NqQrqHjnG1YVBg5ZRBnTG7UxmBBWRwwSJnqsHs9bmCAq1dTpdxS4HYF
 yw1XelQ9K/u2+JyYoch1fxE8hk8Kj7xB+2BcJImoV0Fms5llDZssBlLgeusQWSU0
 MJQivyk=
 =XPLb
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAluFjq4THGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0F+uB/9dBMK45nI1jEMamtVsEfTFv+3TKH7/
 GBxmFMxDs2wo0njQeetYxUtGqHBOIf30pYgrLOiKvvtFufZlhok3iVduDgYTr+aY
 X1QxTvVH3piQpvp1j/5TmFSfUKaxRIw+1ghsdSCaBB4BlhSyQz46NuzwaOp6gaZ3
 rjVfigycorGwCEM9/QiiynTJm09jmC+mrQ5i6QpqFgaYJtNXamXK6d+NbsHk2pxt
 jfas4P58M9Us8sUBRDWiq17jFFd9z+qvj8BsDgwEB5R4EAzNvQOavzIZUQhpOb2r
 uYQdgeVsqXI51ON+BhbPfsFHPfoe0TSiwBxz/mgM7rpaMh8l3XbiX6f0
 =dl9F
 -----END PGP SIGNATURE-----

Merge tag 'v4.19-rc1' into asoc-4.19

Linux 4.19-rc1
2018-08-28 19:03:57 +01:00
Takashi Iwai 87246f7fd5 ALSA: intel_hdmi: Use the new non-cached allocation
The HDMI LPE audio driver requires the non-cached page allocations for
its buffers.  With the recent support of SNDRV_DMA_TYPE_DEV_UC type,
we can reduce lots of codes in the driver side and let the memalloc
core doing it properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:49 +02:00
Takashi Iwai 4985ddbf1e ALSA: intel8x0: Use the new non-cached allocation for 440MX workaround
intel8x0 driver requires the non-cached pages for 440MX workaround,
and this can be implemented more easily with the new memalloc type,
SNDRV_DMA_TYPE_DEV_UC.  This allows us to reduce lots of code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:48 +02:00
Takashi Iwai 193c7e1476 ALSA: hda: Remove substream allocation/free ops
Since we dropped the memory page fiddling in the own allocators in
hda_intel.c, the substream allocation and free ops in both hda_intel.c
and hda_tegra.c became nothing but the simple calls of the standard
snd_pcm_lib helpers.  As both are identical, there is no longer need
for indirect calls via ops; it's a good opportunity for removing ops
and simplifying the codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:47 +02:00
Takashi Iwai fc47814369 ALSA: hda: Use new non-cached allocation for non-snoop mode
Now the ALSA memory allocator helper supports the new non-cached
pages, let's use the new type, SNDRV_DMA_TYPE_DEV_UC_SG, for HD-audio
driver.  This allows us to reduce lots of codes.

As another positive side-effect by this patch, the long-standing issue
with non-snoop mode playing in the non-mmap mode is fixed.  The core
memalloc helper does the proper pgprot setup for non-cached pages for
vmap(), which was missing in the past.

Reported-and-tested-by: Hans Hu <HansHu@zhaoxin.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:47 +02:00
Takashi Iwai 78c9be61c3 ALSA: hda: Check the non-cached stream buffers more explicitly
Introduce a new flag, uc_buffer, to indicate that the controller
requires the non-cached pages for stream buffers, either as a
chip-specific requirement or specified via snoop=0 option.
This improves the code-readability.

Also, this patch fixes the incorrect behavior for C-Media chip where
the stream buffers were never handled as non-cached due to the check
of driver_type even if you pass snoop=0 option.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:47 +02:00
Takashi Iwai 42e748a0b3 ALSA: memalloc: Add non-cached buffer type
In some cases (mainly for x86), we need the DMA coherent buffer with
non-cached pages.  Although this has been done in each driver side
like HD-audio and intel8x0, it can be done cleaner in the core memory
allocator.

This patch adds the new types, SNDRV_DMA_TYPE_DEV_UC and
SNDRV_DMA_TYPE_DEV_UC_SG, for allocating such non-cached buffer
pages.  On non-x86 architectures, they work as same as the standard
SNDRV_DMA_TYPE_DEV and *_SG.

One additional change by this move is that we can assure to pass the
non-cached pgprot to the vmapped buffer, too.  It eventually fixes the
case like non-snoop mode without mmap access on HD-audio.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:47 +02:00
Takashi Iwai 28f3f4f685 ALSA: memalloc: Simplify snd_malloc_dev_pages() calls
snd_malloc_dev_pages() and snd_free_dev_pages() are local functions
and the parameters passed there are all contained in snd_dma_buffer
object.  As a code-simplification, pass snd_dma_buffer object and
assign the address there like other allocators do (except for
snd_malloc_pages() which is called from outside, hence we can't change
easily).

Only code refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:46 +02:00
Takashi Iwai 03486830c5 ALSA: memalloc: Don't align the size to power-of-two
The size passed to dma_alloc_coherent() doesn't have to be aligned
with power-of-two, rather it should be the raw size.  As a minor
optimization, remove the size adjustment in the current code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-08-28 13:56:46 +02:00