Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b19259f
acpi: HACK: silence the Found %d idle state
ujfalusi May 14, 2021
b5dd83b
[WIP] snd_soc_acpi_mach link_mask to mach_params.link_mask stuff
ujfalusi May 6, 2022
40b3f91
[HACK] ASoC: SOF: ipc4-topology: Load one library for testing
ujfalusi Aug 18, 2022
2577f43
Revert "[HACK] ASoC: SOF: ipc4-topology: Load one library for testing"
ujfalusi Aug 31, 2022
ff856a5
--- Hacks ---
ujfalusi Feb 15, 2022
8490ef1
ASoC: SOF: sof-priv: Remove unused SOF_DAI_STREAM() and SOF_FORMATS
ujfalusi Sep 30, 2022
32d14bc
-- misc fixes --
ujfalusi Sep 28, 2022
21bcd0d
ALSA: intel-nhlt: Change struct nhlt_acpi_table.desc struct array to u8
ujfalusi Apr 7, 2022
1745277
ALSA: intel-nhlt: Change struct nhlt_fmt.fmt_config struct array to u8
ujfalusi Apr 7, 2022
47da374
ASoC: SOF: uapi: header: Convert struct sof_manifest.items[] to u8 array
ujfalusi Apr 7, 2022
43a23bc
ASoC: SOF: core: Print out the value of sof_debug if it is set
ujfalusi Oct 17, 2022
1710f43
-- flex to u8 --
ujfalusi Jun 30, 2022
abcfcee
ASoC: SOF: sof-audio: Treat tplg_ops->route_setup() as optional
ujfalusi Oct 7, 2022
8dc8182
ASoC: SOF: sof-audio: Update documentation for sof_ipc_tplg_ops
ujfalusi Oct 12, 2022
aa79f14
ASoC: SOF: Add helper macro to be used to get an IPC ops
ujfalusi Oct 11, 2022
41c89c0
ASoC: SOF: pcm: Extend the optionality of IPC ops to IPC as well
ujfalusi Oct 11, 2022
a73d53d
ASoC: SOF: control: Extend the optionality of IPC ops to IPC as well
ujfalusi Oct 11, 2022
8e6b09b
ASoC: SOF: sof-audio: Extend the optionality of IPC ops to IPC as well
ujfalusi Oct 11, 2022
9535a07
ASoC: SOF: topology: Extend the optionality of IPC ops to IPC as well
ujfalusi Oct 11, 2022
9817ee9
ASoC: SOF: pm: Extend the optionality of IPC ops to IPC as well
ujfalusi Oct 11, 2022
4735c75
ASoC: SOF: sof-priv: Mark fw_tracing ops optional in documentation
ujfalusi Oct 12, 2022
5bbe6a5
ASoC: SOF: trace: Use sof_ipc_get_ops() in sof_fw_trace_init
ujfalusi Oct 11, 2022
d9e124c
ASoC: SOF: trace: No need to check for op pointer in sof_fw_trace_free()
ujfalusi Oct 11, 2022
123589b
ASoC: SOF: pm: Determine the target state earlier on suspend
ujfalusi Oct 7, 2022
05e23b5
ASoC: SOF: sof-audio: skip prepapre/unprepare if swidget is NULL
ranj063 Oct 9, 2022
62de37e
ASoC: SOF: Add flag and state which will be used for DSP-less mode
ujfalusi Oct 11, 2022
0240855
ASoC: SOF: Add support for DSPless mode
ujfalusi Jul 14, 2022
e6e0315
ASoC: SOF: Intel: hda: Add support for DSPless mode
ujfalusi Oct 12, 2022
6b56063
ASoC: SOF: Intel: pci-tgl: Allow DSPless mode
ujfalusi Oct 12, 2022
3421206
ASoC: SOF: Intel: pci-apl: Allow DSPless mode
ujfalusi Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,6 @@ int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu,
memcpy(&info->states[++last_index], &cx, sizeof(cx));
}

