Skip to content
Snippets Groups Projects
Commit bbac7e3c authored by Shengjiu Wang's avatar Shengjiu Wang
Browse files

LF-4175-6: ASoC: imx-rpmsg: add dummy headphone Jack for pulseaudio


with rpmsg devices, there is not headphone plug event on A core side,
but pulseaudio would mute the headphone if there is not headphone
Jack event, so add dummy headphone Jack, which emulates the headphone
is plugged in always.

Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: default avatarPeng Zhang <peng.zhang_8@nxp.com>
parent e6814b23
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
#include <sound/control.h> #include <sound/control.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc-dapm.h> #include <sound/soc-dapm.h>
#include <sound/simple_card_utils.h>
#include "imx-pcm-rpmsg.h" #include "imx-pcm-rpmsg.h"
struct imx_rpmsg { struct imx_rpmsg {
struct snd_soc_dai_link dai; struct snd_soc_dai_link dai;
struct snd_soc_card card; struct snd_soc_card card;
struct asoc_simple_jack hp_jack;
}; };
static const struct snd_soc_dapm_widget imx_rpmsg_dapm_widgets[] = { static const struct snd_soc_dapm_widget imx_rpmsg_dapm_widgets[] = {
...@@ -137,6 +139,11 @@ static int imx_rpmsg_probe(struct platform_device *pdev) ...@@ -137,6 +139,11 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
goto fail; goto fail;
} }
data->hp_jack.pin.pin = "Headphone Jack";
data->hp_jack.pin.mask = SND_JACK_HEADPHONE;
snd_soc_card_jack_new(&data->card, "Headphone Jack", SND_JACK_HEADPHONE,
&data->hp_jack.jack, &data->hp_jack.pin, 1);
snd_soc_jack_report(&data->hp_jack.jack, SND_JACK_HEADPHONE, SND_JACK_HEADPHONE);
fail: fail:
pdev->dev.of_node = NULL; pdev->dev.of_node = NULL;
return ret; return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment