Skip to content

Commit

Permalink
Merge series "ASoC: SOF: Intel: add SoundWire support" from Pierre-Lo…
Browse files Browse the repository at this point in the history
…uis Bossart <[email protected]>:

This patchset provides the support for SoundWire support on Intel
CometLake, IcelLake and TigerLake RVP platforms and form-factor
devices to be released 'soon'.

The bulk of the code is about detecting a valid SoundWire
configuration from ACPI, and implementing the interfaces suggested in
'[PATCH 0/8] soundwire: remove platform devices, add SOF interfaces'
for interrupts, PCI wakes and clock-stop configurations.

Since that SoundWire series will not be in 5.7, the build support for
SOF w/ SoundWire is not provided for now, and fall-back functions will
be used. This code is tested on a daily basis in the SOF tree and is
not expected to change in significant ways.

Changes since v2:
Corrected error in ACPI table (thanks Amadeusz)
Added patch 11 to add reset cycle required on some SoundWire platforms

Bard Liao (1):
  ASoC: SOF: Intel: hda: merge IPC, stream and SoundWire interrupt
    handlers

Pierre-Louis Bossart (8):
  ASoC: soc-acpi: expand description of _ADR-based devices
  ASoC: SOF: Intel: add SoundWire configuration interface
  ASoC: SOF: IPC: dai-intel: move ALH declarations in header file
  ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
  ASoC: SOF: Intel: hda: initial SoundWire machine driver autodetect
  ASoC: SOF: Intel: hda: disable SoundWire interrupts on suspend
  ASoC: SOF: Intel: hda: add parameter to control SoundWire clock stop
    quirks
  ASoC: SOF: Intel: hda-ctrl: add reset cycle before parsing
    capabilities

Rander Wang (2):
  ASoC: SOF: Intel: hda: add WAKEEN interrupt support for SoundWire
  Asoc: SOF: Intel: hda: check SoundWire wakeen interrupt in irq thread

 include/sound/soc-acpi.h                      |  39 +-
 include/sound/sof/dai-intel.h                 |  18 +-
 .../intel/common/soc-acpi-intel-cml-match.c   |  87 +++-
 .../intel/common/soc-acpi-intel-icl-match.c   |  97 ++++-
 .../intel/common/soc-acpi-intel-tgl-match.c   |  49 ++-
 sound/soc/sof/intel/hda-ctrl.c                |  25 +-
 sound/soc/sof/intel/hda-dsp.c                 |   2 +
 sound/soc/sof/intel/hda-loader.c              |  31 ++
 sound/soc/sof/intel/hda.c                     | 400 ++++++++++++++++++
 sound/soc/sof/intel/hda.h                     |  66 +++
 10 files changed, 750 insertions(+), 64 deletions(-)

--
2.20.1
  • Loading branch information
broonie committed Mar 27, 2020
2 parents 914f674 + f09e9c7 commit ef11a6f
Show file tree
Hide file tree
Showing 10 changed files with 750 additions and 64 deletions.
39 changes: 33 additions & 6 deletions include/sound/soc-acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,45 @@ struct snd_soc_acpi_mach_params {
};

/**
* snd_soc_acpi_link_adr: ACPI-based list of _ADR, with a variable
* number of devices per link
*
* snd_soc_acpi_endpoint - endpoint descriptor
* @num: endpoint number (mandatory, unique per device)
* @aggregated: 0 (independent) or 1 (logically grouped)
* @group_position: zero-based order (only when @aggregated is 1)
* @group_id: platform-unique group identifier (only when @aggregrated is 1)
*/
struct snd_soc_acpi_endpoint {
u8 num;
u8 aggregated;
u8 group_position;
u8 group_id;
};

/**
* snd_soc_acpi_adr_device - descriptor for _ADR-enumerated device
* @adr: 64 bit ACPI _ADR value
* @num_endpoints: number of endpoints for this device
* @endpoints: array of endpoints
*/
struct snd_soc_acpi_adr_device {
const u64 adr;
const u8 num_endpoints;
const struct snd_soc_acpi_endpoint *endpoints;
};

/**
* snd_soc_acpi_link_adr - ACPI-based list of _ADR enumerated devices
* @mask: one bit set indicates the link this list applies to
* @num_adr: ARRAY_SIZE of adr
* @adr: array of _ADR (represented as u64).
* @num_adr: ARRAY_SIZE of devices
* @adr_d: array of devices
*
* The number of devices per link can be more than 1, e.g. in SoundWire
* multi-drop configurations.
*/

struct snd_soc_acpi_link_adr {
const u32 mask;
const u32 num_adr;
const u64 *adr;
const struct snd_soc_acpi_adr_device *adr_d;
};

/**
Expand Down
18 changes: 9 additions & 9 deletions include/sound/sof/dai-intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ struct sof_ipc_dai_hda_params {
uint32_t link_dma_ch;
} __packed;

/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */
struct sof_ipc_dai_alh_params {
struct sof_ipc_hdr hdr;
uint32_t stream_id;

/* reserved for future use */
uint32_t reserved[15];
} __packed;

/* DMIC Configuration Request - SOF_IPC_DAI_DMIC_CONFIG */

/* This struct is defined per 2ch PDM controller available in the platform.
Expand Down Expand Up @@ -179,13 +188,4 @@ struct sof_ipc_dai_dmic_params {
struct sof_ipc_dai_dmic_pdm_ctrl pdm[0];
} __packed;

/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */
struct sof_ipc_dai_alh_params {
struct sof_ipc_hdr hdr;
uint32_t stream_id;

/* reserved for future use */
uint32_t reserved[15];
} __packed;

