UPSTREAM: ASoC: codec: hdmi-codec: Support IEC958 encoded PCM format
Existing hdmi-codec driver only support standard pcm format. Support of IEC958 encoded format pass from ALSA IEC958 plugin is needed so that the IEC958 encoded data can be streamed to the HDMI chip. Bug: 239396464 Change-Id: I01516e34605e380995b5312273035a0d000d36f1 Signed-off-by: Sia Jee Heng <jee.heng.sia@intel.com> Link: https://lore.kernel.org/r/20210204014258.10197-2-jee.heng.sia@intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> (cherry picked from commit 28785f548d18e6d52785a1172e5c176784ce74cd)
This commit is contained in:
@@ -34,6 +34,11 @@ struct hdmi_codec_daifmt {
|
|||||||
unsigned int frame_clk_inv:1;
|
unsigned int frame_clk_inv:1;
|
||||||
unsigned int bit_clk_master:1;
|
unsigned int bit_clk_master:1;
|
||||||
unsigned int frame_clk_master:1;
|
unsigned int frame_clk_master:1;
|
||||||
|
/* bit_fmt could be standard PCM format or
|
||||||
|
* IEC958 encoded format. ALSA IEC958 plugin will pass
|
||||||
|
* IEC958_SUBFRAME format to the underneath driver.
|
||||||
|
*/
|
||||||
|
snd_pcm_format_t bit_fmt;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -489,6 +489,7 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
|
|||||||
hp.sample_rate = params_rate(params);
|
hp.sample_rate = params_rate(params);
|
||||||
hp.channels = params_channels(params);
|
hp.channels = params_channels(params);
|
||||||
|
|
||||||
|
cf->bit_fmt = params_format(params);
|
||||||
return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data,
|
return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data,
|
||||||
cf, &hp);
|
cf, &hp);
|
||||||
}
|
}
|
||||||
@@ -617,7 +618,8 @@ static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = {
|
|||||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE |\
|
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE |\
|
||||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |\
|
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |\
|
||||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\
|
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\
|
||||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE)
|
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |\
|
||||||
|
SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
|
||||||
|
|
||||||
static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
|
static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
|
||||||
struct snd_soc_dai *dai)
|
struct snd_soc_dai *dai)
|
||||||
|
Reference in New Issue
Block a user