2020-05-01 22:58:50 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
ASoC: Intel: boards: add sof_sdw machine driver
This machine driver provides support for different configurations:
RT700, RT711, RT1308 (1x and 2x, I2S or SoundWire mode), and RT715
CometLake, Icelake, TigerLake.
PDM digital microphones
HDMI
To avoid introducing one driver per configuration, this common machine
driver relies on platform-specific information, tables and quirks to
dynamically create the relevant dailinks.
Unlike a lot of machine drivers, we use different DAI links for
SoundWire capture and playback since the Cadence PDIs can do capture
OR playback, not both simultaneously.
For each configuration, the card component string is updated so that UCM
can select the relevant parts.
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200325220746.29601-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-26 06:07:44 +08:00
|
|
|
// Copyright (c) 2020 Intel Corporation
|
|
|
|
|
|
|
|
/*
|
|
|
|
* sof_sdw_hdmi - Helpers to handle HDMI from generic machine driver
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/device.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/list.h>
|
|
|
|
#include <sound/soc.h>
|
|
|
|
#include <sound/soc-acpi.h>
|
|
|
|
#include <sound/jack.h>
|
|
|
|
#include "sof_sdw_common.h"
|
|
|
|
#include "hda_dsp_common.h"
|
|
|
|
|
|
|
|
struct hdmi_pcm {
|
|
|
|
struct list_head head;
|
|
|
|
struct snd_soc_dai *codec_dai;
|
|
|
|
int device;
|
|
|
|
};
|
|
|
|
|
|
|
|
int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd)
|
|
|
|
{
|
|
|
|
struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card);
|
2020-04-10 02:58:23 +08:00
|
|
|
struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
|
ASoC: Intel: boards: add sof_sdw machine driver
This machine driver provides support for different configurations:
RT700, RT711, RT1308 (1x and 2x, I2S or SoundWire mode), and RT715
CometLake, Icelake, TigerLake.
PDM digital microphones
HDMI
To avoid introducing one driver per configuration, this common machine
driver relies on platform-specific information, tables and quirks to
dynamically create the relevant dailinks.
Unlike a lot of machine drivers, we use different DAI links for
SoundWire capture and playback since the Cadence PDIs can do capture
OR playback, not both simultaneously.
For each configuration, the card component string is updated so that UCM
can select the relevant parts.
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200325220746.29601-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-26 06:07:44 +08:00
|
|
|
struct hdmi_pcm *pcm;
|
|
|
|
|
|
|
|
pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
|
|
|
|
if (!pcm)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
/* dai_link id is 1:1 mapped to the PCM device */
|
|
|
|
pcm->device = rtd->dai_link->id;
|
|
|
|
pcm->codec_dai = dai;
|
|
|
|
|
|
|
|
list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NAME_SIZE 32
|
|
|
|
int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card)
|
|
|
|
{
|
|
|
|
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
|
|
|
struct hdmi_pcm *pcm;
|
|
|
|
struct snd_soc_component *component = NULL;
|
|
|
|
|
2020-07-18 05:13:34 +08:00
|
|
|
if (!ctx->idisp_codec)
|
|
|
|
return 0;
|
|
|
|
|
2020-07-18 05:13:35 +08:00
|
|
|
if (list_empty(&ctx->hdmi_pcm_list))
|
|
|
|
return -EINVAL;
|
|
|
|
|
ASoC: Intel: boards: add sof_sdw machine driver
This machine driver provides support for different configurations:
RT700, RT711, RT1308 (1x and 2x, I2S or SoundWire mode), and RT715
CometLake, Icelake, TigerLake.
PDM digital microphones
HDMI
To avoid introducing one driver per configuration, this common machine
driver relies on platform-specific information, tables and quirks to
dynamically create the relevant dailinks.
Unlike a lot of machine drivers, we use different DAI links for
SoundWire capture and playback since the Cadence PDIs can do capture
OR playback, not both simultaneously.
For each configuration, the card component string is updated so that UCM
can select the relevant parts.
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200325220746.29601-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-26 06:07:44 +08:00
|
|
|
pcm = list_first_entry(&ctx->hdmi_pcm_list, struct hdmi_pcm,
|
|
|
|
head);
|
|
|
|
component = pcm->codec_dai->component;
|
|
|
|
|
2021-06-22 03:40:49 +08:00
|
|
|
return hda_dsp_hdmi_build_controls(card, component);
|
ASoC: Intel: boards: add sof_sdw machine driver
This machine driver provides support for different configurations:
RT700, RT711, RT1308 (1x and 2x, I2S or SoundWire mode), and RT715
CometLake, Icelake, TigerLake.
PDM digital microphones
HDMI
To avoid introducing one driver per configuration, this common machine
driver relies on platform-specific information, tables and quirks to
dynamically create the relevant dailinks.
Unlike a lot of machine drivers, we use different DAI links for
SoundWire capture and playback since the Cadence PDIs can do capture
OR playback, not both simultaneously.
For each configuration, the card component string is updated so that UCM
can select the relevant parts.
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200325220746.29601-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-26 06:07:44 +08:00
|
|
|
}
|