ASoC: SOF: last patches for 2019
Subsystems (5)
cover ASoC: SOF: last patches for 2019
This patchset adds a set of somewhat independent changes for i.MX, Intel, boards and core.
Guido Roncarolo (2):
ASoC: SOF: imx: Describe SAI parameters to be sent to DSP
ASoC: SOF: imx: Read SAI parameters and send them to DSP
Kai Vehmanen (2):
ASoC: SOF: Intel: drop HDA codec upon probe failure
ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency
Karol Trzcinski (2):
ASoC: SOF: define struct with compiler name and version
ASoC: SOF: log compiler name and version information
Ranjani Sridharan (1):
ASoC: SOF: Introduce state machine for FW boot
Yong Zhi (1):
ASoC: Intel: Add machine driver for da7219_max98373
include/sound/sof/dai-imx.h | 20 + include/sound/sof/dai.h | 1 + include/sound/sof/info.h | 15 + include/uapi/sound/sof/tokens.h | 3 +- sound/soc/intel/boards/Kconfig | 28 +- sound/soc/intel/boards/Makefile | 3 + sound/soc/intel/boards/sof_da7219_max98373.c | 371 ++++++++++++++++++ .../intel/common/soc-acpi-intel-jsl-match.c | 7 + sound/soc/sof/core.c | 50 ++- sound/soc/sof/intel/hda-codec.c | 12 +- sound/soc/sof/intel/hda-loader.c | 1 - sound/soc/sof/intel/hda.c | 4 +- sound/soc/sof/intel/hda.h | 4 +- sound/soc/sof/ipc.c | 17 +- sound/soc/sof/loader.c | 58 ++- sound/soc/sof/pcm.c | 8 + sound/soc/sof/pm.c | 21 +- sound/soc/sof/sof-priv.h | 12 +- sound/soc/sof/topology.c | 69 +++- 19 files changed, 662 insertions(+), 42 deletions(-) create mode 100644 sound/soc/intel/boards/sof_da7219_max98373.c
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 1/8 ASoC: SOF: Introduce state machine for FW boot
From: Ranjani Sridharan <[email protected]>
Add a state machine for FW boot to track the different stages of FW boot and replace the boot_complete field with fw_state field in struct snd_sof_dev. This will be used to determine the actions to be performed during system suspend.
One of the main motivations for adding this change is the fact that errors during the top-level SOF device probe cannot be propagated and therefore suspending the SOF device normally during system suspend could potentially run into errors. For example, with the current flow, if the FW boot failed for some reason and the system suspends, the SOF device suspend could fail because the CTX_SAVE IPC would be attempted even though the FW never really booted successfully causing it to time out. Another scenario that the state machine fixes is when the runtime suspend for the SOF device fails and the DSP is powered down nevertheless, the CTX_SAVE IPC during system suspend would timeout because the DSP is already powered down.
--- sound/soc/sof/core.c | 50 +++++++++++++++++++++++++++++++- sound/soc/sof/intel/hda-loader.c | 1 - sound/soc/sof/intel/hda.c | 4 +-- sound/soc/sof/ipc.c | 17 ++++------- sound/soc/sof/loader.c | 19 ++++++++---- sound/soc/sof/pm.c | 21 +++++++++++++- sound/soc/sof/sof-priv.h | 11 ++++++- 7 files changed, 99 insertions(+), 24 deletions(-)
sound/soc/sof/core.c +49 -1
@@ -92,6 +92,46 @@ void snd_sof_get_status(struct snd_sof_dev *sdev, u32 panic_code, }EXPORT_SYMBOL (snd_sof_get_status); +/* +* FW Boot State Transition Diagram +* +* +-----------------------------------------------------------------------+ +* | | +* ------------------ ------------------ | +* | | | | | +* | BOOT_FAILED | | READY_FAILED |-------------------------+ | +* | | | | | | +* ------------------ ------------------ | | +* ^ ^ | | +* | | | | +* (FW Boot Timeout) (FW_READY FAIL) | | +* | | | | +* | | | | +* ------------------ | ------------------ | | +* | | | | | | | +* | IN_PROGRESS |---------------+------------->| COMPLETE | | | +* | | (FW Boot OK) (FW_READY OK) | | | | +* ------------------ ------------------ | | +* ^ | | | +* | | | | +* (FW Loading OK) (System Suspend/Runtime Suspend) +* | | | | +* | | | | +* ------------------ ------------------ | | | +* | | | |<-----+ | | +* | PREPARE | | NOT_STARTED |<---------------------+ | +* | | | |<---------------------------+ +* ------------------ ------------------ +* | ^ | ^ +* | | | | +* | +-----------------------+ | +* | (DSP Probe OK) | +* | | +* | | +* +------------------------------------+ +* (System Suspend/Runtime Suspend) +*/ +static int sof_probe_continue (struct snd_sof_dev *sdev) {struct snd_sof_pdata *plat_data = sdev->pdata;
@@ -104,6 +144,8 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)return ret; } + sdev->fw_state =SOF_FW_BOOT_PREPARE ; +/* check machine info */ ret =sof_machine_check (sdev);if (ret <0 ) {
@@ -143,7 +185,12 @@ static int sof_probe_continue(struct snd_sof_dev *sdev) goto fw_load_err; } -/* boot the firmware */ + sdev->fw_state =SOF_FW_BOOT_IN_PROGRESS ; + +/* +* Boot the firmware. The FW boot status will be modified +* in snd_sof_run_firmware() depending on the outcome. +*/ ret =snd_sof_run_firmware (sdev);if (ret <0 ) { dev_err(sdev->dev, "error: failed to boot DSP firmware %d\n",
@@ -254,6 +301,7 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data) sdev->pdata = plat_data; sdev->first_boot = true; + sdev->fw_state =SOF_FW_BOOT_NOT_STARTED ;dev_set_drvdata (dev, sdev);/* check all mandatory ops */
sound/soc/sof/intel/hda-loader.c +0 -1
@@ -295,7 +295,6 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)/* init for booting wait */ init_waitqueue_head (&sdev->boot_wait); - sdev->boot_complete = false;/* prepare DMA for code loader stream */ tag = cl_stream_prepare(sdev, 0x40, stripped_firmware.size,
sound/soc/sof/intel/hda.c +2 -2
@@ -168,7 +168,7 @@ void hda_dsp_dump_skl(struct snd_sof_dev *sdev, u32 flags) panic =snd_sof_dsp_read (sdev,HDA_DSP_BAR ,HDA_ADSP_ERROR_CODE_SKL +0x4 ); -if (sdev->boot_complete) { +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE ) {hda_dsp_get_registers (sdev, &xoops, &panic_info, stack,HDA_DSP_STACK_DUMP_SIZE ); snd_sof_get_status(sdev, status, panic, &xoops, &panic_info,
@@ -195,7 +195,7 @@ void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) HDA_DSP_SRAM_REG_FW_STATUS); panic =snd_sof_dsp_read (sdev,HDA_DSP_BAR ,HDA_DSP_SRAM_REG_FW_TRACEP ); -if (sdev->boot_complete) { +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE ) {hda_dsp_get_registers (sdev, &xoops, &panic_info, stack,HDA_DSP_STACK_DUMP_SIZE ); snd_sof_get_status(sdev, status, panic, &xoops, &panic_info,
sound/soc/sof/ipc.c +5 -12
@@ -347,19 +347,12 @@ void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev)break ;case SOF_IPC_FW_READY :/* check for FW boot completion */ -if (!sdev->boot_complete) { +if (sdev->fw_state ==SOF_FW_BOOT_IN_PROGRESS ) { err =sof_ops (sdev)->fw_ready (sdev, cmd); -if (err <0 ) { -/* -* this indicates a mismatch in ABI -* between the driver and fw -*/ -dev_err (sdev->dev,"error: ABI mismatch %d\n" , - err); - }else { -/* firmware boot completed OK */ - sdev->boot_complete = true; - } +if (err <0 ) + sdev->fw_state =SOF_FW_BOOT_READY_FAILED ; +else + sdev->fw_state =SOF_FW_BOOT_COMPLETE ;/* wake up firmware loader */ wake_up (&sdev->boot_wait);
sound/soc/sof/loader.c +13 -6
@@ -512,7 +512,6 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)int init_core_mask;init_waitqueue_head (&sdev->boot_wait); - sdev->boot_complete = false;/* create read-only fw_version debugfs to store boot version info */ if (sdev->first_boot) {
@@ -544,19 +543,27 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev) init_core_mask = ret; -/* now wait for the DSP to boot */ - ret =wait_event_timeout (sdev->boot_wait, sdev->boot_complete, +/* +* now wait for the DSP to boot. There are 3 possible outcomes: +* 1. Boot wait times out indicating FW boot failure. +* 2. FW boots successfully and fw_ready op succeeds. +* 3. FW boots but fw_ready op fails. +*/ + ret =wait_event_timeout (sdev->boot_wait, + sdev->fw_state >SOF_FW_BOOT_IN_PROGRESS ,msecs_to_jiffies (sdev->boot_timeout));if (ret ==0 ) {dev_err (sdev->dev,"error: firmware boot failure\n" );snd_sof_dsp_dbg_dump (sdev,SOF_DBG_REGS |SOF_DBG_MBOX |SOF_DBG_TEXT |SOF_DBG_PCI ); -/* after this point FW_READY msg should be ignored */ - sdev->boot_complete = true; + sdev->fw_state =SOF_FW_BOOT_FAILED ;return -EIO ; } -dev_info (sdev->dev,"firmware boot complete\n" ); +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE ) +dev_info (sdev->dev,"firmware boot complete\n" ); +else +return -EIO ;/* FW boots but fw_ready op failed */ /* perform post fw run operations */ ret =snd_sof_dsp_post_fw_run (sdev);
sound/soc/sof/pm.c +20 -1
@@ -70,6 +70,8 @@ static int sof_resume(struct device *dev, bool runtime_resume)return ret; } + sdev->fw_state =SOF_FW_BOOT_PREPARE ; +/* load the firmware */ ret =snd_sof_load_firmware (sdev);if (ret <0 ) {
@@ -79,7 +81,12 @@ static int sof_resume(struct device *dev, bool runtime_resume)return ret; } -/* boot the firmware */ + sdev->fw_state =SOF_FW_BOOT_IN_PROGRESS ; + +/* +* Boot the firmware. The FW boot status will be modified +* in snd_sof_run_firmware() depending on the outcome. +*/ ret =snd_sof_run_firmware (sdev);if (ret <0 ) { dev_err(sdev->dev,
@@ -128,6 +135,9 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)if (!sof_ops (sdev)->suspend)return 0 ; +if (sdev->fw_state !=SOF_FW_BOOT_COMPLETE ) + goto power_down; +/* release trace */ snd_sof_release_trace (sdev);
@@ -165,6 +175,12 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) ret); } +power_down: + +/* return if the DSP was not probed successfully */ +if (sdev->fw_state ==SOF_FW_BOOT_NOT_STARTED ) +return 0 ; +/* power down all DSP cores */ if (runtime_suspend) ret =snd_sof_dsp_runtime_suspend (sdev);
@@ -175,6 +191,9 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)"error: failed to power down DSP during suspend %d\n" , ret); +/* reset FW state */ + sdev->fw_state =SOF_FW_BOOT_NOT_STARTED ; +return ret; }
sound/soc/sof/sof-priv.h +10 -1
@@ -298,6 +298,15 @@ struct snd_sof_ipc_msg {bool ipc_complete; }; +enum snd_sof_fw_state { +SOF_FW_BOOT_NOT_STARTED =0 , +SOF_FW_BOOT_PREPARE , +SOF_FW_BOOT_IN_PROGRESS , +SOF_FW_BOOT_FAILED , +SOF_FW_BOOT_READY_FAILED ,/* firmware booted but fw_ready op failed */ +SOF_FW_BOOT_COMPLETE , +}; +/* * SOF Device Level. */
@@ -319,7 +328,7 @@ struct snd_sof_dev {/* DSP firmware boot */ wait_queue_head_t boot_wait; -u32 boot_complete; +enum snd_sof_fw_state fw_state;u32 first_boot;/* work queue in case the probe is implemented in two steps */
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: SOF: Introduce state machine for FW boot" to the asoc tree
The patch
ASoC: SOF: Introduce state machine for FW boot
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 6ca5cecbd1c1758666ab79446f19e0e61ed11444 Mon Sep 17 00:00:00 2001
From: Ranjani Sridharan <[email protected]>
Date: Tue, 17 Dec 2019 18:26:09 -0600
Subject: [PATCH] ASoC: SOF: Introduce state machine for FW boot
Add a state machine for FW boot to track the different stages of FW boot and replace the boot_complete field with fw_state field in struct snd_sof_dev. This will be used to determine the actions to be performed during system suspend.
One of the main motivations for adding this change is the fact that errors during the top-level SOF device probe cannot be propagated and therefore suspending the SOF device normally during system suspend could potentially run into errors. For example, with the current flow, if the FW boot failed for some reason and the system suspends, the SOF device suspend could fail because the CTX_SAVE IPC would be attempted even though the FW never really booted successfully causing it to time out. Another scenario that the state machine fixes is when the runtime suspend for the SOF device fails and the DSP is powered down nevertheless, the CTX_SAVE IPC during system suspend would timeout because the DSP is already powered down.
--- sound/soc/sof/core.c | 50 +++++++++++++++++++++++++++++++- sound/soc/sof/intel/hda-loader.c | 1 - sound/soc/sof/intel/hda.c | 4 +-- sound/soc/sof/ipc.c | 17 ++++------- sound/soc/sof/loader.c | 19 ++++++++---- sound/soc/sof/pm.c | 21 +++++++++++++- sound/soc/sof/sof-priv.h | 11 ++++++- 7 files changed, 99 insertions(+), 24 deletions(-)
sound/soc/sof/core.c +49 -1
@@ -92,6 +92,46 @@ void snd_sof_get_status(struct snd_sof_dev *sdev, u32 panic_code, }EXPORT_SYMBOL (snd_sof_get_status); +/* +* FW Boot State Transition Diagram +* +* +-----------------------------------------------------------------------+ +* | | +* ------------------ ------------------ | +* | | | | | +* | BOOT_FAILED | | READY_FAILED |-------------------------+ | +* | | | | | | +* ------------------ ------------------ | | +* ^ ^ | | +* | | | | +* (FW Boot Timeout) (FW_READY FAIL) | | +* | | | | +* | | | | +* ------------------ | ------------------ | | +* | | | | | | | +* | IN_PROGRESS |---------------+------------->| COMPLETE | | | +* | | (FW Boot OK) (FW_READY OK) | | | | +* ------------------ ------------------ | | +* ^ | | | +* | | | | +* (FW Loading OK) (System Suspend/Runtime Suspend) +* | | | | +* | | | | +* ------------------ ------------------ | | | +* | | | |<-----+ | | +* | PREPARE | | NOT_STARTED |<---------------------+ | +* | | | |<---------------------------+ +* ------------------ ------------------ +* | ^ | ^ +* | | | | +* | +-----------------------+ | +* | (DSP Probe OK) | +* | | +* | | +* +------------------------------------+ +* (System Suspend/Runtime Suspend) +*/ +static int sof_probe_continue (struct snd_sof_dev *sdev) {struct snd_sof_pdata *plat_data = sdev->pdata;
@@ -104,6 +144,8 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)return ret; } + sdev->fw_state =SOF_FW_BOOT_PREPARE ; +/* check machine info */ ret =sof_machine_check (sdev);if (ret <0 ) {
@@ -143,7 +185,12 @@ static int sof_probe_continue(struct snd_sof_dev *sdev) goto fw_load_err; } -/* boot the firmware */ + sdev->fw_state =SOF_FW_BOOT_IN_PROGRESS ; + +/* +* Boot the firmware. The FW boot status will be modified +* in snd_sof_run_firmware() depending on the outcome. +*/ ret =snd_sof_run_firmware (sdev);if (ret <0 ) { dev_err(sdev->dev, "error: failed to boot DSP firmware %d\n",
@@ -254,6 +301,7 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data) sdev->pdata = plat_data; sdev->first_boot = true; + sdev->fw_state =SOF_FW_BOOT_NOT_STARTED ;dev_set_drvdata (dev, sdev);/* check all mandatory ops */
sound/soc/sof/intel/hda-loader.c +0 -1
@@ -295,7 +295,6 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)/* init for booting wait */ init_waitqueue_head (&sdev->boot_wait); - sdev->boot_complete = false;/* prepare DMA for code loader stream */ tag = cl_stream_prepare(sdev, 0x40, stripped_firmware.size,
sound/soc/sof/intel/hda.c +2 -2
@@ -168,7 +168,7 @@ void hda_dsp_dump_skl(struct snd_sof_dev *sdev, u32 flags) panic =snd_sof_dsp_read (sdev,HDA_DSP_BAR ,HDA_ADSP_ERROR_CODE_SKL +0x4 ); -if (sdev->boot_complete) { +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE ) {hda_dsp_get_registers (sdev, &xoops, &panic_info, stack,HDA_DSP_STACK_DUMP_SIZE ); snd_sof_get_status(sdev, status, panic, &xoops, &panic_info,
@@ -195,7 +195,7 @@ void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags) HDA_DSP_SRAM_REG_FW_STATUS); panic =snd_sof_dsp_read (sdev,HDA_DSP_BAR ,HDA_DSP_SRAM_REG_FW_TRACEP ); -if (sdev->boot_complete) { +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE ) {hda_dsp_get_registers (sdev, &xoops, &panic_info, stack,HDA_DSP_STACK_DUMP_SIZE ); snd_sof_get_status(sdev, status, panic, &xoops, &panic_info,
sound/soc/sof/ipc.c +5 -12
@@ -347,19 +347,12 @@ void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev)break ;case SOF_IPC_FW_READY :/* check for FW boot completion */ -if (!sdev->boot_complete) { +if (sdev->fw_state ==SOF_FW_BOOT_IN_PROGRESS ) { err =sof_ops (sdev)->fw_ready (sdev, cmd); -if (err <0 ) { -/* -* this indicates a mismatch in ABI -* between the driver and fw -*/ -dev_err (sdev->dev,"error: ABI mismatch %d\n" , - err); - }else { -/* firmware boot completed OK */ - sdev->boot_complete = true; - } +if (err <0 ) + sdev->fw_state =SOF_FW_BOOT_READY_FAILED ; +else + sdev->fw_state =SOF_FW_BOOT_COMPLETE ;/* wake up firmware loader */ wake_up (&sdev->boot_wait);
sound/soc/sof/loader.c +13 -6
@@ -512,7 +512,6 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)int init_core_mask;init_waitqueue_head (&sdev->boot_wait); - sdev->boot_complete = false;/* create read-only fw_version debugfs to store boot version info */ if (sdev->first_boot) {
@@ -544,19 +543,27 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev) init_core_mask = ret; -/* now wait for the DSP to boot */ - ret =wait_event_timeout (sdev->boot_wait, sdev->boot_complete, +/* +* now wait for the DSP to boot. There are 3 possible outcomes: +* 1. Boot wait times out indicating FW boot failure. +* 2. FW boots successfully and fw_ready op succeeds. +* 3. FW boots but fw_ready op fails. +*/ + ret =wait_event_timeout (sdev->boot_wait, + sdev->fw_state >SOF_FW_BOOT_IN_PROGRESS ,msecs_to_jiffies (sdev->boot_timeout));if (ret ==0 ) {dev_err (sdev->dev,"error: firmware boot failure\n" );snd_sof_dsp_dbg_dump (sdev,SOF_DBG_REGS |SOF_DBG_MBOX |SOF_DBG_TEXT |SOF_DBG_PCI ); -/* after this point FW_READY msg should be ignored */ - sdev->boot_complete = true; + sdev->fw_state =SOF_FW_BOOT_FAILED ;return -EIO ; } -dev_info (sdev->dev,"firmware boot complete\n" ); +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE ) +dev_info (sdev->dev,"firmware boot complete\n" ); +else +return -EIO ;/* FW boots but fw_ready op failed */ /* perform post fw run operations */ ret =snd_sof_dsp_post_fw_run (sdev);
sound/soc/sof/pm.c +20 -1
@@ -70,6 +70,8 @@ static int sof_resume(struct device *dev, bool runtime_resume)return ret; } + sdev->fw_state =SOF_FW_BOOT_PREPARE ; +/* load the firmware */ ret =snd_sof_load_firmware (sdev);if (ret <0 ) {
@@ -79,7 +81,12 @@ static int sof_resume(struct device *dev, bool runtime_resume)return ret; } -/* boot the firmware */ + sdev->fw_state =SOF_FW_BOOT_IN_PROGRESS ; + +/* +* Boot the firmware. The FW boot status will be modified +* in snd_sof_run_firmware() depending on the outcome. +*/ ret =snd_sof_run_firmware (sdev);if (ret <0 ) { dev_err(sdev->dev,
@@ -128,6 +135,9 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)if (!sof_ops (sdev)->suspend)return 0 ; +if (sdev->fw_state !=SOF_FW_BOOT_COMPLETE ) + goto power_down; +/* release trace */ snd_sof_release_trace (sdev);
@@ -165,6 +175,12 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) ret); } +power_down: + +/* return if the DSP was not probed successfully */ +if (sdev->fw_state ==SOF_FW_BOOT_NOT_STARTED ) +return 0 ; +/* power down all DSP cores */ if (runtime_suspend) ret =snd_sof_dsp_runtime_suspend (sdev);
@@ -175,6 +191,9 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)"error: failed to power down DSP during suspend %d\n" , ret); +/* reset FW state */ + sdev->fw_state =SOF_FW_BOOT_NOT_STARTED ; +return ret; }
sound/soc/sof/sof-priv.h +10 -1
@@ -298,6 +298,15 @@ struct snd_sof_ipc_msg {bool ipc_complete; }; +enum snd_sof_fw_state { +SOF_FW_BOOT_NOT_STARTED =0 , +SOF_FW_BOOT_PREPARE , +SOF_FW_BOOT_IN_PROGRESS , +SOF_FW_BOOT_FAILED , +SOF_FW_BOOT_READY_FAILED ,/* firmware booted but fw_ready op failed */ +SOF_FW_BOOT_COMPLETE , +}; +/* * SOF Device Level. */
@@ -319,7 +328,7 @@ struct snd_sof_dev {/* DSP firmware boot */ wait_queue_head_t boot_wait; -u32 boot_complete; +enum snd_sof_fw_state fw_state;u32 first_boot;/* work queue in case the probe is implemented in two steps */
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/8 ASoC: SOF: define struct with compiler name and version
In reply to Pierre-Louis BossartFrom: Karol Trzcinski <[email protected]>
Add compiler information structure sof_ipc_cc_version. Add new enum value in sof_ipc_ext_data for new structure. This struct will be used to show more information about firmware in host system. It will be helpful during debugging.
--- include/sound/sof/info.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
include/sound/sof/info.h +15 -0
@@ -30,6 +30,7 @@enum sof_ipc_ext_data {SOF_IPC_EXT_DMA_BUFFER =0 ,SOF_IPC_EXT_WINDOW , +SOF_IPC_EXT_CC_INFO , };/* FW version - SOF_IPC_GLB_VERSION */
@@ -115,4 +116,18 @@ struct sof_ipc_window { struct sof_ipc_window_elem window[]; } __packed; +struct sof_ipc_cc_version { +struct sof_ipc_ext_data_hdr ext_hdr; +uint32_t major; +uint32_t minor; +uint32_t micro; + +/* reserved for future use */ +uint32_t reserved[4 ]; + +char name[16 ];/* null terminated compiler name */ +char optim[4 ];/* null terminated compiler -O flag value */ +char desc[];/* null terminated compiler description */ +} __packed; +#endif
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: SOF: define struct with compiler name and version" to the asoc tree
The patch
ASoC: SOF: define struct with compiler name and version
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From e8b7cab8cec3386598de29bbca70d8d31aacc709 Mon Sep 17 00:00:00 2001
From: Karol Trzcinski <[email protected]>
Date: Tue, 17 Dec 2019 18:26:10 -0600
Subject: [PATCH] ASoC: SOF: define struct with compiler name and version
Add compiler information structure sof_ipc_cc_version. Add new enum value in sof_ipc_ext_data for new structure. This struct will be used to show more information about firmware in host system. It will be helpful during debugging.
--- include/sound/sof/info.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
include/sound/sof/info.h +15 -0
@@ -30,6 +30,7 @@enum sof_ipc_ext_data {SOF_IPC_EXT_DMA_BUFFER =0 ,SOF_IPC_EXT_WINDOW , +SOF_IPC_EXT_CC_INFO , };/* FW version - SOF_IPC_GLB_VERSION */
@@ -115,4 +116,18 @@ struct sof_ipc_window { struct sof_ipc_window_elem window[]; } __packed; +struct sof_ipc_cc_version { +struct sof_ipc_ext_data_hdr ext_hdr; +uint32_t major; +uint32_t minor; +uint32_t micro; + +/* reserved for future use */ +uint32_t reserved[4 ]; + +char name[16 ];/* null terminated compiler name */ +char optim[4 ];/* null terminated compiler -O flag value */ +char desc[];/* null terminated compiler description */ +} __packed; +#endif
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 3/8 ASoC: SOF: log compiler name and version information
In reply to Pierre-Louis BossartFrom: Karol Trzcinski <[email protected]>
Log information about used compilator and optimization level in sof firmware to host system.
It will be helful to catch some compiler dependent bugs.
--- sound/soc/sof/loader.c | 39 +++++++++++++++++++++++++++++++++++++++ sound/soc/sof/sof-priv.h | 1 + 2 files changed, 40 insertions(+)
sound/soc/sof/loader.c +39 -0
@@ -32,6 +32,42 @@ static int get_ext_windows(struct snd_sof_dev *sdev,return 0 ; } +static int get_cc_info (struct snd_sof_dev *sdev, +struct sof_ipc_ext_data_hdr *ext_hdr) +{ +int ret; + +struct sof_ipc_cc_version *cc = + container_of(ext_hdr, struct sof_ipc_cc_version, ext_hdr); + +dev_dbg (sdev->dev,"Firmware info: used compiler %s %d:%d:%d%s used optimization flags %s\n" , + cc->name, cc->major, cc->minor, cc->micro, cc->desc, + cc->optim); + +/* create read-only cc_version debugfs to store compiler version info */ +/* use local copy of the cc_version to prevent data corruption */ +if (sdev->first_boot) { + sdev->cc_version =devm_kmalloc (sdev->dev, cc->ext_hdr.hdr.size, +GFP_KERNEL ); + +if (!sdev->cc_version) +return -ENOMEM ; + +memcpy (sdev->cc_version, cc, cc->ext_hdr.hdr.size); + ret =snd_sof_debugfs_buf_item (sdev, sdev->cc_version, + cc->ext_hdr.hdr.size, +"cc_version" ,0444 ); + +/* errors are only due to memory allocation, not debugfs */ +if (ret <0 ) { +dev_err (sdev->dev,"error: snd_sof_debugfs_buf_item failed\n" ); +return ret; + } + } + +return 0 ; +} +/* parse the extended FW boot data structures from FW boot message */ int snd_sof_fw_parse_ext_data (struct snd_sof_dev *sdev,u32 bar,u32 offset) {
@@ -65,6 +101,9 @@ int snd_sof_fw_parse_ext_data(struct snd_sof_dev *sdev, u32 bar, u32 offset)case SOF_IPC_EXT_WINDOW : ret =get_ext_windows (sdev, ext_hdr);break ; +case SOF_IPC_EXT_CC_INFO : + ret =get_cc_info (sdev, ext_hdr); +break ;default :dev_warn (sdev->dev,"warning: unknown ext header type %d size 0x%x\n" , ext_hdr->type, ext_hdr->hdr.size);
sound/soc/sof/sof-priv.h +1 -0
@@ -361,6 +361,7 @@ struct snd_sof_dev {struct snd_dma_buffer dmab_bdl;struct sof_ipc_fw_ready fw_ready;struct sof_ipc_fw_version fw_version; +struct sof_ipc_cc_version *cc_version;/* topology */ struct snd_soc_tplg_ops *tplg_ops;
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: SOF: log compiler name and version information" to the asoc tree
The patch
ASoC: SOF: log compiler name and version information
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 59283959e82bd272a5e15e4ed5274cdd059fb532 Mon Sep 17 00:00:00 2001
From: Karol Trzcinski <[email protected]>
Date: Tue, 17 Dec 2019 18:26:11 -0600
Subject: [PATCH] ASoC: SOF: log compiler name and version information
Log information about used compilator and optimization level in sof firmware to host system.
It will be helful to catch some compiler dependent bugs.
--- sound/soc/sof/loader.c | 39 +++++++++++++++++++++++++++++++++++++++ sound/soc/sof/sof-priv.h | 1 + 2 files changed, 40 insertions(+)
sound/soc/sof/loader.c +39 -0
@@ -32,6 +32,42 @@ static int get_ext_windows(struct snd_sof_dev *sdev,return 0 ; } +static int get_cc_info (struct snd_sof_dev *sdev, +struct sof_ipc_ext_data_hdr *ext_hdr) +{ +int ret; + +struct sof_ipc_cc_version *cc = + container_of(ext_hdr, struct sof_ipc_cc_version, ext_hdr); + +dev_dbg (sdev->dev,"Firmware info: used compiler %s %d:%d:%d%s used optimization flags %s\n" , + cc->name, cc->major, cc->minor, cc->micro, cc->desc, + cc->optim); + +/* create read-only cc_version debugfs to store compiler version info */ +/* use local copy of the cc_version to prevent data corruption */ +if (sdev->first_boot) { + sdev->cc_version =devm_kmalloc (sdev->dev, cc->ext_hdr.hdr.size, +GFP_KERNEL ); + +if (!sdev->cc_version) +return -ENOMEM ; + +memcpy (sdev->cc_version, cc, cc->ext_hdr.hdr.size); + ret =snd_sof_debugfs_buf_item (sdev, sdev->cc_version, + cc->ext_hdr.hdr.size, +"cc_version" ,0444 ); + +/* errors are only due to memory allocation, not debugfs */ +if (ret <0 ) { +dev_err (sdev->dev,"error: snd_sof_debugfs_buf_item failed\n" ); +return ret; + } + } + +return 0 ; +} +/* parse the extended FW boot data structures from FW boot message */ int snd_sof_fw_parse_ext_data (struct snd_sof_dev *sdev,u32 bar,u32 offset) {
@@ -65,6 +101,9 @@ int snd_sof_fw_parse_ext_data(struct snd_sof_dev *sdev, u32 bar, u32 offset)case SOF_IPC_EXT_WINDOW : ret =get_ext_windows (sdev, ext_hdr);break ; +case SOF_IPC_EXT_CC_INFO : + ret =get_cc_info (sdev, ext_hdr); +break ;default :dev_warn (sdev->dev,"warning: unknown ext header type %d size 0x%x\n" , ext_hdr->type, ext_hdr->hdr.size);
sound/soc/sof/sof-priv.h +1 -0
@@ -361,6 +361,7 @@ struct snd_sof_dev {struct snd_dma_buffer dmab_bdl;struct sof_ipc_fw_ready fw_ready;struct sof_ipc_fw_version fw_version; +struct sof_ipc_cc_version *cc_version;/* topology */ struct snd_soc_tplg_ops *tplg_ops;
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 4/8 ASoC: Intel: Add machine driver for da7219_max98373
In reply to Pierre-Louis BossartFrom: Yong Zhi <[email protected]>
This patch adds sof_da7219_max98373 machine driver.
Tested on JasperLake platform with SOF only.
--- sound/soc/intel/boards/Kconfig | 18 + sound/soc/intel/boards/Makefile | 3 + sound/soc/intel/boards/sof_da7219_max98373.c | 371 ++++++++++++++++++ .../intel/common/soc-acpi-intel-jsl-match.c | 7 + 4 files changed, 399 insertions(+) create mode 100644 sound/soc/intel/boards/sof_da7219_max98373.c
sound/soc/intel/boards/Kconfig +18 -0
@@ -474,4 +474,22 @@ config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH endif ## SND_SOC_SOF_COMETLAKE_LP && SND_SOC_SOF_HDA_LINK +if SND_SOC_SOF_JASPERLAKE + +config SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH + tristate "SOF with DA7219 and MAX98373 in I2S Mode" + depends on I2C && ACPI + depends on MFD_INTEL_LPSS || COMPILE_TEST + select SND_SOC_DA7219 + select SND_SOC_MAX98373 + select SND_SOC_DMIC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC + help + This adds support for ASoC machine driver for SOF platforms + with DA7219 + MAX98373 I2S audio codec. + Say Y if you have such a device. + If unsure select "N". + +endif ## SND_SOC_SOF_JASPERLAKE + endif ## SND_SOC_INTEL_MACH
sound/soc/intel/boards/Makefile +3 -0
@@ -28,6 +28,7 @@ snd-soc-skl_rt286-objs := skl_rt286.o snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o hda_dsp_common.o snd-skl_nau88l25_max98357a-objs := skl_nau88l25_max98357a.o snd-soc-skl_nau88l25_ssm4567-objs := skl_nau88l25_ssm4567.o +snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o hda_dsp_common.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o
@@ -58,3 +59,5 @@ obj-$(CONFIG_SND_SOC_INTEL_SKL_RT286_MACH) += snd-soc-skl_rt286.o obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH) += snd-skl_nau88l25_max98357a.o obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH) += snd-soc-skl_nau88l25_ssm4567.o obj-$(CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH) += snd-soc-skl_hda_dsp.o +obj-$(CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH) += snd-soc-sof_da7219_max98373.o +
sound/soc/intel/boards/sof_da7219_max98373.c new file +371 -0
371 lines not on this page · raw message
sound/soc/intel/common/soc-acpi-intel-jsl-match.c +7 -0
@@ -10,6 +10,13 @@#include <sound/soc-acpi-intel-match.h> struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = { + { + .id ="DLGS7219" , + .drv_name ="sof_da7219_max98373" , + .machine_quirk = snd_soc_acpi_codec_list, + .sof_fw_filename ="sof-jsl.ri" , + .sof_tplg_filename ="sof-jsl-da7219.tplg" , + }, {}, };EXPORT_SYMBOL_GPL (snd_soc_acpi_intel_jsl_machines);
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: Intel: Add machine driver for da7219_max98373" to the asoc tree
The patch
ASoC: Intel: Add machine driver for da7219_max98373
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 35dc19ad86fdf6a2af30c10c281e5fe10d45c041 Mon Sep 17 00:00:00 2001
From: Yong Zhi <[email protected]>
Date: Tue, 17 Dec 2019 18:26:12 -0600
Subject: [PATCH] ASoC: Intel: Add machine driver for da7219_max98373
This patch adds sof_da7219_max98373 machine driver.
Tested on JasperLake platform with SOF only.
--- sound/soc/intel/boards/Kconfig | 18 + sound/soc/intel/boards/Makefile | 3 + sound/soc/intel/boards/sof_da7219_max98373.c | 371 ++++++++++++++++++ .../intel/common/soc-acpi-intel-jsl-match.c | 7 + 4 files changed, 399 insertions(+) create mode 100644 sound/soc/intel/boards/sof_da7219_max98373.c
sound/soc/intel/boards/Kconfig +18 -0
@@ -474,4 +474,22 @@ config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH endif ## SND_SOC_SOF_COMETLAKE_LP && SND_SOC_SOF_HDA_LINK +if SND_SOC_SOF_JASPERLAKE + +config SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH + tristate "SOF with DA7219 and MAX98373 in I2S Mode" + depends on I2C && ACPI + depends on MFD_INTEL_LPSS || COMPILE_TEST + select SND_SOC_DA7219 + select SND_SOC_MAX98373 + select SND_SOC_DMIC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC + help + This adds support for ASoC machine driver for SOF platforms + with DA7219 + MAX98373 I2S audio codec. + Say Y if you have such a device. + If unsure select "N". + +endif ## SND_SOC_SOF_JASPERLAKE + endif ## SND_SOC_INTEL_MACH
sound/soc/intel/boards/Makefile +3 -0
@@ -28,6 +28,7 @@ snd-soc-skl_rt286-objs := skl_rt286.o snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o hda_dsp_common.o snd-skl_nau88l25_max98357a-objs := skl_nau88l25_max98357a.o snd-soc-skl_nau88l25_ssm4567-objs := skl_nau88l25_ssm4567.o +snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o hda_dsp_common.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o
@@ -58,3 +59,5 @@ obj-$(CONFIG_SND_SOC_INTEL_SKL_RT286_MACH) += snd-soc-skl_rt286.o obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH) += snd-skl_nau88l25_max98357a.o obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH) += snd-soc-skl_nau88l25_ssm4567.o obj-$(CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH) += snd-soc-skl_hda_dsp.o +obj-$(CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH) += snd-soc-sof_da7219_max98373.o +
sound/soc/intel/boards/sof_da7219_max98373.c new file +371 -0
371 lines not on this page · raw message
sound/soc/intel/common/soc-acpi-intel-jsl-match.c +7 -0
@@ -10,6 +10,13 @@#include <sound/soc-acpi-intel-match.h> struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = { + { + .id ="DLGS7219" , + .drv_name ="sof_da7219_max98373" , + .machine_quirk = snd_soc_acpi_codec_list, + .sof_fw_filename ="sof-jsl.ri" , + .sof_tplg_filename ="sof-jsl-da7219.tplg" , + }, {}, };EXPORT_SYMBOL_GPL (snd_soc_acpi_intel_jsl_machines);
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 5/8 ASoC: SOF: Intel: drop HDA codec upon probe failure
In reply to Pierre-Louis BossartFrom: Kai Vehmanen <[email protected]>
In case a HDA codec probe fails, do not raise error immediately, but instead remove the codec from bus->codec_mask and continue probe for other codecs.
This allows for more robust behaviour in cases where one codec in the system is faulty. SOF driver load can still proceed with the codecs that can be probed successfully. Probe may still fail if suitable machine driver is not found, but in many cases the generic HDA machine driver can operate with a subset of codecs.
--- sound/soc/sof/intel/hda-codec.c | 12 +++++------- sound/soc/sof/intel/hda.h | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-)
sound/soc/sof/intel/hda-codec.c +5 -7
@@ -140,8 +140,8 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, }/* Codec initialization */ -int hda_codec_probe_bus (struct snd_sof_dev *sdev, -bool hda_codec_use_common_hdmi) +void hda_codec_probe_bus (struct snd_sof_dev *sdev, +bool hda_codec_use_common_hdmi) {struct hdac_bus *bus =sof_to_bus (sdev);int i, ret;
@@ -154,13 +154,11 @@ int hda_codec_probe_bus(struct snd_sof_dev *sdev, ret =hda_codec_probe (sdev, i, hda_codec_use_common_hdmi);if (ret <0 ) { -dev_err (bus->dev,"error: codec #%d probe error, ret: %d\n" , - i, ret); -return ret; +dev_warn (bus->dev,"codec #%d probe error, ret: %d\n" , + i, ret); + bus->codec_mask &= ~BIT (i); } } - -return 0 ; }EXPORT_SYMBOL (hda_codec_probe_bus);
sound/soc/sof/intel/hda.h +2 -2
@@ -575,8 +575,8 @@ void sof_hda_bus_init(struct hdac_bus *bus, struct device *dev);/* * HDA Codec operations. */ -int hda_codec_probe_bus (struct snd_sof_dev *sdev, -bool hda_codec_use_common_hdmi); +void hda_codec_probe_bus (struct snd_sof_dev *sdev, +bool hda_codec_use_common_hdmi);void hda_codec_jack_wake_enable (struct snd_sof_dev *sdev);void hda_codec_jack_check (struct snd_sof_dev *sdev);
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: SOF: Intel: drop HDA codec upon probe failure" to the asoc tree
The patch
ASoC: SOF: Intel: drop HDA codec upon probe failure
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 91dce767cd0b08be9f1c87bb2de8e63391a72692 Mon Sep 17 00:00:00 2001
From: Kai Vehmanen <[email protected]>
Date: Tue, 17 Dec 2019 18:26:13 -0600
Subject: [PATCH] ASoC: SOF: Intel: drop HDA codec upon probe failure
In case a HDA codec probe fails, do not raise error immediately, but instead remove the codec from bus->codec_mask and continue probe for other codecs.
This allows for more robust behaviour in cases where one codec in the system is faulty. SOF driver load can still proceed with the codecs that can be probed successfully. Probe may still fail if suitable machine driver is not found, but in many cases the generic HDA machine driver can operate with a subset of codecs.
--- sound/soc/sof/intel/hda-codec.c | 12 +++++------- sound/soc/sof/intel/hda.h | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-)
sound/soc/sof/intel/hda-codec.c +5 -7
@@ -140,8 +140,8 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, }/* Codec initialization */ -int hda_codec_probe_bus (struct snd_sof_dev *sdev, -bool hda_codec_use_common_hdmi) +void hda_codec_probe_bus (struct snd_sof_dev *sdev, +bool hda_codec_use_common_hdmi) {struct hdac_bus *bus =sof_to_bus (sdev);int i, ret;
@@ -154,13 +154,11 @@ int hda_codec_probe_bus(struct snd_sof_dev *sdev, ret =hda_codec_probe (sdev, i, hda_codec_use_common_hdmi);if (ret <0 ) { -dev_err (bus->dev,"error: codec #%d probe error, ret: %d\n" , - i, ret); -return ret; +dev_warn (bus->dev,"codec #%d probe error, ret: %d\n" , + i, ret); + bus->codec_mask &= ~BIT (i); } } - -return 0 ; }EXPORT_SYMBOL (hda_codec_probe_bus);
sound/soc/sof/intel/hda.h +2 -2
@@ -575,8 +575,8 @@ void sof_hda_bus_init(struct hdac_bus *bus, struct device *dev);/* * HDA Codec operations. */ -int hda_codec_probe_bus (struct snd_sof_dev *sdev, -bool hda_codec_use_common_hdmi); +void hda_codec_probe_bus (struct snd_sof_dev *sdev, +bool hda_codec_use_common_hdmi);void hda_codec_jack_wake_enable (struct snd_sof_dev *sdev);void hda_codec_jack_check (struct snd_sof_dev *sdev);
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 6/8 ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency
In reply to Pierre-Louis BossartFrom: Kai Vehmanen <[email protected]>
Fix typo in Kconfig dependencies. The correct dependency for HDMI is SND_SOC_SOF_HDA_AUDIO_CODEC.
--- sound/soc/intel/boards/Kconfig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/soc/intel/boards/Kconfig +5 -5
@@ -274,7 +274,7 @@ config SND_SOC_INTEL_DA7219_MAX98357A_GENERIC select SND_SOC_DA7219 select SND_SOC_MAX98357A select SND_SOC_DMIC - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI config SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
@@ -401,7 +401,7 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH select SND_SOC_RT5682 select SND_SOC_MAX98357A select SND_SOC_DMIC - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI help This adds support for ASoC machine driver for Geminilake platforms
@@ -415,7 +415,7 @@ if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH tristate "SKL/KBL/BXT/APL with HDA Codecs" - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI select SND_SOC_DMIC # SND_SOC_HDAC_HDA is already selected
@@ -435,7 +435,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH (SND_SOC_SOF_BAYTRAIL && (X86_INTEL_LPSS || COMPILE_TEST)) select SND_SOC_RT5682 select SND_SOC_DMIC - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI help This adds support for ASoC machine driver for SOF platforms
@@ -465,7 +465,7 @@ config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH select SND_SOC_RT5682 select SND_SOC_DMIC select SND_SOC_HDAC_HDMI - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC help This adds support for ASoC machine driver for SOF platform with RT1011 + RT5682 I2S codec.
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency" to the asoc tree
The patch
ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From aa2b4a59871a0528bccb91ad94768c9dc2b7bb3d Mon Sep 17 00:00:00 2001
From: Kai Vehmanen <[email protected]>
Date: Tue, 17 Dec 2019 18:26:14 -0600
Subject: [PATCH] ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency
Fix typo in Kconfig dependencies. The correct dependency for HDMI is SND_SOC_SOF_HDA_AUDIO_CODEC.
--- sound/soc/intel/boards/Kconfig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/soc/intel/boards/Kconfig +5 -5
@@ -274,7 +274,7 @@ config SND_SOC_INTEL_DA7219_MAX98357A_GENERIC select SND_SOC_DA7219 select SND_SOC_MAX98357A select SND_SOC_DMIC - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI config SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON
@@ -401,7 +401,7 @@ config SND_SOC_INTEL_GLK_RT5682_MAX98357A_MACH select SND_SOC_RT5682 select SND_SOC_MAX98357A select SND_SOC_DMIC - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI help This adds support for ASoC machine driver for Geminilake platforms
@@ -415,7 +415,7 @@ if SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC || SND_SOC_SOF_HDA_AUDIO_CODEC config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH tristate "SKL/KBL/BXT/APL with HDA Codecs" - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI select SND_SOC_DMIC # SND_SOC_HDAC_HDA is already selected
@@ -435,7 +435,7 @@ config SND_SOC_INTEL_SOF_RT5682_MACH (SND_SOC_SOF_BAYTRAIL && (X86_INTEL_LPSS || COMPILE_TEST)) select SND_SOC_RT5682 select SND_SOC_DMIC - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC select SND_SOC_HDAC_HDMI help This adds support for ASoC machine driver for SOF platforms
@@ -465,7 +465,7 @@ config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH select SND_SOC_RT5682 select SND_SOC_DMIC select SND_SOC_HDAC_HDMI - select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_CODEC + select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC help This adds support for ASoC machine driver for SOF platform with RT1011 + RT5682 I2S codec.
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 7/8 ASoC: SOF: imx: Describe SAI parameters to be sent to DSP
In reply to Pierre-Louis BossartFrom: Guido Roncarolo <[email protected]>
Introduce sof_ipc_dai_sai_params to keep information that we get from topology and we send to DSP FW.
For the moment it is identical to ESAI one but it will evolve shortly independently
--- include/sound/sof/dai-imx.h | 20 ++++++++++++++++++++ include/sound/sof/dai.h | 1 + include/uapi/sound/sof/tokens.h | 3 +-- 3 files changed, 22 insertions(+), 2 deletions(-)
include/sound/sof/dai-imx.h +20 -0
@@ -31,4 +31,24 @@ struct sof_ipc_dai_esai_params { uint16_t reserved2; /* alignment */ } __packed; +/* SAI Configuration Request - SOF_IPC_DAI_SAI_CONFIG */ +struct sof_ipc_dai_sai_params { +struct sof_ipc_hdr hdr; + +/* MCLK */ +uint16_t reserved1; +uint16_t mclk_id; +uint32_t mclk_direction; + +uint32_t mclk_rate;/* MCLK frequency in Hz */ +uint32_t fsync_rate;/* FSYNC frequency in Hz */ +uint32_t bclk_rate;/* BCLK frequency in Hz */ + +/* TDM */ +uint32_t tdm_slots; +uint32_t rx_slots; +uint32_t tx_slots; +uint16_t tdm_slot_width; +uint16_t reserved2;/* alignment */ +} __packed;#endif
include/sound/sof/dai.h +1 -0
@@ -75,6 +75,7 @@ struct sof_ipc_dai_config {struct sof_ipc_dai_hda_params hda;struct sof_ipc_dai_alh_params alh;struct sof_ipc_dai_esai_params esai; +struct sof_ipc_dai_sai_params sai; }; } __packed;
include/uapi/sound/sof/tokens.h +1 -2
@@ -113,8 +113,7 @@#define SOF_TKN_EFFECT_TYPE SOF_TKN_PROCESS_TYPE/* SAI */ -#define SOF_TKN_IMX_SAI_FIRST_TOKEN 1000 -/* TODO: Add SAI tokens */ +#define SOF_TKN_IMX_SAI_MCLK_ID 1000/* ESAI */ #define SOF_TKN_IMX_ESAI_MCLK_ID 1100
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: SOF: imx: Describe SAI parameters to be sent to DSP" to the asoc tree
The patch
ASoC: SOF: imx: Describe SAI parameters to be sent to DSP
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From 9c1d4cf6ac26f890d82278326f6c7552c53ffb65 Mon Sep 17 00:00:00 2001
From: Guido Roncarolo <[email protected]>
Date: Tue, 17 Dec 2019 18:26:15 -0600
Subject: [PATCH] ASoC: SOF: imx: Describe SAI parameters to be sent to DSP
Introduce sof_ipc_dai_sai_params to keep information that we get from topology and we send to DSP FW.
For the moment it is identical to ESAI one but it will evolve shortly independently
--- include/sound/sof/dai-imx.h | 20 ++++++++++++++++++++ include/sound/sof/dai.h | 1 + include/uapi/sound/sof/tokens.h | 3 +-- 3 files changed, 22 insertions(+), 2 deletions(-)
include/sound/sof/dai-imx.h +20 -0
@@ -31,4 +31,24 @@ struct sof_ipc_dai_esai_params { uint16_t reserved2; /* alignment */ } __packed; +/* SAI Configuration Request - SOF_IPC_DAI_SAI_CONFIG */ +struct sof_ipc_dai_sai_params { +struct sof_ipc_hdr hdr; + +/* MCLK */ +uint16_t reserved1; +uint16_t mclk_id; +uint32_t mclk_direction; + +uint32_t mclk_rate;/* MCLK frequency in Hz */ +uint32_t fsync_rate;/* FSYNC frequency in Hz */ +uint32_t bclk_rate;/* BCLK frequency in Hz */ + +/* TDM */ +uint32_t tdm_slots; +uint32_t rx_slots; +uint32_t tx_slots; +uint16_t tdm_slot_width; +uint16_t reserved2;/* alignment */ +} __packed;#endif
include/sound/sof/dai.h +1 -0
@@ -75,6 +75,7 @@ struct sof_ipc_dai_config {struct sof_ipc_dai_hda_params hda;struct sof_ipc_dai_alh_params alh;struct sof_ipc_dai_esai_params esai; +struct sof_ipc_dai_sai_params sai; }; } __packed;
include/uapi/sound/sof/tokens.h +1 -2
@@ -113,8 +113,7 @@#define SOF_TKN_EFFECT_TYPE SOF_TKN_PROCESS_TYPE/* SAI */ -#define SOF_TKN_IMX_SAI_FIRST_TOKEN 1000 -/* TODO: Add SAI tokens */ +#define SOF_TKN_IMX_SAI_MCLK_ID 1000/* ESAI */ #define SOF_TKN_IMX_ESAI_MCLK_ID 1100
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 8/8 ASoC: SOF: imx: Read SAI parameters and send them to DSP
In reply to Pierre-Louis BossartFrom: Guido Roncarolo <[email protected]>
Follow example from Intel SSP.
--- sound/soc/sof/pcm.c | 8 +++++ sound/soc/sof/topology.c | 69 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 2 deletions(-)
sound/soc/sof/pcm.c +8 -0
@@ -693,6 +693,14 @@ static int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, channels->min = dai->dai_config->esai.tdm_slots; channels->max = dai->dai_config->esai.tdm_slots; +dev_dbg (component->dev, +"channels_min: %d channels_max: %d\n" , + channels->min, channels->max); +break ; +case SOF_DAI_IMX_SAI : + channels->min = dai->dai_config->sai.tdm_slots; + channels->max = dai->dai_config->sai.tdm_slots; +dev_dbg (component->dev,"channels_min: %d channels_max: %d\n" , channels->min, channels->max);
sound/soc/sof/topology.c +67 -2
81 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainer[alsa-devel] Applied "ASoC: SOF: imx: Read SAI parameters and send them to DSP" to the asoc tree
The patch
ASoC: SOF: imx: Read SAI parameters and send them to DSP
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
From d88cbd6feaf4b5de07d91f531112cf57ce821d78 Mon Sep 17 00:00:00 2001
From: Guido Roncarolo <[email protected]>
Date: Tue, 17 Dec 2019 18:26:16 -0600
Subject: [PATCH] ASoC: SOF: imx: Read SAI parameters and send them to DSP
Follow example from Intel SSP.
--- sound/soc/sof/pcm.c | 8 +++++ sound/soc/sof/topology.c | 69 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 2 deletions(-)
sound/soc/sof/pcm.c +8 -0
@@ -693,6 +693,14 @@ static int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, channels->min = dai->dai_config->esai.tdm_slots; channels->max = dai->dai_config->esai.tdm_slots; +dev_dbg (component->dev, +"channels_min: %d channels_max: %d\n" , + channels->min, channels->max); +break ; +case SOF_DAI_IMX_SAI : + channels->min = dai->dai_config->sai.tdm_slots; + channels->max = dai->dai_config->sai.tdm_slots; +dev_dbg (component->dev,"channels_min: %d channels_max: %d\n" , channels->min, channels->max);
sound/soc/sof/topology.c +67 -2
81 lines not on this page · raw message
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel