Loading asoc/msm-pcm-voice-v2.c +24 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019, 2021, The Linux Foundation. All rights reserved. */ #include <linux/init.h> Loading Loading @@ -29,6 +29,8 @@ static struct msm_voice voice_info[VOICE_SESSION_INDEX_MAX]; static int voice_probe_done; static struct snd_pcm_hardware msm_pcm_hardware = { .info = (SNDRV_PCM_INFO_INTERLEAVED | Loading Loading @@ -778,6 +780,7 @@ static int msm_pcm_probe(struct platform_device *pdev) bool destroy_cvd = false; const char *is_destroy_cvd = "qcom,destroy-cvd"; voice_probe_done = 0; if (!is_voc_initialized()) { pr_debug("%s: voice module not initialized yet, deferring probe()\n", __func__); Loading Loading @@ -806,11 +809,31 @@ static int msm_pcm_probe(struct platform_device *pdev) rc = snd_soc_register_component(&pdev->dev, &msm_soc_component, NULL, 0); if (!rc) { pr_debug("%s msm_pcm_voice probe success! \n", __func__); voice_probe_done = 1; } done: return rc; } /** * msm_voice_get_probe_status - Returns the probe * status of msm-pcm-voice. * * Function that returns the probe status of msm-pcm-voice * driver. * * Returns: 1 on probe success, 0 otherwise. */ int msm_voice_get_probe_status(void) { return voice_probe_done; } EXPORT_SYMBOL(msm_voice_get_probe_status); static int msm_pcm_remove(struct platform_device *pdev) { snd_soc_unregister_component(&pdev->dev); Loading asoc/msm-pcm-voice-v2.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2015, 2021, The Linux Foundation. All rights reserved. */ #ifndef _MSM_PCM_VOICE_H #define _MSM_PCM_VOICE_H Loading Loading @@ -31,4 +31,6 @@ struct msm_voice { int capture_start; }; int msm_voice_get_probe_status(void); #endif /*_MSM_PCM_VOICE_H*/ asoc/msm8952.c +9 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "msm-pcm-routing-v2.h" #include <asoc/msm-cdc-pinctrl.h> #include "msm8952.h" #include "msm-pcm-voice-v2.h" #define DRV_NAME "msm8952-asoc-wcd" Loading Loading @@ -3426,6 +3427,14 @@ static int msm8952_asoc_machine_probe(struct platform_device *pdev) } } /* Check if voice probe done, defer otherwise */ ret = msm_voice_get_probe_status(); if (!ret) { pr_debug("%s msm-pcm-voice probe status %d \n", __func__, ret); ret = -EPROBE_DEFER; goto err; } card = msm8952_populate_sndcard_dailinks(&pdev->dev, pdata->snd_card_val); dev_dbg(&pdev->dev, "default codec configured\n"); Loading Loading
asoc/msm-pcm-voice-v2.c +24 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2019, 2021, The Linux Foundation. All rights reserved. */ #include <linux/init.h> Loading Loading @@ -29,6 +29,8 @@ static struct msm_voice voice_info[VOICE_SESSION_INDEX_MAX]; static int voice_probe_done; static struct snd_pcm_hardware msm_pcm_hardware = { .info = (SNDRV_PCM_INFO_INTERLEAVED | Loading Loading @@ -778,6 +780,7 @@ static int msm_pcm_probe(struct platform_device *pdev) bool destroy_cvd = false; const char *is_destroy_cvd = "qcom,destroy-cvd"; voice_probe_done = 0; if (!is_voc_initialized()) { pr_debug("%s: voice module not initialized yet, deferring probe()\n", __func__); Loading Loading @@ -806,11 +809,31 @@ static int msm_pcm_probe(struct platform_device *pdev) rc = snd_soc_register_component(&pdev->dev, &msm_soc_component, NULL, 0); if (!rc) { pr_debug("%s msm_pcm_voice probe success! \n", __func__); voice_probe_done = 1; } done: return rc; } /** * msm_voice_get_probe_status - Returns the probe * status of msm-pcm-voice. * * Function that returns the probe status of msm-pcm-voice * driver. * * Returns: 1 on probe success, 0 otherwise. */ int msm_voice_get_probe_status(void) { return voice_probe_done; } EXPORT_SYMBOL(msm_voice_get_probe_status); static int msm_pcm_remove(struct platform_device *pdev) { snd_soc_unregister_component(&pdev->dev); Loading
asoc/msm-pcm-voice-v2.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2015, 2021, The Linux Foundation. All rights reserved. */ #ifndef _MSM_PCM_VOICE_H #define _MSM_PCM_VOICE_H Loading Loading @@ -31,4 +31,6 @@ struct msm_voice { int capture_start; }; int msm_voice_get_probe_status(void); #endif /*_MSM_PCM_VOICE_H*/
asoc/msm8952.c +9 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "msm-pcm-routing-v2.h" #include <asoc/msm-cdc-pinctrl.h> #include "msm8952.h" #include "msm-pcm-voice-v2.h" #define DRV_NAME "msm8952-asoc-wcd" Loading Loading @@ -3426,6 +3427,14 @@ static int msm8952_asoc_machine_probe(struct platform_device *pdev) } } /* Check if voice probe done, defer otherwise */ ret = msm_voice_get_probe_status(); if (!ret) { pr_debug("%s msm-pcm-voice probe status %d \n", __func__, ret); ret = -EPROBE_DEFER; goto err; } card = msm8952_populate_sndcard_dailinks(&pdev->dev, pdata->snd_card_val); dev_dbg(&pdev->dev, "default codec configured\n"); Loading