HDMI interface can also be used as receiver, this patch is to
add such support. The most difference compare with TX is that RX
don't need to get edid information.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1606372608-2329-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
of_match_device() already handles properly !CONFIG_OF case, so passing
the argument via of_match_ptr() is not needed.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-40-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/samsung/i2s.c:1646:42: warning: ‘i2sv5_dai_type_i2s1’ defined but not used [-Wunused-const-variable=]
sound/soc/samsung/i2s.c:1639:42: warning: ‘i2sv7_dai_type’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-36-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/es7241.c:206:33: warning: ‘es7241_chip’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-35-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/es7134.c:264:33: warning: ‘es7154_chip’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-34-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/ts3a227e.c:369:34: warning: ‘ts3a227e_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-33-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/tlv320aic23-i2c.c:38:34: warning: ‘tlv320aic23_of_match’ defined but not used [-Wunused-const-variable=]
sound/soc/codecs/tlv320adcx140.c:1076:34: warning: ‘tlv320adcx140_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-32-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/tas2562.c:805:34: warning: ‘tas2562_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-31-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/rt5660.c:1238:34: warning: ‘rt5660_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-30-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/pcm179x-i2c.c:33:34: warning: ‘pcm179x_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-29-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/pcm1789-i2c.c:36:34: warning: ‘pcm1789_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-28-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/max98926.c:574:34: warning: ‘max98926_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-27-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/max98925.c:630:34: warning: ‘max98925_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-26-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/max9867.c:652:34: warning: ‘max9867_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-25-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/max98371.c:411:34: warning: ‘max98371_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-24-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/max98095.c:2151:34: warning: ‘max98095_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-23-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/max98090.c:2671:34: warning: ‘max98090_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-22-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/es8316.c:837:34: warning: ‘es8316_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-21-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/da9055.c:1522:34: warning: ‘da9055_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-20-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/da7219.c:1705:34: warning: ‘da7219_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-19-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/da7218.c:2281:34: warning: ‘da7218_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-18-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/alc5632.c:1170:34: warning: ‘alc5632_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-17-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/alc5623.c:1071:34: warning: ‘alc5623_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-16-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can match by multiple methods. Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:
sound/soc/codecs/ak4118.c:407:34: warning: ‘ak4118_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-15-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/uniphier/aio-ld11.c:375:34: warning: ‘uniphier_aio_of_match’ defined but not used [-Wunused-const-variable=]
sound/soc/uniphier/evea.c:554:34: warning: ‘evea_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-14-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/ti/davinci-i2s.c:750:34: warning: ‘davinci_i2s_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-13-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/rockchip/rockchip_i2s.c:569:34: warning: ‘rockchip_i2s_match’ defined but not used [-Wunused-const-variable=]
sound/soc/rockchip/rockchip_pdm.c:463:34: warning: ‘rockchip_pdm_match’ defined but not used [-Wunused-const-variable=]
sound/soc/rockchip/rockchip_spdif.c:44:34: warning: ‘rk_spdif_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-12-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/samsung/smdk_wm8994.c:139:34: warning: ‘samsung_wm8994_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-11-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/qcom/lpass-apq8016.c:294:34: warning: ‘apq8016_lpass_cpu_device_id’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-10-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/meson/t9015.c:315:34: warning: ‘t9015_ids’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-9-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/kirkwood/armada-370-db.c:137:34: warning: ‘a370db_dt_ids’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-8-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/tas571x.c:892:34: warning: ‘tas571x_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-7-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/rk3328_codec.c:502:34: warning: ‘rk3328_codec_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-6-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/inno_rk3036.c:470:34: warning: ‘rk3036_codec_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-5-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/gtm601.c:90:34: warning: ‘gtm601_codec_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-4-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/bd28623.c:225:34: warning: ‘bd28623_of_match’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-3-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver can be compile tested with !CONFIG_OF making certain data
unused:
sound/soc/codecs/ak5558.c:418:34: warning: ‘ak5558_i2c_dt_ids’ defined but not used [-Wunused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-2-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
To fix errors in some 4 poles headset detection cases,
this patch adjusts the voltage threshold for mic detection.
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20201126092759.9427-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Since we have resource_intersection() helper, let's utilize it here.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Fix to return a negative error code from the error handling case
instead of 0 in function wm_adsp_load(), as done elsewhere in this
function.
Fixes: 170b1e123f ("ASoC: wm_adsp: Add support for new Halo core DSPs")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Luo Meng <luomeng12@huawei.com>
Acked-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201123133839.4073787-1-luomeng12@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This file content describes memory allocation status
at run-time, typically to detect memory leaks.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201124180017.2232128-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Values given in this dictionary describes used firmware configuration,
like feature availability, buffer size limits and similar properties.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201124180017.2232128-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Some laptops like ASUS UX482EG & B9400CEA's headset audio does not work
until the quirk ALC294_FIXUP_ASUS_HPE is applied.
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201124092024.179540-1-jhp@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
.id_table support in this driver was only useful for old non-devicetree
platforms.
Get rid of the .id_table since it is no longer used.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201123200917.16447-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The TI/OMAP sound drivers use Common Clock Framework thus they cannot be
built on platforms without it (e.g. compile test on MIPS with RALINK and
SOC_RT305X):
/usr/bin/mips-linux-gnu-ld: sound/soc/ti/davinci-mcasp.o:davinci-mcasp.c:(.text+0x1c64): more undefined references to `clk_set_parent' follow
/usr/bin/mips-linux-gnu-ld: sound/soc/ti/omap-dmic.o: in function `omap_dmic_set_dai_sysclk':
omap-dmic.c:(.text+0xa5c): undefined reference to `clk_get_parent'
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201116175133.402553-4-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The STM32 I2S drivers use Common Clock Framework thus they cannot be
built on platforms without it (e.g. compile test on MIPS with RALINK and
SOC_RT305X):
/usr/bin/mips-linux-gnu-ld: sound/soc/stm/stm32_i2s.o: in function `stm32_i2s_hw_params':
stm32_i2s.c:(.text+0x1870): undefined reference to `clk_set_parent'
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201116175133.402553-3-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The SH4 FSI sound drivers use SuperH clocks thus they cannot be built on
platforms without proper clock support (e.g. compile test on MIPS with
RALINK and SOC_RT305X):
/usr/bin/mips-linux-gnu-ld: sound/soc/sh/fsi.o: in function `fsi_clk_set_rate_external':
fsi.c:(.text+0x2714): undefined reference to `clk_set_parent'
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201116175133.402553-2-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
In plugged callback, ELD should be updated from display driver so that
user space can query information from ELD immediately after receiving jack
plugged event.
When jack is unplugged, clear ELD buffer so that user space does not get
obsolete information of unplugged HDMI.
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20201118043852.1338877-1-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Fix enabling BCLK and LRCLK only when LPAIF is invalid state and
bit clock in enable state.
In device suspend/resume scenario LPAIF is going to reset state.
which is causing LRCLK disable and BCLK enable.
Avoid such inconsitency by removing unnecessary cpu dai prepare API,
which is doing LRCLK enable, and by maintaining BLCK state information.
Fixes: 7e6799d8f8 ("ASoC: qcom: lpass-cpu: Enable MI2S BCLK and LRCLK together")
Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/1606148273-17325-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Now that the usb audio driver correctly finds implicit feedback endpoints,
the implicit feedback quirk for the MOTU M-Series is no longer required.
This also removes some unnecessary vendor specific messages from the MOTU
M-Series boot quirk. The removed vendor specific messages turned on vendor
specific interrupts to the host every 32 samples. The only thing the boot
quirk needs to do is wait for 2 seconds.
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Signed-off-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-42-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A few other BOSS devices (BR-80, GT-100v2, Katana) seem requiring the
same quirk as BOSS GT-001, i.e. no implicit feedback for playback but
tying with capture. Add and correct the corresponding quirk table
entries for them.
Reported-and-tested-by: Keith Milner <kamilner@superlative.org>
Link: https://lore.kernel.org/r/20201123085347.19667-41-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A new module option, implicit_fb, is added to specify the driver
looking for the implicit feedback sync. This can be useful for a
device that could be working better in the implicit feed back mode and
user wants to test it quickly. When this works, we can add the quirk
entry easily.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-40-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch extends the implicit feedback mode parser code to check the
description more generically, so that the quirk entries can be added
without the explicit EP and interface numbers. The search is done for
the next and the previous interface of the given altset, and if both
entries are ASYNC mode and the direction matches, it just takes as the
sync endpoint. The generic parser is applicable only for the playback
stream.
As of now, only a few M-Audio devices have been converted to use this
mode.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-39-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The code dealing with the implicit feedback mode grew recently, and
it's becoming messy. As we receive more and more devices that need
the similar handling, it's better to be processed through a table
instead of the open code.
This patch moves the code that is relevant with parsing the implicit
feedback mode and some helpers into another file, implicit.c. The
detection and the setup of the implicit feedback sync EPs are
rewritten to use the ID/class matching table instead.
There should be no functional changes.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-38-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The capture stream of BOSS GT-001 seems always requiring to be tied
with the playback stream. OTOH, the playback stream of this device
doesn't seem working in the implicit fb mode, per se, since the
playback must be running before the capture stream.
This patch tries to address the points above:
- Avoid the implicit fb mode for the playback
- Set up a fake sync EP for the capture stream with the hard-coded
playback stream using the implicit fb mode
Reported-by: Keith Milner <kamilner@superlative.org>
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-37-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Now the sync endpoints have been parsed at the beginning and won't be
changed dynamically, let's show them in the proc outputs for helping
debugging.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-36-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Just for consistency, use unsigned char for iface and altsetting in
allover places. Also rearrange the field positions of
snd_usb_endpiont and tidy up with some comments.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-35-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Follow the inclusive terminology, just replace sync_master/sync_slave
with sync_source/sync_sink. It's also a bit clearer from its meaning,
too.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-34-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
There are multiple places in format.c performing the similar code for
setting the rate_min, rate_max and rates fields. This patch unifies
those in a helper function and calls it at the end of the parser phase
so that all rate_table entries have been already determined.
No functional changes, just a minor code refactoring.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-33-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
There are two places calculating the next packet size for the playback
stream in the exactly same way. Provide the single helper for this
purpose and use it from both places gracefully.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-32-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Some fields like interface and alt_idx in snd_usb_substream are mostly
useless now as they can be referred via either cur_audiofmt or
data_endpoint assigned to the substream. Drop those, and also assure
the concurrency about the access of cur_audiofmt field.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-31-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Minor code refactoring to consolidate the URB deactivation code in
endpoint.c. A slight behavior change is that the error handling in
snd_usb_endpoint_start() leaves EP_FLAG_STOPPING now. This should be
synced with the later PCM sync_stop callback.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-30-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The endpoint objects may be started/stopped concurrently by different
substreams in the case of implicit feedback mode, while the current
code handles the reference counter without any protection.
This patch changes the refcount to atomic_t for avoiding the
inconsistency. We need no reference_t here as the refcount goes only
up to 2.
Also the name "use_count" is renamed to "running" since this is about
actually the running status, not the open refcount.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-29-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The audioformat is referred in many places but most of usages are
read-only. Let's add const prefix in the possible places.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-28-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The implicit feedback mode uses a ring buffer for storing the received
packet sizes from the feedback source, and the code has a slight flaw;
when a playback stream stalls by some reason and the URBs aren't
processed, the next_packet FIFO might become empty, but the driver
can't distinguish whether it's empty or full because it's managed with
read_poss and write_pos.
This patch addresses those by changing the next_packet array
management. Instead of keeping read and write positions, now the head
position and the queued amount are kept. It's easier to understand
about the emptiness. Also, the URB active flag is now cleared before
calling queue_pending_output_urbs() for avoiding (theoretically)
possible inconsistency.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-27-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This is an intensive surgery for the endpoint and stream management
for achieving more robust and clean code.
The goals of this patch are:
- More clear endpoint resource changes
- The interface altsetting control in a single place
Below are brief description of the whole changes.
First off, most of the endpoint operations are moved into endpoint.c,
so that the snd_usb_endpoint object is only referred in other places.
The endpoint object is acquired and released via the new functions
snd_usb_endpoint_open() and snd_usb_endpoint_close() that are called
at PCM hw_params and hw_free callbacks, respectively. Those are
ref-counted and EPs can manage the multiple opens.
The open callback receives the audioformat and hw_params arguments,
and those are used for initializing the EP parameters; especially the
endpoint, interface and altset numbers are read from there, as well as
the PCM parameters like the format, rate and channels. Those are
stored in snd_usb_endpoint object. If it's the secondary open, the
function checks whether the given parameters are compatible with the
already opened EP setup, too.
The coupling with a sync EP (including an implicit feedback sync) is
done by the sole snd_usb_endpoint_set_sync() call.
The configuration of each endpoint is done in a single shot via
snd_usb_endpoint_configure() call. This is the place where most of
PCM configurations are done. A few flags and special handling in the
snd_usb_substream are dropped along with this change.
A significant difference wrt the configuration from the previous code
is the order of USB host interface setups. Now the interface is
always disabled at beginning and (re-)enabled at the last step of
snd_usb_endpoint_configure(), in order to be compliant with the
standard UAC2/3. For UAC1, the interface is set before the parameter
setups since there seem devices that require it (e.g. Yamaha THR10),
just like how it was done in the previous driver code.
The start/stop are almost same as before, also single-shots. The URB
callbacks need to be set via snd_usb_endpoint_set_callback() like the
previous code at the trigger phase, too.
Finally, the flag for the re-setup is set at the device suspend
through the full EP list, instead of PCM trigger. This catches the
overlooked cases where the PCM hasn't been running yet but the device
needs the full setup after resume.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-26-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The function to evaluate the match of the parameters with an EP
assumes only the discrete rate tables and doesn't handle the
continuous rates properly.
This patch fixes match_endpoint_audioformats() to handle the
continuous rates. Also the almost useless debug prints there are
dropped.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-25-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The commit 92adc96f8e ("ALSA: usb-audio: set the interface format
after resume on Dell WD19") introduced the workaround for the broken
setup after the resume specifically on a Dell dock model. However,
the full setup should have been performed after the resume on all
devices, as we can't guarantee the same state. So this patch removes
the conditional check and applies the workaround always.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-24-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The prepare_data_urb and retire_data_urb fields of the endpoint object
are set dynamically at PCM trigger start/stop. Those are evaluated in
the endpoint handler, but there can be a race, especially if two
different PCM substreams are handling the same endpoint for the
implicit feedback case. Also, the data_subs field of the endpoint is
set and accessed dynamically, too, which has the same risk.
As a slight improvement for the concurrency, this patch introduces the
function to set the callbacks and the data in a shot with the memory
barrier. In the reader side, it's also fetched with the memory
barrier.
There is still a room of race if prepare and retire callbacks are set
during executing the URB completion. But such an inconsistency may
happen only for the implicit fb source, i.e. it's only about the
capture stream. And luckily, the capture stream never sets the
prepare callback, hence the problem doesn't happen practically.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-23-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
start_endpoints() may leave the data endpoint running if an error
happens at starting the sync endpoint. We should stop both streams
properly, instead.
While we're at it, move the debug prints into the endpoint.c that is a
more suitable place.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-22-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A preliminary change for the later big changes. This is a minor code
refactoring to drop the unnecessary arguments that can be retrieved in
a different way.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-21-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A preliminary change for the later big changes. This is a minor code
refactoring to drop the unnecessary arguments that can be retrieved in
a different way.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-20-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A preliminary patch for the later big change. Just a minor code
refactoring.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-19-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Setting the active altsetting at changing sample rate seems
unrecommended. The host should deselect the altsetting at first
before that, then select it again.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-18-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add a helper function to retrieve the usb_host_interface object from
the given interface and altsetting number pair, which is a commonly
used procedure in the driver code.
No functional changes, just minor code refactoring.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-17-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This behavior turned out to be invalid from the USB spec POV and
shouldn't be applied. As it's an optional flag that is set only via
an card control element that must be hardly used, let's drop it
again.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-16-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Currently snd_usb_endpoint objects are created at first when the
substream is opened and tries to assign the endpoints corresponding to
the matching audioformat. But since basically the all endpoints have
been already parsed and the information have been obtained, we may
create the endpoint objects statically at the init phase. It's easier
to manage for the implicit fb case, for example.
This patch changes the endpoint object management and lets the parser
to create the all endpoint objects.
This change shouldn't bring any functional changes.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-15-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The implicit feedback mode initializes both the main data stream and
the sync data stream. When a sync stream was already opened, this
would result in the doubly initialization and might screw up things.
Add the check of already opened sync streams and skip the unnecessary
initialization.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-14-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The file debug.h contains a simple macro for debug prints, and it's
used only in two places, the format parser and the hw_params rules.
The former actually should print a more informative message instead,
so the only users are the hw_parmas rules.
This patch moves the contents of debug.h into the hw_params rules
local code and remove the unneeded includes. Also, the debug print in
the format parser is replaced with the information print with more
useful information, and the raw printk() call is replaced with
pr_debug().
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-13-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Several hw_params functions narrows the interval via min/max rule in
the very similar way, so factor out those into a helper function and
use commonly.
No functional changes, just minor code refactoring.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-12-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
In the current code, there is no check at the stream open time whether
the endpoint is being already used by others. In the normal
operations, this shouldn't happen, but in the case of the implicit
feedback mode, it's a common problem with the full duplex operation,
because the capture stream is always opened by the playback stream as
an implicit sync source.
Although we recently introduced the check of such a conflict of
parameters at the PCM hw_params time, it doesn't give any hint at the
hw_params itself and just gives the error. This isn't quite
comfortable, and it caused problems on many applications.
This patch attempts to make the parameter handling easier by
introducing the strict hw constraint matching with the counterpart
stream that is being used. That said, when an implicit feedback
playback stream is running before a capture stream is opened, the
capture stream carries the PCM hw-constraint to allow only the same
sample rate, format, periods and period frames as the running playback
stream. If not opened or there is no conflict of endpoints, the
behavior remains as same as before.
Note that this kind of "weak link" should work for most cases, but
this is no concrete solution; e.g. if an application changes the hw
params multiple times while another stream is opened, this would lead
to inconsistencies.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This is a preliminary work for the upcoming hw-constraint change for
the implicit feedback mode.
Currently snd_usb_autoresume() is called at the end of
setup_hwinfo(). It's a bit confusing; because of this implicit
refcount usage, the caller side needs to call snd_usb_autosuspend()
later in the error path although it's not seen inside the function.
Instead, it's clearer to call both snd_usb_autoresume() and suspend()
in the very same function.
It's only refactoring and no functional changes.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of parsing and evaluating the sync endpoint and the implicit
feedback mode at each time the audio stream is opened, let's parse it
once at the probe time, as the all needed information can be obtained
statically from the descriptor or from the quirk.
This patch extends audioformat struct to record the sync endpoint,
interface and altsetting as well as the implicit feedback flag, which
are filled at parsing the streams. Then, set_sync_endpoint() is much
simplified just to follow the already parsed data.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
There are a few rooms for improvements wrt the debug prints:
- The EP debug print is shown only at starting, not at stopping
- The EP debug print contains useless object addresses
- Some helpers show the urb and the EP object addresses, too
This patch addresses those shortcomings.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The sync EP setup isn't cleared at stopping the stream but expected to
be cleared at the next stream start. This may leave the sync link
setup stale and can spoof wrongly when full duplex streams were
running in the implicit fb sync. Let's initialize them properly at
start and end of the stream.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Factor out the code to obtain snd_usb_endpoint object matching with
the given endpoint. It'll be used in the later patch to add the
implicit feedback hw-constraint.
No functional change by this patch itself.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
It seems that many UAC2 devices are with the implicit feedback, but
they couldn't be probed properly because the assumption the driver
takes currently isn't applied: they have the single endpoint for both
data and implicit-fb streams, while we checked only the classical sync
endpoints assigned to the next altsetting in the same interface.
This patch extends the search to match with those typical cases where
the implicit fb stream is found in the next interface number.
While we're at it, slightly refactor the code, not returning 0/-ERROR
but use the standard bool to success/failur, which is more intuitive
in this particular case.
Reported-by: Dylan Robinson <dylan_robinson@motu.com>
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The current driver code assumes blindly that all found sample rates for
the same endpoint from the UAC2 and UAC3 descriptors can be used no
matter which altsetting, but actually this was wrong: some devices
accept only limited sample rates in each altsetting. For determining
which altsetting supports which rate, we need to verify each sample rate
and check the validity via UAC2_AS_VAL_ALT_SETTINGS. This control
reports back the available altsettings as a bitmap.
This patch implements the missing piece above, the verification and
reconstructs the sample rate tables based on the result.
An open question is how to deal with the altsettings that ended up
with no valid sample rates after verification. At least, there is a
device that showed this problem although the sample rates did work in
the later usage (see bug link). For now, we accept such an altset as
is, assuming that it's a firmware bug.
Reported-by: Dylan Robinson <dylan_robinson@motu.com>
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1178203
Link: https://lore.kernel.org/r/20201123085347.19667-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The PCM trigger callback is atomic, hence we must not call a function
like usb_set_interface() there. Calling it from there would lead to a
kernel Oops.
Fix it by moving the usb_set_interface() call to set_sync_endpoint().
Also, apply the snd_usb_set_interface_quirk() for consistency, too.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
In the current code, when the device provides the discrete sample rate
tables with unusual sample rates, the driver tries to gather the whole
values from the audioformat entries and create a hw-constraint rule to
restrict with this single rate list. This is rather inefficient and
may overlook the rates that are associated only with the certain
audioformat entries.
This patch improves the hw constraint setup by rewriting the existing
hw_rule_rate(). The discrete sample rates (identified by rate_table
and nr_rates of format entry) are checked in the existing
hw_rule_rate() instead of extra rules; in the case of discrete rates,
the function compares with each rate table entry and calculates the
min/max values from there. For the contiguous rates, the behavior
doesn't change.
Along with it, snd_usb_pcm_check_knot() and snb_usb_substream
rate_list field become superfluous, thus those are dropped.
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by
an equivalent 'dma_set_mask_and_coherent()' which is much less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20201121083747.1330299-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The only usage of the ops field in the loopback_cable struct is to call
its members, the field it self is never changed. Make it a pointer to
const. This allows us to constify two static loopback_ops structs to
allow the compiler to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20201120231046.76758-1-rikard.falkeborn@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The ignore_machine field in the component driver is used to
ignore the FE DAI links defined in the machine driver,
override BE fixups and set the stream names for the
DAI links defined in the machine driver. This is required
to make SOF compatible with the legacy machine drivers.
In the case of the nocodec machine driver in SOF, there is
no need to rely upon this ignore_machine logic in the core.
Modify the machine driver to set DAI link stream names and the
BE hw_params_fixup callback appropriately.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201120141653.2160134-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This series fixed "LDO_VAUD18-supply" regulator register fail.
We can see the error log "mt6359-sound supply LDO_VAUD18 not found, using
dummy regulator" when register the DAPM widget "LDO_VAUD18"
Otherwise, the power can not be turned on correctly when recording.
Jiaxin Yu (2):
ASoC: mediatek: mt6359: Fix regulator_dev_lookup() fails for id
"LDO_VAUD18"
dt-bindings: mediatek: mt6359: remove unused property for mt6359
Documentation/devicetree/bindings/sound/mt6359.yaml | 9 ---------
sound/soc/codecs/mt6359.c | 7 ++++---
2 files changed, 4 insertions(+), 12 deletions(-)
--
2.18.0
The module snd-intel-dspcfg, suggested by Jaroslav last year,
currently provide the means to select a PCI driver at run-time, based
on quirks, recommendations or user selection via a kernel
parameter. This capability removed a lot of confusions in
distributions and removed the need for recompilations to select legacy
HDaudio, SST or SOF drivers.
This patchset extends the concept to ACPI devices. This was driven by
the desire to at some point deprecate the Atom/SST driver for Baytrail
and Cherrytrail, which is no longer maintained by Intel. By having the
SOF driver enabled by distributions for Baytrail/Cherrytrail, we can
enable more end-user tests and make the transition easier for
distributions (likely in 2021 at this point).
This patchset provides the same solution for Broadwell, mainly to have
a single build for all Intel platforms. SOF on Broadwell remains an
option not recommended for distributions, as long as the 'catpt'
driver is maintained there is no burning desire to make SOF the
default on the three Broadwell-based platforms with the DSP
enabled.
Pierre-Louis Bossart (14):
ASoC: Intel: broadwell: add missing pm_ops
ASoC: Intel: bdw-rt5677: add missing pm_ops
ALSA: hda: intel-dsp-config: add helper for ACPI DSP driver selection
ASoC: soc-acpi: add helper to identify parent driver.
ASoC: Intel: boards: byt/cht: set card and driver name at run time
ASoC: Intel: byt/cht: set pm ops dynamically
ASoC: SOF: acpi: add dynamic selection of DSP driver
ASoC: Intel: Atom: add dynamic selection of DSP driver
ASoC: SOF: Intel: allow for coexistence between SOF and Atom/SST
drivers
ALSA: hda: intel-dsp-config: add Broadwell ACPI DSP driver selection
ASoC: Intel: broadwell: set card and driver name dynamically
ASoC: Intel: catpt: add dynamic selection of DSP driver
ASoC: SOF: Intel: allow for coexistence between SOF and catpt drivers
ALSA: hda: intel-dsp-config: ignore dsp_driver parameter for PCI
legacy devices
include/sound/intel-dsp-config.h | 7 ++
include/sound/soc-acpi.h | 6 +
sound/hda/intel-dsp-config.c | 111 +++++++++++++++++++
sound/soc/intel/Kconfig | 2 +
sound/soc/intel/atom/sst/sst_acpi.c | 8 ++
sound/soc/intel/boards/bdw-rt5650.c | 17 ++-
sound/soc/intel/boards/bdw-rt5677.c | 18 ++-
sound/soc/intel/boards/broadwell.c | 20 ++--
sound/soc/intel/boards/bytcht_cx2072x.c | 27 +++--
sound/soc/intel/boards/bytcht_da7213.c | 27 +++--
sound/soc/intel/boards/bytcht_es8316.c | 29 +++--
sound/soc/intel/boards/bytcr_rt5640.c | 30 +++--
sound/soc/intel/boards/bytcr_rt5651.c | 27 +++--
sound/soc/intel/boards/cht_bsw_max98090_ti.c | 29 +++--
sound/soc/intel/boards/cht_bsw_nau8824.c | 29 +++--
sound/soc/intel/boards/cht_bsw_rt5645.c | 38 ++++---
sound/soc/intel/boards/cht_bsw_rt5672.c | 29 +++--
sound/soc/intel/catpt/device.c | 12 ++
sound/soc/sof/intel/Kconfig | 33 +++---
sound/soc/sof/sof-acpi-dev.c | 14 ++-
20 files changed, 392 insertions(+), 121 deletions(-)
--
2.25.1
Current code does not setup CPU dai (causing -EIO errors on playback)
and does not pass SND_SOC_DAIFMT_I2S to codec fmt (causing i2s-hifi
errors). Fix both errors to enable HDMI audio playback on SM8250. Tested
on RB5 platform.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: aa2e278554 ("ASoC: qcom: sm8250: add sound card qrb5165-rb5 support")
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201119123145.709891-1-dmitry.baryshkov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This platform only had one audio jack.
If it plugged speaker then replug with speaker or headset, the sound
tone will change to abnormal.
Headset Mic also can't record when this issue was happen.
[ Added a short comment about the COEF by tiwai ]
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/593c777dcfef4546aa050e105b8e53b5@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If hw params enables dual phase transmission, then the word length for
the second phase should be set to match the sample format instead of
remaining at the reset default. This matches the configuration already
being done for the first phase.
This driver already sets the phase two sample size, so this should complete
the phase two configuration.
Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Link: https://lore.kernel.org/r/20201119034106.1273906-1-bkylerussell@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC dapm controls currently don't support more than 2 channels. This is
a problem for SOF-based devices where individual volume control cannot
be provided on the 4 DMIC input path.
If we want to provide controls for more than 2 channels, this patch
suggests a simple solution based on an override of the info callback.
For example, in the case with 4 channel DMIC PGAs, a sof_info callback
would be used. Mono and stereo cases will keep using the existing dapm
info callback.
A longer-term solution would be to remove the limits to 2 channels in
ASoC/DAPM/topology. This is a topic Intel is currently looking into,
e.g. by removing the use of 'reg' and 'rreg' fields and use arrays
instead. Such changes will be rather intrusive and touch multiple codec
and platform drivers. Removing restrictions is the right thing to do,
but this will need to be done in steps with lots of validation.
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201111173105.1927466-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mt6359 platform device is instantiated by mfd_add_devices(). In the
case, dev->of_node is NULL so that always fails to get the regulator_dev.
Use regualator-name "vaud18" that in dts node instead of
"LDO_VAUD19-supply". So that we can get regulator_dev through
regulator_lookup_by_name() directly.
Fixes: 64a70744b7 ("ASoC: Fix vaud18 power leakage of mt6359")
Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1605841573-1442-2-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Currently <crypto/sha.h> contains declarations for both SHA-1 and SHA-2,
and <crypto/sha3.h> contains declarations for SHA-3.
This organization is inconsistent, but more importantly SHA-1 is no
longer considered to be cryptographically secure. So to the extent
possible, SHA-1 shouldn't be grouped together with any of the other SHA
versions, and usage of it should be phased out.
Therefore, split <crypto/sha.h> into two headers <crypto/sha1.h> and
<crypto/sha2.h>, and make everyone explicitly specify whether they want
the declarations for SHA-1, SHA-2, or both.
This avoids making the SHA-1 declarations visible to files that don't
want anything to do with SHA-1. It also prepares for potentially moving
sha1.h into a new insecure/ or dangerous/ directory.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
A collection of driver specific fixes, mostly for x86 systems (or CODECs
used mostly on x86) and all for relatively minor issues, the biggest one
being fixing S24_LE format on Keem Bay systems.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl+2peUACgkQJNaLcl1U
h9COxAf/aq+7DrGjU1umHPD/zfS3ppjmN1hNCHBxqiCm1U9SBbBLGlnDMMcPqFQR
wS8SKdDfhKONA7q7fhGDvvFZd07r9HzIFra+9HVjuc5ouKlPkoETF8uDfXqAdOkM
sXkffe45Wh9DqWIPZOng8ZpKVGW6v3oUCAMrlx53t9LUT9Sd8oQrhsx3nwgr/CUb
SmZiBFF5kWpK8CgG82PuDlCHEnsI4SEatYqHtEMYRBfE0K8fzROye7e7WCKBsb/8
QaDf1RrQ599GXLMVJzbFsXpybBwaaP7LWkKCDHfQbAeKZ6EAWH0agbvUq2X1H2nm
/a3Th5SgL6Vm6KXYvIFGHyTq8rbPLg==
=OkNz
-----END PGP SIGNATURE-----
Merge tag 'asoc-fix-v5.10-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.11
A collection of driver specific fixes, mostly for x86 systems (or CODECs
used mostly on x86) and all for relatively minor issues, the biggest one
being fixing S24_LE format on Keem Bay systems.
Now that we have all the support needed for coexistence between ACPI
drivers for Broadwell, remove mutual exclusion in the Kconfig
file. The selection is done by playing with the snd_intel_dspcfg
module 'dsp_driver' parameter.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
On Haswell/Broadwell/Baytrail/Braswell, the DSP is not used for the
HDMI/DP interface, and setting the dsp_driver parameter to a value > 1
has the side effect of preventing the HDaudio legacy driver from
probing.
The DSP driver selection should really only handle cases where a DSP
is actually used. This patch traps all known PCI devices and makes
sure the HDaudio driver can always be probed.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Follow PCI example and stop the probe when another driver is desired
for the same ACPI HID.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add ACPI IDs for Broadwell (and Haswell for consistency). This
addition is required for dynamic selection of drivers on those
devices.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Now that we have all the support needed for coexistence between ACPI
drivers for Baytrail and Cherrytrail, remove mutual exclusion in the
Kconfig file. The selection is done by playing with the snd_intel_dsp
module parameter.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Follow PCI example and stop the probe when another driver is desired
for the same ACPI HID.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Follow PCI example and stop the probe when another driver is desired
for the same ACPI HID.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The Atom/SST driver does not rely on ASoC power management, but the
SOF driver does. Rather than using a hard-coded build-time assignment,
we can set this pm_ops dynamically depending on what the parent
is. That will remove the last build-time dependency and allow for
coexistence of both SST and SOF drivers for Baytrail/Cherrytrail.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
To avoid hard-coded variations between SOF and SST drivers, set the
card name and driver dynamically depending on the parent type. This is
the first pass required to let distributions select which drivers to
use with kernel parameters instead of build-time selection.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mirror capabilities provided for PCI devices, so that distributions
can select which ACPI driver is loaded at run-time with kernel
parameters and DMI tables instead of forcing a build-time selection.
The "legacy" option supported for HDaudio has no meaning here and will
be ignored.
The 'SST' driver based on closed-source firmware has the priority to
avoid any impact on users, and the choice to use SOF is strictly
opt-in. This may change at some point when the 'SST' driver is
deprecated on Baytrail/Cherrytrail.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The code change for switching to non-atomic mode brought the
unexpected mutex deadlock in get_msg(). It converted the spinlock
with the existing mutex, but there were calls with the already holding
the mutex. Since the only place that needs the extra lock is the code
path from snd_mixart_send_msg(), remove the mutex lock in get_msg()
and apply in the caller side for fixing the mutex deadlock.
Fixes: 8d3a8b5cb5 ("ALSA: mixart: Use nonatomic PCM ops")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201119121440.18945-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patchset adds support for two Codec Macro blocks( WSA and VA) available in
Qualcomm LPASS (Low Power Audio SubSystem).
There are WSA, VA, TX and RX Macros on LPASS IP, each of the Macro block
has specific connectivity like WSA Macros are intended to connect
to WSA Smart speaker codecs via SoundWire. VA Macro is intended for DMICs,
and TX/RX for Analog codecs via SoundWire like other WCD Codecs to provide
headphone/ear/lineout etc ..
Most of the work is derived from downstream Qualcomm kernels.
Credits to various Qualcomm authors from Patrick Lai's team who have
contributed to this code.
This patchset has been tested on support to Qualcomm Robotics RB5 Development
Kit based on QRB5165 Robotics SoC. This board has 2 WSA881X smart speakers
with onboard DMIC connected to internal LPASS codec via WSA and VA macros
respectively.
Thanks,
srini
-Changes since v2:
- various unnecessary variable intializations removed, suggested by Pierre
- fixed a static checker error
- collected reviews for dt-bindings.
- fixed licence headers as suggested by Pierre.
Srinivas Kandagatla (6):
ASoC: qcom: dt-bindings: add bindings for lpass wsa macro codec
ASoC: codecs: lpass-wsa-macro: Add support to WSA Macro
ASoC: codecs: lpass-wsa-macro: add dapm widgets and route
ASoC: qcom: dt-bindings: add bindings for lpass va macro codec
ASoC: codecs: lpass-va-macro: Add support to VA Macro
ASoC: codecs: lpass-va-macro: add dapm widgets and routes
.../bindings/sound/qcom,lpass-va-macro.yaml | 67 +
.../bindings/sound/qcom,lpass-wsa-macro.yaml | 69 +
sound/soc/codecs/Kconfig | 8 +
sound/soc/codecs/Makefile | 4 +
sound/soc/codecs/lpass-va-macro.c | 1503 ++++++++++
sound/soc/codecs/lpass-wsa-macro.c | 2464 +++++++++++++++++
sound/soc/codecs/lpass-wsa-macro.h | 17 +
7 files changed, 4132 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
create mode 100644 Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml
create mode 100644 sound/soc/codecs/lpass-va-macro.c
create mode 100644 sound/soc/codecs/lpass-wsa-macro.c
create mode 100644 sound/soc/codecs/lpass-wsa-macro.h
--
2.21.0
Currently, the SND_SOC_DAPM_STREAM_START event is sent during
pcm_prepare() but the SND_SOC_DAPM_STREAM_STOP event is
sent only in dpcm_fe_dai_shutdown() after soc_pcm_close().
This results in an imbalance between when the DAPM widgets
receive the PRE/POST_PMU/PMD events. So call
snd_soc_dapm_stream_stop() in soc_pcm_hw_clean() before the
snd_soc_pcm_component_hw_free() to keep the stream_stop DAPM
event balanced with the stream_start event in soc_pm_prepare().
Also, in order to prevent duplicate DAPM stream events,
remove the call for DAPM STREAM_START event in dpcm_fe_dai_prepare()
and the call for DAPM STREAM_STOP event in dpcm_fe_dai_shutdown().
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20201117215001.163107-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Part of PCM constraints are set based on DSP topology, but rest
should be set based on hardware capabilities. Add PCM constraints
for Intel platforms:
- Add constraint for the period count to be integer. This avoids
wrap-arounds of the DMA circular buffer in middle of a period.
- Align period size to dword/32bit as per HDA spec.
Both constraints are aligned with current implementation in snd-hda-intel
driver.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20201118140545.2138895-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Current SOF implementation limits period and buffer sizes to multiples
of period_min. Period_min is defined in topology, but is in practise set
to align with the SOF DSP timer tick (typically 1ms).
While this approach helps user-space to avoid period sizes, which are
not aligned to the DSP timer tick, it causes problems to applications
which want to align data processing size to that of ALSA period size.
One example is JACK audio server, which limits period sizes to power of
two values.
Other ALSA drivers where audio data transfer is driven by a timer tick,
like USB, do not constraint period and buffer sizes to exact multiple of
the timer tick.
To align SOF to follow the same behaviour, drop the additional alignment
constraints. As a side-effect, this patch can cause irregularity to
period wakeup timing. This happens when application chooses settings
which were previously forbidden. For example, if application configures
period size to 2^14 bytes and audio config of S32_LE/2ch/48000Hz, one
period represents 42.667ms of audio. Without this patch, this
configuration is not allowed by SOF. With the patch applied,
configuration is allowed but the wakeups are paced by the DSP timer
tick, which is typically 1ms. Application will see period wakeups with a
42/43/42/43ms repeating pattern.
Both approaches are valid within ALSA context, but relaxing the
constraints is better aligned with existing applications and other ALSA
drivers like USB audio.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20201118140545.2138895-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Select WANT_DEV_COREDUMP for catpt driver.
Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
--
Changes in v2:
- change should be added to catpt only
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201117145223.21222-1-gustaw.lewandowski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
On VF610, mclk0 = bus_clk;
On i.MX6SX/6UL/6ULL/7D, mclk0 = mclk1;
On i.MX7ULP, mclk0 = bus_clk;
On i.MX8QM/8QXP, mclk0 = bus_clk;
On i.MX8MQ/8MN/8MM/8MP, mclk0 = bus_clk;
So add variable mclk0_is_mclk1 in fsl_sai_soc_data to
distinguish these platforms.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1605768038-4582-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
COMMON_CLK is a user-selectable option with its own dependencies. The
most important dependency is !HAVE_LEGACY_CLK. User-selectable drivers
should not select COMMON_CLK because they will create a dependency cycle
and build failures. For example on MIPS a configuration with COMMON_CLK
(selected by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (selected by
SOC_RT305X) is possible:
WARNING: unmet direct dependencies detected for COMMON_CLK
Depends on [n]: !HAVE_LEGACY_CLK [=y]
Selected by [y]:
- SND_SUN8I_CODEC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] &&
(ARCH_SUNXI || COMPILE_TEST [=y]) && OF [=y] && (MACH_SUN8I || ARM64 && ARCH_SUNXI || COMPILE_TEST [=y])
/usr/bin/mips-linux-gnu-ld: drivers/clk/clk.o: in function `clk_set_rate':
(.text+0xaeb4): multiple definition of `clk_set_rate'; arch/mips/ralink/clk.o:(.text+0x88): first defined here
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20201118201420.4878-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
For some reason this ops is missing in 2 out of the 3 broadwell
drivers. Add to make sure ASoC takes care of power management.
Tested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
For some reason this ops is missing in 2 out of the 3 broadwell
drivers. Add to make sure ASoC takes care of power management.
Tested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add dapm widgets and routes for this codec.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201105113458.12360-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Qualcomm LPASS (Low Power Audio SubSystem) has internal codec
VA macro block which is used for connecting with DMICs.
This patch adds support to the codec part of the VA Macro block
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201105113458.12360-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch adds dapm widgets and routes on this codec
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201105113458.12360-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Qualcomm LPASS (Low Power Audio SubSystem) has internal codec
WSA macro block which is used for connecting with WSA Smart
speakers over soundwire.
This patch adds support to the codec part of the WSA Macro block.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201105113458.12360-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The HP Pavilion x2 Detachable line comes in many variants:
1. Bay Trail SoC + AXP288 PMIC, Micro-USB charging (10-k010nz, ...)
DMI_SYS_VENDOR: "Hewlett-Packard"
DMI_PRODUCT_NAME: "HP Pavilion x2 Detachable PC 10"
DMI_BOARD_NAME: "8021"
2. Bay Trail SoC + AXP288 PMIC, Type-C charging (10-n000nd, 10-n010nl, ...)
DMI_SYS_VENDOR: "Hewlett-Packard"
DMI_PRODUCT_NAME: "HP Pavilion x2 Detachable"
DMI_BOARD_NAME: "815D"
3. Cherry Trail SoC + AXP288 PMIC, Type-C charging (10-n101ng, ...)
DMI_SYS_VENDOR: "HP"
DMI_PRODUCT_NAME: "HP Pavilion x2 Detachable"
DMI_BOARD_NAME: "813E"
4. Cherry Trail SoC + TI PMIC, Type-C charging (10-p002nd, 10-p018wm, ...)
DMI_SYS_VENDOR: "HP"
DMI_PRODUCT_NAME: "HP x2 Detachable 10-p0XX"
DMI_BOARD_NAME: "827C"
5. Cherry Trail SoC + TI PMIC, Type-C charging (x2-210-g2, ...)
DMI_SYS_VENDOR: "HP"
DMI_PRODUCT_NAME: "HP x2 210 G2"
DMI_BOARD_NAME: "82F4"
Variant 1 needs the exact same quirk as variant 2, so relax the DMI check
for the existing quirk a bit so that it matches both variant 1 and 2
(note the other variants will still not match).
Variant 2 already has an existing quirk (which now also matches variant 1)
Variant 3 uses a cx2072x codec, so is not applicable here.
Variant 4 almost works with the defaults, but it also needs a quirk to
fix jack-detection, add a new quirk for this.
Variant 5 does use a RT5640 codec (based on old dmesg output), but was
otherwise not tested, keep using the defaults for this variant.
Fixes: ec8e8418ff ("ASoC: Intel: bytcr_rt5640: Add quirks for various devices")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201118121515.11441-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
CONFIG_PCI=n leads to a compile warning like:
sound/pci/hda/patch_ca0132.c:8214:10: warning: no case matching constant switch condition '0'
due to the missed handling of QUIRK_NONE in ca0132_mmio_init().
Fix it.
Fixes: bf2aa9ccc8 ("ALSA: hda/ca0132 - Cleanup ca0132_mmio_init function.")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20201119120404.16833-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Hi Mark
These are v2 of snd_soc_component_compr_xxx() function patches.
I think component related function should be implemented at
soc-component.c, otherwise it is confusable to read.
These are for it.
v1 -> v2
- fixup function return timing on
snd_soc_component_compr_get_params()
snd_soc_component_compr_get_metadata()
- use mutex at compr side on
snd_soc_component_compr_get_caps()
snd_soc_component_compr_get_codec_caps()
snd_soc_component_compr_copy()
Link: https://lore.kernel.org/r/878sb78ac4.wl-kuninori.morimoto.gx@renesas.com
Kuninori Morimoto (12):
ASoC: soc-component: add snd_soc_component_compr_open()
ASoC: soc-component: add snd_soc_component_compr_free()
ASoC: soc-component: add snd_soc_component_compr_trigger()
ASoC: soc-component: add snd_soc_component_compr_set_params()
ASoC: soc-component: add snd_soc_component_compr_get_params()
ASoC: soc-component: add snd_soc_component_compr_get_caps()
ASoC: soc-component: add snd_soc_component_compr_get_codec_caps()
ASoC: soc-component: add snd_soc_component_compr_ack()
ASoC: soc-component: add snd_soc_component_compr_pointer()
ASoC: soc-component: add snd_soc_component_compr_copy()
ASoC: soc-component: add snd_soc_component_compr_set_metadata()
ASoC: soc-component: add snd_soc_component_compr_get_metadata()
include/sound/soc-component.h | 22 +++
sound/soc/soc-component.c | 255 ++++++++++++++++++++++++++++++++
sound/soc/soc-compress.c | 263 ++++------------------------------
3 files changed, 303 insertions(+), 237 deletions(-)
--
2.25.1
./sound/soc/samsung/midas_wm1811.c:534:3-8: No need to set .owner here. The core will do it.
Remove .owner field if calls are used which set it automatically
Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/1605529740-68757-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The transmit phase register value is never cleared during hw params.
So once hw params sets this bit to handle a two channel format, it
remains configured for dual-phase, which is not desirable for mono
playback.
Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Link: https://lore.kernel.org/r/20201106145905.365903-1-bkylerussell@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The '>=' expression itself is bool, no need to convert it to bool.
Fix the following coccicheck warning:
./sound/soc/codecs/wcd9335.c:3982:25-30: WARNING: conversion to bool not needed here
Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Link: https://lore.kernel.org/r/1604652816-1330-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_get_metadata().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87zh3l6gl8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_set_metadata().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/871rgx7v5t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_copy().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87361d7v5z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_pointer().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/874klt7v65.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_ack().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/875z697v6c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_get_codec_caps().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/877dqp7v6i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_get_caps().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/878sb57v6q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch adds snd_soc_component_compr_get_params().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87a6vl7v6x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch moves soc-compress soc_compr_components_set_params()
to soc-component as snd_soc_component_compr_set_params().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87blg17v74.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch moves soc-compress soc_compr_components_trigger()
to soc-component as snd_soc_component_compr_trigger().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87d00h7v7k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch moves soc-compress soc_compr_components_free()
to soc-component as snd_soc_component_compr_free().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87eekx7v7r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
component related function should be implemented at
soc-component.c.
This patch moves soc-compress soc_compr_components_open()
to soc-component as snd_soc_component_compr_open().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87ft5d7v7x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In kabylake_set_bias_level(), enabling mclk may fail if the clock has
already been enabled by the firmware. Attempts to disable that clock
later will fail with a warning backtrace.
mclk already disabled
WARNING: CPU: 2 PID: 108 at drivers/clk/clk.c:952 clk_core_disable+0x1b6/0x1cf
...
Call Trace:
clk_disable+0x2d/0x3a
kabylake_set_bias_level+0x72/0xfd [snd_soc_kbl_rt5663_rt5514_max98927]
snd_soc_card_set_bias_level+0x2b/0x6f
snd_soc_dapm_set_bias_level+0xe1/0x209
dapm_pre_sequence_async+0x63/0x96
async_run_entry_fn+0x3d/0xd1
process_one_work+0x2a9/0x526
...
Only disable the clock if it has been enabled.
Fixes: 15747a8020 ("ASoC: eve: implement set_bias_level function for rt5514")
Cc: Brent Lu <brent.lu@intel.com>
Cc: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20201111205434.207610-1-linux@roeck-us.net
Signed-off-by: Mark Brown <broonie@kernel.org>
The Intel Keem Bay audio module is only present on Intel Keem Bay SoCs.
Hence add a dependency on ARCH_KEEMBAY, to prevent asking the user about
this driver when configuring a kernel without Intel Keem Bay platform
support.
Fixes: c544912bcc ("ASoC: Intel: Add makefiles and kconfig changes for KeemBay")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20201110145001.3280479-1-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
The Freescale/NXP AUDIO TO HDMI TX module is only present on NXP i.MX 8
Series SoCs. Hence add a dependency on ARCH_MXC, to prevent asking the
user about this driver when configuring a kernel without i.MX 8 platform
support.
Fixes: 8a24c834c0 ("ASoC: fsl_aud2htx: Add aud2htx module driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20201110145120.3280658-1-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
Audio ADI reference designs are also used on some ZynqMP boards, and can
also be used on Intel FPGA boards and also on some more complex FPGA
combinations (FPGA cards connected through PCIe).
This change removes the dependency on Microblaze and Zynq architectures
to allow the usage of this driver for the systems described above.
Signed-off-by: Bogdan Togorean <bogdan.togorean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201110152213.37811-1-alexandru.ardelean@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Found one more Logitech device, BCC950 ConferenceCam, which needs
the same delay here. This makes 3 out of 3 devices I have tried.
Therefore, add a delay for all Logitech devices as it does not hurt.
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Cc: <stable@vger.kernel.org> # 4.19.y, 5.4.y
Link: https://lore.kernel.org/r/20201117122803.24310-1-joakim.tjernlund@infinera.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
First two of the series address bugs connected mainly to offload streams:
- scenarios with very low buffer sizes: RESET_STREAM IPC timeouts
- fix lp clock selection when switching between PAUSE <-> RESUME states:
glitches on first offload when no additional stream is opened
simultaneously
Follow ups are: code reduction and optimization oriented patches.
This has been foretold in:
[PATCH v10 00/14] ASoC: Intel: Catpt - Lynx and Wildcat point
https://www.spinics.net/lists/alsa-devel/msg116440.html
Note: LPT power up/down sequences might get aligned with WPT once
enough testing is done as capabilities are shared for both DSPs.
First, optimize applying of user settings - prevent redundand calls from
happening - and then as mentioned above, streamline power on/off sequence
for LPT and WPT.
Cezary Rojewski (5):
ASoC: Intel: catpt: Skip position update for unprepared streams
ASoC: Intel: catpt: Correct clock selection for dai trigger
ASoC: Intel: catpt: Optimize applying user settings
ASoC: Intel: catpt: Streamline power routines across LPT and WPT
ASoC: Intel: catpt: Cleanup after power routines streamlining
sound/soc/intel/catpt/core.h | 10 ++-
sound/soc/intel/catpt/device.c | 18 +++---
sound/soc/intel/catpt/dsp.c | 56 ++--------------
sound/soc/intel/catpt/pcm.c | 113 ++++++++++++++++-----------------
4 files changed, 74 insertions(+), 123 deletions(-)
--
2.17.1
base-commit: 3650b228f8
Set format from `set_fmt()` func instead of `hw_params()`, plus supportive
commits
Kirill Marinushkin (4):
ASoC: pcm512x: Fix not setting word length if DAIFMT_CBS_CFS
ASoC: pcm512x: Rearrange operations in `hw_params()`
ASoC: pcm512x: Move format check into `set_fmt()`
ASoC: pcm512x: Add support for more data formats
sound/soc/codecs/pcm512x.c | 134 ++++++++++++++++++++++++++++-----------------
1 file changed, 84 insertions(+), 50 deletions(-)
--
2.13.6
Add 32 bit format support for capture in lpass-sc7180
snd_soc_dai_driver capabilities. Need to add contstraints
in machine driver so that only specific format allowed.
Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Signed-off-by: Srinivasa Rao Manidadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/1605512955-7017-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Add Kconfig entries, PCI ID and chip info for Alderlake-S product.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201116142642.2106067-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When compiled with CONFIG_HAVE_CLK, the kernel need to get provider for the
clock API. This is usually selected by the platform and the sound drivers
should not really care about this. However COMPILE_TEST is special and the
platform required may not have been selected, leading to this type of
error:
> aiu-encoder-spdif.c:(.text+0x3a0): undefined reference to `clk_set_parent'
Since we need a sane provider of the API with COMPILE_TEST, depends on
COMMON_CLK.
Fixes: 6dc4fa179f ("ASoC: meson: add axg fifo base driver")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20201116172423.546855-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The "no_headphone" variable is never set to "false" so it could be
uninitialized.
Fixes: e936619b7c ("ASoC: qcom: sc7180: Modify machine driver for sound card")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201116125950.GA44063@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
With LPT switching to WPT-based power on/off routines, functions that
have been previously used by it are rendered redundant so remove them.
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201116133332.8530-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
There is no need for separate power on/off routines for LPT and WPT as
as the protocol is shared for both platforms. Make WPT routines generic
and reuse them in LPT case too.
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201116133332.8530-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Initial user settings such as volume control need to be applied only
once after stream is allocated. As prepare() operation can be invoked
multiple times during the stream's lifetime, relocate
catpt_dai_apply_usettings() and call it directly within
catpt_dai_hw_params() rather than on every catpt_dai_prepare().
catpt_dai_apply_usettings() remains unchanged.
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201116133332.8530-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
During stream start DSP firmware requires LPCS disabled as that moment in
time is resource heavy. Currently high-clock is selected on start of
second stream onwards while low-clock is re-selected before stream
actually leaves RESUME state i.e. PAUSE_STREAM call. Fix this by always
updating clock before RESUME_STREAM and directly after PAUSE_STREAM.
Fixes: a126750fc8 ("ASoC: Intel: catpt: PCM operations")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201116133332.8530-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Playing with very low period sizes may lead to timeouts when awaiting
RESET_STREAM reply for offload streams. This is caused by NOTIFY_POSITION
appearing in the middle of trigger(stop).
Stream is unprepared during trigger(stop) where PAUSE_STREAM IPC gets
invoked. However, all data that is already mixed in DSP firmware's mixer
stream will still be played regardless of the pause. For offload streams,
this means possibility for another NOTIFY_POSITION to process. Keep these
notifications in check by only handling them when stream is in prepared
state.
Fixes: a126750fc8 ("ASoC: Intel: catpt: PCM operations")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201116133332.8530-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Currently, pcm512x driver supports only I2S data format.
This commit adds RJ, LJ, DSP_A and DSP_B as well.
I don't expect regression WRT existing sound cards, because:
* default value in corresponding register of pcm512x codec is 0 == I2S
* existing in-tree sound cards with pcm512x codec are configured for I2S
* i don't see how existing off-tree sound cards with pcm512x codec could be
configured differently - it would not work
* tested explicitly, that there is no regression with Raspberry Pi +
sound card `sound/soc/bcm/hifiberry_dacplus.c`
Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Matthias Reichl <hias@horus.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20201115122306.18164-5-kmarinushkin@birdec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
I would like to describe the reasoning by quoting Peter Ujfalusi
<peter.ujfalusi@ti.com> from his review of this patch series v1 [1]:
> When you bind a link you will use set_fmt for the two sides to see if
> they can agree, that both can support what has been asked.
>
> The pcm512x driver just saves the fmt and say back to that card:
> whatever, I'm fine with it. But runtime during hw_params it can fail due
> to unsupported bus format, which it actually acked to be ok.
>
> This is the difference.
>
> Sure, some device have constraint based on the fmt towards the hw_params
> and it is perfectly OK to do such a checks and rejections or build
> rules/constraints based on fmt, but failing hw_params just because
> set_fmt did not checked that the bus format is not even supported is not
> a nice thing to do.
[1] https://patchwork.kernel.org/project/alsa-devel/patch/
20201109212133.25869-1-kmarinushkin@birdec.com/
Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Matthias Reichl <hias@horus.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20201115122306.18164-4-kmarinushkin@birdec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is a preparation for the next patch in the series.
It's goal is to make format check easy-to-move-out. Theoretically, more
butifications are possile in `hw_params()` func, but my intention in this
commit is to keep behaviour unchanged.
Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Matthias Reichl <hias@horus.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20201115122306.18164-3-kmarinushkin@birdec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In `pcm512x_hw_params()`, the following switch-case:
~~~~
switch (pcm512x->fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS:
~~~~
returns 0, which was preventing word length from being written into codecs
register.
Fixed by writing it into register before checking
`SND_SOC_DAIFMT_MASTER_MASK`.
Tested with Raspberry Pi + sound card `hifiberry_dacplus` in CBS_CFS format
Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Matthias Reichl <hias@horus.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20201115122306.18164-2-kmarinushkin@birdec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
lpass_pcm_data is not freed in error paths. Free it in
error paths to avoid memory leak.
Fixes: 022d00ee0b ("ASoC: lpass-platform: Fix broken pcm data usage")
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/1605416210-14530-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
S24_LE is 24 bit audio in 32 bit container configuration
Fixing the configuration to match the data arrangement of
this audio format.
Fixes: c5477e9667 ("ASoC: Intel: Add KeemBay platform driver")
Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201116061905.32431-2-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The spin_lock/unlock_irq() functions cannot be nested. The problem is
that presumably we would want the IRQs to be re-enabled on the second
call the spin_unlock_irq() but instead it will be enabled at the first
call so IRQs will be enabled earlier than expected.
In this situation the copy_resp_to_buf() function is only called from
one function and it is called with IRQs disabled. We can just use
the regular spin_lock/unlock() functions.
Fixes: 555e8a8f7f ("ALSA: fireworks: Add command/response functionality into hwdep interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201113101241.GB168908@mwanda
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The SOF (Sound Open Firmware) tree contains a lot of references in
topology files to 'codec_slave'/'codec_master' terms, which in turn
come from alsa-lib and ALSA/ASoC topology support at the kernel
level. These terms are no longer compatible with the guidelines
adopted by the kernel community [1], standard organizations, and need
to change in backwards-compatible ways.
The main/secondary terms typically suggested in guidelines don't mean
anything for clocks, this patchset suggests instead the use of
'provider' and 'consumer' terms, with the 'codec' prefix kept to make
it clear that the codec is the reference. The CM/CS suffixes are also
replaced by CP/CC.
It can be argued that the change of suffix is invasive, but finding a
replacement that keeps the M and S shortcuts has proven difficult in
quite a few contexts.
The previous definitions are kept for backwards-compatibility so this
change should not have any functional impact. It is suggested that new
contributions only use the new terms but there is no requirement to
transition immediately to the new definitions for existing code. Intel
will however update all its past contributions related to bit
clock/frame sync configurations immediately.
This patchset contains the kernel changes only, the alsa-lib changes
were shared separately.
Feedback welcome
~Pierre
[1] https://lkml.org/lkml/2020/7/4/229
Pierre-Louis Bossart (4):
ASoC: topology: use inclusive language for bclk and fsync
ASoC: SOF: use inclusive language for bclk and fsync
ASoC: Intel: atom: use inclusive language for SSP bclk/fsync
ASoC: Intel: keembay: use inclusive language for bclk and fsync
include/sound/soc-dai.h | 32 +++++++++++++++---------
include/sound/sof/dai.h | 16 ++++++++----
include/uapi/sound/asoc.h | 22 ++++++++++------
sound/soc/intel/atom/sst-atom-controls.c | 12 ++++-----
sound/soc/intel/atom/sst-atom-controls.h | 4 +--
sound/soc/intel/keembay/kmb_platform.c | 22 ++++++++--------
sound/soc/intel/keembay/kmb_platform.h | 8 +++---
sound/soc/soc-topology.c | 24 +++++++++---------
sound/soc/sof/topology.c | 18 ++++++-------
9 files changed, 89 insertions(+), 69 deletions(-)
--
2.25.1
To meet the most platform, the detection time should be increased to
avoid that the flushing DAC data fails.
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20201113092125.19206-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When processing request to add/replace user-defined element set, check
of given element identifier and decision of numeric identifier is done
in "__snd_ctl_add_replace()" helper function. When the result of check
is wrong, the helper function returns error code. The error code shall
be returned to userspace application.
Current implementation includes bug to return zero to userspace application
regardless of the result. This commit fixes the bug.
Cc: <stable@vger.kernel.org>
Fixes: e1a7bfe380 ("ALSA: control: Fix race between adding and removing a user element")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20201113092043.16148-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
System boot or warm boot with plugged headset.
If it turn on power save mode, Headset Mic will lose.
This patch will solve this issue.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1ae4d98e92c147b780ace3911c4e1d73@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
HP Pavilion x360 Convertible machine, it supported mute led.
GPIO4 high will turn on led.
The patch will enable control led via GPIO4 pin.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1ae4d98e92c147b780ace3911c4e1d73@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The imx-ssi driver was only used by i.MX non-DT platforms.
Since 5.10-rc1, i.MX has been converted to a DT-only platform and all
board files are gone.
Remove the imx-ssi audio driver as there are no more users at all.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201110203937.25684-6-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
SND_SOC_IMX_SSI was only used by i.MX non-DT platforms.
SND_SOC_EUKREA_TLV320 already selects the SND_SOC_FSL_SSI symbol,
which is enough.
Remove the unneeded SND_SOC_IMX_SSI selection.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201110203937.25684-5-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>