- 07 Oct, 2019 8 commits
-
-
Pierre-Louis Bossart authored
When interfaces can be pin-muxed, static information from ACPI might not be enough. Add information on which links needs to be enabled by hardware/firmware for a specific machine driver to be selected. When walking through the list of possible machines, links will be checked, which implies that configurations where multiple links are required need to be checked first. Additional criteria will be needed later, such as which SoundWire Slave devices are actually enabled, but for now this helps detect between basic configurations. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190916214251.13130-2-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Dan Murphy authored
According the documentation for snd_soc_update_bits the API will return a 1 if the update was successful with a value change, a 0 if the update was successful with no value change or a negative if the command just failed. So the value of return in the driver needs to be checked for being less then 0 or the caller may indicate failure when the value actually changed. Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20191007171157.17813-1-dmurphy@ti.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Dan Murphy authored
Remove unused defines and structure variables that are not referenced by the code. If these are needed for future enhancements then they should be added at that time. Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20191007171157.17813-3-dmurphy@ti.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Dan Murphy authored
Remove the unneeded and incorrect read of the TDM_CFG3 register. The read is done but the value is never used. Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20191007171157.17813-2-dmurphy@ti.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Dan Carpenter authored
There are several problems in the error handling in fsl_mqs_probe(). 1) "ret" isn't initialized on some paths. GCC has a feature which warns about uninitialized variables but the code initializes "ret" to zero at the start of the function so the checking is turned off. 2) "gpr_np" is a pointer so initializing it to zero is confusing and generates a Sparse warning. 3) of_parse_phandle() doesn't return error pointers on error, it returns NULL. 4) If devm_snd_soc_register_component() fails then the function should free the "gpr_np". Fixes: 9e28f653 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20191004102208.GB823@mwandaSigned-off-by: Mark Brown <broonie@kernel.org>
-
YueHaibing authored
Fixes gcc '-Wunused-but-set-variable' warning: sound/soc/fsl/fsl_mqs.c: In function fsl_mqs_hw_params: sound/soc/fsl/fsl_mqs.c:54:6: warning: variable bclk set but not used [-Wunused-but-set-variable] It is never used, so can be removed. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20191006105522.58560-1-yuehaibing@huawei.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
YueHaibing authored
If GPIOLIB is not set, building fails: sound/soc/codecs/tas2770.c: In function tas2770_reset: sound/soc/codecs/tas2770.c:38:3: error: implicit declaration of function gpiod_set_value_cansleep; did you mean gpio_set_value_cansleep? [-Werror=implicit-function-declaration] gpiod_set_value_cansleep(tas2770->reset_gpio, 0); ^~~~~~~~~~~~~~~~~~~~~~~~ gpio_set_value_cansleep sound/soc/codecs/tas2770.c: In function tas2770_i2c_probe: sound/soc/codecs/tas2770.c:749:24: error: implicit declaration of function devm_gpiod_get_optional; did you mean devm_regulator_get_optional? [-Werror=implicit-function-declaration] tas2770->reset_gpio = devm_gpiod_get_optional(tas2770->dev, ^~~~~~~~~~~~~~~~~~~~~~~ devm_regulator_get_optional sound/soc/codecs/tas2770.c:751:13: error: GPIOD_OUT_HIGH undeclared (first use in this function); did you mean GPIOF_INIT_HIGH? GPIOD_OUT_HIGH); ^~~~~~~~~~~~~~ GPIOF_INIT_HIGH Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 1a476abc ("tas2770: add tas2770 smart PA kernel driver") Suggested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20191006104631.60608-1-yuehaibing@huawei.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Stephen Boyd authored
This probe function is only called if the device is backed by a DT node, so switch this call to of_device_get_match_data() to reduce code size and simplify a bit. This also avoids needing to reference a potentially undefined variable because of_device_get_match_data() doesn't need to know anything beyond the struct device to find the match table. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Paul Cercueil <paul@crapouillou.net> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com> Cc: <alsa-devel@alsa-project.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20191004214334.149976-8-swboyd@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 04 Oct, 2019 1 commit
-
-
Biju Das authored
Document SoC specific bindings for RZ/G2N (r8a774b1) SoC. Signed-off-by: Biju Das <biju.das@bp.renesas.com> Link: https://lore.kernel.org/r/1570171940-42937-1-git-send-email-biju.das@bp.renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 03 Oct, 2019 7 commits
-
-
Kuninori Morimoto authored
snd_soc_limit_volume() is finding snd_kcontrol by using original coding, but we already have snd_soc_card_get_kcontrol(). Let's use existing function. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y2y3afgd.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
card->rtd_num is used to count rtd. Initialize it at snd_soc_instantiate_card() is very natural and less confusion. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zhijafgk.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
dai / component related resources are created when component is registered, and it will be freed when component was unregistered. These resources are not re-used after that. This means, we can use devm_xxx for dai / component, without thinking about kfree(). This patch uses devm_xxx for these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/8736gbbu1a.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
ALSA needs to setup shortname, longname, and driver. These methods are very similar. This patch adds new soc_setup_card_name() and setup these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874l0rbu1i.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
It is easy to read code if it is cleanly using paired function/naming, like start <-> stop, register <-> unregister, etc, etc. But, current ALSA SoC code is very random, unbalance, not paired, etc. It is easy to create bug at the such code, and it will be difficult to debug. soc_cleanup_card_resources() (a) which is paired function of snd_soc_instantiate_card() (A) is calling soc_remove_dai_links() (*) to remove card related resources, but it is breaking add/remove balance (B)(b)(C)(c)(D)(d), in other words these should be called from soc_cleanup_card_resources() (a) from balance point of view. More headacke is that it is using original removing method for dai_link even though we already have snd_soc_remove_dai_link() which is the function for it (d). This patch removes snd_soc_remove_dai_links() and balance up code. static void soc_remove_dai_links(...) { ... (b) soc_remove_link_dais(card); (c) soc_remove_link_components(card); for_each_card_links_safe(card, link, _link) { ... /* it should use snd_soc_remove_dai_link() here */ (d) list_del(&link->list); } } (a) static int soc_cleanup_card_resources(...) { ... /* remove and free each DAI */ (*) soc_remove_dai_links(card); ... } (A) static int snd_soc_instantiate_card(struct snd_soc_card *card) { ... /* add predefined DAI links to the list */ for_each_card_prelinks(card, i, dai_link) (B) snd_soc_add_dai_link(card, dai_link); ... /* probe all components used by DAI links on this card */ (C) ret = soc_probe_link_components(card); ... /* probe all DAI links on this card */ (D) ret = soc_probe_link_dais(card); ... } Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875zl7bu1r.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
Current rtd, rtd->dev, rtd->codec_dais are created by normal kzalloc(), but we want to use devm_kzalloc() as much as possible. Created rtd->dev is registered by device_register() at soc_new_pcm_runtime(), and it will be freed at soc_free_pcm_runtime() by device_unregister(). This means, if we can use devm_kzalloc(rtd->dev, xxx) for rtd / rtd->codec_dais, all these are automatically freed via soc_free_pcm_runtime(). This patch uses devm_kzalloc(rtd->dev, xxx) for rtd / rtd->codec_dais. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/877e5nbu1z.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
kbuild test robot authored
sound/soc/codecs/tas2770.c:796: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 Fixes: 1a476abc ("tas2770: add tas2770 smart PA kernel driver") CC: Frank Shi <shifu0704@thundersoft.com> Signed-off-by: kbuild test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20191001175504.ufhyxh66psrht42k@332d0cec05f4Signed-off-by: Mark Brown <broonie@kernel.org>
-
- 02 Oct, 2019 4 commits
-
-
Sylwester Nawrocki authored
Rename arndale_rt5631.c to just arnddale.c as we support other CODECs than RT5631. While at it replace spaces in Kconfig with tabs. Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Link: https://lore.kernel.org/r/20191002105652.24821-3-s.nawrocki@samsung.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Sylwester Nawrocki authored
The Arndale boards come with different types of the audio daughter board. In order to support the WM1811 one we add new definition of an ASoC card which will be registered when the driver matches on "samsung,arndale-wm1811" compatible. There is no runtime detection of the audio daughter board type at the moment, compatible string of the audio card needs to be adjusted in DT, e.g. by the bootloader, depending on actual audio board (CODEC) used. Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Link: https://lore.kernel.org/r/20191002105652.24821-2-s.nawrocki@samsung.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Sylwester Nawrocki authored
There is only one DAI link so we can drop an unnecessary loop statement. Use card->dai_link in place of direct static arndale_rt5631_dai[] array dereference as a prerequisite for adding support for other CODECs. Unnecessary assignment of dai_link->codecs->name to NULL is removed. Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Link: https://lore.kernel.org/r/20191002105652.24821-1-s.nawrocki@samsung.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mark Brown authored
-
- 01 Oct, 2019 20 commits
-
-
Liam Girdwood authored
Helps with FW debug as it provides DSP IPC processing context. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-13-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Marcin Rajwa authored
This patch prevents the reset of host period bytes and uses no_stream_position to record requests for stream position. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-10-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Marcin Rajwa authored
The host period bytes value needs to be passed to firmware. However current implementation uses this field for different purpose - to indicate whether FW should send stream position to the host. Therefore this patch introduces another field "no_stream_position", a boolean value aimed to store information about position tracking. This way host_period_bytes preserves its original value. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-9-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Ranjani Sridharan authored
fw_ready should be a mandatory op. Make sure fw_ready ops is set during probe. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-8-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Liam Girdwood authored
Add config option to prevent DSP entering D3 after any FW exception. This can then be used to dump FW context for debug. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-5-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
In a number of debug cases, the DMA-based trace can add problems (e.g. with HDaudio channel allocation). It also generates additional traffic on the bus and if the DMA handling is unreliable will prevent audio use-cases from working normally. Using the trace also requires tools to be installed on the target. The trace can be instead handled as dynamic debug. We can use a Kconfig to force the trace to be enabled in all cases, or use a module parameter to enable it on a need-basis, e.g. by setting "options snd_sof sof_debug=0x1" in a /etc/modprobe.d file. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-4-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Jaska Uimonen authored
When removing sof module the support_button_press function will oops because hp_jack pointer is not checked for NULL. So add a check to fix this. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927201408.925-2-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Jaska Uimonen authored
When removing sof module the rt5682 jack handler will oops if jack detection is not disabled. So add remove function, which disables the jack detection. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927201408.925-5-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Jaska Uimonen authored
Implement NULL handler in set_jack function to disable irq's. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927201408.925-4-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Bard Liao authored
dmic map can only be added when dmic dai link is present. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927201408.925-3-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Ranjani Sridharan authored
There is a known issue on some Intel platforms which causes pause/release to run into xrun's during capture usecases. The suggested workaround to address the issue is to disable the entry of lower power L1 state in the physical DMI link when there is a capture stream open. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-14-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Liam Girdwood authored
FW mailbox offset was not set before use and HDR size was not validated. Fix this. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-12-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kai Vehmanen authored
The "snd_pcm_substream" handle was not initialized properly in hda-loader.c for firmware load. When the HDA DMAs were used to load the firmware, the interrupts related to firmware load also triggered calls to snd_sof_pcm_period_elapsed() on a non-existent ALSA PCM stream. This caused runtime kernel warnings from pcm_lib.c:snd_pcm_period_elapsed(). Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-11-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pan Xiuli authored
The old STOP sequence is: 1. stop DMA 2. send STOP ipc If delay happen before the steps 1 and 2, the DMA buffer will be empty in short time and cause pipeline xrun then stop the pipeline. Then the step 2 ipc stop will return error as pipeline is already stopped. Suggested change to avoid the issue is to switch the order of steps 1 and 2 for the stop sequence. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-7-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kai Vehmanen authored
Fix a bug in sof_pcm_hw_free() where some cleanup actions were skipped if STREAM_PCM_FREE IPC was already successfully sent to DSP when the stream was stopped or suspended. This is incorrect as hw_free should clean up also other resources, including pcm lib page allocations, period elapsed work queue and call to platform hw_free. Fixes: c29d96c3b9b4 ("ASoC: SOF: reset DMA state in prepare") Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-6-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Keyon Jie authored
We are using sof_parse_word_tokens() to parse tokens with bool/byte/short/word tuple types, here add the missing check, to fix the parsing failure at byte/bool tuple types. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-3-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Pierre-Louis Bossart authored
When we fail to boot the firmware, we encounter a kernel oops in hda_dsp_get_registers(), which is called conditionally in hda_dsp_dump() when the sdev_>boot_complete flag is set. Setting this flag _after_ dumping the data fixes the issue and does not change the programming flow. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190927200538.660-2-pierre-louis.bossart@linux.intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Charles Keepax authored
Some Madera CODECs have a third MCLK pin allow this to be sourced for the FLLs and system clocks. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20191001135700.31017-1-ckeepax@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Li Xu authored
Fix potential NULL pointer dereference for alg_region in wm_adsp_buffer_parse_legacy. In practice this can never happen as loading the firmware should have failed at the wm_adsp2_setup_algs stage, however probably better for the code to be robust against future changes and this is more helpful for static analysis. Signed-off-by: Li Xu <li.xu@cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20191001130911.19238-1-ckeepax@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Sathyanarayana Nujella authored
Below Oops is caused in a system which uses ACPI instead of device node: of_get_named_gpiod_flags: can't parse 'maxim,reset-gpio' property of node '(null)[0]' BUG: kernel NULL pointer dereference, address: 0000000000000010 This patch avoids NULL pointer deferencing by adding a check before parsing and initializes to make reset-gpio pin as invalid. Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> Signed-off-by: Jairaj Arava <jairaj.arava@intel.com> Link: https://lore.kernel.org/r/1569702150-11976-1-git-send-email-sathyanarayana.nujella@intel.comSigned-off-by: Mark Brown <broonie@kernel.org>
-