Merge series "ASoC: meson: tdm fixes" from Jerome Brunet <jbrunet@baylibre.com>:
This patcheset is collection of fixes for the TDM input and output the axg audio architecture. Its fixes: - slave mode format setting - g12 and sm1 skew offset - tdm clock inversion - standard daifmt props names which don't require a specific prefix Jerome Brunet (4): ASoC: meson: axg-tdm-interface: fix link fmt setup ASoC: meson: axg-tdmin: fix g12a skew ASoC: meson: axg-tdm-formatters: fix sclk inversion ASoC: meson: cards: remove DT_PREFIX for standard daifmt properties sound/soc/meson/axg-tdm-formatter.c | 11 ++++++----- sound/soc/meson/axg-tdm-formatter.h | 1 - sound/soc/meson/axg-tdm-interface.c | 26 +++++++++++++++++--------- sound/soc/meson/axg-tdmin.c | 16 +++++++++++++++- sound/soc/meson/axg-tdmout.c | 3 --- sound/soc/meson/meson-card-utils.c | 2 +- 6 files changed, 39 insertions(+), 20 deletions(-) -- 2.25.4
Tento commit je obsažen v:
@@ -336,22 +336,45 @@ static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
|
||||
struct snd_interval *chan = hw_param_interval(params,
|
||||
SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||
struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
|
||||
struct snd_soc_dpcm *dpcm = container_of(
|
||||
params, struct snd_soc_dpcm, hw_params);
|
||||
struct snd_soc_dai_link *fe_dai_link = dpcm->fe->dai_link;
|
||||
struct snd_soc_dai_link *be_dai_link = dpcm->be->dai_link;
|
||||
struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
|
||||
|
||||
/*
|
||||
* The following loop will be called only for playback stream
|
||||
* In this platform, there is only one playback device on every SSP
|
||||
*/
|
||||
for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
|
||||
rtd_dpcm = dpcm;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* This following loop will be called only for capture stream
|
||||
* In this platform, there is only one capture device on every SSP
|
||||
*/
|
||||
for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
|
||||
rtd_dpcm = dpcm;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!rtd_dpcm)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* The above 2 loops are mutually exclusive based on the stream direction,
|
||||
* thus rtd_dpcm variable will never be overwritten
|
||||
*/
|
||||
|
||||
/*
|
||||
* The ADSP will convert the FE rate to 48k, stereo, 24 bit
|
||||
*/
|
||||
if (!strcmp(fe_dai_link->name, "Kbl Audio Port") ||
|
||||
!strcmp(fe_dai_link->name, "Kbl Audio Headset Playback") ||
|
||||
!strcmp(fe_dai_link->name, "Kbl Audio Capture Port")) {
|
||||
if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
|
||||
!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
|
||||
!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
|
||||
rate->min = rate->max = 48000;
|
||||
chan->min = chan->max = 2;
|
||||
snd_mask_none(fmt);
|
||||
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
|
||||
} else if (!strcmp(fe_dai_link->name, "Kbl Audio DMIC cap")) {
|
||||
} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
|
||||
if (params_channels(params) == 2 ||
|
||||
DMIC_CH(dmic_constraints) == 2)
|
||||
chan->min = chan->max = 2;
|
||||
@@ -362,7 +385,7 @@ static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
|
||||
* The speaker on the SSP0 supports S16_LE and not S24_LE.
|
||||
* thus changing the mask here
|
||||
*/
|
||||
if (!strcmp(be_dai_link->name, "SSP0-Codec"))
|
||||
if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
|
||||
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
|
||||
|
||||
return 0;
|
||||
|
@@ -33,6 +33,7 @@ struct skl_hda_private {
|
||||
int dai_index;
|
||||
const char *platform_name;
|
||||
bool common_hdmi_codec_drv;
|
||||
bool idisp_codec;
|
||||
};
|
||||
|
||||
extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS];
|
||||
|
@@ -79,6 +79,9 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link)
|
||||
link->platforms->name = ctx->platform_name;
|
||||
link->nonatomic = 1;
|
||||
|
||||
if (!ctx->idisp_codec)
|
||||
return 0;
|
||||
|
||||
if (strstr(link->name, "HDMI")) {
|
||||
ret = skl_hda_hdmi_add_pcm(card, ctx->pcm_count);
|
||||
|
||||
@@ -118,19 +121,20 @@ static char hda_soc_components[30];
|
||||
static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
|
||||
{
|
||||
struct snd_soc_card *card = &hda_soc_card;
|
||||
struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card);
|
||||
struct snd_soc_dai_link *dai_link;
|
||||
u32 codec_count, codec_mask, idisp_mask;
|
||||
u32 codec_count, codec_mask;
|
||||
int i, num_links, num_route;
|
||||
|
||||
codec_mask = mach_params->codec_mask;
|
||||
codec_count = hweight_long(codec_mask);
|
||||
idisp_mask = codec_mask & IDISP_CODEC_MASK;
|
||||
ctx->idisp_codec = !!(codec_mask & IDISP_CODEC_MASK);
|
||||
|
||||
if (!codec_count || codec_count > 2 ||
|
||||
(codec_count == 2 && !idisp_mask))
|
||||
(codec_count == 2 && !ctx->idisp_codec))
|
||||
return -EINVAL;
|
||||
|
||||
if (codec_mask == idisp_mask) {
|
||||
if (codec_mask == IDISP_CODEC_MASK) {
|
||||
/* topology with iDisp as the only HDA codec */
|
||||
num_links = IDISP_DAI_COUNT + DMIC_DAI_COUNT;
|
||||
num_route = IDISP_ROUTE_COUNT;
|
||||
@@ -152,7 +156,7 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
|
||||
num_route = ARRAY_SIZE(skl_hda_map);
|
||||
card->dapm_widgets = skl_hda_widgets;
|
||||
card->num_dapm_widgets = ARRAY_SIZE(skl_hda_widgets);
|
||||
if (!idisp_mask) {
|
||||
if (!ctx->idisp_codec) {
|
||||
for (i = 0; i < IDISP_DAI_COUNT; i++) {
|
||||
skl_hda_be_dai_links[i].codecs = dummy_codec;
|
||||
skl_hda_be_dai_links[i].num_codecs =
|
||||
@@ -211,6 +215,8 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
|
||||
if (!mach)
|
||||
return -EINVAL;
|
||||
|
||||
snd_soc_card_set_drvdata(&hda_soc_card, ctx);
|
||||
|
||||
ret = skl_hda_fill_card_info(&mach->mach_params);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Unsupported HDAudio/iDisp configuration found\n");
|
||||
@@ -223,7 +229,6 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
|
||||
ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv;
|
||||
|
||||
hda_soc_card.dev = &pdev->dev;
|
||||
snd_soc_card_set_drvdata(&hda_soc_card, ctx);
|
||||
|
||||
if (mach->mach_params.dmic_num > 0) {
|
||||
snprintf(hda_soc_components, sizeof(hda_soc_components),
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele