Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 460f623a authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branch 'asoc/topic/intel' into asoc-next

parents 39e0a0ae 38a77085
Loading
Loading
Loading
Loading
+91 −1
Original line number Diff line number Diff line
@@ -163,8 +163,71 @@
 *
 * %SKL_TKN_U32_DMA_BUF_SIZE:	DMA buffer size in millisec
 *
 * %SKL_TKN_U32_PIPE_DIR:       Specifies pipe direction. Can be
 *                              playback/capture.
 *
 * %SKL_TKN_U32_NUM_CONFIGS:    Number of pipe configs
 *
 * %SKL_TKN_U32_PATH_MEM_PGS:   Size of memory (in pages) required for pipeline
 *                              and its data
 *
 * %SKL_TKN_U32_PIPE_CONFIG_ID: Config id for the modules in the pipe
 *                              and PCM params supported by that pipe
 *                              config. This is used as index to fill
 *                              up the pipe config and module config
 *                              structure.
 *
 * %SKL_TKN_U32_CFG_FREQ:
 * %SKL_TKN_U8_CFG_CHAN:
 * %SKL_TKN_U8_CFG_BPS:         PCM params (freq, channels, bits per sample)
 *                              supported for each of the pipe configs.
 *
 * %SKL_TKN_CFG_MOD_RES_ID:     Module's resource index for each of the
 *                              pipe config
 *
 * %SKL_TKN_CFG_MOD_FMT_ID:     Module's interface index for each of the
 *                              pipe config
 *
 * %SKL_TKN_U8_NUM_MOD:         Number of modules in the manifest
 *
 * %SKL_TKN_MM_U8_MOD_IDX:      Current index of the module in the manifest
 *
 * %SKL_TKN_MM_U8_NUM_RES:      Number of resources for the module
 *
 * %SKL_TKN_MM_U8_NUM_INTF:     Number of interfaces for the module
 *
 * %SKL_TKN_MM_U32_RES_ID:      Resource index for the resource info to
 *                              be filled into.
 *                              A module can support multiple resource
 *                              configuration and is represnted as a
 *                              resource table. This index is used to
 *                              fill information into appropriate index.
 *
 * %SKL_TKN_MM_U32_CPS:         DSP cycles per second
 *
 * %SKL_TKN_MM_U32_DMA_SIZE:    Allocated buffer size for gateway DMA
 *
 * %SKL_TKN_MM_U32_CPC:         DSP cycles allocated per frame
 *
 * %SKL_TKN_MM_U32_RES_PIN_ID:  Resource pin index in the module
 *
 * %SKL_TKN_MM_U32_INTF_PIN_ID: Interface index in the module
 *
 * %SKL_TKN_MM_U32_PIN_BUF:     Buffer size of the module pin
 *
 * %SKL_TKN_MM_U32_FMT_ID:      Format index for each of the interface/
 *                              format information to be filled into.
 *
 * %SKL_TKN_MM_U32_NUM_IN_FMT:  Number of input formats
 * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
 *
 * module_id and loadable flags dont have tokens as these values will be
 * read from the DSP FW manifest
 *
 * Tokens defined can be used either in the manifest or widget private data.
 *
 * SKL_TKN_MM is used as a suffix for all tokens that represent
 * module data in the manifest.
 */
enum SKL_TKNS {
	SKL_TKN_UUID = 1,
@@ -218,7 +281,34 @@ enum SKL_TKNS {
	SKL_TKL_U32_D0I3_CAPS, /* Typo added at v4.10 */
	SKL_TKN_U32_D0I3_CAPS = SKL_TKL_U32_D0I3_CAPS,
	SKL_TKN_U32_DMA_BUF_SIZE,
	SKL_TKN_MAX = SKL_TKN_U32_DMA_BUF_SIZE,

	SKL_TKN_U32_PIPE_DIRECTION,
	SKL_TKN_U32_PIPE_CONFIG_ID,
	SKL_TKN_U32_NUM_CONFIGS,
	SKL_TKN_U32_PATH_MEM_PGS,

	SKL_TKN_U32_CFG_FREQ,
	SKL_TKN_U8_CFG_CHAN,
	SKL_TKN_U8_CFG_BPS,
	SKL_TKN_CFG_MOD_RES_ID,
	SKL_TKN_CFG_MOD_FMT_ID,
	SKL_TKN_U8_NUM_MOD,

	SKL_TKN_MM_U8_MOD_IDX,
	SKL_TKN_MM_U8_NUM_RES,
	SKL_TKN_MM_U8_NUM_INTF,
	SKL_TKN_MM_U32_RES_ID,
	SKL_TKN_MM_U32_CPS,
	SKL_TKN_MM_U32_DMA_SIZE,
	SKL_TKN_MM_U32_CPC,
	SKL_TKN_MM_U32_RES_PIN_ID,
	SKL_TKN_MM_U32_INTF_PIN_ID,
	SKL_TKN_MM_U32_PIN_BUF,
	SKL_TKN_MM_U32_FMT_ID,
	SKL_TKN_MM_U32_NUM_IN_FMT,
	SKL_TKN_MM_U32_NUM_OUT_FMT,

	SKL_TKN_MAX = SKL_TKN_MM_U32_NUM_OUT_FMT,
};

#endif
+1 −0
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ obj-$(CONFIG_SND_SOC_MAX98088) += snd-soc-max98088.o
obj-$(CONFIG_SND_SOC_MAX98090)	+= snd-soc-max98090.o
obj-$(CONFIG_SND_SOC_MAX98095)	+= snd-soc-max98095.o
obj-$(CONFIG_SND_SOC_MAX98357A)	+= snd-soc-max98357a.o
obj-$(CONFIG_SND_SOC_MAX98371)	+= snd-soc-max98371.o
obj-$(CONFIG_SND_SOC_MAX9867)	+= snd-soc-max9867.o
obj-$(CONFIG_SND_SOC_MAX98925)	+= snd-soc-max98925.o
obj-$(CONFIG_SND_SOC_MAX98926)	+= snd-soc-max98926.o
+34 −5
Original line number Diff line number Diff line
@@ -121,6 +121,10 @@ struct hdac_hdmi_dai_port_map {
	struct hdac_hdmi_cvt *cvt;
};

struct hdac_hdmi_drv_data {
	unsigned int vendor_nid;
};

struct hdac_hdmi_priv {
	struct hdac_hdmi_dai_port_map dai_map[HDA_MAX_CVTS];
	struct list_head pin_list;
@@ -131,6 +135,7 @@ struct hdac_hdmi_priv {
	int num_ports;
	struct mutex pin_mutex;
	struct hdac_chmap chmap;
	struct hdac_hdmi_drv_data *drv_data;
};

static struct hdac_hdmi_pcm *
@@ -1321,6 +1326,7 @@ static int hdac_hdmi_add_pin(struct hdac_ext_device *edev, hda_nid_t nid)
}

#define INTEL_VENDOR_NID 0x08
#define INTEL_GLK_VENDOR_NID 0x0b
#define INTEL_GET_VENDOR_VERB 0xf81
#define INTEL_SET_VENDOR_VERB 0x781
#define INTEL_EN_DP12			0x02 /* enable DP 1.2 features */
@@ -1329,14 +1335,17 @@ static int hdac_hdmi_add_pin(struct hdac_ext_device *edev, hda_nid_t nid)
static void hdac_hdmi_skl_enable_all_pins(struct hdac_device *hdac)
{
	unsigned int vendor_param;
	struct hdac_ext_device *edev = to_ehdac_device(hdac);
	struct hdac_hdmi_priv *hdmi = edev->private_data;
	unsigned int vendor_nid = hdmi->drv_data->vendor_nid;

	vendor_param = snd_hdac_codec_read(hdac, INTEL_VENDOR_NID, 0,
	vendor_param = snd_hdac_codec_read(hdac, vendor_nid, 0,
				INTEL_GET_VENDOR_VERB, 0);
	if (vendor_param == -1 || vendor_param & INTEL_EN_ALL_PIN_CVTS)
		return;

	vendor_param |= INTEL_EN_ALL_PIN_CVTS;
	vendor_param = snd_hdac_codec_read(hdac, INTEL_VENDOR_NID, 0,
	vendor_param = snd_hdac_codec_read(hdac, vendor_nid, 0,
				INTEL_SET_VENDOR_VERB, vendor_param);
	if (vendor_param == -1)
		return;
@@ -1345,15 +1354,18 @@ static void hdac_hdmi_skl_enable_all_pins(struct hdac_device *hdac)
static void hdac_hdmi_skl_enable_dp12(struct hdac_device *hdac)
{
	unsigned int vendor_param;
	struct hdac_ext_device *edev = to_ehdac_device(hdac);
	struct hdac_hdmi_priv *hdmi = edev->private_data;
	unsigned int vendor_nid = hdmi->drv_data->vendor_nid;

	vendor_param = snd_hdac_codec_read(hdac, INTEL_VENDOR_NID, 0,
	vendor_param = snd_hdac_codec_read(hdac, vendor_nid, 0,
				INTEL_GET_VENDOR_VERB, 0);
	if (vendor_param == -1 || vendor_param & INTEL_EN_DP12)
		return;

	/* enable DP1.2 mode */
	vendor_param |= INTEL_EN_DP12;
	vendor_param = snd_hdac_codec_read(hdac, INTEL_VENDOR_NID, 0,
	vendor_param = snd_hdac_codec_read(hdac, vendor_nid, 0,
				INTEL_SET_VENDOR_VERB, vendor_param);
	if (vendor_param == -1)
		return;
@@ -1927,6 +1939,14 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdac, int pcm_idx)
	return port->eld.info.spk_alloc;
}

static struct hdac_hdmi_drv_data intel_glk_drv_data  = {
	.vendor_nid = INTEL_GLK_VENDOR_NID,
};

static struct hdac_hdmi_drv_data intel_drv_data  = {
	.vendor_nid = INTEL_VENDOR_NID,
};

static int hdac_hdmi_dev_probe(struct hdac_ext_device *edev)
{
	struct hdac_device *codec = &edev->hdac;
@@ -1935,6 +1955,8 @@ static int hdac_hdmi_dev_probe(struct hdac_ext_device *edev)
	struct hdac_ext_link *hlink = NULL;
	int num_dais = 0;
	int ret = 0;
	struct hdac_driver *hdrv = drv_to_hdac_driver(codec->dev.driver);
	const struct hda_device_id *hdac_id = hdac_get_device_id(codec, hdrv);

	/* hold the ref while we probe */
	hlink = snd_hdac_ext_bus_get_link(edev->ebus, dev_name(&edev->hdac.dev));
@@ -1956,6 +1978,12 @@ static int hdac_hdmi_dev_probe(struct hdac_ext_device *edev)
	hdmi_priv->chmap.ops.is_pcm_attached = is_hdac_hdmi_pcm_attached;
	hdmi_priv->chmap.ops.get_spk_alloc = hdac_hdmi_get_spk_alloc;

	if (hdac_id->driver_data)
		hdmi_priv->drv_data =
			(struct hdac_hdmi_drv_data *)hdac_id->driver_data;
	else
		hdmi_priv->drv_data = &intel_drv_data;

	dev_set_drvdata(&codec->dev, edev);

	INIT_LIST_HEAD(&hdmi_priv->pin_list);
@@ -2127,7 +2155,8 @@ static const struct hda_device_id hdmi_list[] = {
	HDA_CODEC_EXT_ENTRY(0x80862809, 0x100000, "Skylake HDMI", 0),
	HDA_CODEC_EXT_ENTRY(0x8086280a, 0x100000, "Broxton HDMI", 0),
	HDA_CODEC_EXT_ENTRY(0x8086280b, 0x100000, "Kabylake HDMI", 0),
	HDA_CODEC_EXT_ENTRY(0x8086280d, 0x100000, "Geminilake HDMI", 0),
	HDA_CODEC_EXT_ENTRY(0x8086280d, 0x100000, "Geminilake HDMI",
						   &intel_glk_drv_data),
	{}
};

+8 −6
Original line number Diff line number Diff line
@@ -349,12 +349,14 @@ static struct snd_soc_dai_driver max98371_dai[] = {
};

static const struct snd_soc_codec_driver max98371_codec = {
	.component_driver = {
		.controls = max98371_snd_controls,
		.num_controls = ARRAY_SIZE(max98371_snd_controls),
		.dapm_routes = max98371_audio_map,
		.num_dapm_routes = ARRAY_SIZE(max98371_audio_map),
		.dapm_widgets = max98371_dapm_widgets,
		.num_dapm_widgets = ARRAY_SIZE(max98371_dapm_widgets),
	},
};

static const struct regmap_config max98371_regmap = {
+2 −1
Original line number Diff line number Diff line
@@ -255,11 +255,12 @@ config SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH

config SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH
        tristate "ASoC Audio driver for KBL with RT5663, RT5514 and MAX98927 in I2S Mode"
        depends on X86_INTEL_LPSS && I2C
        depends on X86_INTEL_LPSS && I2C && SPI
        select SND_SOC_INTEL_SST
        select SND_SOC_INTEL_SKYLAKE
        select SND_SOC_RT5663
        select SND_SOC_RT5514
        select SND_SOC_RT5514_SPI
        select SND_SOC_MAX98927
        select SND_SOC_HDAC_HDMI
        help
Loading