imx-rpmsg.c (e9cbc89067cce78211c8629c78e931c0fe64e29d) | imx-rpmsg.c (14ec63f678e8beaaa1005ccae6c112bf672ba2b3) |
---|---|
1// SPDX-License-Identifier: GPL-2.0+ 2// Copyright 2017-2020 NXP 3 4#include <linux/module.h> 5#include <linux/of_platform.h> 6#include <linux/of_reserved_mem.h> 7#include <linux/i2c.h> 8#include <linux/of_gpio.h> --- 20 unchanged lines hidden (view full) --- 29 SND_SOC_DAPM_MIC("Main MIC", NULL), 30}; 31 32static int imx_rpmsg_late_probe(struct snd_soc_card *card) 33{ 34 struct imx_rpmsg *data = snd_soc_card_get_drvdata(card); 35 struct snd_soc_pcm_runtime *rtd = list_first_entry(&card->rtd_list, 36 struct snd_soc_pcm_runtime, list); | 1// SPDX-License-Identifier: GPL-2.0+ 2// Copyright 2017-2020 NXP 3 4#include <linux/module.h> 5#include <linux/of_platform.h> 6#include <linux/of_reserved_mem.h> 7#include <linux/i2c.h> 8#include <linux/of_gpio.h> --- 20 unchanged lines hidden (view full) --- 29 SND_SOC_DAPM_MIC("Main MIC", NULL), 30}; 31 32static int imx_rpmsg_late_probe(struct snd_soc_card *card) 33{ 34 struct imx_rpmsg *data = snd_soc_card_get_drvdata(card); 35 struct snd_soc_pcm_runtime *rtd = list_first_entry(&card->rtd_list, 36 struct snd_soc_pcm_runtime, list); |
37 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); | 37 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); |
38 struct device *dev = card->dev; 39 int ret; 40 41 if (!data->sysclk) 42 return 0; 43 44 ret = snd_soc_dai_set_sysclk(codec_dai, 0, data->sysclk, SND_SOC_CLOCK_IN); 45 if (ret && ret != -ENOTSUPP) { --- 38 unchanged lines hidden (view full) --- 84 data->dai.num_codecs = 1; 85 86 data->dai.name = "rpmsg hifi"; 87 data->dai.stream_name = "rpmsg hifi"; 88 data->dai.dai_fmt = SND_SOC_DAIFMT_I2S | 89 SND_SOC_DAIFMT_NB_NF | 90 SND_SOC_DAIFMT_CBC_CFC; 91 | 38 struct device *dev = card->dev; 39 int ret; 40 41 if (!data->sysclk) 42 return 0; 43 44 ret = snd_soc_dai_set_sysclk(codec_dai, 0, data->sysclk, SND_SOC_CLOCK_IN); 45 if (ret && ret != -ENOTSUPP) { --- 38 unchanged lines hidden (view full) --- 84 data->dai.num_codecs = 1; 85 86 data->dai.name = "rpmsg hifi"; 87 data->dai.stream_name = "rpmsg hifi"; 88 data->dai.dai_fmt = SND_SOC_DAIFMT_I2S | 89 SND_SOC_DAIFMT_NB_NF | 90 SND_SOC_DAIFMT_CBC_CFC; 91 |
92 /* 93 * i.MX rpmsg sound cards work on codec slave mode. MCLK will be 94 * disabled by CPU DAI driver in hw_free(). Some codec requires MCLK 95 * present at power up/down sequence. So need to set ignore_pmdown_time 96 * to power down codec immediately before MCLK is turned off. 97 */ 98 data->dai.ignore_pmdown_time = 1; 99 | |
100 /* Optional codec node */ 101 ret = of_parse_phandle_with_fixed_args(np, "audio-codec", 0, 0, &args); 102 if (ret) { | 92 /* Optional codec node */ 93 ret = of_parse_phandle_with_fixed_args(np, "audio-codec", 0, 0, &args); 94 if (ret) { |
103 *data->dai.codecs = asoc_dummy_dlc; | 95 *data->dai.codecs = snd_soc_dummy_dlc; |
104 } else { 105 struct clk *clk; 106 107 ret = snd_soc_get_dlc(&args, data->dai.codecs); 108 if (ret) { 109 dev_err(&pdev->dev, "Unable to get codec_dai_name\n"); 110 goto fail; 111 } --- 77 unchanged lines hidden --- | 96 } else { 97 struct clk *clk; 98 99 ret = snd_soc_get_dlc(&args, data->dai.codecs); 100 if (ret) { 101 dev_err(&pdev->dev, "Unable to get codec_dai_name\n"); 102 goto fail; 103 } --- 77 unchanged lines hidden --- |