From 68d8904b25df28821425753eaebc8fe992dde236 Mon Sep 17 00:00:00 2001 From: Ajit Pandey Date: Fri, 14 Aug 2020 16:23:04 +0530 Subject: ASoC: Add sc7180-lpass bindings header Add header defining dai-id and mclk id for SC7180 lpass soc. Signed-off-by: Ajit Pandey Signed-off-by: Rohit kumar Acked-by: Rob Herring Link: https://lore.kernel.org/r/1597402388-14112-9-git-send-email-rohitkr@codeaurora.org Signed-off-by: Mark Brown --- include/dt-bindings/sound/sc7180-lpass.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 include/dt-bindings/sound/sc7180-lpass.h (limited to 'include') diff --git a/include/dt-bindings/sound/sc7180-lpass.h b/include/dt-bindings/sound/sc7180-lpass.h new file mode 100644 index 000000000000..7d988f6346a5 --- /dev/null +++ b/include/dt-bindings/sound/sc7180-lpass.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __DT_SC7180_LPASS_H +#define __DT_SC7180_LPASS_H + +#define MI2S_PRIMARY 0 +#define MI2S_SECONDARY 1 + +#define LPASS_MCLK0 0 + +#endif /* __DT_APQ8016_LPASS_H */ -- cgit v1.2.3 From 1ae0965dc21698ba41638c95b5478779f3c4a9e4 Mon Sep 17 00:00:00 2001 From: Stephan Gerhold Date: Sat, 1 Aug 2020 12:02:55 +0200 Subject: ASoC: core: Add common helper to parse aux devs from device tree simple-card.c and meson-card-utils.c use pretty much the same helper function to parse auxiliary devices from the device tree. Make it easier for other drivers to parse these from the device tree as well by adding a shared helper function to soc-core.c. snd_soc_of_parse_aux_devs() is pretty much a copy of meson_card_add_aux_devices() from meson-card-utils.c with two minor changes: - Make property name configurable as parameter - Change dev_err() message slightly for consistency with other error messages in soc-core.c Signed-off-by: Stephan Gerhold Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20200801100257.22658-1-stephan@gerhold.net Signed-off-by: Mark Brown --- include/sound/soc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sound/soc.h b/include/sound/soc.h index 5e3919ffb00c..a0918d159fd3 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1331,6 +1331,7 @@ void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, const char *propname); +int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname); unsigned int snd_soc_of_parse_daifmt(struct device_node *np, const char *prefix, struct device_node **bitclkmaster, -- cgit v1.2.3 From 135ab457e776d042c481d70d8954f6775ce35958 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 24 Aug 2020 15:09:12 -0500 Subject: ASoC: Intel: use consistent HDAudio spelling in comments/docs We use HDaudio and HDAudio, pick one to make searches easier. No functionality change Reported-by: Guennadi Liakhovetski Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200824200912.46852-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- include/sound/soc-acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index d2e9e3b4d7ea..b77b05c413a3 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -58,7 +58,7 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) * snd_soc_acpi_mach_params: interface for machine driver configuration * * @acpi_ipc_irq_index: used for BYT-CR detection - * @platform: string used for HDaudio codec support + * @platform: string used for HDAudio codec support * @codec_mask: used for HDAudio support * @common_hdmi_codec_drv: use commom HDAudio HDMI codec driver * @link_mask: links enabled on the board -- cgit v1.2.3 From 76ab546cd8f0c64d4603b2faad4558c5b670561e Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 25 Aug 2020 16:58:51 -0700 Subject: ASoC: SOF: IPC: make sof_ipc_window monosized This step is needed to add possibility to pack sof_ipc_window inside another one in used FW build tools - for example in extended manifest. Structure reusability leads to easy parsing function reuse, so source code is shorter and easier to maintain. Using structures with constant size is less tricky and properly supported by each toolchain by contrast to variable size elements. This is minor ABI change - backward compatibility is kept. Signed-off-by: Karol Trzcinski Reviewed-by: Guennadi Liakhovetski Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200825235854.1588034-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown --- include/sound/sof/info.h | 2 +- include/uapi/sound/sof/abi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sound/sof/info.h b/include/sound/sof/info.h index 5a55ba8b7e56..313e3e70c630 100644 --- a/include/sound/sof/info.h +++ b/include/sound/sof/info.h @@ -99,7 +99,7 @@ struct sof_ipc_window_elem { struct sof_ipc_window { struct sof_ipc_ext_data_hdr ext_hdr; uint32_t num_windows; - struct sof_ipc_window_elem window[]; + struct sof_ipc_window_elem window[SOF_IPC_MAX_ELEMS]; } __packed; struct sof_ipc_cc_version { diff --git a/include/uapi/sound/sof/abi.h b/include/uapi/sound/sof/abi.h index d54be303090f..6af32f82fb99 100644 --- a/include/uapi/sound/sof/abi.h +++ b/include/uapi/sound/sof/abi.h @@ -26,7 +26,7 @@ /* SOF ABI version major, minor and patch numbers */ #define SOF_ABI_MAJOR 3 -#define SOF_ABI_MINOR 16 +#define SOF_ABI_MINOR 17 #define SOF_ABI_PATCH 0 /* SOF ABI version number. Format within 32bit word is MMmmmppp */ -- cgit v1.2.3 From 60b7c1ba289b8ebe4f275b0b381f711e5b60184b Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 25 Aug 2020 16:58:53 -0700 Subject: ASoC: SOF: ext_manifest: Parse debug ABI version The debug ABI can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200825235854.1588034-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown --- include/sound/sof/ext_manifest.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/sound/sof/ext_manifest.h b/include/sound/sof/ext_manifest.h index 04359cda92dc..342e86e54db5 100644 --- a/include/sound/sof/ext_manifest.h +++ b/include/sound/sof/ext_manifest.h @@ -60,6 +60,7 @@ enum sof_ext_man_elem_type { SOF_EXT_MAN_ELEM_FW_VERSION = 0, SOF_EXT_MAN_ELEM_WINDOW = SOF_IPC_EXT_WINDOW, SOF_EXT_MAN_ELEM_CC_VERSION = SOF_IPC_EXT_CC_INFO, + SOF_EXT_MAN_ELEM_DBG_ABI = SOF_IPC_EXT_USER_ABI_INFO, }; /* extended manifest element header */ @@ -92,4 +93,10 @@ struct sof_ext_man_cc_version { struct sof_ipc_cc_version cc_version; } __packed; +struct ext_man_dbg_abi { + struct sof_ext_man_elem_header hdr; + /* use sof_ipc struct because of code re-use */ + struct sof_ipc_user_abi_version dbg_abi; +} __packed; + #endif /* __SOF_FIRMWARE_EXT_MANIFEST_H__ */ -- cgit v1.2.3 From c242766f286aa5a54cc3d987e71b8c952059132d Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Wed, 26 Aug 2020 11:45:25 -0700 Subject: ALSA: hda: fix VS_LTRC register name It should be called VS_LTRP instead. Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20200826184532.1612070-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown --- include/sound/hda_register.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/hda_register.h b/include/sound/hda_register.h index 057d2a2d0bd0..4f987b1f32f7 100644 --- a/include/sound/hda_register.h +++ b/include/sound/hda_register.h @@ -119,7 +119,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; #define AZX_REG_VS_EM3U 0x103C #define AZX_REG_VS_EM4L 0x1040 #define AZX_REG_VS_EM4U 0x1044 -#define AZX_REG_VS_LTRC 0x1048 +#define AZX_REG_VS_LTRP 0x1048 #define AZX_REG_VS_D0I3C 0x104A #define AZX_REG_VS_PCE 0x104B #define AZX_REG_VS_L2MAGC 0x1050 -- cgit v1.2.3 From c1c277b2c425f69b9b4f4258d9db18562d9be041 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 27 Aug 2020 08:55:39 +0900 Subject: ASoC: soc-core: add snd_soc_find_dai_with_mutex() commit 25612477d20b52 ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper") added snd_soc_dai_link_set_capabilities(). But it is using snd_soc_find_dai() (A) which is required client_mutex (B). And client_mutex is soc-core.c local. struct snd_soc_dai *snd_soc_find_dai(xxx) { ... (B) lockdep_assert_held(&client_mutex); ... } void snd_soc_dai_link_set_capabilities(xxx) { ... for_each_pcm_streams(direction) { ... for_each_link_cpus(dai_link, i, cpu) { (A) dai = snd_soc_find_dai(cpu); ... } ... for_each_link_codecs(dai_link, i, codec) { (A) dai = snd_soc_find_dai(codec); ... } } ... } Because of these background, we will get WARNING if .config has CONFIG_LOCKDEP. WARNING: CPU: 2 PID: 53 at sound/soc/soc-core.c:814 snd_soc_find_dai+0xf8/0x100 CPU: 2 PID: 53 Comm: kworker/2:1 Not tainted 5.7.0-rc1+ #328 Hardware name: Renesas H3ULCB Kingfisher board based on r8a77951 (DT) Workqueue: events deferred_probe_work_func pstate: 60000005 (nZCv daif -PAN -UAO) pc : snd_soc_find_dai+0xf8/0x100 lr : snd_soc_find_dai+0xf4/0x100 ... Call trace: snd_soc_find_dai+0xf8/0x100 snd_soc_dai_link_set_capabilities+0xa0/0x16c graph_dai_link_of_dpcm+0x390/0x3c0 graph_for_each_link+0x134/0x200 graph_probe+0x144/0x230 platform_drv_probe+0x5c/0xb0 really_probe+0xe4/0x430 driver_probe_device+0x60/0xf4 snd_soc_find_dai() will be used from (X) CPU/Codec/Platform driver with mutex lock, and (Y) Card driver without mutex lock. This snd_soc_dai_link_set_capabilities() is for Card driver, this means called without mutex. This patch adds snd_soc_find_dai_with_mutex() to solve it. Fixes: 25612477d20b52 ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper") Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87blixvuab.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sound/soc.h b/include/sound/soc.h index a0918d159fd3..b94ebff12350 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1362,6 +1362,8 @@ void snd_soc_unregister_dai(struct snd_soc_dai *dai); struct snd_soc_dai *snd_soc_find_dai( const struct snd_soc_dai_link_component *dlc); +struct snd_soc_dai *snd_soc_find_dai_with_mutex( + const struct snd_soc_dai_link_component *dlc); #include -- cgit v1.2.3 From d1c6c4a9fd3da5c735386b0cdb44d79667f10a1b Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 2 Sep 2020 17:07:55 +0300 Subject: ASoC: SOF: support topology components on secondary cores Currently SOF supports running pipelines on secondary DSP cores in a limited way. This patch represents the next step in SOF multi-core DSP support, it adds checks for core ID to individual topology components. It takes care to power up all the requested cores. More advanced DSP core power management should be added in the future. Signed-off-by: Pan Xiuli Signed-off-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200902140756.1427005-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/uapi/sound/sof/tokens.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h index 5941e2eb1588..37f5aaa09c2b 100644 --- a/include/uapi/sound/sof/tokens.h +++ b/include/uapi/sound/sof/tokens.h @@ -73,6 +73,7 @@ /* Token retired with ABI 3.2, do not use for new capabilities * #define SOF_TKN_COMP_PRELOAD_COUNT 403 */ +#define SOF_TKN_COMP_CORE_ID 404 /* SSP */ #define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500 -- cgit v1.2.3 From d20e834e13ce349c9b901b9dd8b7013e255083e8 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Sat, 5 Sep 2020 02:28:52 +0800 Subject: ASoC: soc-dai: clarify return value for get_sdw_stream() Previous changes move to use ERR_PTR(-ENOTSUPP), but it's not clear what implementations can return in case of errors. Explicitly document that NULL is not a possible return value, only ERR_PTR with a negative error code is valid. Fixes: 308811a327c38 ('ASoC: soc-dai: return proper error for get_sdw_stream()') Cc: Srinivas Kandagatla Reported-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20200904182854.3944-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown --- include/sound/soc-dai.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 776a60529e70..8b693dade9c6 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -471,7 +471,8 @@ static inline int snd_soc_dai_set_sdw_stream(struct snd_soc_dai *dai, * This routine only retrieves that was previously configured * with snd_soc_dai_get_sdw_stream() * - * Returns pointer to stream or -ENOTSUPP if callback is not supported; + * Returns pointer to stream or an ERR_PTR value, e.g. + * ERR_PTR(-ENOTSUPP) if callback is not supported; */ static inline void *snd_soc_dai_get_sdw_stream(struct snd_soc_dai *dai, int direction) -- cgit v1.2.3 From 43fbb0860c682859780907d00bdb4abbb1b6359e Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Fri, 4 Sep 2020 16:27:29 +0300 Subject: ASoC: SOF: tokens: add token for component UUID Add the definition SOF_TKN_COMP_UUID for the component UUID token, this shall be used for all types of component in the future. Signed-off-by: Keyon Jie Reviewed-by: Ranjani Sridharan Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200904132744.1699575-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/uapi/sound/sof/tokens.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h index 37f5aaa09c2b..d3aae4ad8959 100644 --- a/include/uapi/sound/sof/tokens.h +++ b/include/uapi/sound/sof/tokens.h @@ -74,6 +74,7 @@ * #define SOF_TKN_COMP_PRELOAD_COUNT 403 */ #define SOF_TKN_COMP_CORE_ID 404 +#define SOF_TKN_COMP_UUID 405 /* SSP */ #define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500 -- cgit v1.2.3 From f970a77f1d064eeddc32a9ed0fd7db3a66d82fdd Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Fri, 4 Sep 2020 16:27:30 +0300 Subject: ASoC: SOF: add comp_ext to struct snd_sof_widget Add member comp_ext to struct snd_sof_widget, which will be used for topology extended tokens parsing. Signed-off-by: Keyon Jie Reviewed-by: Ranjani Sridharan Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200904132744.1699575-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/sound/sof/topology.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/sound/sof/topology.h b/include/sound/sof/topology.h index f56e80d09b32..796b6c8e851d 100644 --- a/include/sound/sof/topology.h +++ b/include/sound/sof/topology.h @@ -87,6 +87,9 @@ struct sof_ipc_comp { */ #define SOF_BUF_UNDERRUN_PERMITTED BIT(1) +/* the UUID size in bytes, shared between FW and host */ +#define SOF_UUID_SIZE 16 + /* create new component buffer - SOF_IPC_TPLG_BUFFER_NEW */ struct sof_ipc_buffer { struct sof_ipc_comp comp; @@ -300,4 +303,9 @@ enum sof_event_types { SOF_KEYWORD_DETECT_DAPM_EVENT, }; +/* extended data struct for UUID components */ +struct sof_ipc_comp_ext { + uint8_t uuid[SOF_UUID_SIZE]; +} __packed; + #endif -- cgit v1.2.3 From 50b55fd463ce565b768d8bc214dd0280bee8b10d Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Fri, 4 Sep 2020 16:27:33 +0300 Subject: ASoC: SOF: use the sof_ipc_comp reserved bytes for extended data Use the 32bit reserved member of the struct sof_ipc_comp as the extended data length, this will help to minimize the ABI change for adding new extended data to the struct sof_ipc_comp, usually only minor ABI version bump needed for every update with this new solution. Signed-off-by: Keyon Jie Reviewed-by: Ranjani Sridharan Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200904132744.1699575-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/sound/sof/topology.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sound/sof/topology.h b/include/sound/sof/topology.h index 796b6c8e851d..d12736e14b69 100644 --- a/include/sound/sof/topology.h +++ b/include/sound/sof/topology.h @@ -57,8 +57,8 @@ struct sof_ipc_comp { uint32_t pipeline_id; uint32_t core; - /* reserved for future use */ - uint32_t reserved[1]; + /* extended data length, 0 if no extended data */ + uint32_t ext_data_length; } __packed; /* -- cgit v1.2.3 From 783560d02dd61aee20d1d00c1c061bcafea30264 Mon Sep 17 00:00:00 2001 From: Dharageswari R Date: Tue, 8 Sep 2020 12:28:25 +0300 Subject: ASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IO This patch implements the snd_sof_bytes_ext_volatile_get() to read the actual parameters from DSP by sending the SOF_IPC_COMP_GET_DATA IPC for the kcontrol of type SOF_TPLG_KCTL_BYTES_VOLATILE_RO. Signed-off-by: Dharageswari R Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200908092825.1813847-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/uapi/sound/sof/tokens.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h index d3aae4ad8959..a642bf30c027 100644 --- a/include/uapi/sound/sof/tokens.h +++ b/include/uapi/sound/sof/tokens.h @@ -24,6 +24,9 @@ #define SOF_TPLG_KCTL_ENUM_ID 257 #define SOF_TPLG_KCTL_BYTES_ID 258 #define SOF_TPLG_KCTL_SWITCH_ID 259 +#define SOF_TPLG_KCTL_BYTES_VOLATILE_RO 260 +#define SOF_TPLG_KCTL_BYTES_VOLATILE_RW 261 +#define SOF_TPLG_KCTL_BYTES_WO_ID 262 /* * Tokens - must match values in topology configurations -- cgit v1.2.3 From bf0835957f553aeddec896f3de386562536feee4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 3 Sep 2020 12:41:22 +0200 Subject: ALSA: timer: Replace tasklet with work The tasklet is an old API that should be deprecated, usually can be converted to another decent API. In ALSA core timer API, the callbacks can be offlined to a tasklet when a flag is set in the timer backend. It can be achieved gracefully with a work queued in the high-prio system workqueue. This patch replaces the usage of tasklet in ALSA timer API with a simple work. Currently the tasklet feature is used only in the system timer and hrtimer backends, so both are patched to use the new flag name SNDRV_TIMER_HW_WORK, too. Link: https://lore.kernel.org/r/20200903104131.21097-3-tiwai@suse.de Signed-off-by: Takashi Iwai --- include/sound/timer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/sound/timer.h b/include/sound/timer.h index 23e885d31525..760e132cc0cd 100644 --- a/include/sound/timer.h +++ b/include/sound/timer.h @@ -21,13 +21,13 @@ #define SNDRV_TIMER_HW_STOP 0x00000002 /* call stop before start */ #define SNDRV_TIMER_HW_SLAVE 0x00000004 /* only slave timer (variable resolution) */ #define SNDRV_TIMER_HW_FIRST 0x00000008 /* first tick can be incomplete */ -#define SNDRV_TIMER_HW_TASKLET 0x00000010 /* timer is called from tasklet */ +#define SNDRV_TIMER_HW_WORK 0x00000010 /* timer is called from work */ #define SNDRV_TIMER_IFLG_SLAVE 0x00000001 #define SNDRV_TIMER_IFLG_RUNNING 0x00000002 #define SNDRV_TIMER_IFLG_START 0x00000004 #define SNDRV_TIMER_IFLG_AUTO 0x00000008 /* auto restart */ -#define SNDRV_TIMER_IFLG_FAST 0x00000010 /* fast callback (do not use tasklet) */ +#define SNDRV_TIMER_IFLG_FAST 0x00000010 /* fast callback (do not use work) */ #define SNDRV_TIMER_IFLG_CALLBACK 0x00000020 /* timer callback is active */ #define SNDRV_TIMER_IFLG_EXCLUSIVE 0x00000040 /* exclusive owner - no more instances */ #define SNDRV_TIMER_IFLG_EARLY_EVENT 0x00000080 /* write early event to the poll queue */ @@ -74,7 +74,7 @@ struct snd_timer { struct list_head active_list_head; struct list_head ack_list_head; struct list_head sack_list_head; /* slow ack list head */ - struct tasklet_struct task_queue; + struct work_struct task_work; int max_instances; /* upper limit of timer instances */ int num_instances; /* current number of timer instances */ }; @@ -96,7 +96,7 @@ struct snd_timer_instance { unsigned long ticks; /* auto-load ticks when expired */ unsigned long cticks; /* current ticks */ unsigned long pticks; /* accumulated ticks for callback */ - unsigned long resolution; /* current resolution for tasklet */ + unsigned long resolution; /* current resolution for work */ unsigned long lost; /* lost ticks */ int slave_class; unsigned int slave_id; -- cgit v1.2.3 From 5554743d88483934cabff45943913be0830e66bc Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Wed, 9 Sep 2020 21:57:44 +0800 Subject: ALSA: pcm: Remove unused inline function snd_mask_sizeof There is no caller in tree, so can remove it. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20200909135744.33464-1-yuehaibing@huawei.com Signed-off-by: Takashi Iwai --- include/sound/pcm_params.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 36f94735d23d..ba184f49f7e1 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h @@ -23,11 +23,6 @@ int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params, #define MASK_OFS(i) ((i) >> 5) #define MASK_BIT(i) (1U << ((i) & 31)) -static inline size_t snd_mask_sizeof(void) -{ - return sizeof(struct snd_mask); -} - static inline void snd_mask_none(struct snd_mask *mask) { memset(mask, 0, sizeof(*mask)); -- cgit v1.2.3 From 150b2e86c54ad09c26e60f32925aeaf1fca1a5d3 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Thu, 10 Sep 2020 11:17:25 +0100 Subject: ASoC: q6dsp: q6afe: add support to Codec DMA ports New LPASS supports various codec macros, DSP firmware already has support to those ports. Add corresponding configuration support to those ports in adsp drivers. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200910101732.23484-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown --- include/dt-bindings/sound/qcom,q6afe.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include') diff --git a/include/dt-bindings/sound/qcom,q6afe.h b/include/dt-bindings/sound/qcom,q6afe.h index 1df06f8ad5c3..7207ab2b57bf 100644 --- a/include/dt-bindings/sound/qcom,q6afe.h +++ b/include/dt-bindings/sound/qcom,q6afe.h @@ -107,6 +107,28 @@ #define QUINARY_TDM_RX_7 102 #define QUINARY_TDM_TX_7 103 #define DISPLAY_PORT_RX 104 +#define WSA_CODEC_DMA_RX_0 105 +#define WSA_CODEC_DMA_TX_0 106 +#define WSA_CODEC_DMA_RX_1 107 +#define WSA_CODEC_DMA_TX_1 108 +#define WSA_CODEC_DMA_TX_2 109 +#define VA_CODEC_DMA_TX_0 110 +#define VA_CODEC_DMA_TX_1 111 +#define VA_CODEC_DMA_TX_2 112 +#define RX_CODEC_DMA_RX_0 113 +#define TX_CODEC_DMA_TX_0 114 +#define RX_CODEC_DMA_RX_1 115 +#define TX_CODEC_DMA_TX_1 116 +#define RX_CODEC_DMA_RX_2 117 +#define TX_CODEC_DMA_TX_2 118 +#define RX_CODEC_DMA_RX_3 119 +#define TX_CODEC_DMA_TX_3 120 +#define RX_CODEC_DMA_RX_4 121 +#define TX_CODEC_DMA_TX_4 122 +#define RX_CODEC_DMA_RX_5 123 +#define TX_CODEC_DMA_TX_5 124 +#define RX_CODEC_DMA_RX_6 125 +#define RX_CODEC_DMA_RX_7 126 #endif /* __DT_BINDINGS_Q6_AFE_H__ */ -- cgit v1.2.3 From 6eab771472af50e11a484d56ba444e2ec82e9126 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 13:56:27 +0300 Subject: ASoC: SOF: Add `src_hash` to `sof_ipc_fw_version` structure This field will be used to compare ldc file with loaded fw version, to assert validity of trace logs. Value used in sof-logger. Signed-off-by: Karol Trzcinski Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200917105633.2579047-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/sound/sof/info.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/sof/info.h b/include/sound/sof/info.h index 313e3e70c630..0b7101aef596 100644 --- a/include/sound/sof/info.h +++ b/include/sound/sof/info.h @@ -46,9 +46,11 @@ struct sof_ipc_fw_version { uint8_t time[10]; uint8_t tag[6]; uint32_t abi_version; + /* used to check FW and ldc file compatibility, reproducible value */ + uint32_t src_hash; /* reserved for future use */ - uint32_t reserved[4]; + uint32_t reserved[3]; } __packed; /* FW ready Message - sent by firmware when boot has completed */ -- cgit v1.2.3 From 4e398353a7e51410c34fd19f8b7dfc56fff5901b Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Thu, 10 Sep 2020 14:57:07 +0100 Subject: ASoC: q6afe: dt-bindings: add q6afe clock bindings q6afe exposes various lpass clocks controls via q6dsp q6afe commands. This patch adds bindings required for this clock controller. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200910135708.14842-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown --- include/dt-bindings/sound/qcom,q6afe.h | 74 +++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dt-bindings/sound/qcom,q6afe.h b/include/dt-bindings/sound/qcom,q6afe.h index 7207ab2b57bf..f64b5d2e6efd 100644 --- a/include/dt-bindings/sound/qcom,q6afe.h +++ b/include/dt-bindings/sound/qcom,q6afe.h @@ -130,5 +130,77 @@ #define RX_CODEC_DMA_RX_6 125 #define RX_CODEC_DMA_RX_7 126 -#endif /* __DT_BINDINGS_Q6_AFE_H__ */ +#define LPASS_CLK_ID_PRI_MI2S_IBIT 1 +#define LPASS_CLK_ID_PRI_MI2S_EBIT 2 +#define LPASS_CLK_ID_SEC_MI2S_IBIT 3 +#define LPASS_CLK_ID_SEC_MI2S_EBIT 4 +#define LPASS_CLK_ID_TER_MI2S_IBIT 5 +#define LPASS_CLK_ID_TER_MI2S_EBIT 6 +#define LPASS_CLK_ID_QUAD_MI2S_IBIT 7 +#define LPASS_CLK_ID_QUAD_MI2S_EBIT 8 +#define LPASS_CLK_ID_SPEAKER_I2S_IBIT 9 +#define LPASS_CLK_ID_SPEAKER_I2S_EBIT 10 +#define LPASS_CLK_ID_SPEAKER_I2S_OSR 11 +#define LPASS_CLK_ID_QUI_MI2S_IBIT 12 +#define LPASS_CLK_ID_QUI_MI2S_EBIT 13 +#define LPASS_CLK_ID_SEN_MI2S_IBIT 14 +#define LPASS_CLK_ID_SEN_MI2S_EBIT 15 +#define LPASS_CLK_ID_INT0_MI2S_IBIT 16 +#define LPASS_CLK_ID_INT1_MI2S_IBIT 17 +#define LPASS_CLK_ID_INT2_MI2S_IBIT 18 +#define LPASS_CLK_ID_INT3_MI2S_IBIT 19 +#define LPASS_CLK_ID_INT4_MI2S_IBIT 20 +#define LPASS_CLK_ID_INT5_MI2S_IBIT 21 +#define LPASS_CLK_ID_INT6_MI2S_IBIT 22 +#define LPASS_CLK_ID_QUI_MI2S_OSR 23 +#define LPASS_CLK_ID_PRI_PCM_IBIT 24 +#define LPASS_CLK_ID_PRI_PCM_EBIT 25 +#define LPASS_CLK_ID_SEC_PCM_IBIT 26 +#define LPASS_CLK_ID_SEC_PCM_EBIT 27 +#define LPASS_CLK_ID_TER_PCM_IBIT 28 +#define LPASS_CLK_ID_TER_PCM_EBIT 29 +#define LPASS_CLK_ID_QUAD_PCM_IBIT 30 +#define LPASS_CLK_ID_QUAD_PCM_EBIT 31 +#define LPASS_CLK_ID_QUIN_PCM_IBIT 32 +#define LPASS_CLK_ID_QUIN_PCM_EBIT 33 +#define LPASS_CLK_ID_QUI_PCM_OSR 34 +#define LPASS_CLK_ID_PRI_TDM_IBIT 35 +#define LPASS_CLK_ID_PRI_TDM_EBIT 36 +#define LPASS_CLK_ID_SEC_TDM_IBIT 37 +#define LPASS_CLK_ID_SEC_TDM_EBIT 38 +#define LPASS_CLK_ID_TER_TDM_IBIT 39 +#define LPASS_CLK_ID_TER_TDM_EBIT 40 +#define LPASS_CLK_ID_QUAD_TDM_IBIT 41 +#define LPASS_CLK_ID_QUAD_TDM_EBIT 42 +#define LPASS_CLK_ID_QUIN_TDM_IBIT 43 +#define LPASS_CLK_ID_QUIN_TDM_EBIT 44 +#define LPASS_CLK_ID_QUIN_TDM_OSR 45 +#define LPASS_CLK_ID_MCLK_1 46 +#define LPASS_CLK_ID_MCLK_2 47 +#define LPASS_CLK_ID_MCLK_3 48 +#define LPASS_CLK_ID_MCLK_4 49 +#define LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE 50 +#define LPASS_CLK_ID_INT_MCLK_0 51 +#define LPASS_CLK_ID_INT_MCLK_1 52 +#define LPASS_CLK_ID_MCLK_5 53 +#define LPASS_CLK_ID_WSA_CORE_MCLK 54 +#define LPASS_CLK_ID_WSA_CORE_NPL_MCLK 55 +#define LPASS_CLK_ID_VA_CORE_MCLK 56 +#define LPASS_CLK_ID_TX_CORE_MCLK 57 +#define LPASS_CLK_ID_TX_CORE_NPL_MCLK 58 +#define LPASS_CLK_ID_RX_CORE_MCLK 59 +#define LPASS_CLK_ID_RX_CORE_NPL_MCLK 60 +#define LPASS_CLK_ID_VA_CORE_2X_MCLK 61 + +#define LPASS_HW_AVTIMER_VOTE 101 +#define LPASS_HW_MACRO_VOTE 102 +#define LPASS_HW_DCODEC_VOTE 103 + +#define Q6AFE_MAX_CLK_ID 104 +#define LPASS_CLK_ATTRIBUTE_INVALID 0x0 +#define LPASS_CLK_ATTRIBUTE_COUPLE_NO 0x1 +#define LPASS_CLK_ATTRIBUTE_COUPLE_DIVIDEND 0x2 +#define LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR 0x3 + +#endif /* __DT_BINDINGS_Q6_AFE_H__ */ -- cgit v1.2.3 From 43437d0417a36bc9174deedce4ecc2c516ffde57 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 21 Sep 2020 13:50:38 +0300 Subject: ASoC: SOF: pm: Fix prepare callback behavior for OF usecase On i.MX platforms PM is not managed via ACPI although CONFIG_ACPI can be set. So, in order to correctly set the system target state we introduce a flag for platforms that require to use acpi target states. Signed-off-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200921105038.2909899-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/sound/sof.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sound/sof.h b/include/sound/sof.h index f3e716c8ce1c..9aa055289dcc 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -66,6 +66,8 @@ struct sof_dev_desc { /* alternate list of machines using this configuration */ struct snd_soc_acpi_mach *alt_machines; + bool use_acpi_target_states; + /* Platform resource indexes in BAR / ACPI resources. */ /* Must set to -1 if not used - add new items to end */ int resindex_lpe_base; -- cgit v1.2.3 From 163cd1059a85d225b811ddb4192fabd1553f77f1 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 21 Sep 2020 13:08:41 +0300 Subject: ASoC: hdac: make SOF HDA codec driver probe deterministic To provide backward compatibility to older systems, the SOF HDA driver allows user to specify which HDMI codec driver to use at runtime via kernel parameter. This mechanism has a subtle flaw in that it assumes the codec drivers not to be loaded when the SOF PCI driver is loaded. The problem is rooted in use of the hdev->type field. snd_hdac_ext_bus_device_init() initializes this field to HDA_DEV_ASOC. This signals the HDA core that ASoC drivers should be considered in driver matching (hda_bus_match()). The SOF and SST drivers continue by overriding this field to HDA_DEV_LEGACY and proceeding to load driver modules with request_module(). Correct drivers will get loaded and attached. If however the codec drivers are already loaded when snd_hdac_ext_bus_device_init() is called, the matching will not work as expected as device type is still set to HDA_DEV_ASOC. Specifically if hdac-hdmi is attached when machine driver is configured to use hdac-hda, this leads to out-of-bounds memory access in hda_dsp_hdmi_build_controls(). Fix the issue by adding codec type as a parameter to snd_hdac_ext_bus_device_init() and ensuring type is set correctly from the start. Fixes: 139c7febad1a ("ASoC: SOF: Intel: add support for snd-hda-codec-hdmi") Signed-off-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200921100841.2882662-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/sound/hdaudio_ext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/hdaudio_ext.h b/include/sound/hdaudio_ext.h index ef88b20c7b0a..7abf74c1c474 100644 --- a/include/sound/hdaudio_ext.h +++ b/include/sound/hdaudio_ext.h @@ -10,7 +10,7 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev, void snd_hdac_ext_bus_exit(struct hdac_bus *bus); int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr, - struct hdac_device *hdev); + struct hdac_device *hdev, int type); void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev); void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus); -- cgit v1.2.3 From 55c5cc63ab3277aa20637dc20f6528987ac23743 Mon Sep 17 00:00:00 2001 From: Cheng-Yi Chiang Date: Tue, 22 Sep 2020 14:23:16 +0800 Subject: ASoC: hdmi-codec: Use set_jack ops to set jack Use set_jack ops to set jack so machine drivers do not need to include hdmi-codec.h explicitly. Signed-off-by: Cheng-Yi Chiang Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20200922062316.1172935-1-cychiang@chromium.org Signed-off-by: Mark Brown --- include/sound/hdmi-codec.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 7754631a3102..b55970859a13 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -117,9 +117,6 @@ struct hdmi_codec_pdata { struct snd_soc_component; struct snd_soc_jack; -int hdmi_codec_set_jack_detect(struct snd_soc_component *component, - struct snd_soc_jack *jack); - #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec" #endif /* __HDMI_CODEC_H__ */ -- cgit v1.2.3 From f93808308aab34071259fa8cffbda273bc346ea7 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 23 Sep 2020 11:05:11 +0300 Subject: ASoC: Intel: add codec name prefix to ACPI machine description The current SOF machine driver adds a name prefix for each codec, mainly to differentiate ALSA controls for left and right amplifiers. This is a good idea, but the machine driver duplicates some of the information that already exists in ACPI descriptors, so add those prefixes there. Follow-up patches will make use of the information encoded in these tables and remove duplication. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200923080514.3242858-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown --- include/sound/soc-acpi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index b77b05c413a3..b16a844d16ef 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -93,11 +93,13 @@ struct snd_soc_acpi_endpoint { * @adr: 64 bit ACPI _ADR value * @num_endpoints: number of endpoints for this device * @endpoints: array of endpoints + * @name_prefix: string used for codec controls */ struct snd_soc_acpi_adr_device { const u64 adr; const u8 num_endpoints; const struct snd_soc_acpi_endpoint *endpoints; + const char *name_prefix; }; /** -- cgit v1.2.3 From 00a0b46c99e26b30ea27c1fb4f4dbdfc6f8b1c49 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 28 Sep 2020 09:00:40 +0900 Subject: ASoC: soc-dai: add mark for snd_soc_dai_startup/shutdown() soc_pcm_open() does rollback when failed (A), but, it is almost same as soc_pcm_close(). static int soc_pcm_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ config_err: | ... | rtd_startup_err: (A) ... | component_err: | ... v return ret; } The difference is soc_pcm_close() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_pcm_close() and rollback. Now, soc_pcm_open/close() are handling => 1) snd_soc_dai_startup/shutdown() 2) snd_soc_link_startup/shutdown() 3) snd_soc_component_module_get/put() 4) snd_soc_component_open/close() 5) pm_runtime_put/get() This patch is for 1) snd_soc_dai_startup/shutdown(). The idea of having bit-flag or counter is not enough for this purpose. For example if one DAI is used for 2xPlaybacks for some reasons, and if 1st Playback was succeeded but 2nd Playback was failed, 2nd Playback rollback doesn't need to call shutdown. But it has succeeded bit-flag or counter via 1st Playback, thus, 2nd Playback rollback will call unneeded shutdown. And 1st Playback's necessary shutdown will not be called, because bit-flag or counter was cleared by wrong 2nd Playback rollback. To avoid such case, this patch marks substream pointer when startup() was succeeded. If rollback needed, it will check rollback flag and marked substream pointer. One note here is that it cares *current* startup() only now. but we might want to check *whole* marked substream in the future. This patch is using macro named "push/pop", so that it can be easily update. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87lfgubwoc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc-dai.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 8b693dade9c6..2150bd4c7a05 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -153,7 +153,7 @@ void snd_soc_dai_hw_free(struct snd_soc_dai *dai, int snd_soc_dai_startup(struct snd_soc_dai *dai, struct snd_pcm_substream *substream); void snd_soc_dai_shutdown(struct snd_soc_dai *dai, - struct snd_pcm_substream *substream); + struct snd_pcm_substream *substream, int rollback); snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai, struct snd_pcm_substream *substream); void snd_soc_dai_suspend(struct snd_soc_dai *dai); @@ -388,6 +388,9 @@ struct snd_soc_dai { struct list_head list; + /* function mark */ + struct snd_pcm_substream *mark_startup; + /* bit field */ unsigned int probed:1; }; -- cgit v1.2.3 From 6064ed73cd2405d13c252b190ac64c03ab40e4b9 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 28 Sep 2020 09:00:57 +0900 Subject: ASoC: soc-link: add mark for snd_soc_link_startup/shutdown() soc_pcm_open() does rollback when failed (A), but, it is almost same as soc_pcm_close(). static int soc_pcm_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ config_err: | ... | rtd_startup_err: (A) ... | component_err: | ... v return ret; } The difference is soc_pcm_close() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_pcm_close() and rollback. Now, soc_pcm_open/close() are handling 1) snd_soc_dai_startup/shutdown() => 2) snd_soc_link_startup/shutdown() 3) snd_soc_component_module_get/put() 4) snd_soc_component_open/close() 5) pm_runtime_put/get() This patch is for 2) snd_soc_link_startup/shutdown(). The idea of having bit-flag or counter is not enough for this purpose. For example if one DAI is used for 2xPlaybacks for some reasons, and if 1st Playback was succeeded but 2nd Playback was failed, 2nd Playback rollback doesn't need to call shutdown. But it has succeeded bit-flag or counter via 1st Playback, thus, 2nd Playback rollback will call unneeded shutdown. And 1st Playback's necessary shutdown will not be called, because bit-flag or counter was cleared by wrong 2nd Playback rollback. To avoid such case, this patch marks substream pointer when startup() was succeeded. If rollback needed, it will check rollback flag and marked substream pointer. One note here is that it cares *current* startup() only now. but we might want to check *whole* marked substream in the future. This patch is using macro named "push/pop", so that it can be easily update. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87k0webwnv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc-link.h | 3 ++- include/sound/soc.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/soc-link.h b/include/sound/soc-link.h index 337ac5666757..dac6c0ce6ede 100644 --- a/include/sound/soc-link.h +++ b/include/sound/soc-link.h @@ -14,7 +14,8 @@ int snd_soc_link_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params); int snd_soc_link_startup(struct snd_pcm_substream *substream); -void snd_soc_link_shutdown(struct snd_pcm_substream *substream); +void snd_soc_link_shutdown(struct snd_pcm_substream *substream, + int rollback); int snd_soc_link_prepare(struct snd_pcm_substream *substream); int snd_soc_link_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); diff --git a/include/sound/soc.h b/include/sound/soc.h index 09a7d8409ade..3b038c563ae1 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1159,6 +1159,9 @@ struct snd_soc_pcm_runtime { unsigned int num; /* 0-based and monotonic increasing */ struct list_head list; /* rtd list of the soc card */ + /* function mark */ + struct snd_pcm_substream *mark_startup; + /* bit field */ unsigned int pop_wait:1; unsigned int fe_compr:1; /* for Dynamic PCM */ -- cgit v1.2.3 From 51aff91ad123e03d1461ec1d980efd1814dca69e Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 28 Sep 2020 09:01:04 +0900 Subject: ASoC: soc-component: add mark for soc_pcm_components_open/close() soc_pcm_open() does rollback when failed (A), but, it is almost same as soc_pcm_close(). static int soc_pcm_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ config_err: | ... | rtd_startup_err: (A) ... | component_err: | ... v return ret; } The difference is soc_pcm_close() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_pcm_close() and rollback. Now, soc_pcm_open/close() are handling 1) snd_soc_dai_startup/shutdown() 2) snd_soc_link_startup/shutdown() => 3) snd_soc_component_module_get/put() => 4) snd_soc_component_open/close() 5) pm_runtime_put/get() This patch is for 3) snd_soc_component_module_get/put() 4) snd_soc_component_open/close(). The idea of having bit-flag or counter is not enough for this purpose. For example if one DAI is used for 2xPlaybacks for some reasons, and if 1st Playback was succeeded but 2nd Playback was failed, 2nd Playback rollback doesn't need to call shutdown. But it has succeeded bit-flag or counter via 1st Playback, thus, 2nd Playback rollback will call unneeded shutdown. And 1st Playback's necessary shutdown will not be called, because bit-flag or counter was cleared by wrong 2nd Playback rollback. To avoid such case, this patch marks substream pointer when open() was succeeded. If rollback needed, it will check rollback flag and marked substream pointer. One note here is that it cares *current* open() only now. but we might want to check *whole* marked substream in the future. This patch is using macro named "push/pop", so that it can be easily update. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87imbybwno.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc-component.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index 089ea9441fd1..a812202ec595 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -217,6 +217,10 @@ struct snd_soc_component { /* machine specific init */ int (*init)(struct snd_soc_component *component); + /* function mark */ + struct snd_pcm_substream *mark_module; + struct snd_pcm_substream *mark_open; + #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_root; const char *debugfs_prefix; @@ -370,17 +374,19 @@ void snd_soc_component_exit_regmap(struct snd_soc_component *component); #endif #define snd_soc_component_module_get_when_probe(component)\ - snd_soc_component_module_get(component, 0) -#define snd_soc_component_module_get_when_open(component) \ - snd_soc_component_module_get(component, 1) + snd_soc_component_module_get(component, NULL, 0) +#define snd_soc_component_module_get_when_open(component, substream) \ + snd_soc_component_module_get(component, substream, 1) int snd_soc_component_module_get(struct snd_soc_component *component, + struct snd_pcm_substream *substream, int upon_open); #define snd_soc_component_module_put_when_remove(component) \ - snd_soc_component_module_put(component, 0) -#define snd_soc_component_module_put_when_close(component) \ - snd_soc_component_module_put(component, 1) + snd_soc_component_module_put(component, NULL, 0, 0) +#define snd_soc_component_module_put_when_close(component, substream, rollback) \ + snd_soc_component_module_put(component, substream, 1, rollback) void snd_soc_component_module_put(struct snd_soc_component *component, - int upon_open); + struct snd_pcm_substream *substream, + int upon_open, int rollback); static inline void snd_soc_component_set_drvdata(struct snd_soc_component *c, void *data) @@ -424,7 +430,8 @@ int snd_soc_component_force_enable_pin_unlocked( int snd_soc_component_open(struct snd_soc_component *component, struct snd_pcm_substream *substream); int snd_soc_component_close(struct snd_soc_component *component, - struct snd_pcm_substream *substream); + struct snd_pcm_substream *substream, + int rollback); void snd_soc_component_suspend(struct snd_soc_component *component); void snd_soc_component_resume(struct snd_soc_component *component); int snd_soc_component_is_suspended(struct snd_soc_component *component); -- cgit v1.2.3 From 939a5cfb2a5609d2d6f996b5cd853397a82a92b9 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 28 Sep 2020 09:01:17 +0900 Subject: ASoC: soc-component: add mark for snd_soc_pcm_component_pm_runtime_get/put() soc_pcm_open() does rollback when failed (A), but, it is almost same as soc_pcm_close(). static int soc_pcm_open(xxx) { ... if (ret < 0) goto xxx_err; ... return 0; ^ config_err: | ... | rtd_startup_err: (A) ... | component_err: | ... v return ret; } The difference is soc_pcm_close() is for all dai/component/substream, rollback is for succeeded part only. This kind of duplicated code can be a hotbed of bugs, thus, we want to share soc_pcm_close() and rollback. Now, soc_pcm_open/close() are handling 1) snd_soc_dai_startup/shutdown() 2) snd_soc_link_startup/shutdown() 3) snd_soc_component_module_get/put() 4) snd_soc_component_open/close() => 5) pm_runtime_put/get() This patch is for 5) pm_runtime_put/get(). The idea of having bit-flag or counter is not enough for this purpose. For example if one DAI is used for 2xPlaybacks for some reasons, and if 1st Playback was succeeded but 2nd Playback was failed, 2nd Playback rollback doesn't need to call shutdown. But it has succeeded bit-flag or counter via 1st Playback, thus, 2nd Playback rollback will call unneeded shutdown. And 1st Playback's necessary shutdown will not be called, because bit-flag or counter was cleared by wrong 2nd Playback rollback. To avoid such case, this patch marks substream pointer when get() was succeeded. If rollback needed, it will check rollback flag and marked substream pointer. One note here is that it cares *current* get() only now. but we might want to check *whole* marked substream in the future. This patch is using macro named "push/pop", so that it can be easily update. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87h7ribwnb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc-component.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index a812202ec595..2c790ce95259 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -220,6 +220,7 @@ struct snd_soc_component { /* function mark */ struct snd_pcm_substream *mark_module; struct snd_pcm_substream *mark_open; + void *mark_pm; #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_root; @@ -464,5 +465,9 @@ void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream, struct snd_soc_component *last); int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream, int cmd); +int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd, + void *stream); +void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd, + void *stream, int rollback); #endif /* __SOC_COMPONENT_H */ -- cgit v1.2.3 From 8f2242b91501f4510f63f400cf7dae61912c6fef Mon Sep 17 00:00:00 2001 From: Cezary Rojewski Date: Tue, 25 Aug 2020 22:17:43 +0200 Subject: spi: pxa2xx: Add SSC2 and SSPSP2 SSP registers Update list of SSP registers with SSC2 and SSPSP2. These registers are utilized by LPT/WPT AudioDSP architecture. While SSC2 shares the same offset (0x40) as SSACDD, description of this register for SSP device present on mentioned AudioDSP is different so define separate constant to avoid any ambiguity. Cc: Andy Shevchenko Signed-off-by: Cezary Rojewski Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200825201743.4926-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown --- include/linux/pxa2xx_ssp.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index 6facf27865f9..1608c760fe91 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h @@ -186,6 +186,10 @@ #define SSIRF 0x48 /* RX FIFO trigger level */ #define SSIRF_RxThresh(x) ((x) - 1) +/* LPT/WPT SSP */ +#define SSCR2 (0x40) /* SSP Command / Status 2 */ +#define SSPSP2 (0x44) /* SSP Programmable Serial Protocol 2 */ + enum pxa_ssp_type { SSP_UNDEFINED = 0, PXA25x_SSP, /* pxa 210, 250, 255, 26x */ -- cgit v1.2.3 From ca756120d4bcf28dfde5e3df8882153303d4010f Mon Sep 17 00:00:00 2001 From: Cezary Rojewski Date: Tue, 6 Oct 2020 08:48:55 +0200 Subject: ASoC: Intel: Remove haswell solution Newly added catpt solution found in sound/soc/intel/catpt is a direct replacement to sound/soc/intel/haswell. It covers all features supported by it and more - by aligning to recommended flows and requirement list based on Windows driver equivalent. No harm is done to userspace as catpt - similarly to haswell - loads no extenal topology files while sharing the exact same ADSP firmware binary. Given the above, existing haswell code is redundant so remove it. Signed-off-by: Cezary Rojewski Reviewed-by: Andy Shevchenko Acked-by: Liam Girdwood Link: https://lore.kernel.org/r/20201006064907.16277-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown --- include/trace/events/hswadsp.h | 385 ----------------------------------------- 1 file changed, 385 deletions(-) delete mode 100644 include/trace/events/hswadsp.h (limited to 'include') diff --git a/include/trace/events/hswadsp.h b/include/trace/events/hswadsp.h deleted file mode 100644 index 939d7a09d73f..000000000000 --- a/include/trace/events/hswadsp.h +++ /dev/null @@ -1,385 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM hswadsp - -#if !defined(_TRACE_HSWADSP_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_HSWADSP_H - -#include -#include -#include - -struct sst_hsw; -struct sst_hsw_stream; -struct sst_hsw_ipc_stream_free_req; -struct sst_hsw_ipc_volume_req; -struct sst_hsw_ipc_stream_alloc_req; -struct sst_hsw_audio_data_format_ipc; -struct sst_hsw_ipc_stream_info_reply; -struct sst_hsw_ipc_device_config_req; - -DECLARE_EVENT_CLASS(sst_irq, - - TP_PROTO(uint32_t status, uint32_t mask), - - TP_ARGS(status, mask), - - TP_STRUCT__entry( - __field( unsigned int, status ) - __field( unsigned int, mask ) - ), - - TP_fast_assign( - __entry->status = status; - __entry->mask = mask; - ), - - TP_printk("status 0x%8.8x mask 0x%8.8x", - (unsigned int)__entry->status, (unsigned int)__entry->mask) -); - -DEFINE_EVENT(sst_irq, sst_irq_busy, - - TP_PROTO(unsigned int status, unsigned int mask), - - TP_ARGS(status, mask) - -); - -DEFINE_EVENT(sst_irq, sst_irq_done, - - TP_PROTO(unsigned int status, unsigned int mask), - - TP_ARGS(status, mask) - -); - -DECLARE_EVENT_CLASS(ipc, - - TP_PROTO(const char *name, int val), - - TP_ARGS(name, val), - - TP_STRUCT__entry( - __string( name, name ) - __field( unsigned int, val ) - ), - - TP_fast_assign( - __assign_str(name, name); - __entry->val = val; - ), - - TP_printk("%s 0x%8.8x", __get_str(name), (unsigned int)__entry->val) - -); - -DEFINE_EVENT(ipc, ipc_request, - - TP_PROTO(const char *name, int val), - - TP_ARGS(name, val) - -); - -DEFINE_EVENT(ipc, ipc_reply, - - TP_PROTO(const char *name, int val), - - TP_ARGS(name, val) - -); - -DEFINE_EVENT(ipc, ipc_pending_reply, - - TP_PROTO(const char *name, int val), - - TP_ARGS(name, val) - -); - -DEFINE_EVENT(ipc, ipc_notification, - - TP_PROTO(const char *name, int val), - - TP_ARGS(name, val) - -); - -DEFINE_EVENT(ipc, ipc_error, - - TP_PROTO(const char *name, int val), - - TP_ARGS(name, val) - -); - -DECLARE_EVENT_CLASS(stream_position, - - TP_PROTO(unsigned int id, unsigned int pos), - - TP_ARGS(id, pos), - - TP_STRUCT__entry( - __field( unsigned int, id ) - __field( unsigned int, pos ) - ), - - TP_fast_assign( - __entry->id = id; - __entry->pos = pos; - ), - - TP_printk("id %d position 0x%x", - (unsigned int)__entry->id, (unsigned int)__entry->pos) -); - -DEFINE_EVENT(stream_position, stream_read_position, - - TP_PROTO(unsigned int id, unsigned int pos), - - TP_ARGS(id, pos) - -); - -DEFINE_EVENT(stream_position, stream_write_position, - - TP_PROTO(unsigned int id, unsigned int pos), - - TP_ARGS(id, pos) - -); - -TRACE_EVENT(hsw_stream_buffer, - - TP_PROTO(struct sst_hsw_stream *stream), - - TP_ARGS(stream), - - TP_STRUCT__entry( - __field( int, id ) - __field( int, pt_addr ) - __field( int, num_pages ) - __field( int, ring_size ) - __field( int, ring_offset ) - __field( int, first_pfn ) - ), - - TP_fast_assign( - __entry->id = stream->host_id; - __entry->pt_addr = stream->request.ringinfo.ring_pt_address; - __entry->num_pages = stream->request.ringinfo.num_pages; - __entry->ring_size = stream->request.ringinfo.ring_size; - __entry->ring_offset = stream->request.ringinfo.ring_offset; - __entry->first_pfn = stream->request.ringinfo.ring_first_pfn; - ), - - TP_printk("stream %d ring addr 0x%x pages %d size 0x%x offset 0x%x PFN 0x%x", - (int) __entry->id, (int)__entry->pt_addr, - (int)__entry->num_pages, (int)__entry->ring_size, - (int)__entry->ring_offset, (int)__entry->first_pfn) -); - -TRACE_EVENT(hsw_stream_alloc_reply, - - TP_PROTO(struct sst_hsw_stream *stream), - - TP_ARGS(stream), - - TP_STRUCT__entry( - __field( int, id ) - __field( int, stream_id ) - __field( int, mixer_id ) - __field( int, peak0 ) - __field( int, peak1 ) - __field( int, vol0 ) - __field( int, vol1 ) - ), - - TP_fast_assign( - __entry->id = stream->host_id; - __entry->stream_id = stream->reply.stream_hw_id; - __entry->mixer_id = stream->reply.mixer_hw_id; - __entry->peak0 = stream->reply.peak_meter_register_address[0]; - __entry->peak1 = stream->reply.peak_meter_register_address[1]; - __entry->vol0 = stream->reply.volume_register_address[0]; - __entry->vol1 = stream->reply.volume_register_address[1]; - ), - - TP_printk("stream %d hw id %d mixer %d peak 0x%x:0x%x vol 0x%x,0x%x", - (int) __entry->id, (int) __entry->stream_id, (int)__entry->mixer_id, - (int)__entry->peak0, (int)__entry->peak1, - (int)__entry->vol0, (int)__entry->vol1) -); - -TRACE_EVENT(hsw_mixer_info_reply, - - TP_PROTO(struct sst_hsw_ipc_stream_info_reply *reply), - - TP_ARGS(reply), - - TP_STRUCT__entry( - __field( int, mixer_id ) - __field( int, peak0 ) - __field( int, peak1 ) - __field( int, vol0 ) - __field( int, vol1 ) - ), - - TP_fast_assign( - __entry->mixer_id = reply->mixer_hw_id; - __entry->peak0 = reply->peak_meter_register_address[0]; - __entry->peak1 = reply->peak_meter_register_address[1]; - __entry->vol0 = reply->volume_register_address[0]; - __entry->vol1 = reply->volume_register_address[1]; - ), - - TP_printk("mixer id %d peak 0x%x:0x%x vol 0x%x,0x%x", - (int)__entry->mixer_id, - (int)__entry->peak0, (int)__entry->peak1, - (int)__entry->vol0, (int)__entry->vol1) -); - -TRACE_EVENT(hsw_stream_data_format, - - TP_PROTO(struct sst_hsw_stream *stream, - struct sst_hsw_audio_data_format_ipc *req), - - TP_ARGS(stream, req), - - TP_STRUCT__entry( - __field( uint32_t, id ) - __field( uint32_t, frequency ) - __field( uint32_t, bitdepth ) - __field( uint32_t, map ) - __field( uint32_t, config ) - __field( uint32_t, style ) - __field( uint8_t, ch_num ) - __field( uint8_t, valid_bit ) - ), - - TP_fast_assign( - __entry->id = stream->host_id; - __entry->frequency = req->frequency; - __entry->bitdepth = req->bitdepth; - __entry->map = req->map; - __entry->config = req->config; - __entry->style = req->style; - __entry->ch_num = req->ch_num; - __entry->valid_bit = req->valid_bit; - ), - - TP_printk("stream %d freq %d depth %d map 0x%x config 0x%x style 0x%x ch %d bits %d", - (int) __entry->id, (uint32_t)__entry->frequency, - (uint32_t)__entry->bitdepth, (uint32_t)__entry->map, - (uint32_t)__entry->config, (uint32_t)__entry->style, - (uint8_t)__entry->ch_num, (uint8_t)__entry->valid_bit) -); - -TRACE_EVENT(hsw_stream_alloc_request, - - TP_PROTO(struct sst_hsw_stream *stream, - struct sst_hsw_ipc_stream_alloc_req *req), - - TP_ARGS(stream, req), - - TP_STRUCT__entry( - __field( uint32_t, id ) - __field( uint8_t, path_id ) - __field( uint8_t, stream_type ) - __field( uint8_t, format_id ) - ), - - TP_fast_assign( - __entry->id = stream->host_id; - __entry->path_id = req->path_id; - __entry->stream_type = req->stream_type; - __entry->format_id = req->format_id; - ), - - TP_printk("stream %d path %d type %d format %d", - (int) __entry->id, (uint8_t)__entry->path_id, - (uint8_t)__entry->stream_type, (uint8_t)__entry->format_id) -); - -TRACE_EVENT(hsw_stream_free_req, - - TP_PROTO(struct sst_hsw_stream *stream, - struct sst_hsw_ipc_stream_free_req *req), - - TP_ARGS(stream, req), - - TP_STRUCT__entry( - __field( int, id ) - __field( int, stream_id ) - ), - - TP_fast_assign( - __entry->id = stream->host_id; - __entry->stream_id = req->stream_id; - ), - - TP_printk("stream %d hw id %d", - (int) __entry->id, (int) __entry->stream_id) -); - -TRACE_EVENT(hsw_volume_req, - - TP_PROTO(struct sst_hsw_stream *stream, - struct sst_hsw_ipc_volume_req *req), - - TP_ARGS(stream, req), - - TP_STRUCT__entry( - __field( int, id ) - __field( uint32_t, channel ) - __field( uint32_t, target_volume ) - __field( uint64_t, curve_duration ) - __field( uint32_t, curve_type ) - ), - - TP_fast_assign( - __entry->id = stream->host_id; - __entry->channel = req->channel; - __entry->target_volume = req->target_volume; - __entry->curve_duration = req->curve_duration; - __entry->curve_type = req->curve_type; - ), - - TP_printk("stream %d chan 0x%x vol %d duration %llu type %d", - (int) __entry->id, (uint32_t) __entry->channel, - (uint32_t)__entry->target_volume, - (uint64_t)__entry->curve_duration, - (uint32_t)__entry->curve_type) -); - -TRACE_EVENT(hsw_device_config_req, - - TP_PROTO(struct sst_hsw_ipc_device_config_req *req), - - TP_ARGS(req), - - TP_STRUCT__entry( - __field( uint32_t, ssp ) - __field( uint32_t, clock_freq ) - __field( uint32_t, mode ) - __field( uint16_t, clock_divider ) - ), - - TP_fast_assign( - __entry->ssp = req->ssp_interface; - __entry->clock_freq = req->clock_frequency; - __entry->mode = req->mode; - __entry->clock_divider = req->clock_divider; - ), - - TP_printk("SSP %d Freq %d mode %d div %d", - (uint32_t)__entry->ssp, - (uint32_t)__entry->clock_freq, (uint32_t)__entry->mode, - (uint32_t)__entry->clock_divider) -); - -#endif /* _TRACE_HSWADSP_H */ - -/* This part must be outside protection */ -#include -- cgit v1.2.3 From 3056cb0082feccee9a0012440ee5e4ca6a6e80ac Mon Sep 17 00:00:00 2001 From: Cezary Rojewski Date: Tue, 6 Oct 2020 08:48:57 +0200 Subject: ASoC: Intel: Remove rt5640 support for baytrail solution byt-rt5640 is deprecated in favor of bytcr_rt5640 used by sound/soc/intel/atom and SOF solutions both. Remove redundant machine board and all related code. Signed-off-by: Cezary Rojewski Reviewed-by: Andy Shevchenko Acked-by: Liam Girdwood Link: https://lore.kernel.org/r/20201006064907.16277-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown --- include/sound/soc-acpi-intel-match.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/sound/soc-acpi-intel-match.h b/include/sound/soc-acpi-intel-match.h index ab6f75a86611..5c49e7d78002 100644 --- a/include/sound/soc-acpi-intel-match.h +++ b/include/sound/soc-acpi-intel-match.h @@ -16,7 +16,6 @@ */ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_haswell_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_broadwell_machines[]; -extern struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_legacy_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_baytrail_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytrail_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_skl_machines[]; -- cgit v1.2.3 From 12fbfc4cabec65950bb0cc10eab0fc5c4c4d039f Mon Sep 17 00:00:00 2001 From: V Sujith Kumar Reddy Date: Thu, 8 Oct 2020 10:46:57 +0530 Subject: ASoC: Add sc7180-lpass binding header hdmi define Add header defining hdmi dai-id for SC7180 lpass soc in dt bindings. Signed-off-by: V Sujith Kumar Reddy Acked-by: Rob Herring Signed-off-by: Srinivasa Rao Tested-by: Srinivas Kandagatla Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/1602134223-2562-2-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown --- include/dt-bindings/sound/sc7180-lpass.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/dt-bindings/sound/sc7180-lpass.h b/include/dt-bindings/sound/sc7180-lpass.h index 7d988f6346a5..56ecaafd2dc6 100644 --- a/include/dt-bindings/sound/sc7180-lpass.h +++ b/include/dt-bindings/sound/sc7180-lpass.h @@ -4,6 +4,7 @@ #define MI2S_PRIMARY 0 #define MI2S_SECONDARY 1 +#define LPASS_DP_RX 2 #define LPASS_MCLK0 0 -- cgit v1.2.3 From 96e503f9000f2ad17d550cd884a5e386eb7f532f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 6 Oct 2020 19:17:22 +0300 Subject: ALSA: hda/i915 - fix list corruption with concurrent probes Current hdac_i915 uses a static completion instance to wait for i915 driver to complete the component bind. This design is not safe if multiple HDA controllers are active and communicating with different i915 instances, and can lead to list corruption and failed audio driver probe. Fix the design by moving completion mechanism to common acomp code and remove the related code from hdac_i915. Fixes: 7b882fe3e3e8 ("ALSA: hda - handle multiple i915 device instances") Co-developed-by: Kai Vehmanen Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20201006161722.500256-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai --- include/drm/drm_audio_component.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/drm/drm_audio_component.h b/include/drm/drm_audio_component.h index a45f93487039..0d36bfd1a4cd 100644 --- a/include/drm/drm_audio_component.h +++ b/include/drm/drm_audio_component.h @@ -117,6 +117,10 @@ struct drm_audio_component { * @audio_ops: Ops implemented by hda driver, called by DRM driver */ const struct drm_audio_component_audio_ops *audio_ops; + /** + * @master_bind_complete: completion held during component master binding + */ + struct completion master_bind_complete; }; #endif /* _DRM_AUDIO_COMPONENT_H_ */ -- cgit v1.2.3 From a6e7d0a4bdb02a7a3ffe0b44aaa8842b7efdd056 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 12 Oct 2020 13:27:04 +0300 Subject: ALSA: hda: fix jack detection with Realtek codecs when in D3 In case HDA controller becomes active, but codec is runtime suspended, jack detection is not successful and no interrupt is raised. This has been observed with multiple Realtek codecs and HDA controllers from different vendors. Bug does not occur if both codec and controller are active, or both are in suspend. Bug can be easily hit on desktop systems with no built-in speaker. The problem can be fixed by powering up the codec once after every controller runtime resume. Even if codec goes back to suspend later, the jack detection will continue to work. Add a flag to 'hda_codec' to describe codecs that require this flow from the controller driver. Modify __azx_runtime_resume() to use pm_request_resume() to make the intent clearer. Mark all Realtek codecs with the new forced_resume flag. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209379 Cc: Kailang Yang Co-developed-by: Kai-Heng Feng Signed-off-by: Kai-Heng Feng Signed-off-by: Kai Vehmanen Cc: Link: https://lore.kernel.org/r/20201012102704.794423-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai --- include/sound/hda_codec.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h index 0fea49bfc5e8..73827b7d17e0 100644 --- a/include/sound/hda_codec.h +++ b/include/sound/hda_codec.h @@ -253,6 +253,7 @@ struct hda_codec { unsigned int force_pin_prefix:1; /* Add location prefix */ unsigned int link_down_at_suspend:1; /* link down at runtime suspend */ unsigned int relaxed_resume:1; /* don't resume forcibly for jack */ + unsigned int forced_resume:1; /* forced resume for jack */ unsigned int mst_no_extra_pcms:1; /* no backup PCMs for DP-MST */ #ifdef CONFIG_PM -- cgit v1.2.3