#endif
87 changes: 70 additions & 17 deletions sound/soc/intel/common/soc-acpi-intel-cml-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,42 +59,95 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
};
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_cml_machines);

static const u64 rt711_0_adr[] = {
0x000010025D071100
static const struct snd_soc_acpi_endpoint single_endpoint = {
.num = 0,
.aggregated = 0,
.group_position = 0,
.group_id = 0,
};

static const u64 rt1308_1_adr[] = {
0x000110025D130800
static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
.num = 0,
.aggregated = 1,
.group_position = 0,
.group_id = 1,
};

static const u64 rt1308_2_adr[] = {
0x000210025D130800
static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
.num = 0,
.aggregated = 1,
.group_position = 1,
.group_id = 1,
};

static const u64 rt715_3_adr[] = {
0x000310025D071500
static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
{
.adr = 0x000010025D071100,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
{
.adr = 0x000110025D130800,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const struct snd_soc_acpi_adr_device rt1308_2_adr[] = {
{
.adr = 0x000210025D130800,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
{
.adr = 0x000110025D130800,
.num_endpoints = 1,
.endpoints = &spk_l_endpoint,
}
};

static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
{
.adr = 0x000210025D130800,
.num_endpoints = 1,
.endpoints = &spk_r_endpoint,
}
};

static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
{
.adr = 0x000310025D071500,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const struct snd_soc_acpi_link_adr cml_3_in_1_default[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_0_adr),
.adr = rt711_0_adr,
.adr_d = rt711_0_adr,
},
{
.mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_adr),
.adr = rt1308_1_adr,
.num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
.adr_d = rt1308_1_group1_adr,
},
{
.mask = BIT(2),
.num_adr = ARRAY_SIZE(rt1308_2_adr),
.adr = rt1308_2_adr,
.num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
.adr_d = rt1308_2_group1_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt715_3_adr),
.adr = rt715_3_adr,
.adr_d = rt715_3_adr,
},
{}
};
Expand All @@ -103,17 +156,17 @@ static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_0_adr),
.adr = rt711_0_adr,
.adr_d = rt711_0_adr,
},
{
.mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_adr),
.adr = rt1308_1_adr,
.adr_d = rt1308_1_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt715_3_adr),
.adr = rt715_3_adr,
.adr_d = rt715_3_adr,
},
{}
};
Expand Down
97 changes: 77 additions & 20 deletions sound/soc/intel/common/soc-acpi-intel-icl-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,112 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[] = {
};
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_icl_machines);

static const u64 rt700_0_adr[] = {
0x000010025D070000
static const struct snd_soc_acpi_endpoint single_endpoint = {
.num = 0,
.aggregated = 0,
.group_position = 0,
.group_id = 0,
};

static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
.num = 0,
.aggregated = 1,
.group_position = 0,
.group_id = 1,
};

static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
.num = 0,
.aggregated = 1,
.group_position = 1,
.group_id = 1,
};

static const struct snd_soc_acpi_adr_device rt700_0_adr[] = {
{
.adr = 0x000010025D070000,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const struct snd_soc_acpi_link_adr icl_rvp[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt700_0_adr),
.adr = rt700_0_adr,
.adr_d = rt700_0_adr,
},
{}
};

static const u64 rt711_0_adr[] = {
0x000010025D071100
static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
{
.adr = 0x000010025D071100,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
{
.adr = 0x000110025D130800,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const u64 rt1308_1_adr[] = {
0x000110025D130800
static const struct snd_soc_acpi_adr_device rt1308_2_adr[] = {
{
.adr = 0x000210025D130800,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const u64 rt1308_2_adr[] = {
0x000210025D130800
static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
{
.adr = 0x000110025D130800,
.num_endpoints = 1,
.endpoints = &spk_l_endpoint,
}
};

static const u64 rt715_3_adr[] = {
0x000310025D071500
static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
{
.adr = 0x000210025D130800,
.num_endpoints = 1,
.endpoints = &spk_r_endpoint,
}
};

static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
{
.adr = 0x000310025D071500,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};

static const struct snd_soc_acpi_link_adr icl_3_in_1_default[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_0_adr),
.adr = rt711_0_adr,
.adr_d = rt711_0_adr,
},
{
.mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_adr),
.adr = rt1308_1_adr,
.num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
.adr_d = rt1308_1_group1_adr,
},
{
.mask = BIT(2),
.num_adr = ARRAY_SIZE(rt1308_2_adr),
.adr = rt1308_2_adr,
.num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
.adr_d = rt1308_2_group1_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt715_3_adr),
.adr = rt715_3_adr,
.adr_d = rt715_3_adr,
},
{}
};
Expand All @@ -90,17 +147,17 @@ static const struct snd_soc_acpi_link_adr icl_3_in_1_mono_amp[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_0_adr),
.adr = rt711_0_adr,
.adr_d = rt711_0_adr,
},
{
.mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_adr),
.adr = rt1308_1_adr,
.adr_d = rt1308_1_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt715_3_adr),
.adr = rt715_3_adr,
.adr_d = rt715_3_adr,
},
{}
};
Expand Down
Loading

0 comments on commit ef11a6f

Please sign in to comment.