acpi_handle_info(handle, "Found %d idle states\n", last_index);

info->count = last_index;

end:
Expand Down
4 changes: 2 additions & 2 deletions include/sound/intel-nhlt.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct nhlt_fmt_cfg {

struct nhlt_fmt {
u8 fmt_count;
struct nhlt_fmt_cfg fmt_config[];
u8 fmt_config[]; /* flexible array of 'struct nhlt_fmt_cfg' */
} __packed;

struct nhlt_endpoint {
Expand All @@ -78,7 +78,7 @@ struct nhlt_endpoint {
struct nhlt_acpi_table {
struct acpi_table_header header;
u8 endpoint_count;
struct nhlt_endpoint desc[];
u8 desc[]; /* flexible array of 'struct nhlt_endpoint' */
} __packed;

struct nhlt_resource_desc {
Expand Down
5 changes: 5 additions & 0 deletions include/sound/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct snd_sof_dev;
/**
* enum sof_fw_state - DSP firmware state definitions
* @SOF_FW_BOOT_NOT_STARTED: firmware boot is not yet started
* @SOF_DSPLESS_MODE: DSP is not used
* @SOF_FW_BOOT_PREPARE: preparing for boot (firmware loading for exaqmple)
* @SOF_FW_BOOT_IN_PROGRESS: firmware boot is in progress
* @SOF_FW_BOOT_FAILED: firmware boot failed
Expand All @@ -31,6 +32,7 @@ struct snd_sof_dev;
*/
enum sof_fw_state {
SOF_FW_BOOT_NOT_STARTED = 0,
SOF_DSPLESS_MODE,
SOF_FW_BOOT_PREPARE,
SOF_FW_BOOT_IN_PROGRESS,
SOF_FW_BOOT_FAILED,
Expand Down Expand Up @@ -130,6 +132,9 @@ struct sof_dev_desc {
unsigned int ipc_supported_mask;
enum sof_ipc_type ipc_default;

/* The platform supports DSPless mode */
bool dspless_mode_supported;

/* defaults paths for firmware, library and topology files */
const char *default_fw_path[SOF_IPC_TYPE_COUNT];
const char *default_lib_path[SOF_IPC_TYPE_COUNT];
Expand Down
4 changes: 2 additions & 2 deletions include/uapi/sound/sof/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ struct sof_manifest_tlv {
* @abi_minor: Minor ABI version
* @abi_patch: ABI patch
* @count: count of tlv items
* @items: consecutive variable size tlv items
* @items: consecutive variable size tlv items (struct sof_manifest_tlv)
*/
struct sof_manifest {
__le16 abi_major;
__le16 abi_minor;
__le16 abi_patch;
__le16 count;
struct sof_manifest_tlv items[];
__u8 items[];
};

#endif
12 changes: 7 additions & 5 deletions sound/hda/intel-nhlt.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
return 0;
}

for (j = 0, epnt = nhlt->desc; j < nhlt->endpoint_count; j++,
epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length)) {
for (j = 0, epnt = (struct nhlt_endpoint *)nhlt->desc;
j < nhlt->endpoint_count;
j++, epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length)) {

if (epnt->linktype != NHLT_LINK_DMIC)
continue;
Expand All @@ -55,11 +56,12 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)

/* find max number of channels based on format_configuration */
if (fmt_configs->fmt_count) {
struct nhlt_fmt_cfg *fmt_cfg = fmt_configs->fmt_config;
struct nhlt_fmt_cfg *fmt_cfg;

dev_dbg(dev, "found %d format definitions\n",
fmt_configs->fmt_count);

fmt_cfg = (struct nhlt_fmt_cfg *)fmt_configs->fmt_config;
for (i = 0; i < fmt_configs->fmt_count; i++) {
struct wav_fmt_ext *fmt_ext;

Expand Down Expand Up @@ -188,7 +190,7 @@ int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num)
epnt->virtual_bus_id == ssp_num) {

fmt = (struct nhlt_fmt *)(epnt->config.caps + epnt->config.size);
cfg = fmt->fmt_config;
cfg = (struct nhlt_fmt_cfg *)fmt->fmt_config;

/*
* In theory all formats should use the same MCLK but it doesn't hurt to
Expand Down Expand Up @@ -240,7 +242,7 @@ static struct nhlt_specific_cfg *
nhlt_get_specific_cfg(struct device *dev, struct nhlt_fmt *fmt, u8 num_ch,
u32 rate, u8 vbps, u8 bps)
{
struct nhlt_fmt_cfg *cfg = fmt->fmt_config;
struct nhlt_fmt_cfg *cfg = (struct nhlt_fmt_cfg *)fmt->fmt_config;
struct wav_fmt *wfmt;
u16 _bps, _vbps;
int i;
Expand Down
64 changes: 56 additions & 8 deletions sound/soc/intel/common/soc-acpi-intel-tgl-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,84 +422,132 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
.links = sdw_mockup_headset_2amps_mic,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1308-rt715.tplg",
.mach_params = {
.link_mask = GENMASK(3, 0),
.links = sdw_mockup_headset_2amps_mic,
},
},
{
.link_mask = BIT(0) | BIT(1) | BIT(3),
.links = sdw_mockup_headset_1amp_mic,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1308-mono-rt715.tplg",
.mach_params = {
.link_mask = BIT(0) | BIT(1) | BIT(3),
.links = sdw_mockup_headset_1amp_mic,
},
},
{
.link_mask = BIT(0) | BIT(1) | BIT(2),
.links = sdw_mockup_mic_headset_1amp,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt715-rt711-rt1308-mono.tplg",
.mach_params = {
.link_mask = BIT(0) | BIT(1) | BIT(2),
.links = sdw_mockup_mic_headset_1amp,
},
},
{
.link_mask = 0x7,
.links = tgl_sdw_rt711_link1_rt1308_link2_rt715_link0,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt715-rt711-rt1308-mono.tplg",
.mach_params = {
.link_mask = 0x7,
.links = tgl_sdw_rt711_link1_rt1308_link2_rt715_link0,
},
},
{
.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_default,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1308-rt715.tplg",
.mach_params = {
.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_default,
},
},
{
.link_mask = 0xF,
.links = tgl_3_in_1_mono_amp,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1308-mono-rt715.tplg",
/*
* link_mask should be 0xB, but all links are enabled by BIOS.
* This entry will be selected if there is no rt1308 exposed
* on link2 since it will fail to match the above entry.
*/
.link_mask = 0xF,
.links = tgl_3_in_1_mono_amp,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1308-mono-rt715.tplg",
.mach_params = {
.link_mask = 0xF,
.links = tgl_3_in_1_mono_amp,
},
},
{
.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_sdca,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1316-rt714.tplg",
.mach_params = {
.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_sdca,
},
},
{
.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_sdca_mono,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-l0-rt1316-l1-mono-rt714-l3.tplg",
/*
* link_mask should be 0xB, but all links are enabled by BIOS.
* This entry will be selected if there is no rt1316 amplifier exposed
* on link2 since it will fail to match the above entry.
*/

.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_sdca_mono,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-l0-rt1316-l1-mono-rt714-l3.tplg",
.mach_params = {
.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_sdca_mono,
},
},

{
.link_mask = 0x3, /* rt711 on link 0 and 1 rt1308 on link 1 */
.links = tgl_hp,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1308.tplg",
.mach_params = {
.link_mask = 0x3, /* rt711 on link 0 and 1 rt1308 on link 1 */
.links = tgl_hp,
},
},
{
.link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */
.links = tgl_rvp,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711-rt1308.tplg",
.mach_params = {
.link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */
.links = tgl_rvp,
},
},
{
.link_mask = 0x3, /* rt5682 on link0 & 2xmax98373 on link 1 */
.links = tgl_chromebook_base,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-sdw-max98373-rt5682.tplg",
.mach_params = {
.link_mask = 0x3, /* rt5682 on link0 & 2xmax98373 on link 1 */
.links = tgl_chromebook_base,
},
},
{
.link_mask = 0x1, /* rt711 on link 0 */
.links = tgl_rvp_headset_only,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-tgl-rt711.tplg",
.mach_params = {
.link_mask = 0x1, /* rt711 on link 0 */
.links = tgl_rvp_headset_only,
},
},
{},
};
Expand Down
44 changes: 22 additions & 22 deletions sound/soc/sof/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ int snd_sof_volume_get(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = sm->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->volume_get)
if (tplg_ops && tplg_ops->control && tplg_ops->control->volume_get)
return tplg_ops->control->volume_get(scontrol, ucontrol);

return 0;
Expand All @@ -37,9 +37,9 @@ int snd_sof_volume_put(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = sm->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->volume_put)
if (tplg_ops && tplg_ops->control && tplg_ops->control->volume_put)
return tplg_ops->control->volume_put(scontrol, ucontrol);

return false;
Expand Down Expand Up @@ -74,9 +74,9 @@ int snd_sof_switch_get(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = sm->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->switch_get)
if (tplg_ops && tplg_ops->control && tplg_ops->control->switch_get)
return tplg_ops->control->switch_get(scontrol, ucontrol);

return 0;
Expand All @@ -89,9 +89,9 @@ int snd_sof_switch_put(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = sm->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->switch_put)
if (tplg_ops && tplg_ops->control && tplg_ops->control->switch_put)
return tplg_ops->control->switch_put(scontrol, ucontrol);

return false;
Expand All @@ -104,9 +104,9 @@ int snd_sof_enum_get(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = se->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->enum_get)
if (tplg_ops && tplg_ops->control && tplg_ops->control->enum_get)
return tplg_ops->control->enum_get(scontrol, ucontrol);

return 0;
Expand All @@ -119,9 +119,9 @@ int snd_sof_enum_put(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = se->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->enum_put)
if (tplg_ops && tplg_ops->control && tplg_ops->control->enum_put)
return tplg_ops->control->enum_put(scontrol, ucontrol);

return false;
Expand All @@ -134,9 +134,9 @@ int snd_sof_bytes_get(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = be->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->bytes_get)
if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_get)
return tplg_ops->control->bytes_get(scontrol, ucontrol);

return 0;
Expand All @@ -149,9 +149,9 @@ int snd_sof_bytes_put(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = be->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->bytes_put)
if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_put)
return tplg_ops->control->bytes_put(scontrol, ucontrol);

return 0;
Expand All @@ -165,13 +165,13 @@ int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = be->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

/* make sure we have at least a header */
if (size < sizeof(struct snd_ctl_tlv))
return -EINVAL;

if (tplg_ops->control->bytes_ext_put)
if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_ext_put)
return tplg_ops->control->bytes_ext_put(scontrol, binary_data, size);

return 0;
Expand All @@ -184,7 +184,7 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
struct snd_sof_control *scontrol = be->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);
int ret, err;

ret = pm_runtime_resume_and_get(scomp->dev);
Expand All @@ -193,7 +193,7 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
return ret;
}

if (tplg_ops->control->bytes_ext_volatile_get)
if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_ext_volatile_get)
ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size);

pm_runtime_mark_last_busy(scomp->dev);
Expand All @@ -212,9 +212,9 @@ int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
struct snd_sof_control *scontrol = be->dobj.private;
struct snd_soc_component *scomp = scontrol->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg);

if (tplg_ops->control->bytes_ext_get)
if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_ext_get)
return tplg_ops->control->bytes_ext_get(scontrol, binary_data, size);

return 0;
Expand Down
Loading