diff options
author | Zidan Wang <zidan.wang@freescale.com> | 2016-01-20 09:50:40 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:50:04 +0800 |
commit | 5bc6557674611923916d7f02beec502fae087ae6 (patch) | |
tree | 1ad2e3131921328757ad7cc5b777336763017a13 | |
parent | c770ac5d82d0937d408e3c267027ea37660d0ebd (diff) |
MLK-12244 ASoC: fsl: Set the sound card owner field
When load sound card, the pulseaudio will using the sound card to
playback and record. It may be cause a kernel crash when the sound
card is unloaded while the playback/record is active
After setting the sound card owner field, when pulseaudio is running,
the sound card module ref-count will not be 0 and the sound card will
not be unloaded. So you should stop the pulseaudio when you want to
unload the sound card.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
[ Aisheng: hdmi change merged into hdmi branch ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
-rw-r--r-- | sound/soc/fsl/imx-cs42888.c | 1 | ||||
-rw-r--r-- | sound/soc/fsl/imx-sii902x.c | 3 | ||||
-rw-r--r-- | sound/soc/fsl/imx-wm8958.c | 3 | ||||
-rw-r--r-- | sound/soc/fsl/imx-wm8960.c | 3 |
4 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/fsl/imx-cs42888.c b/sound/soc/fsl/imx-cs42888.c index 82d56d54073b..51fa05b7df7b 100644 --- a/sound/soc/fsl/imx-cs42888.c +++ b/sound/soc/fsl/imx-cs42888.c @@ -215,6 +215,7 @@ static struct snd_soc_card snd_soc_card_imx_cs42888 = { .num_dapm_widgets = ARRAY_SIZE(imx_cs42888_dapm_widgets), .dapm_routes = audio_map, .num_dapm_routes = ARRAY_SIZE(audio_map), + .owner = THIS_MODULE, }; /* diff --git a/sound/soc/fsl/imx-sii902x.c b/sound/soc/fsl/imx-sii902x.c index 7cd19faa8617..f66ecf59c016 100644 --- a/sound/soc/fsl/imx-sii902x.c +++ b/sound/soc/fsl/imx-sii902x.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Freescale Semiconductor, Inc. + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. * * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License @@ -225,6 +225,7 @@ static int imx_sii902x_probe(struct platform_device *pdev) SND_SOC_DAIFMT_CBS_CFS; data->card.dev = &pdev->dev; + data->card.owner = THIS_MODULE; ret = snd_soc_of_parse_card_name(&data->card, "model"); if (ret) goto fail; diff --git a/sound/soc/fsl/imx-wm8958.c b/sound/soc/fsl/imx-wm8958.c index 047bdf9e70bb..e8ad44c315e8 100644 --- a/sound/soc/fsl/imx-wm8958.c +++ b/sound/soc/fsl/imx-wm8958.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Freescale Semiconductor, Inc. + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. * * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License @@ -485,6 +485,7 @@ static int imx_wm8958_probe(struct platform_device *pdev) data->dai.dai_fmt |= SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF; data->card.set_bias_level = imx_wm8958_set_bias_level; data->card.set_bias_level_post = imx_wm8958_set_bias_level_post; + data->card.owner = THIS_MODULE; data->card.dev = &pdev->dev; ret = snd_soc_of_parse_card_name(&data->card, "model"); diff --git a/sound/soc/fsl/imx-wm8960.c b/sound/soc/fsl/imx-wm8960.c index 584010b86cce..6443ae1a095e 100644 --- a/sound/soc/fsl/imx-wm8960.c +++ b/sound/soc/fsl/imx-wm8960.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Freescale Semiconductor, Inc. + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. * * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License @@ -537,6 +537,7 @@ static int imx_wm8960_probe(struct platform_device *pdev) } data->card.dev = &pdev->dev; + data->card.owner = THIS_MODULE; ret = snd_soc_of_parse_card_name(&data->card, "model"); if (ret) goto fail; |