imx-hdmi.c (9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e) imx-hdmi.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 <sound/jack.h>
7#include <sound/pcm_params.h>
8#include <sound/hdmi-codec.h>

--- 21 unchanged lines hidden (view full) ---

30};
31
32static int imx_hdmi_hw_params(struct snd_pcm_substream *substream,
33 struct snd_pcm_hw_params *params)
34{
35 struct snd_soc_pcm_runtime *rtd = substream->private_data;
36 struct imx_hdmi_data *data = snd_soc_card_get_drvdata(rtd->card);
37 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
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 <sound/jack.h>
7#include <sound/pcm_params.h>
8#include <sound/hdmi-codec.h>

--- 21 unchanged lines hidden (view full) ---

30};
31
32static int imx_hdmi_hw_params(struct snd_pcm_substream *substream,
33 struct snd_pcm_hw_params *params)
34{
35 struct snd_soc_pcm_runtime *rtd = substream->private_data;
36 struct imx_hdmi_data *data = snd_soc_card_get_drvdata(rtd->card);
37 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
38 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
38 struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
39 struct snd_soc_card *card = rtd->card;
40 struct device *dev = card->dev;
41 u32 slot_width = data->cpu_priv.slot_width;
42 int ret;
43
44 /* MCLK always is (256 or 192) * rate. */
45 ret = snd_soc_dai_set_sysclk(cpu_dai, data->cpu_priv.sysclk_id[tx],
46 8 * slot_width * params_rate(params),

--- 18 unchanged lines hidden (view full) ---

65
66static const struct snd_soc_dapm_widget imx_hdmi_widgets[] = {
67 SND_SOC_DAPM_LINE("HDMI Jack", NULL),
68};
69
70static int imx_hdmi_init(struct snd_soc_pcm_runtime *rtd)
71{
72 struct snd_soc_card *card = rtd->card;
39 struct snd_soc_card *card = rtd->card;
40 struct device *dev = card->dev;
41 u32 slot_width = data->cpu_priv.slot_width;
42 int ret;
43
44 /* MCLK always is (256 or 192) * rate. */
45 ret = snd_soc_dai_set_sysclk(cpu_dai, data->cpu_priv.sysclk_id[tx],
46 8 * slot_width * params_rate(params),

--- 18 unchanged lines hidden (view full) ---

65
66static const struct snd_soc_dapm_widget imx_hdmi_widgets[] = {
67 SND_SOC_DAPM_LINE("HDMI Jack", NULL),
68};
69
70static int imx_hdmi_init(struct snd_soc_pcm_runtime *rtd)
71{
72 struct snd_soc_card *card = rtd->card;
73 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
73 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
74 struct snd_soc_component *component = codec_dai->component;
75 struct imx_hdmi_data *data = snd_soc_card_get_drvdata(card);
76 int ret;
77
78 data->hdmi_jack_pin.pin = "HDMI Jack";
79 data->hdmi_jack_pin.mask = SND_JACK_LINEOUT;
80 /* enable jack detection */
81 ret = snd_soc_card_jack_new_pins(card, "HDMI Jack", SND_JACK_LINEOUT,

--- 154 unchanged lines hidden ---
74 struct snd_soc_component *component = codec_dai->component;
75 struct imx_hdmi_data *data = snd_soc_card_get_drvdata(card);
76 int ret;
77
78 data->hdmi_jack_pin.pin = "HDMI Jack";
79 data->hdmi_jack_pin.mask = SND_JACK_LINEOUT;
80 /* enable jack detection */
81 ret = snd_soc_card_jack_new_pins(card, "HDMI Jack", SND_JACK_LINEOUT,

--- 154 unchanged lines hidden ---