1
0
Fork 0
Commit Graph

12 Commits (604629bcb5057d778839652f8f38d23734f2fe1d)

Author SHA1 Message Date
Ranjani Sridharan bdf4ad3fd0
ASoC: SOF: Intel: hda: assign link DMA channel at run-time
The recommended HDA HW programming sequence for setting
the DMA format requires that the link DMA and host DMA
channels be coupled before setting the format. This
change means that host DMA or link DMA channels be
reserved even if only one is used.

Statically assigned link DMA channels would mean that
all the corresponding host DMA channels will need to be
reserved, leaving only a few channels available at run-time.
So, the suggestion here is to switch to dynamically assigning
both host DMA channels and link DMA channels are run-time.

The host DMA channel is assigned when the pcm
is opened as before. While choosing the link DMA channel,
if the host DMA channel corresponding to the link DMA channel
is already taken, the proposed method checks to make
sure that the BE is connected to the FE that has been assigned
this host DMA channel. Once the link DMA channel is assigned,
an IPC is sent to the DSP to set the link DMA channel.

The link DMA channel is freed during hw_free() and also in the
SUSPEND trigger callback. It will be re-assigned when hw_params
are set upon resume.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-17 13:37:16 +01:00
Ranjani Sridharan 1b7e195686
ASoC: SOF: topology: add cpu_dai_name for DAIs
Add the cpu_dai_name member to snd_sof_dai and save the
cpu_dai_name while setting the DAI config.

The internal SOF representation will have to change at a later point
as well when we have multiple CPU dais.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-17 13:36:53 +01:00
Bard Liao 0c888baba8
ASoC: SOF: dont wake dsp up in kcontrol IO
Always get kcontrol value from cache, set kcontrol value to DSP
when DSP is active. Kcontrol values will be restored when DSP boot up.
We will set the default value of kcontrol in sof_complete to make sure
the value is align with firmware.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-13 19:56:07 +01:00
Seppo Ingalsuo 7df43911e9
ASoC: SOF: Add DMIC token for unmute gain ramp time
The settling time of DMIC DC level is both platform and used
microphone model specific. The unmute gain ramp is used to conceal
most of the large DC level seen in beginning of capture. This patch
adds into the DMIC DAI IPC struct a new field called unmute_ramp_time
and a new token SOF_TKN_INTEL_DMIC_UNMUTE_RAMP_TIME. The value is the
ramp length in milliseconds (ms).

The ABI minor version is incremented for this backwards compatible
change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-13 19:55:44 +01:00
Zhu Yingjiang 65a18a46b2
ASoC: SOF: topology: pass volume min/max linear value to FW
The driver currently passes the volume ramp type and length
topology tokens to firmware, but the min and max volume are
not set. This patch provides a correction to convert the
information from the topology file and pass the linear volume
min/max value to the firmware to improve transitions.

Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-13 19:55:22 +01:00
Zhu Yingjiang aa66fd80e0
ASoC: SOF: topology: add min/max step for volume_table
add two units min_volume_step and max_volume_step to the snd_sof_control
struct, for the min and max step of the volume_table.

Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-13 19:54:59 +01:00
Kuninori Morimoto 7ba06110de
ASoC: sof: use modern dai_link style
ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-06 22:10:38 +01:00
Jaska Uimonen 6635806956
ASoC: SOF: topology: add support for mux/demux component
Add enumerations to support mux/demux processing component.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-03 18:00:06 +01:00
Gustavo A. R. Silva 41f4fadb34
ASoC: SOF: topology: Use struct_size() helper
Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, replace the following form:

sizeof(struct sof_ipc_ctrl_data) + sizeof(struct sof_ipc_ctrl_value_chan) *
	le32_to_cpu(mc->num_channels)

with:

struct_size(scontrol->control_data, chanv, le32_to_cpu(mc->num_channels))

and so on...

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-28 15:51:01 +01:00
Pierre-Louis Bossart 8e3a6e45a7
ASoC: SOF: topology: add support for stricter ABI checks
Fail early if topology is more recent than kernel and Kconfig is
selected.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 14:56:31 +09:00
Colin Ian King c437ba0300
ASoC: SOF: remove redundant null checks of dai
Currently there are two null checks of pointer dai in function
sof_connect_dai_widget and yet there is no null check of dai
at the end of the function when checking !dai->name.  The latter
would be a null pointer deference if dai is null (as picked up
by static analysis), however the function is only ever called
when dai is successfully allocated, so the null checks are
redundant. Clean up the code by removing the null checks.

Addresses-Coverity: ("Dereference after null check")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 14:54:15 +09:00
Liam Girdwood 311ce4fe76
ASoC: SOF: Add support for loading topologies
SOF uses topology to define the DAPM graphs and widgets, DAIs, PCMs and set
parameters for init and run time usage. This patch loads topology and
maps it to IPC commands that are build the topology on the DSP.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-28 02:48:06 +09:00