2020-05-01 09:58:50 -05: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-25 17:07:44 -05:00
|
|
|
// Copyright (c) 2020 Intel Corporation
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* sof_sdw - ASOC Machine driver for Intel SoundWire platforms
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <linux/device.h>
|
|
|
|
|
#include <linux/dmi.h>
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
|
#include <linux/soundwire/sdw.h>
|
|
|
|
|
#include <linux/soundwire/sdw_type.h>
|
|
|
|
|
#include <sound/soc.h>
|
|
|
|
|
#include <sound/soc-acpi.h>
|
|
|
|
|
#include "sof_sdw_common.h"
|
2021-07-12 15:32:39 -05:00
|
|
|
#include "../../codecs/rt711.h"
|
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-25 17:07:44 -05:00
|
|
|
|
2021-07-12 15:32:39 -05:00
|
|
|
unsigned long sof_sdw_quirk = RT711_JD1;
|
2020-06-25 14:12:56 -05:00
|
|
|
static int quirk_override = -1;
|
|
|
|
|
module_param_named(quirk, quirk_override, int, 0444);
|
|
|
|
|
MODULE_PARM_DESC(quirk, "Board-specific quirk override");
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
#define INC_ID(BE, CPU, LINK) do { (BE)++; (CPU)++; (LINK)++; } while (0)
|
|
|
|
|
|
2023-06-02 15:22:11 -05:00
|
|
|
#define SDW_MAX_LINKS 4
|
|
|
|
|
|
|
|
|
|
/* To store SDW Pin index for each SoundWire link */
|
|
|
|
|
static unsigned int sdw_pin_index[SDW_MAX_LINKS];
|
|
|
|
|
|
2020-06-25 14:12:56 -05:00
|
|
|
static void log_quirks(struct device *dev)
|
|
|
|
|
{
|
2023-06-02 15:22:05 -05:00
|
|
|
if (SOF_JACK_JDSRC(sof_sdw_quirk))
|
2020-06-25 14:12:56 -05:00
|
|
|
dev_dbg(dev, "quirk realtek,jack-detect-source %ld\n",
|
2023-06-02 15:22:05 -05:00
|
|
|
SOF_JACK_JDSRC(sof_sdw_quirk));
|
2020-06-25 14:12:56 -05:00
|
|
|
if (sof_sdw_quirk & SOF_SDW_FOUR_SPK)
|
|
|
|
|
dev_dbg(dev, "quirk SOF_SDW_FOUR_SPK enabled\n");
|
|
|
|
|
if (sof_sdw_quirk & SOF_SDW_TGL_HDMI)
|
|
|
|
|
dev_dbg(dev, "quirk SOF_SDW_TGL_HDMI enabled\n");
|
|
|
|
|
if (sof_sdw_quirk & SOF_SDW_PCH_DMIC)
|
|
|
|
|
dev_dbg(dev, "quirk SOF_SDW_PCH_DMIC enabled\n");
|
|
|
|
|
if (SOF_SSP_GET_PORT(sof_sdw_quirk))
|
|
|
|
|
dev_dbg(dev, "SSP port %ld\n",
|
|
|
|
|
SOF_SSP_GET_PORT(sof_sdw_quirk));
|
|
|
|
|
if (sof_sdw_quirk & SOF_SDW_NO_AGGREGATION)
|
|
|
|
|
dev_dbg(dev, "quirk SOF_SDW_NO_AGGREGATION enabled\n");
|
|
|
|
|
}
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
static int sof_sdw_quirk_cb(const struct dmi_system_id *id)
|
|
|
|
|
{
|
|
|
|
|
sof_sdw_quirk = (unsigned long)id->driver_data;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const struct dmi_system_id sof_sdw_quirk_table[] = {
|
2021-02-08 17:33:26 -06:00
|
|
|
/* CometLake devices */
|
2020-11-11 15:43:15 -06:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
2021-02-08 17:33:26 -06:00
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "CometLake Client"),
|
2021-01-25 10:11:17 +02:00
|
|
|
},
|
2021-02-08 17:33:26 -06:00
|
|
|
.driver_data = (void *)SOF_SDW_PCH_DMIC,
|
2021-01-25 10:11:17 +02:00
|
|
|
},
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "09C6")
|
|
|
|
|
},
|
2021-10-27 10:18:21 +08:00
|
|
|
.driver_data = (void *)RT711_JD2,
|
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-25 17:07:44 -05:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
/* early version of SKU 09C6 */
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0983")
|
|
|
|
|
},
|
2021-10-27 10:18:21 +08:00
|
|
|
.driver_data = (void *)RT711_JD2,
|
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-25 17:07:44 -05:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "098F"),
|
|
|
|
|
},
|
2021-07-12 15:32:39 -05:00
|
|
|
.driver_data = (void *)(RT711_JD2 |
|
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-25 17:07:44 -05:00
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-02-08 17:33:26 -06:00
|
|
|
{
|
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-25 17:07:44 -05:00
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0990"),
|
|
|
|
|
},
|
2021-07-12 15:32:39 -05:00
|
|
|
.driver_data = (void *)(RT711_JD2 |
|
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-25 17:07:44 -05:00
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-02-08 17:33:26 -06:00
|
|
|
/* IceLake devices */
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Ice Lake Client"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)SOF_SDW_PCH_DMIC,
|
|
|
|
|
},
|
|
|
|
|
/* TigerLake devices */
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME,
|
|
|
|
|
"Tiger Lake Client Platform"),
|
|
|
|
|
},
|
2021-02-08 17:33:27 -06:00
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
2021-07-12 15:32:39 -05:00
|
|
|
RT711_JD1 |
|
2021-02-08 17:33:27 -06:00
|
|
|
SOF_SDW_PCH_DMIC |
|
|
|
|
|
SOF_SSP_PORT(SOF_I2S_SSP2)),
|
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-25 17:07:44 -05:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
2021-02-08 17:33:26 -06:00
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A3E")
|
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-25 17:07:44 -05:00
|
|
|
},
|
2021-02-08 17:33:26 -06:00
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
2021-10-27 10:18:21 +08:00
|
|
|
RT711_JD2),
|
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-25 17:07:44 -05:00
|
|
|
},
|
2021-10-27 10:18:17 +08:00
|
|
|
{
|
|
|
|
|
/* another SKU of Dell Latitude 9520 */
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A3F")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
2021-10-27 10:18:21 +08:00
|
|
|
RT711_JD2),
|
2021-10-27 10:18:17 +08:00
|
|
|
},
|
2021-08-02 10:21:48 -05:00
|
|
|
{
|
|
|
|
|
/* Dell XPS 9710 */
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5D")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
2021-02-08 17:33:26 -06:00
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E")
|
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-25 17:07:44 -05:00
|
|
|
},
|
2021-02-08 17:33:26 -06:00
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
2021-07-12 15:32:39 -05:00
|
|
|
RT711_JD2 |
|
2021-02-08 17:33:26 -06:00
|
|
|
SOF_SDW_FOUR_SPK),
|
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-25 17:07:44 -05:00
|
|
|
},
|
2020-03-25 17:07:46 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Volteer"),
|
|
|
|
|
},
|
2021-02-08 17:33:27 -06:00
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
2021-05-05 11:36:59 -05:00
|
|
|
SOF_SDW_FOUR_SPK |
|
|
|
|
|
SOF_BT_OFFLOAD_SSP(2) |
|
|
|
|
|
SOF_SSP_BT_OFFLOAD_PRESENT),
|
2020-03-25 17:07:46 -05:00
|
|
|
},
|
2020-08-21 14:55:58 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Ripto"),
|
|
|
|
|
},
|
2021-02-08 17:33:27 -06:00
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
2020-08-21 14:55:58 -05:00
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-02-08 17:33:28 -06:00
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* this entry covers multiple HP SKUs. The family name
|
|
|
|
|
* does not seem robust enough, so we use a partial
|
|
|
|
|
* match that ignores the product name suffix
|
|
|
|
|
* (e.g. 15-eb1xxx, 14t-ea000 or 13-aw2xxx)
|
|
|
|
|
*/
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
|
2022-03-04 14:45:32 -06:00
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Conv"),
|
2021-02-08 17:33:28 -06:00
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
ASoC: Intel: sof_sdw: fix jack detection on HP Spectre x360 convertible
Tests on device show the JD2 mode does not work at all, the 'Headphone
Jack' and 'Headset Mic Jack' are shown as 'on' always.
JD1 seems to be the better option, with at least a change between the
two cases.
Jack not plugged-in:
[root@fedora ~]# amixer -Dhw:0 cget numid=12
numid=12,iface=CARD,name='Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off
Jack plugged-in:
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on
The 'Headset Mic Jack' is updated with a delay which seems normal with
additional calibration needed.
Fixes: d92e279dee56 ('ASoC: Intel: sof_sdw: add quirk for HP Spectre x360 convertible')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-27 10:18:16 +08:00
|
|
|
RT711_JD1),
|
2023-05-12 12:33:03 -05:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* this entry covers HP Spectre x360 where the DMI information
|
|
|
|
|
* changed somehow
|
|
|
|
|
*/
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
|
|
|
|
|
DMI_MATCH(DMI_BOARD_NAME, "8709"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
|
|
|
|
RT711_JD1),
|
2021-02-08 17:33:28 -06:00
|
|
|
},
|
2021-07-19 18:32:48 -05:00
|
|
|
{
|
|
|
|
|
/* NUC15 'Bishop County' LAPBC510 and LAPBC710 skews */
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel(R) Client Systems"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "LAPBC"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
|
|
|
|
RT711_JD1),
|
|
|
|
|
},
|
2022-10-17 15:40:54 -05:00
|
|
|
{
|
|
|
|
|
/* NUC15 LAPBC710 skews */
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
|
|
|
|
|
DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
|
|
|
|
RT711_JD1),
|
|
|
|
|
},
|
2023-03-14 17:05:52 +08:00
|
|
|
{
|
|
|
|
|
/* NUC15 'Rooks County' LAPRC510 and LAPRC710 skews */
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel(R) Client Systems"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "LAPRC"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
|
|
|
|
RT711_JD2_100K),
|
|
|
|
|
},
|
2021-02-08 17:33:26 -06:00
|
|
|
/* TigerLake-SDCA devices */
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A32")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
2021-07-12 15:32:39 -05:00
|
|
|
RT711_JD2 |
|
2021-02-08 17:33:26 -06:00
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-10-04 16:35:12 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A45")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
2021-10-27 10:18:21 +08:00
|
|
|
RT711_JD2),
|
2021-10-04 16:35:12 -05:00
|
|
|
},
|
2021-04-15 12:50:09 -05:00
|
|
|
/* AlderLake devices */
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Alder Lake Client Platform"),
|
|
|
|
|
},
|
2021-07-12 15:32:40 -05:00
|
|
|
.driver_data = (void *)(RT711_JD2_100K |
|
2021-04-15 12:50:09 -05:00
|
|
|
SOF_SDW_TGL_HDMI |
|
2021-05-21 18:56:32 +03:00
|
|
|
SOF_BT_OFFLOAD_SSP(2) |
|
|
|
|
|
SOF_SSP_BT_OFFLOAD_PRESENT),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Brya"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_PCH_DMIC |
|
|
|
|
|
SOF_SDW_FOUR_SPK |
|
|
|
|
|
SOF_BT_OFFLOAD_SSP(2) |
|
|
|
|
|
SOF_SSP_BT_OFFLOAD_PRESENT),
|
2021-04-15 12:50:09 -05:00
|
|
|
},
|
2022-07-25 14:49:00 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF0")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-11-05 10:26:38 +08:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF3"),
|
|
|
|
|
},
|
|
|
|
|
/* No Jack */
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2023-07-31 16:42:42 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFE")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2022-09-19 13:46:40 +02:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFF")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-11-05 10:26:40 +08:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B00")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B01")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-11-05 10:26:41 +08:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B11")
|
|
|
|
|
},
|
2021-11-05 10:26:46 +08:00
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B12")
|
|
|
|
|
},
|
2021-11-05 10:26:41 +08:00
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2021-11-05 10:26:42 +08:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B13"),
|
|
|
|
|
},
|
|
|
|
|
/* No Jack */
|
|
|
|
|
.driver_data = (void *)SOF_SDW_TGL_HDMI,
|
|
|
|
|
},
|
2021-11-05 10:26:44 +08:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B29"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2023-06-02 15:22:15 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B34"),
|
|
|
|
|
},
|
|
|
|
|
/* No Jack */
|
|
|
|
|
.driver_data = (void *)SOF_SDW_TGL_HDMI,
|
|
|
|
|
},
|
2022-07-15 09:41:43 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-k0xxx"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2),
|
|
|
|
|
},
|
2022-11-10 16:54:28 -06:00
|
|
|
/* RaptorLake devices */
|
2023-06-02 15:22:13 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0BDA")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2022-11-10 16:54:28 -06:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C10"),
|
|
|
|
|
},
|
|
|
|
|
/* No Jack */
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2022-11-17 08:27:57 +08:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C11")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2022-11-10 16:54:30 -06:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C40")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2022-11-22 13:20:52 +08:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
|
|
|
|
|
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C4F")
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
|
|
|
|
|
RT711_JD2 |
|
|
|
|
|
SOF_SDW_FOUR_SPK),
|
|
|
|
|
},
|
2022-06-10 16:44:15 -05:00
|
|
|
/* MeteorLake devices */
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_mtlrvp"),
|
|
|
|
|
},
|
2023-05-12 12:32:59 -05:00
|
|
|
.driver_data = (void *)(RT711_JD1),
|
2022-06-10 16:44:15 -05:00
|
|
|
},
|
2023-05-12 12:33:00 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Meteor Lake Client Platform"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(RT711_JD2_100K),
|
|
|
|
|
},
|
2023-06-02 15:22:24 -05:00
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Rex"),
|
|
|
|
|
},
|
2023-07-31 16:42:38 -05:00
|
|
|
.driver_data = (void *)(SOF_SDW_PCH_DMIC |
|
|
|
|
|
SOF_BT_OFFLOAD_SSP(1) |
|
|
|
|
|
SOF_SSP_BT_OFFLOAD_PRESENT),
|
2023-06-02 15:22:24 -05:00
|
|
|
},
|
2023-05-12 12:33:05 -05:00
|
|
|
/* LunarLake devices */
|
|
|
|
|
{
|
|
|
|
|
.callback = sof_sdw_quirk_cb,
|
|
|
|
|
.matches = {
|
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
|
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Lunar Lake Client Platform"),
|
|
|
|
|
},
|
|
|
|
|
.driver_data = (void *)(RT711_JD2_100K),
|
|
|
|
|
},
|
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-25 17:07:44 -05:00
|
|
|
{}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct snd_soc_dai_link_component dmic_component[] = {
|
|
|
|
|
{
|
|
|
|
|
.name = "dmic-codec",
|
|
|
|
|
.dai_name = "dmic-hifi",
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct snd_soc_dai_link_component platform_component[] = {
|
|
|
|
|
{
|
|
|
|
|
/* name might be overridden during probe */
|
|
|
|
|
.name = "0000:00:1f.3"
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* these wrappers are only needed to avoid typecast compilation errors */
|
2020-06-25 14:26:20 -05:00
|
|
|
int sdw_startup(struct snd_pcm_substream *substream)
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
return sdw_startup_stream(substream);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-23 11:05:09 +03:00
|
|
|
int sdw_prepare(struct snd_pcm_substream *substream)
|
2020-09-05 02:28:54 +08:00
|
|
|
{
|
|
|
|
|
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
|
|
|
|
struct sdw_stream_runtime *sdw_stream;
|
|
|
|
|
struct snd_soc_dai *dai;
|
|
|
|
|
|
|
|
|
|
/* Find stream from first CPU DAI */
|
|
|
|
|
dai = asoc_rtd_to_cpu(rtd, 0);
|
|
|
|
|
|
2021-12-24 10:10:31 +08:00
|
|
|
sdw_stream = snd_soc_dai_get_stream(dai, substream->stream);
|
2020-09-05 02:28:54 +08:00
|
|
|
if (IS_ERR(sdw_stream)) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name);
|
2020-09-05 02:28:54 +08:00
|
|
|
return PTR_ERR(sdw_stream);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sdw_prepare_stream(sdw_stream);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-23 11:05:09 +03:00
|
|
|
int sdw_trigger(struct snd_pcm_substream *substream, int cmd)
|
2020-09-05 02:28:53 +08:00
|
|
|
{
|
|
|
|
|
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
|
|
|
|
struct sdw_stream_runtime *sdw_stream;
|
|
|
|
|
struct snd_soc_dai *dai;
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
/* Find stream from first CPU DAI */
|
|
|
|
|
dai = asoc_rtd_to_cpu(rtd, 0);
|
|
|
|
|
|
2021-12-24 10:10:31 +08:00
|
|
|
sdw_stream = snd_soc_dai_get_stream(dai, substream->stream);
|
2020-09-05 02:28:53 +08:00
|
|
|
if (IS_ERR(sdw_stream)) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name);
|
2020-09-05 02:28:53 +08:00
|
|
|
return PTR_ERR(sdw_stream);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
|
case SNDRV_PCM_TRIGGER_START:
|
|
|
|
|
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
|
|
|
|
case SNDRV_PCM_TRIGGER_RESUME:
|
|
|
|
|
ret = sdw_enable_stream(sdw_stream);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
|
|
|
|
case SNDRV_PCM_TRIGGER_SUSPEND:
|
|
|
|
|
case SNDRV_PCM_TRIGGER_STOP:
|
|
|
|
|
ret = sdw_disable_stream(sdw_stream);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ret = -EINVAL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ret)
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(rtd->dev, "%s trigger %d failed: %d\n", __func__, cmd, ret);
|
2020-09-05 02:28:53 +08:00
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-07 11:12:42 +08:00
|
|
|
int sdw_hw_params(struct snd_pcm_substream *substream,
|
|
|
|
|
struct snd_pcm_hw_params *params)
|
|
|
|
|
{
|
|
|
|
|
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
|
|
|
|
int ch = params_channels(params);
|
|
|
|
|
struct snd_soc_dai *codec_dai;
|
|
|
|
|
struct snd_soc_dai *cpu_dai;
|
|
|
|
|
unsigned int ch_mask;
|
|
|
|
|
int num_codecs;
|
|
|
|
|
int step;
|
|
|
|
|
int i;
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
|
|
if (!rtd->dai_link->codec_ch_maps)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Identical data will be sent to all codecs in playback */
|
|
|
|
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
|
|
|
|
ch_mask = GENMASK(ch - 1, 0);
|
|
|
|
|
step = 0;
|
|
|
|
|
} else {
|
|
|
|
|
num_codecs = rtd->dai_link->num_codecs;
|
|
|
|
|
|
|
|
|
|
if (ch < num_codecs || ch % num_codecs != 0) {
|
|
|
|
|
dev_err(rtd->dev, "Channels number %d is invalid when codec number = %d\n",
|
|
|
|
|
ch, num_codecs);
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ch_mask = GENMASK(ch / num_codecs - 1, 0);
|
|
|
|
|
step = hweight_long(ch_mask);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The captured data will be combined from each cpu DAI if the dai
|
|
|
|
|
* link has more than one codec DAIs. Set codec channel mask and
|
|
|
|
|
* ASoC will set the corresponding channel numbers for each cpu dai.
|
|
|
|
|
*/
|
|
|
|
|
for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
|
|
|
|
|
for_each_rtd_codec_dais(rtd, j, codec_dai) {
|
|
|
|
|
if (rtd->dai_link->codec_ch_maps[j].connected_cpu_id != i)
|
|
|
|
|
continue;
|
|
|
|
|
rtd->dai_link->codec_ch_maps[j].ch_mask = ch_mask << (j * step);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-23 11:05:09 +03:00
|
|
|
int sdw_hw_free(struct snd_pcm_substream *substream)
|
2020-09-05 02:28:54 +08:00
|
|
|
{
|
|
|
|
|
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
|
|
|
|
struct sdw_stream_runtime *sdw_stream;
|
|
|
|
|
struct snd_soc_dai *dai;
|
|
|
|
|
|
|
|
|
|
/* Find stream from first CPU DAI */
|
|
|
|
|
dai = asoc_rtd_to_cpu(rtd, 0);
|
|
|
|
|
|
2021-12-24 10:10:31 +08:00
|
|
|
sdw_stream = snd_soc_dai_get_stream(dai, substream->stream);
|
2020-09-05 02:28:54 +08:00
|
|
|
if (IS_ERR(sdw_stream)) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name);
|
2020-09-05 02:28:54 +08:00
|
|
|
return PTR_ERR(sdw_stream);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sdw_deprepare_stream(sdw_stream);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-25 14:26:20 -05:00
|
|
|
void sdw_shutdown(struct snd_pcm_substream *substream)
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
sdw_shutdown_stream(substream);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const struct snd_soc_ops sdw_ops = {
|
|
|
|
|
.startup = sdw_startup,
|
2020-09-05 02:28:54 +08:00
|
|
|
.prepare = sdw_prepare,
|
2020-09-05 02:28:53 +08:00
|
|
|
.trigger = sdw_trigger,
|
2023-06-07 11:12:42 +08:00
|
|
|
.hw_params = sdw_hw_params,
|
2020-09-05 02:28:54 +08:00
|
|
|
.hw_free = sdw_hw_free,
|
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-25 17:07:44 -05:00
|
|
|
.shutdown = sdw_shutdown,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct sof_sdw_codec_info codec_info_list[] = {
|
|
|
|
|
{
|
2020-08-21 14:55:56 -05:00
|
|
|
.part_id = 0x700,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt700-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt700_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
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-25 17:07:44 -05:00
|
|
|
},
|
|
|
|
|
{
|
2020-08-21 14:55:56 -05:00
|
|
|
.part_id = 0x711,
|
2020-08-21 14:56:01 -05:00
|
|
|
.version_id = 3,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt711-sdca-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
2023-06-02 15:22:06 -05:00
|
|
|
.init = sof_sdw_rt_sdca_jack_init,
|
|
|
|
|
.exit = sof_sdw_rt_sdca_jack_exit,
|
2023-06-02 15:21:59 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2020-08-21 14:56:01 -05:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x711,
|
|
|
|
|
.version_id = 2,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt711-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt711_init,
|
|
|
|
|
.exit = sof_sdw_rt711_exit,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
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-25 17:07:44 -05:00
|
|
|
},
|
2023-06-02 15:22:07 -05:00
|
|
|
{
|
|
|
|
|
.part_id = 0x712,
|
|
|
|
|
.version_id = 3,
|
|
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt712-sdca-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
|
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
|
|
|
|
.init = sof_sdw_rt_sdca_jack_init,
|
|
|
|
|
.exit = sof_sdw_rt_sdca_jack_exit,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, false},
|
|
|
|
|
.dai_name = "rt712-sdca-aif2",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
|
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID},
|
|
|
|
|
.init = sof_sdw_rt712_spk_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x1712,
|
|
|
|
|
.version_id = 3,
|
|
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {false, true},
|
|
|
|
|
.dai_name = "rt712-sdca-dmic-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_MIC,
|
2023-06-02 15:22:10 -05:00
|
|
|
.dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
|
|
|
|
|
.init = sof_sdw_rt712_sdca_dmic_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x713,
|
|
|
|
|
.version_id = 3,
|
|
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt712-sdca-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
|
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
|
|
|
|
.init = sof_sdw_rt_sdca_jack_init,
|
|
|
|
|
.exit = sof_sdw_rt_sdca_jack_exit,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x1713,
|
|
|
|
|
.version_id = 3,
|
|
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {false, true},
|
|
|
|
|
.dai_name = "rt712-sdca-dmic-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_MIC,
|
2023-06-02 15:22:07 -05:00
|
|
|
.dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
|
|
|
|
|
.init = sof_sdw_rt712_sdca_dmic_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
|
|
|
|
},
|
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-25 17:07:44 -05:00
|
|
|
{
|
2020-08-21 14:55:56 -05:00
|
|
|
.part_id = 0x1308,
|
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-25 17:07:44 -05:00
|
|
|
.acpi_id = "10EC1308",
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, false},
|
|
|
|
|
.dai_name = "rt1308-aif",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt_amp_init,
|
|
|
|
|
.exit = sof_sdw_rt_amp_exit,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
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-25 17:07:44 -05:00
|
|
|
.ops = &sof_sdw_rt1308_i2s_ops,
|
|
|
|
|
},
|
2020-08-21 14:56:01 -05:00
|
|
|
{
|
|
|
|
|
.part_id = 0x1316,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt1316-aif",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt_amp_init,
|
|
|
|
|
.exit = sof_sdw_rt_amp_exit,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2020-08-21 14:56:01 -05:00
|
|
|
},
|
2022-11-17 08:27:56 +08:00
|
|
|
{
|
|
|
|
|
.part_id = 0x1318,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt1318-aif",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt_amp_init,
|
|
|
|
|
.exit = sof_sdw_rt_amp_exit,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2022-11-17 08:27:56 +08:00
|
|
|
},
|
2020-08-21 14:56:01 -05:00
|
|
|
{
|
|
|
|
|
.part_id = 0x714,
|
2020-10-02 16:19:02 -05:00
|
|
|
.version_id = 3,
|
2021-05-05 11:36:56 -05:00
|
|
|
.ignore_pch_dmic = true,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {false, true},
|
|
|
|
|
.dai_name = "rt715-aif2",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_MIC,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt715_sdca_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2020-08-21 14:56:01 -05:00
|
|
|
},
|
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-25 17:07:44 -05:00
|
|
|
{
|
2020-08-21 14:55:56 -05:00
|
|
|
.part_id = 0x715,
|
2020-10-02 16:19:02 -05:00
|
|
|
.version_id = 3,
|
2021-05-05 11:36:56 -05:00
|
|
|
.ignore_pch_dmic = true,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {false, true},
|
|
|
|
|
.dai_name = "rt715-aif2",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_MIC,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt715_sdca_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2020-10-02 16:19:02 -05:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x714,
|
|
|
|
|
.version_id = 2,
|
2021-05-05 11:36:56 -05:00
|
|
|
.ignore_pch_dmic = true,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {false, true},
|
|
|
|
|
.dai_name = "rt715-aif2",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_MIC,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt715_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2020-10-02 16:19:02 -05:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x715,
|
|
|
|
|
.version_id = 2,
|
2021-05-05 11:36:56 -05:00
|
|
|
.ignore_pch_dmic = true,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {false, true},
|
|
|
|
|
.dai_name = "rt715-aif2",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_MIC,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt715_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
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-25 17:07:44 -05:00
|
|
|
},
|
2020-06-25 14:26:20 -05:00
|
|
|
{
|
2020-08-21 14:55:56 -05:00
|
|
|
.part_id = 0x8373,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "max98373-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID},
|
2023-06-02 15:22:22 -05:00
|
|
|
.init = sof_sdw_maxim_init,
|
2023-06-02 15:21:59 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2020-06-25 14:26:20 -05:00
|
|
|
},
|
2023-06-02 15:22:23 -05:00
|
|
|
{
|
|
|
|
|
.part_id = 0x8363,
|
|
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, false},
|
|
|
|
|
.dai_name = "max98363-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
|
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID},
|
|
|
|
|
.init = sof_sdw_maxim_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
|
|
|
|
},
|
2020-03-25 17:07:46 -05:00
|
|
|
{
|
2020-08-21 14:55:56 -05:00
|
|
|
.part_id = 0x5682,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "rt5682-sdw",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = sof_sdw_rt5682_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2020-03-25 17:07:46 -05:00
|
|
|
},
|
2023-07-31 16:42:54 -05:00
|
|
|
{
|
|
|
|
|
.part_id = 0x3556,
|
|
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "cs35l56-sdw1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
|
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID},
|
|
|
|
|
.init = sof_sdw_cs_amp_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
|
|
|
|
},
|
2023-06-02 15:22:20 -05:00
|
|
|
{
|
|
|
|
|
.part_id = 0x4242,
|
|
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "cs42l42-sdw",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
|
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
|
|
|
|
.init = sof_sdw_cs42l42_init,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
|
|
|
|
},
|
2021-07-14 11:22:03 +08:00
|
|
|
{
|
|
|
|
|
.part_id = 0xaaaa, /* generic codec mockup */
|
|
|
|
|
.version_id = 0,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "sdw-mockup-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = NULL,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2021-07-14 11:22:03 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0xaa55, /* headset codec mockup */
|
|
|
|
|
.version_id = 0,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.direction = {true, true},
|
|
|
|
|
.dai_name = "sdw-mockup-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_JACK,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = NULL,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2021-07-14 11:22:03 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x55aa, /* amplifier mockup */
|
|
|
|
|
.version_id = 0,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
2023-07-31 16:42:40 -05:00
|
|
|
.direction = {true, true},
|
2023-06-02 15:21:59 -05:00
|
|
|
.dai_name = "sdw-mockup-aif1",
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_AMP,
|
2023-07-31 16:42:40 -05:00
|
|
|
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = NULL,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2021-07-14 11:22:03 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.part_id = 0x5555,
|
|
|
|
|
.version_id = 0,
|
2023-06-02 15:21:59 -05:00
|
|
|
.dais = {
|
|
|
|
|
{
|
|
|
|
|
.dai_name = "sdw-mockup-aif1",
|
|
|
|
|
.direction = {false, true},
|
|
|
|
|
.dai_type = SOF_SDW_DAI_TYPE_MIC,
|
2023-06-02 15:22:00 -05:00
|
|
|
.dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
|
2023-06-02 15:21:59 -05:00
|
|
|
.init = NULL,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
.dai_num = 1,
|
2021-07-14 11:22:03 +08:00
|
|
|
},
|
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-25 17:07:44 -05:00
|
|
|
};
|
|
|
|
|
|
2023-07-31 16:42:48 -05:00
|
|
|
static inline int find_codec_info_part(const u64 adr)
|
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-25 17:07:44 -05:00
|
|
|
{
|
2020-08-21 14:55:55 -05:00
|
|
|
unsigned int part_id, sdw_version;
|
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-25 17:07:44 -05:00
|
|
|
int i;
|
|
|
|
|
|
2020-08-21 14:55:55 -05:00
|
|
|
part_id = SDW_PART_ID(adr);
|
|
|
|
|
sdw_version = SDW_VERSION(adr);
|
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-25 17:07:44 -05:00
|
|
|
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
|
2020-08-21 14:55:55 -05:00
|
|
|
/*
|
|
|
|
|
* A codec info is for all sdw version with the part id if
|
|
|
|
|
* version_id is not specified in the codec info.
|
|
|
|
|
*/
|
2020-08-21 14:55:56 -05:00
|
|
|
if (part_id == codec_info_list[i].part_id &&
|
2020-08-21 14:55:55 -05:00
|
|
|
(!codec_info_list[i].version_id ||
|
|
|
|
|
sdw_version == codec_info_list[i].version_id))
|
|
|
|
|
return i;
|
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-25 17:07:44 -05:00
|
|
|
|
2020-08-21 14:55:55 -05:00
|
|
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int find_codec_info_acpi(const u8 *acpi_id)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (!acpi_id[0])
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
|
2023-07-31 16:42:47 -05:00
|
|
|
if (!memcmp(codec_info_list[i].acpi_id, acpi_id, ACPI_ID_LEN))
|
|
|
|
|
return i;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:47 -05:00
|
|
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* get BE dailink number and CPU DAI number based on sdw link adr.
|
|
|
|
|
* Since some sdw slaves may be aggregated, the CPU DAI number
|
|
|
|
|
* may be larger than the number of BE dailinks.
|
|
|
|
|
*/
|
2023-07-31 16:42:56 -05:00
|
|
|
static int get_dailink_info(struct device *dev,
|
|
|
|
|
const struct snd_soc_acpi_link_adr *adr_link,
|
|
|
|
|
int *sdw_be_num, int *sdw_cpu_dai_num, int *codecs_num)
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
bool group_visited[SDW_MAX_GROUPS];
|
|
|
|
|
bool no_aggregation;
|
|
|
|
|
int i;
|
2023-06-02 15:22:03 -05:00
|
|
|
int j;
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
no_aggregation = sof_sdw_quirk & SOF_SDW_NO_AGGREGATION;
|
|
|
|
|
*sdw_cpu_dai_num = 0;
|
|
|
|
|
*sdw_be_num = 0;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
if (!adr_link)
|
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-25 17:07:44 -05:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < SDW_MAX_GROUPS; i++)
|
|
|
|
|
group_visited[i] = false;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
for (; adr_link->num_adr; adr_link++) {
|
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-25 17:07:44 -05:00
|
|
|
const struct snd_soc_acpi_endpoint *endpoint;
|
2023-06-02 15:22:01 -05:00
|
|
|
struct sof_sdw_codec_info *codec_info;
|
2020-08-21 14:55:55 -05:00
|
|
|
int codec_index;
|
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-25 17:07:44 -05:00
|
|
|
int stream;
|
|
|
|
|
u64 adr;
|
|
|
|
|
|
2023-08-08 14:20:04 +01:00
|
|
|
/* make sure the link mask has a single bit set */
|
|
|
|
|
if (!is_power_of_2(adr_link->mask))
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
for (i = 0; i < adr_link->num_adr; i++) {
|
|
|
|
|
adr = adr_link->adr_d[i].adr;
|
2023-04-19 14:55:23 -05:00
|
|
|
codec_index = find_codec_info_part(adr);
|
|
|
|
|
if (codec_index < 0)
|
|
|
|
|
return codec_index;
|
2023-07-31 16:42:56 -05:00
|
|
|
|
2023-06-02 15:22:01 -05:00
|
|
|
codec_info = &codec_info_list[codec_index];
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:56 -05:00
|
|
|
*codecs_num += codec_info->dai_num;
|
|
|
|
|
|
|
|
|
|
if (!adr_link->adr_d[i].name_prefix) {
|
|
|
|
|
dev_err(dev, "codec 0x%llx does not have a name prefix\n",
|
|
|
|
|
adr_link->adr_d[i].adr);
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
endpoint = adr_link->adr_d[i].endpoints;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-06-02 15:22:03 -05:00
|
|
|
for (j = 0; j < codec_info->dai_num; j++) {
|
|
|
|
|
/* count DAI number for playback and capture */
|
|
|
|
|
for_each_pcm_streams(stream) {
|
|
|
|
|
if (!codec_info->dais[j].direction[stream])
|
|
|
|
|
continue;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-06-02 15:22:03 -05:00
|
|
|
(*sdw_cpu_dai_num)++;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-06-02 15:22:03 -05:00
|
|
|
/* count BE for each non-aggregated slave or group */
|
|
|
|
|
if (!endpoint->aggregated || no_aggregation ||
|
|
|
|
|
!group_visited[endpoint->group_id])
|
|
|
|
|
(*sdw_be_num)++;
|
|
|
|
|
}
|
2023-04-19 14:55:23 -05:00
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
|
2023-04-19 14:55:23 -05:00
|
|
|
if (endpoint->aggregated)
|
|
|
|
|
group_visited[endpoint->group_id] = true;
|
|
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-08 17:33:31 -06:00
|
|
|
static void init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links,
|
|
|
|
|
int be_id, char *name, int playback, int capture,
|
|
|
|
|
struct snd_soc_dai_link_component *cpus, int cpus_num,
|
|
|
|
|
struct snd_soc_dai_link_component *codecs, int codecs_num,
|
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-25 17:07:44 -05:00
|
|
|
int (*init)(struct snd_soc_pcm_runtime *rtd),
|
|
|
|
|
const struct snd_soc_ops *ops)
|
|
|
|
|
{
|
2021-02-08 17:33:31 -06:00
|
|
|
dev_dbg(dev, "create dai link %s, id %d\n", name, be_id);
|
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-25 17:07:44 -05:00
|
|
|
dai_links->id = be_id;
|
|
|
|
|
dai_links->name = name;
|
|
|
|
|
dai_links->platforms = platform_component;
|
|
|
|
|
dai_links->num_platforms = ARRAY_SIZE(platform_component);
|
|
|
|
|
dai_links->no_pcm = 1;
|
|
|
|
|
dai_links->cpus = cpus;
|
|
|
|
|
dai_links->num_cpus = cpus_num;
|
|
|
|
|
dai_links->codecs = codecs;
|
|
|
|
|
dai_links->num_codecs = codecs_num;
|
|
|
|
|
dai_links->dpcm_playback = playback;
|
|
|
|
|
dai_links->dpcm_capture = capture;
|
|
|
|
|
dai_links->init = init;
|
|
|
|
|
dai_links->ops = ops;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
static bool is_unique_device(const struct snd_soc_acpi_link_adr *adr_link,
|
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-25 17:07:44 -05:00
|
|
|
unsigned int sdw_version,
|
|
|
|
|
unsigned int mfg_id,
|
|
|
|
|
unsigned int part_id,
|
|
|
|
|
unsigned int class_id,
|
2023-07-31 16:42:45 -05:00
|
|
|
int index_in_link)
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
for (i = 0; i < adr_link->num_adr; i++) {
|
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-25 17:07:44 -05:00
|
|
|
unsigned int sdw1_version, mfg1_id, part1_id, class1_id;
|
|
|
|
|
u64 adr;
|
|
|
|
|
|
|
|
|
|
/* skip itself */
|
|
|
|
|
if (i == index_in_link)
|
|
|
|
|
continue;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
adr = adr_link->adr_d[i].adr;
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
sdw1_version = SDW_VERSION(adr);
|
|
|
|
|
mfg1_id = SDW_MFG_ID(adr);
|
|
|
|
|
part1_id = SDW_PART_ID(adr);
|
|
|
|
|
class1_id = SDW_CLASS_ID(adr);
|
|
|
|
|
|
|
|
|
|
if (sdw_version == sdw1_version &&
|
|
|
|
|
mfg_id == mfg1_id &&
|
|
|
|
|
part_id == part1_id &&
|
|
|
|
|
class_id == class1_id)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int create_codec_dai_name(struct device *dev,
|
2023-07-31 16:42:43 -05:00
|
|
|
const struct snd_soc_acpi_link_adr *adr_link,
|
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-25 17:07:44 -05:00
|
|
|
struct snd_soc_dai_link_component *codec,
|
2020-09-23 11:05:12 +03:00
|
|
|
int offset,
|
|
|
|
|
struct snd_soc_codec_conf *codec_conf,
|
|
|
|
|
int codec_count,
|
2023-04-19 14:55:23 -05:00
|
|
|
int *codec_conf_index,
|
2023-06-02 15:22:03 -05:00
|
|
|
int adr_index,
|
|
|
|
|
int dai_index)
|
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-25 17:07:44 -05:00
|
|
|
{
|
2023-04-19 14:55:23 -05:00
|
|
|
int _codec_index = -1;
|
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-25 17:07:44 -05:00
|
|
|
int i;
|
|
|
|
|
|
2020-09-23 11:05:12 +03:00
|
|
|
/* sanity check */
|
2023-07-31 16:42:43 -05:00
|
|
|
if (*codec_conf_index + adr_link->num_adr - adr_index > codec_count) {
|
2020-09-23 11:05:12 +03:00
|
|
|
dev_err(dev, "codec_conf: out-of-bounds access requested\n");
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
for (i = adr_index; i < adr_link->num_adr; i++) {
|
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-25 17:07:44 -05:00
|
|
|
unsigned int sdw_version, unique_id, mfg_id;
|
|
|
|
|
unsigned int link_id, part_id, class_id;
|
|
|
|
|
int codec_index, comp_index;
|
|
|
|
|
char *codec_str;
|
|
|
|
|
u64 adr;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
adr = adr_link->adr_d[i].adr;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:52 -05:00
|
|
|
codec_index = find_codec_info_part(adr);
|
|
|
|
|
if (codec_index < 0)
|
|
|
|
|
return codec_index;
|
|
|
|
|
if (_codec_index != -1 && codec_index != _codec_index) {
|
|
|
|
|
dev_dbg(dev, "Different devices on the same sdw link\n");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_codec_index = codec_index;
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
sdw_version = SDW_VERSION(adr);
|
|
|
|
|
link_id = SDW_DISCO_LINK_ID(adr);
|
|
|
|
|
unique_id = SDW_UNIQUE_ID(adr);
|
|
|
|
|
mfg_id = SDW_MFG_ID(adr);
|
|
|
|
|
part_id = SDW_PART_ID(adr);
|
|
|
|
|
class_id = SDW_CLASS_ID(adr);
|
|
|
|
|
|
2023-04-19 14:55:23 -05:00
|
|
|
comp_index = i - adr_index + offset;
|
2023-07-31 16:42:53 -05:00
|
|
|
if (codec_info_list[codec_index].codec_name) {
|
|
|
|
|
codec[comp_index].name =
|
|
|
|
|
devm_kstrdup(dev, codec_info_list[codec_index].codec_name,
|
|
|
|
|
GFP_KERNEL);
|
|
|
|
|
} else if (is_unique_device(adr_link, sdw_version, mfg_id, part_id,
|
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-25 17:07:44 -05:00
|
|
|
class_id, i)) {
|
2021-05-11 14:01:37 +08:00
|
|
|
codec_str = "sdw:%01x:%04x:%04x:%02x";
|
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-25 17:07:44 -05:00
|
|
|
codec[comp_index].name =
|
|
|
|
|
devm_kasprintf(dev, GFP_KERNEL, codec_str,
|
|
|
|
|
link_id, mfg_id, part_id,
|
|
|
|
|
class_id);
|
|
|
|
|
} else {
|
2021-05-11 14:01:37 +08:00
|
|
|
codec_str = "sdw:%01x:%04x:%04x:%02x:%01x";
|
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-25 17:07:44 -05:00
|
|
|
codec[comp_index].name =
|
|
|
|
|
devm_kasprintf(dev, GFP_KERNEL, codec_str,
|
|
|
|
|
link_id, mfg_id, part_id,
|
|
|
|
|
class_id, unique_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!codec[comp_index].name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
codec[comp_index].dai_name =
|
2023-06-02 15:22:03 -05:00
|
|
|
codec_info_list[codec_index].dais[dai_index].dai_name;
|
2020-09-23 11:05:12 +03:00
|
|
|
|
|
|
|
|
codec_conf[*codec_conf_index].dlc = codec[comp_index];
|
2023-07-31 16:42:43 -05:00
|
|
|
codec_conf[*codec_conf_index].name_prefix = adr_link->adr_d[i].name_prefix;
|
2020-09-23 11:05:12 +03:00
|
|
|
|
|
|
|
|
++*codec_conf_index;
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-13 10:11:12 -05:00
|
|
|
static int set_codec_init_func(struct snd_soc_card *card,
|
2023-07-31 16:42:43 -05:00
|
|
|
const struct snd_soc_acpi_link_adr *adr_link,
|
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-25 17:07:44 -05:00
|
|
|
struct snd_soc_dai_link *dai_links,
|
2023-06-02 15:22:03 -05:00
|
|
|
bool playback, int group_id, int adr_index, int dai_index)
|
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-25 17:07:44 -05:00
|
|
|
{
|
2023-05-12 12:33:02 -05:00
|
|
|
int i = adr_index;
|
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-25 17:07:44 -05:00
|
|
|
|
2020-04-09 13:58:20 -05:00
|
|
|
do {
|
|
|
|
|
/*
|
|
|
|
|
* Initialize the codec. If codec is part of an aggregated
|
|
|
|
|
* group (group_id>0), initialize all codecs belonging to
|
|
|
|
|
* same group.
|
2023-07-31 16:42:43 -05:00
|
|
|
* The first link should start with adr_link->adr_d[adr_index]
|
2023-05-12 12:33:02 -05:00
|
|
|
* because that is the device that we want to initialize and
|
|
|
|
|
* we should end immediately if it is not aggregated (group_id=0)
|
2020-04-09 13:58:20 -05:00
|
|
|
*/
|
2023-07-31 16:42:43 -05:00
|
|
|
for ( ; i < adr_link->num_adr; i++) {
|
2020-04-09 13:58:20 -05:00
|
|
|
int codec_index;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
codec_index = find_codec_info_part(adr_link->adr_d[i].adr);
|
2020-04-09 13:58:20 -05:00
|
|
|
if (codec_index < 0)
|
|
|
|
|
return codec_index;
|
2023-06-02 15:22:03 -05:00
|
|
|
|
2020-04-09 13:58:20 -05:00
|
|
|
/* The group_id is > 0 iff the codec is aggregated */
|
2023-07-31 16:42:43 -05:00
|
|
|
if (adr_link->adr_d[i].endpoints->group_id != group_id)
|
2020-04-09 13:58:20 -05:00
|
|
|
continue;
|
2023-06-02 15:22:03 -05:00
|
|
|
|
|
|
|
|
if (codec_info_list[codec_index].dais[dai_index].init)
|
|
|
|
|
codec_info_list[codec_index].dais[dai_index].init(card,
|
2023-07-31 16:42:43 -05:00
|
|
|
adr_link,
|
2020-04-09 13:58:20 -05:00
|
|
|
dai_links,
|
|
|
|
|
&codec_info_list[codec_index],
|
|
|
|
|
playback);
|
2023-05-12 12:33:02 -05:00
|
|
|
if (!group_id)
|
|
|
|
|
return 0;
|
2020-04-09 13:58:20 -05:00
|
|
|
}
|
2023-07-31 16:42:43 -05:00
|
|
|
|
2023-05-12 12:33:02 -05:00
|
|
|
i = 0;
|
2023-07-31 16:42:43 -05:00
|
|
|
adr_link++;
|
|
|
|
|
} while (adr_link->mask);
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* check endpoint status in slaves and gather link ID for all slaves in
|
|
|
|
|
* the same group to generate different CPU DAI. Now only support
|
|
|
|
|
* one sdw link with all slaves set with only single group id.
|
|
|
|
|
*
|
|
|
|
|
* one slave on one sdw link with aggregated = 0
|
|
|
|
|
* one sdw BE DAI <---> one-cpu DAI <---> one-codec DAI
|
|
|
|
|
*
|
|
|
|
|
* two or more slaves on one sdw link with aggregated = 0
|
|
|
|
|
* one sdw BE DAI <---> one-cpu DAI <---> multi-codec DAIs
|
|
|
|
|
*
|
|
|
|
|
* multiple links with multiple slaves with aggregated = 1
|
|
|
|
|
* one sdw BE DAI <---> 1 .. N CPU DAIs <----> 1 .. N codec DAIs
|
|
|
|
|
*/
|
|
|
|
|
static int get_slave_info(const struct snd_soc_acpi_link_adr *adr_link,
|
|
|
|
|
struct device *dev, int *cpu_dai_id, int *cpu_dai_num,
|
2021-06-21 14:40:54 -05:00
|
|
|
int *codec_num, unsigned int *group_id,
|
2023-07-31 16:42:57 -05:00
|
|
|
int adr_index)
|
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-25 17:07:44 -05:00
|
|
|
{
|
|
|
|
|
const struct snd_soc_acpi_adr_device *adr_d;
|
|
|
|
|
const struct snd_soc_acpi_link_adr *adr_next;
|
|
|
|
|
bool no_aggregation;
|
|
|
|
|
int index = 0;
|
2023-04-19 14:55:23 -05:00
|
|
|
int i;
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
no_aggregation = sof_sdw_quirk & SOF_SDW_NO_AGGREGATION;
|
2023-04-19 14:55:23 -05:00
|
|
|
adr_d = &adr_link->adr_d[adr_index];
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
cpu_dai_id[index++] = ffs(adr_link->mask) - 1;
|
|
|
|
|
if (!adr_d->endpoints->aggregated || no_aggregation) {
|
|
|
|
|
*cpu_dai_num = 1;
|
2023-04-19 14:55:22 -05:00
|
|
|
*codec_num = 1;
|
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-25 17:07:44 -05:00
|
|
|
*group_id = 0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*group_id = adr_d->endpoints->group_id;
|
|
|
|
|
|
2023-04-19 14:55:23 -05:00
|
|
|
/* Count endpoints with the same group_id in the adr_link */
|
|
|
|
|
*codec_num = 0;
|
|
|
|
|
for (i = 0; i < adr_link->num_adr; i++) {
|
|
|
|
|
if (adr_link->adr_d[i].endpoints->aggregated &&
|
|
|
|
|
adr_link->adr_d[i].endpoints->group_id == *group_id)
|
|
|
|
|
(*codec_num)++;
|
|
|
|
|
}
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
/* gather other link ID of slaves in the same group */
|
|
|
|
|
for (adr_next = adr_link + 1; adr_next && adr_next->num_adr;
|
|
|
|
|
adr_next++) {
|
|
|
|
|
const struct snd_soc_acpi_endpoint *endpoint;
|
|
|
|
|
|
|
|
|
|
endpoint = adr_next->adr_d->endpoints;
|
|
|
|
|
if (!endpoint->aggregated ||
|
|
|
|
|
endpoint->group_id != *group_id)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (index >= SDW_MAX_CPU_DAIS) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(dev, "cpu_dai_id array overflows\n");
|
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-25 17:07:44 -05:00
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cpu_dai_id[index++] = ffs(adr_next->mask) - 1;
|
2023-04-19 14:55:23 -05:00
|
|
|
for (i = 0; i < adr_next->num_adr; i++) {
|
|
|
|
|
if (adr_next->adr_d[i].endpoints->aggregated &&
|
|
|
|
|
adr_next->adr_d[i].endpoints->group_id == *group_id)
|
|
|
|
|
(*codec_num)++;
|
|
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*cpu_dai_num = index;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-07 11:12:42 +08:00
|
|
|
static void set_dailink_map(struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_maps,
|
|
|
|
|
int codec_num, int cpu_num)
|
|
|
|
|
{
|
|
|
|
|
int step;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
step = codec_num / cpu_num;
|
|
|
|
|
for (i = 0; i < codec_num; i++)
|
|
|
|
|
sdw_codec_ch_maps[i].connected_cpu_id = i / step;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-19 14:55:24 -05:00
|
|
|
static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"};
|
|
|
|
|
|
2023-07-31 16:42:50 -05:00
|
|
|
static int create_sdw_dailink(struct snd_soc_card *card, int *link_index,
|
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-25 17:07:44 -05:00
|
|
|
struct snd_soc_dai_link *dai_links,
|
|
|
|
|
int sdw_be_num, int sdw_cpu_dai_num,
|
|
|
|
|
struct snd_soc_dai_link_component *cpus,
|
2023-07-31 16:42:43 -05:00
|
|
|
const struct snd_soc_acpi_link_adr *adr_link,
|
2023-07-31 16:42:57 -05:00
|
|
|
int *cpu_id, struct snd_soc_codec_conf *codec_conf,
|
2023-07-31 16:42:41 -05:00
|
|
|
int codec_count, int *be_id,
|
2021-05-05 11:36:56 -05:00
|
|
|
int *codec_conf_index,
|
2023-04-19 14:55:23 -05:00
|
|
|
bool *ignore_pch_dmic,
|
2023-06-02 15:22:02 -05:00
|
|
|
bool append_dai_type,
|
2023-06-02 15:22:03 -05:00
|
|
|
int adr_index,
|
|
|
|
|
int dai_index)
|
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-25 17:07:44 -05:00
|
|
|
{
|
2023-07-31 16:42:50 -05:00
|
|
|
struct device *dev = card->dev;
|
2023-07-31 16:42:43 -05:00
|
|
|
const struct snd_soc_acpi_link_adr *adr_link_next;
|
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-25 17:07:44 -05:00
|
|
|
struct snd_soc_dai_link_component *codecs;
|
2023-06-02 15:22:01 -05:00
|
|
|
struct sof_sdw_codec_info *codec_info;
|
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-25 17:07:44 -05:00
|
|
|
int cpu_dai_id[SDW_MAX_CPU_DAIS];
|
|
|
|
|
int cpu_dai_num, cpu_dai_index;
|
2020-08-21 14:55:55 -05:00
|
|
|
unsigned int group_id;
|
2023-07-31 16:42:44 -05:00
|
|
|
int codec_dlc_index = 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-25 17:07:44 -05:00
|
|
|
int codec_index;
|
|
|
|
|
int codec_num;
|
|
|
|
|
int stream;
|
2023-06-02 15:22:11 -05:00
|
|
|
int i = 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-25 17:07:44 -05:00
|
|
|
int ret;
|
|
|
|
|
int k;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
ret = get_slave_info(adr_link, dev, cpu_dai_id, &cpu_dai_num, &codec_num,
|
2023-07-31 16:42:57 -05:00
|
|
|
&group_id, adr_index);
|
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-25 17:07:44 -05:00
|
|
|
if (ret)
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
codecs = devm_kcalloc(dev, codec_num, sizeof(*codecs), GFP_KERNEL);
|
|
|
|
|
if (!codecs)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
/* generate codec name on different links in the same group */
|
2023-07-31 16:42:43 -05:00
|
|
|
for (adr_link_next = adr_link; adr_link_next && adr_link_next->num_adr &&
|
|
|
|
|
i < cpu_dai_num; adr_link_next++) {
|
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-25 17:07:44 -05:00
|
|
|
const struct snd_soc_acpi_endpoint *endpoints;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
endpoints = adr_link_next->adr_d->endpoints;
|
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-25 17:07:44 -05:00
|
|
|
if (group_id && (!endpoints->aggregated ||
|
|
|
|
|
endpoints->group_id != group_id))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* skip the link excluded by this processed group */
|
2023-07-31 16:42:43 -05:00
|
|
|
if (cpu_dai_id[i] != ffs(adr_link_next->mask) - 1)
|
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-25 17:07:44 -05:00
|
|
|
continue;
|
|
|
|
|
|
2023-07-31 16:42:44 -05:00
|
|
|
ret = create_codec_dai_name(dev, adr_link_next, codecs, codec_dlc_index,
|
2023-06-02 15:22:03 -05:00
|
|
|
codec_conf, codec_count, codec_conf_index,
|
|
|
|
|
adr_index, dai_index);
|
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-25 17:07:44 -05:00
|
|
|
if (ret < 0)
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
/* check next link to create codec dai in the processed group */
|
|
|
|
|
i++;
|
2023-07-31 16:42:44 -05:00
|
|
|
codec_dlc_index += adr_link_next->num_adr;
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* find codec info to create BE DAI */
|
2023-07-31 16:42:43 -05:00
|
|
|
codec_index = find_codec_info_part(adr_link->adr_d[adr_index].adr);
|
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-25 17:07:44 -05:00
|
|
|
if (codec_index < 0)
|
|
|
|
|
return codec_index;
|
2023-06-02 15:22:01 -05:00
|
|
|
codec_info = &codec_info_list[codec_index];
|
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-25 17:07:44 -05:00
|
|
|
|
2023-06-02 15:22:01 -05:00
|
|
|
if (codec_info->ignore_pch_dmic)
|
2021-05-05 11:36:56 -05:00
|
|
|
*ignore_pch_dmic = true;
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
cpu_dai_index = *cpu_id;
|
|
|
|
|
for_each_pcm_streams(stream) {
|
2023-06-07 11:12:42 +08:00
|
|
|
struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_maps;
|
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-25 17:07:44 -05:00
|
|
|
char *name, *cpu_name;
|
|
|
|
|
int playback, capture;
|
|
|
|
|
static const char * const sdw_stream_name[] = {
|
|
|
|
|
"SDW%d-Playback",
|
|
|
|
|
"SDW%d-Capture",
|
2023-04-19 14:55:24 -05:00
|
|
|
"SDW%d-Playback-%s",
|
|
|
|
|
"SDW%d-Capture-%s",
|
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-25 17:07:44 -05:00
|
|
|
};
|
|
|
|
|
|
2023-06-02 15:22:03 -05:00
|
|
|
if (!codec_info->dais[dai_index].direction[stream])
|
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-25 17:07:44 -05:00
|
|
|
continue;
|
|
|
|
|
|
2023-07-31 16:42:41 -05:00
|
|
|
*be_id = codec_info->dais[dai_index].dailink[stream];
|
|
|
|
|
if (*be_id < 0) {
|
|
|
|
|
dev_err(dev, "Invalid dailink id %d\n", *be_id);
|
2023-06-02 15:22:00 -05:00
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-07 11:12:42 +08:00
|
|
|
sdw_codec_ch_maps = devm_kcalloc(dev, codec_num,
|
|
|
|
|
sizeof(*sdw_codec_ch_maps), GFP_KERNEL);
|
|
|
|
|
if (!sdw_codec_ch_maps)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
/* create stream name according to first link id */
|
2023-06-02 15:22:02 -05:00
|
|
|
if (append_dai_type) {
|
2023-04-19 14:55:24 -05:00
|
|
|
name = devm_kasprintf(dev, GFP_KERNEL,
|
|
|
|
|
sdw_stream_name[stream + 2], cpu_dai_id[0],
|
2023-06-02 15:22:03 -05:00
|
|
|
type_strings[codec_info->dais[dai_index].dai_type]);
|
2023-04-19 14:55:24 -05:00
|
|
|
} else {
|
|
|
|
|
name = devm_kasprintf(dev, GFP_KERNEL,
|
|
|
|
|
sdw_stream_name[stream], cpu_dai_id[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-25 17:07:44 -05:00
|
|
|
if (!name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* generate CPU DAI name base on the sdw link ID and
|
|
|
|
|
* PIN ID with offset of 2 according to sdw dai driver.
|
|
|
|
|
*/
|
|
|
|
|
for (k = 0; k < cpu_dai_num; k++) {
|
|
|
|
|
cpu_name = devm_kasprintf(dev, GFP_KERNEL,
|
|
|
|
|
"SDW%d Pin%d", cpu_dai_id[k],
|
2023-06-02 15:22:11 -05:00
|
|
|
sdw_pin_index[cpu_dai_id[k]]++);
|
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-25 17:07:44 -05:00
|
|
|
if (!cpu_name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
if (cpu_dai_index >= sdw_cpu_dai_num) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(dev, "invalid cpu dai index %d\n",
|
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-25 17:07:44 -05:00
|
|
|
cpu_dai_index);
|
|
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cpus[cpu_dai_index++].dai_name = cpu_name;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-27 10:18:18 +08:00
|
|
|
/*
|
|
|
|
|
* We create sdw dai links at first stage, so link index should
|
|
|
|
|
* not be larger than sdw_be_num
|
|
|
|
|
*/
|
|
|
|
|
if (*link_index >= sdw_be_num) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(dev, "invalid dai link index %d\n", *link_index);
|
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-25 17:07:44 -05:00
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (*cpu_id >= sdw_cpu_dai_num) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(dev, "invalid cpu dai index %d\n", *cpu_id);
|
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-25 17:07:44 -05:00
|
|
|
return -EINVAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
playback = (stream == SNDRV_PCM_STREAM_PLAYBACK);
|
|
|
|
|
capture = (stream == SNDRV_PCM_STREAM_CAPTURE);
|
2023-07-31 16:42:41 -05:00
|
|
|
init_dai_link(dev, dai_links + *link_index, (*be_id)++, name,
|
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-25 17:07:44 -05:00
|
|
|
playback, capture,
|
|
|
|
|
cpus + *cpu_id, cpu_dai_num,
|
|
|
|
|
codecs, codec_num,
|
|
|
|
|
NULL, &sdw_ops);
|
2021-10-27 10:18:18 +08:00
|
|
|
|
2021-09-07 13:44:36 -05:00
|
|
|
/*
|
|
|
|
|
* SoundWire DAILINKs use 'stream' functions and Bank Switch operations
|
|
|
|
|
* based on wait_for_completion(), tag them as 'nonatomic'.
|
|
|
|
|
*/
|
2021-10-27 10:18:18 +08:00
|
|
|
dai_links[*link_index].nonatomic = true;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-06-07 11:12:42 +08:00
|
|
|
set_dailink_map(sdw_codec_ch_maps, codec_num, cpu_dai_num);
|
|
|
|
|
dai_links[*link_index].codec_ch_maps = sdw_codec_ch_maps;
|
2023-07-31 16:42:43 -05:00
|
|
|
ret = set_codec_init_func(card, adr_link, dai_links + (*link_index)++,
|
2023-06-02 15:22:03 -05:00
|
|
|
playback, group_id, adr_index, dai_index);
|
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-25 17:07:44 -05:00
|
|
|
if (ret < 0) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(dev, "failed to init codec %d\n", codec_index);
|
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-25 17:07:44 -05:00
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*cpu_id += cpu_dai_num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-17 16:13:34 -05:00
|
|
|
#define IDISP_CODEC_MASK 0x4
|
|
|
|
|
|
2023-07-31 16:42:50 -05:00
|
|
|
static int sof_card_dai_links_create(struct snd_soc_card *card)
|
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-25 17:07:44 -05:00
|
|
|
{
|
2023-07-31 16:42:50 -05:00
|
|
|
struct device *dev = card->dev;
|
|
|
|
|
struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev);
|
2023-07-31 16:42:55 -05:00
|
|
|
int sdw_be_num = 0, ssp_num = 0, dmic_num = 0, hdmi_num = 0, bt_num = 0;
|
2020-07-17 16:13:34 -05:00
|
|
|
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
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-25 17:07:44 -05:00
|
|
|
struct snd_soc_dai_link_component *idisp_components;
|
|
|
|
|
struct snd_soc_dai_link_component *ssp_components;
|
2023-07-31 16:42:55 -05:00
|
|
|
struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params;
|
|
|
|
|
const struct snd_soc_acpi_link_adr *adr_link = mach_params->links;
|
2023-07-31 16:42:57 -05:00
|
|
|
bool aggregation = !(sof_sdw_quirk & SOF_SDW_NO_AGGREGATION);
|
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-25 17:07:44 -05:00
|
|
|
struct snd_soc_dai_link_component *cpus;
|
2020-09-23 11:05:12 +03:00
|
|
|
struct snd_soc_codec_conf *codec_conf;
|
2023-06-02 15:22:02 -05:00
|
|
|
bool append_dai_type = false;
|
2021-05-05 11:36:56 -05:00
|
|
|
bool ignore_pch_dmic = false;
|
2023-07-31 16:42:56 -05:00
|
|
|
int codec_conf_num = 0;
|
2020-09-23 11:05:12 +03:00
|
|
|
int codec_conf_index = 0;
|
2023-07-31 16:42:57 -05:00
|
|
|
bool group_generated[SDW_MAX_GROUPS] = { };
|
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-25 17:07:44 -05:00
|
|
|
int ssp_codec_index, ssp_mask;
|
2023-07-31 16:42:43 -05:00
|
|
|
struct snd_soc_dai_link *dai_links;
|
2021-10-27 10:18:18 +08:00
|
|
|
int num_links, link_index = 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-25 17:07:44 -05:00
|
|
|
char *name, *cpu_name;
|
|
|
|
|
int total_cpu_dai_num;
|
|
|
|
|
int sdw_cpu_dai_num;
|
|
|
|
|
int i, j, be_id = 0;
|
2023-06-02 15:22:03 -05:00
|
|
|
int codec_index;
|
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-25 17:07:44 -05:00
|
|
|
int cpu_id = 0;
|
|
|
|
|
int ret;
|
|
|
|
|
|
2023-07-31 16:42:56 -05:00
|
|
|
ret = get_dailink_info(dev, adr_link, &sdw_be_num, &sdw_cpu_dai_num,
|
|
|
|
|
&codec_conf_num);
|
2023-07-31 16:42:55 -05:00
|
|
|
if (ret < 0) {
|
|
|
|
|
dev_err(dev, "failed to get sdw link info %d\n", ret);
|
|
|
|
|
return ret;
|
2022-06-06 15:46:22 -05:00
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* on generic tgl platform, I2S or sdw mode is supported
|
|
|
|
|
* based on board rework. A ACPI device is registered in
|
|
|
|
|
* system only when I2S mode is supported, not sdw mode.
|
|
|
|
|
* Here check ACPI ID to confirm I2S is supported.
|
|
|
|
|
*/
|
|
|
|
|
ssp_codec_index = find_codec_info_acpi(mach->id);
|
2023-07-31 16:42:55 -05:00
|
|
|
if (ssp_codec_index >= 0) {
|
|
|
|
|
ssp_mask = SOF_SSP_GET_PORT(sof_sdw_quirk);
|
|
|
|
|
ssp_num = hweight_long(ssp_mask);
|
|
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:55 -05:00
|
|
|
if (mach_params->codec_mask & IDISP_CODEC_MASK) {
|
|
|
|
|
ctx->idisp_codec = true;
|
|
|
|
|
|
|
|
|
|
if (sof_sdw_quirk & SOF_SDW_TGL_HDMI)
|
|
|
|
|
hdmi_num = SOF_TGL_HDMI_COUNT;
|
|
|
|
|
else
|
|
|
|
|
hdmi_num = SOF_PRE_TGL_HDMI_COUNT;
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* enable dmic01 & dmic16k */
|
2023-07-31 16:42:55 -05:00
|
|
|
if (sof_sdw_quirk & SOF_SDW_PCH_DMIC || mach_params->dmic_num)
|
|
|
|
|
dmic_num = 2;
|
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-25 17:07:44 -05:00
|
|
|
|
2021-05-05 11:36:59 -05:00
|
|
|
if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
|
2023-07-31 16:42:55 -05:00
|
|
|
bt_num = 1;
|
2021-05-05 11:36:59 -05:00
|
|
|
|
2023-07-31 16:42:55 -05:00
|
|
|
dev_dbg(dev, "sdw %d, ssp %d, dmic %d, hdmi %d, bt: %d\n",
|
|
|
|
|
sdw_be_num, ssp_num, dmic_num, hdmi_num, bt_num);
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
/* allocate BE dailinks */
|
2023-07-31 16:42:55 -05:00
|
|
|
num_links = sdw_be_num + ssp_num + dmic_num + hdmi_num + bt_num;
|
2023-07-31 16:42:43 -05:00
|
|
|
dai_links = devm_kcalloc(dev, num_links, sizeof(*dai_links), GFP_KERNEL);
|
2023-07-31 16:42:55 -05:00
|
|
|
if (!dai_links)
|
|
|
|
|
return -ENOMEM;
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
/* allocated CPU DAIs */
|
2023-07-31 16:42:55 -05:00
|
|
|
total_cpu_dai_num = sdw_cpu_dai_num + ssp_num + dmic_num + hdmi_num + bt_num;
|
|
|
|
|
cpus = devm_kcalloc(dev, total_cpu_dai_num, sizeof(*cpus), GFP_KERNEL);
|
|
|
|
|
if (!cpus)
|
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-25 17:07:44 -05:00
|
|
|
return -ENOMEM;
|
|
|
|
|
|
2023-07-31 16:42:56 -05:00
|
|
|
/* allocate codec conf, will be populated when dailinks are created */
|
|
|
|
|
codec_conf = devm_kcalloc(dev, codec_conf_num, sizeof(*codec_conf),
|
|
|
|
|
GFP_KERNEL);
|
|
|
|
|
if (!codec_conf)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
/* SDW */
|
|
|
|
|
if (!sdw_be_num)
|
|
|
|
|
goto SSP;
|
|
|
|
|
|
2023-06-02 15:22:11 -05:00
|
|
|
for (i = 0; i < SDW_MAX_LINKS; i++)
|
|
|
|
|
sdw_pin_index[i] = SDW_INTEL_BIDIR_PDI_BASE;
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
for (; adr_link->num_adr; adr_link++) {
|
2023-04-19 14:55:24 -05:00
|
|
|
/*
|
|
|
|
|
* If there are two or more different devices on the same sdw link, we have to
|
|
|
|
|
* append the codec type to the dai link name to prevent duplicated dai link name.
|
|
|
|
|
* The same type devices on the same sdw link will be in the same
|
|
|
|
|
* snd_soc_acpi_adr_device array. They won't be described in different adr_links.
|
|
|
|
|
*/
|
|
|
|
|
for (i = 0; i < adr_link->num_adr; i++) {
|
2023-06-02 15:22:03 -05:00
|
|
|
/* find codec info to get dai_num */
|
|
|
|
|
codec_index = find_codec_info_part(adr_link->adr_d[i].adr);
|
|
|
|
|
if (codec_index < 0)
|
|
|
|
|
return codec_index;
|
|
|
|
|
if (codec_info_list[codec_index].dai_num > 1) {
|
|
|
|
|
append_dai_type = true;
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
2023-04-19 14:55:24 -05:00
|
|
|
for (j = 0; j < i; j++) {
|
|
|
|
|
if ((SDW_PART_ID(adr_link->adr_d[i].adr) !=
|
|
|
|
|
SDW_PART_ID(adr_link->adr_d[j].adr)) ||
|
|
|
|
|
(SDW_MFG_ID(adr_link->adr_d[i].adr) !=
|
2023-06-14 15:21:16 +01:00
|
|
|
SDW_MFG_ID(adr_link->adr_d[j].adr))) {
|
2023-06-02 15:22:02 -05:00
|
|
|
append_dai_type = true;
|
2023-04-19 14:55:24 -05:00
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
out:
|
|
|
|
|
|
|
|
|
|
/* generate DAI links by each sdw link */
|
|
|
|
|
for (adr_link = mach_params->links ; adr_link->num_adr; adr_link++) {
|
2023-04-19 14:55:23 -05:00
|
|
|
for (i = 0; i < adr_link->num_adr; i++) {
|
|
|
|
|
const struct snd_soc_acpi_endpoint *endpoint;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-04-19 14:55:23 -05:00
|
|
|
endpoint = adr_link->adr_d[i].endpoints;
|
|
|
|
|
if (endpoint->aggregated && !endpoint->group_id) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(dev, "invalid group id on link %x\n",
|
2023-04-19 14:55:23 -05:00
|
|
|
adr_link->mask);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
|
2023-04-19 14:55:23 -05:00
|
|
|
/* this group has been generated */
|
|
|
|
|
if (endpoint->aggregated &&
|
|
|
|
|
group_generated[endpoint->group_id])
|
|
|
|
|
continue;
|
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-25 17:07:44 -05:00
|
|
|
|
2023-06-02 15:22:03 -05:00
|
|
|
/* find codec info to get dai_num */
|
|
|
|
|
codec_index = find_codec_info_part(adr_link->adr_d[i].adr);
|
|
|
|
|
if (codec_index < 0)
|
|
|
|
|
return codec_index;
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < codec_info_list[codec_index].dai_num ; j++) {
|
2023-07-31 16:42:50 -05:00
|
|
|
ret = create_sdw_dailink(card, &link_index, dai_links,
|
2023-07-31 16:42:43 -05:00
|
|
|
sdw_be_num, sdw_cpu_dai_num, cpus,
|
2023-07-31 16:42:57 -05:00
|
|
|
adr_link, &cpu_id,
|
2023-07-31 16:42:56 -05:00
|
|
|
codec_conf, codec_conf_num,
|
2023-06-02 15:22:03 -05:00
|
|
|
&be_id, &codec_conf_index,
|
|
|
|
|
&ignore_pch_dmic, append_dai_type, i, j);
|
|
|
|
|
if (ret < 0) {
|
2023-08-08 14:20:02 +01:00
|
|
|
dev_err(dev, "failed to create dai link %d\n", link_index);
|
2023-06-02 15:22:03 -05:00
|
|
|
return ret;
|
|
|
|
|
}
|
2023-04-19 14:55:23 -05:00
|
|
|
}
|
2023-07-31 16:42:57 -05:00
|
|
|
|
|
|
|
|
if (aggregation && endpoint->aggregated)
|
|
|
|
|
group_generated[endpoint->group_id] = true;
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SSP:
|
|
|
|
|
/* SSP */
|
|
|
|
|
if (!ssp_num)
|
|
|
|
|
goto DMIC;
|
|
|
|
|
|
|
|
|
|
for (i = 0, j = 0; ssp_mask; i++, ssp_mask >>= 1) {
|
|
|
|
|
struct sof_sdw_codec_info *info;
|
|
|
|
|
int playback, capture;
|
|
|
|
|
char *codec_name;
|
|
|
|
|
|
|
|
|
|
if (!(ssp_mask & 0x1))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
name = devm_kasprintf(dev, GFP_KERNEL,
|
|
|
|
|
"SSP%d-Codec", i);
|
|
|
|
|
if (!name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
cpu_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", i);
|
|
|
|
|
if (!cpu_name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
ssp_components = devm_kzalloc(dev, sizeof(*ssp_components),
|
|
|
|
|
GFP_KERNEL);
|
|
|
|
|
if (!ssp_components)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
info = &codec_info_list[ssp_codec_index];
|
|
|
|
|
codec_name = devm_kasprintf(dev, GFP_KERNEL, "i2c-%s:0%d",
|
|
|
|
|
info->acpi_id, j++);
|
|
|
|
|
if (!codec_name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
ssp_components->name = codec_name;
|
2023-06-02 15:22:03 -05:00
|
|
|
/* TODO: support multi codec dai on SSP when it is needed */
|
2023-06-02 15:21:59 -05:00
|
|
|
ssp_components->dai_name = info->dais[0].dai_name;
|
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-25 17:07:44 -05:00
|
|
|
cpus[cpu_id].dai_name = cpu_name;
|
|
|
|
|
|
2023-06-02 15:21:59 -05:00
|
|
|
playback = info->dais[0].direction[SNDRV_PCM_STREAM_PLAYBACK];
|
|
|
|
|
capture = info->dais[0].direction[SNDRV_PCM_STREAM_CAPTURE];
|
2023-07-31 16:42:43 -05:00
|
|
|
init_dai_link(dev, dai_links + link_index, be_id, name,
|
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-25 17:07:44 -05:00
|
|
|
playback, capture,
|
|
|
|
|
cpus + cpu_id, 1,
|
|
|
|
|
ssp_components, 1,
|
|
|
|
|
NULL, info->ops);
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
ret = info->dais[0].init(card, NULL, dai_links + link_index, info, 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-25 17:07:44 -05:00
|
|
|
if (ret < 0)
|
|
|
|
|
return ret;
|
|
|
|
|
|
2021-10-27 10:18:18 +08:00
|
|
|
INC_ID(be_id, cpu_id, link_index);
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DMIC:
|
|
|
|
|
/* dmic */
|
|
|
|
|
if (dmic_num > 0) {
|
2021-05-05 11:36:56 -05:00
|
|
|
if (ignore_pch_dmic) {
|
|
|
|
|
dev_warn(dev, "Ignoring PCH DMIC\n");
|
|
|
|
|
goto HDMI;
|
|
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
cpus[cpu_id].dai_name = "DMIC01 Pin";
|
2023-07-31 16:42:43 -05:00
|
|
|
init_dai_link(dev, dai_links + link_index, be_id, "dmic01",
|
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-25 17:07:44 -05:00
|
|
|
0, 1, // DMIC only supports capture
|
|
|
|
|
cpus + cpu_id, 1,
|
|
|
|
|
dmic_component, 1,
|
|
|
|
|
sof_sdw_dmic_init, NULL);
|
2021-10-27 10:18:18 +08:00
|
|
|
INC_ID(be_id, cpu_id, link_index);
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
cpus[cpu_id].dai_name = "DMIC16k Pin";
|
2023-07-31 16:42:43 -05:00
|
|
|
init_dai_link(dev, dai_links + link_index, be_id, "dmic16k",
|
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-25 17:07:44 -05:00
|
|
|
0, 1, // DMIC only supports capture
|
|
|
|
|
cpus + cpu_id, 1,
|
|
|
|
|
dmic_component, 1,
|
|
|
|
|
/* don't call sof_sdw_dmic_init() twice */
|
|
|
|
|
NULL, NULL);
|
2021-10-27 10:18:18 +08:00
|
|
|
INC_ID(be_id, cpu_id, link_index);
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 11:36:56 -05:00
|
|
|
HDMI:
|
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-25 17:07:44 -05:00
|
|
|
/* HDMI */
|
|
|
|
|
if (hdmi_num > 0) {
|
|
|
|
|
idisp_components = devm_kcalloc(dev, hdmi_num,
|
|
|
|
|
sizeof(*idisp_components),
|
|
|
|
|
GFP_KERNEL);
|
|
|
|
|
if (!idisp_components)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < hdmi_num; i++) {
|
|
|
|
|
name = devm_kasprintf(dev, GFP_KERNEL,
|
|
|
|
|
"iDisp%d", i + 1);
|
|
|
|
|
if (!name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
2020-07-17 16:13:34 -05:00
|
|
|
if (ctx->idisp_codec) {
|
|
|
|
|
idisp_components[i].name = "ehdaudio0D2";
|
|
|
|
|
idisp_components[i].dai_name = devm_kasprintf(dev,
|
|
|
|
|
GFP_KERNEL,
|
|
|
|
|
"intel-hdmi-hifi%d",
|
|
|
|
|
i + 1);
|
|
|
|
|
if (!idisp_components[i].dai_name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
} else {
|
2023-04-24 02:37:11 +00:00
|
|
|
idisp_components[i] = asoc_dummy_dlc;
|
2020-07-17 16:13:34 -05:00
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
|
|
|
|
|
cpu_name = devm_kasprintf(dev, GFP_KERNEL,
|
|
|
|
|
"iDisp%d Pin", i + 1);
|
|
|
|
|
if (!cpu_name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
cpus[cpu_id].dai_name = cpu_name;
|
2023-07-31 16:42:43 -05:00
|
|
|
init_dai_link(dev, dai_links + link_index, be_id, name,
|
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-25 17:07:44 -05:00
|
|
|
1, 0, // HDMI only supports playback
|
|
|
|
|
cpus + cpu_id, 1,
|
|
|
|
|
idisp_components + i, 1,
|
|
|
|
|
sof_sdw_hdmi_init, NULL);
|
2021-10-27 10:18:18 +08:00
|
|
|
INC_ID(be_id, cpu_id, link_index);
|
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-25 17:07:44 -05:00
|
|
|
}
|
|
|
|
|
|
2021-05-05 11:36:59 -05:00
|
|
|
if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) {
|
|
|
|
|
int port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >>
|
|
|
|
|
SOF_BT_OFFLOAD_SSP_SHIFT;
|
|
|
|
|
|
|
|
|
|
name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", port);
|
|
|
|
|
if (!name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
cpu_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", port);
|
|
|
|
|
if (!cpu_name)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
|
|
cpus[cpu_id].dai_name = cpu_name;
|
2023-07-31 16:42:43 -05:00
|
|
|
init_dai_link(dev, dai_links + link_index, be_id, name, 1, 1,
|
|
|
|
|
cpus + cpu_id, 1, &asoc_dummy_dlc, 1, NULL, NULL);
|
2021-05-05 11:36:59 -05:00
|
|
|
}
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
card->dai_link = dai_links;
|
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-25 17:07:44 -05:00
|
|
|
card->num_links = num_links;
|
|
|
|
|
|
2020-09-23 11:05:12 +03:00
|
|
|
card->codec_conf = codec_conf;
|
2023-07-31 16:42:56 -05:00
|
|
|
card->num_configs = codec_conf_num;
|
2020-09-23 11:05:12 +03:00
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-08 15:32:15 -05:00
|
|
|
static int sof_sdw_card_late_probe(struct snd_soc_card *card)
|
|
|
|
|
{
|
2022-06-06 15:46:22 -05:00
|
|
|
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
|
|
|
|
int ret = 0;
|
|
|
|
|
int i;
|
2020-07-08 15:32:15 -05:00
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) {
|
2023-04-19 14:55:20 -05:00
|
|
|
if (codec_info_list[i].codec_card_late_probe) {
|
|
|
|
|
ret = codec_info_list[i].codec_card_late_probe(card);
|
2020-07-08 15:32:15 -05:00
|
|
|
|
2023-04-19 14:55:20 -05:00
|
|
|
if (ret < 0)
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2020-07-08 15:32:15 -05:00
|
|
|
}
|
|
|
|
|
|
2022-06-06 15:46:22 -05:00
|
|
|
if (ctx->idisp_codec)
|
|
|
|
|
ret = sof_sdw_hdmi_card_late_probe(card);
|
|
|
|
|
|
|
|
|
|
return ret;
|
2020-07-08 15:32:15 -05:00
|
|
|
}
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
/* SoC card */
|
|
|
|
|
static const char sdw_card_long_name[] = "Intel Soundwire SOF";
|
|
|
|
|
|
|
|
|
|
static struct snd_soc_card card_sof_sdw = {
|
|
|
|
|
.name = "soundwire",
|
2020-06-25 14:12:54 -05:00
|
|
|
.owner = THIS_MODULE,
|
2020-07-08 15:32:15 -05:00
|
|
|
.late_probe = sof_sdw_card_late_probe,
|
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-25 17:07:44 -05:00
|
|
|
};
|
|
|
|
|
|
2023-06-02 15:22:03 -05:00
|
|
|
/* helper to get the link that the codec DAI is used */
|
|
|
|
|
static struct snd_soc_dai_link *mc_find_codec_dai_used(struct snd_soc_card *card,
|
|
|
|
|
const char *dai_name)
|
|
|
|
|
{
|
2023-07-31 16:42:43 -05:00
|
|
|
struct snd_soc_dai_link *dai_link;
|
2023-06-02 15:22:03 -05:00
|
|
|
int i;
|
|
|
|
|
int j;
|
|
|
|
|
|
2023-07-31 16:42:43 -05:00
|
|
|
for_each_card_prelinks(card, i, dai_link) {
|
|
|
|
|
for (j = 0; j < dai_link->num_codecs; j++) {
|
2023-06-02 15:22:03 -05:00
|
|
|
/* Check each codec in a link */
|
2023-07-31 16:42:43 -05:00
|
|
|
if (!strcmp(dai_link->codecs[j].dai_name, dai_name))
|
|
|
|
|
return dai_link;
|
2023-06-02 15:22:03 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-06 15:37:48 -05:00
|
|
|
static void mc_dailink_exit_loop(struct snd_soc_card *card)
|
|
|
|
|
{
|
2023-07-31 16:42:43 -05:00
|
|
|
struct snd_soc_dai_link *dai_link;
|
2022-06-06 15:37:48 -05:00
|
|
|
int ret;
|
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) {
|
2023-06-02 15:22:03 -05:00
|
|
|
for (j = 0; j < codec_info_list[i].dai_num; j++) {
|
|
|
|
|
/* Check each dai in codec_info_lis to see if it is used in the link */
|
|
|
|
|
if (!codec_info_list[i].dais[j].exit)
|
|
|
|
|
continue;
|
|
|
|
|
/*
|
|
|
|
|
* We don't need to call .exit function if there is no matched
|
|
|
|
|
* dai link found.
|
|
|
|
|
*/
|
2023-07-31 16:42:43 -05:00
|
|
|
dai_link = mc_find_codec_dai_used(card,
|
|
|
|
|
codec_info_list[i].dais[j].dai_name);
|
|
|
|
|
if (dai_link) {
|
2023-06-02 15:22:03 -05:00
|
|
|
/* Do the .exit function if the codec dai is used in the link */
|
2023-07-31 16:42:43 -05:00
|
|
|
ret = codec_info_list[i].dais[j].exit(card, dai_link);
|
2022-06-06 15:37:48 -05:00
|
|
|
if (ret)
|
|
|
|
|
dev_warn(card->dev,
|
|
|
|
|
"codec exit failed %d\n",
|
|
|
|
|
ret);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
static int mc_probe(struct platform_device *pdev)
|
|
|
|
|
{
|
|
|
|
|
struct snd_soc_card *card = &card_sof_sdw;
|
2023-07-31 16:42:49 -05:00
|
|
|
struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
|
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-25 17:07:44 -05:00
|
|
|
struct mc_private *ctx;
|
2020-04-20 02:35:09 +08:00
|
|
|
int amp_num = 0, i;
|
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-25 17:07:44 -05:00
|
|
|
int ret;
|
|
|
|
|
|
2023-07-31 16:42:49 -05:00
|
|
|
card->dev = &pdev->dev;
|
|
|
|
|
|
|
|
|
|
dev_dbg(card->dev, "Entry\n");
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:49 -05:00
|
|
|
ctx = devm_kzalloc(card->dev, sizeof(*ctx), GFP_KERNEL);
|
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-25 17:07:44 -05:00
|
|
|
if (!ctx)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
2023-07-31 16:42:49 -05:00
|
|
|
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
|
|
|
|
|
|
|
|
|
|
snd_soc_card_set_drvdata(card, ctx);
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
dmi_check_system(sof_sdw_quirk_table);
|
|
|
|
|
|
2020-06-25 14:12:56 -05:00
|
|
|
if (quirk_override != -1) {
|
2023-07-31 16:42:49 -05:00
|
|
|
dev_info(card->dev, "Overriding quirk 0x%lx => 0x%x\n",
|
2020-06-25 14:12:56 -05:00
|
|
|
sof_sdw_quirk, quirk_override);
|
|
|
|
|
sof_sdw_quirk = quirk_override;
|
|
|
|
|
}
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:49 -05:00
|
|
|
log_quirks(card->dev);
|
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-25 17:07:44 -05:00
|
|
|
|
2023-07-31 16:42:51 -05:00
|
|
|
/* reset amp_num to ensure amp_num++ starts from 0 in each probe */
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
|
|
|
|
|
codec_info_list[i].amp_num = 0;
|
|
|
|
|
|
2023-07-31 16:42:50 -05:00
|
|
|
ret = sof_card_dai_links_create(card);
|
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-25 17:07:44 -05:00
|
|
|
if (ret < 0)
|
|
|
|
|
return ret;
|
|
|
|
|
|
2020-04-20 02:35:09 +08:00
|
|
|
/*
|
|
|
|
|
* the default amp_num is zero for each codec and
|
|
|
|
|
* amp_num will only be increased for active amp
|
|
|
|
|
* codecs on used platform
|
|
|
|
|
*/
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
|
|
|
|
|
amp_num += codec_info_list[i].amp_num;
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
|
2020-05-15 16:07:28 -05:00
|
|
|
"cfg-spk:%d cfg-amp:%d",
|
2020-04-20 02:35:09 +08:00
|
|
|
(sof_sdw_quirk & SOF_SDW_FOUR_SPK)
|
|
|
|
|
? 4 : 2, amp_num);
|
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-25 17:07:44 -05:00
|
|
|
if (!card->components)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
2021-02-08 17:33:29 -06:00
|
|
|
if (mach->mach_params.dmic_num) {
|
|
|
|
|
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
|
|
|
|
|
"%s mic:dmic cfg-mics:%d",
|
|
|
|
|
card->components,
|
|
|
|
|
mach->mach_params.dmic_num);
|
|
|
|
|
if (!card->components)
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
}
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
card->long_name = sdw_card_long_name;
|
|
|
|
|
|
|
|
|
|
/* Register the card */
|
2023-07-31 16:42:49 -05:00
|
|
|
ret = devm_snd_soc_register_card(card->dev, card);
|
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-25 17:07:44 -05:00
|
|
|
if (ret) {
|
|
|
|
|
dev_err(card->dev, "snd_soc_register_card failed %d\n", ret);
|
2022-06-06 15:37:48 -05:00
|
|
|
mc_dailink_exit_loop(card);
|
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-25 17:07:44 -05:00
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
platform_set_drvdata(pdev, card);
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-15 16:06:33 +01:00
|
|
|
static void mc_remove(struct platform_device *pdev)
|
2020-08-20 21:45:42 +08:00
|
|
|
{
|
|
|
|
|
struct snd_soc_card *card = platform_get_drvdata(pdev);
|
|
|
|
|
|
2022-06-06 15:37:48 -05:00
|
|
|
mc_dailink_exit_loop(card);
|
2020-08-20 21:45:42 +08:00
|
|
|
}
|
|
|
|
|
|
2023-07-31 16:42:46 -05:00
|
|
|
static const struct platform_device_id mc_id_table[] = {
|
|
|
|
|
{ "sof_sdw", },
|
|
|
|
|
{}
|
|
|
|
|
};
|
|
|
|
|
MODULE_DEVICE_TABLE(platform, mc_id_table);
|
|
|
|
|
|
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-25 17:07:44 -05:00
|
|
|
static struct platform_driver sof_sdw_driver = {
|
|
|
|
|
.driver = {
|
|
|
|
|
.name = "sof_sdw",
|
|
|
|
|
.pm = &snd_soc_pm_ops,
|
|
|
|
|
},
|
|
|
|
|
.probe = mc_probe,
|
2023-03-15 16:06:33 +01:00
|
|
|
.remove_new = mc_remove,
|
2023-07-31 16:42:46 -05:00
|
|
|
.id_table = mc_id_table,
|
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-25 17:07:44 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module_platform_driver(sof_sdw_driver);
|
|
|
|
|
|
|
|
|
|
MODULE_DESCRIPTION("ASoC SoundWire Generic Machine driver");
|
|
|
|
|
MODULE_AUTHOR("Bard Liao <yung-chuan.liao@linux.intel.com>");
|
|
|
|
|
MODULE_AUTHOR("Rander Wang <rander.wang@linux.intel.com>");
|
|
|
|
|
MODULE_AUTHOR("Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>");
|
|
|
|
|
MODULE_LICENSE("GPL v2");
|
2021-05-05 11:36:57 -05:00
|
|
|
MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
|
2021-05-05 11:36:58 -05:00
|
|
|
MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON);
|