All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Cezary Rojewski <cezary.rojewski@intel.com>,
	alsa-devel@alsa-project.org,  broonie@kernel.org
Cc: upstream@semihalf.com, harshapriya.n@intel.com, rad@semihalf.com,
	tiwai@suse.com, hdegoede@redhat.com,
	amadeuszx.slawinski@linux.intel.com, cujomalainey@chromium.org,
	lma@semihalf.com
Subject: Re: [PATCH 05/14] ASoC: Intel: avs: HDA PCM BE operations
Date: Tue, 26 Apr 2022 16:45:16 -0500	[thread overview]
Message-ID: <6331fe1d-3bbf-8ba9-bb81-c670093d41c9@linux.intel.com> (raw)
In-Reply-To: <20220426172346.3508411-6-cezary.rojewski@intel.com>



> +static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
> +{
> +	struct avs_dma_data *data;
> +	struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
> +	struct hdac_ext_stream *estream;

host_stream, estream, there seems to be multiple naming conventions for the same thing?

> +	struct hdac_ext_link *link;
> +	struct hda_codec *codec;
> +
> +	dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name);
> +
> +	data = snd_soc_dai_get_dma_data(dai, substream);
> +	if (!data->path)
> +		return 0;
> +
> +	estream = substream->runtime->private_data;
> +	estream->link_prepared = false;
> +	avs_path_free(data->path);
> +	data->path = NULL;
> +
> +	/* clear link <-> stream mapping */
> +	codec = dev_to_hda_codec(asoc_rtd_to_codec(rtd, 0)->dev);
> +	link = snd_hdac_ext_bus_link_at(&codec->bus->core, codec->core.addr);
> +	if (!link)
> +		return -EINVAL;
> +
> +	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
> +		snd_hdac_ext_link_clear_stream_id(link, estream->hstream.stream_tag);
> +
> +	return 0;
> +}

> +static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
> +				  struct snd_soc_dai *dai)
> +{
> +	struct hdac_ext_stream *estream;
> +	struct avs_dma_data *data;
> +	int ret = 0;
> +
> +	dev_dbg(dai->dev, "entry %s cmd=%d\n", __func__, cmd);
> +
> +	data = snd_soc_dai_get_dma_data(dai, substream);
> +	estream = substream->runtime->private_data;
> +
> +	switch (cmd) {
> +	case SNDRV_PCM_TRIGGER_START:
> +	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> +		snd_hdac_ext_link_stream_start(estream);
> +
> +		ret = avs_path_run(data->path, AVS_TPLG_TRIGGER_AUTO);
> +		if (ret < 0)
> +			dev_err(dai->dev, "run BE path failed: %d\n", ret);
> +		break;
> +
> +	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
> +	case SNDRV_PCM_TRIGGER_STOP:
> +		ret = avs_path_pause(data->path);
> +		if (ret < 0)
> +			dev_err(dai->dev, "pause BE path failed: %d\n", ret);
> +
> +		snd_hdac_ext_link_stream_clear(estream);
> +
> +		if (cmd == SNDRV_PCM_TRIGGER_STOP) {
> +			ret = avs_path_reset(data->path);
> +			if (ret < 0)
> +				dev_err(dai->dev, "reset BE path failed: %d\n", ret);
> +		}
> +		break;
> +
> +	default:
> +		ret = -EINVAL;

TRIGGER_SUSPEND?

> +		break;
> +	}
> +
> +	return ret;
> +}

> +static const struct snd_soc_component_driver avs_hda_component_driver = {
> +	.name			= "avs-hda-pcm",
> +	.probe			= avs_component_hda_probe,
> +	.remove			= avs_component_hda_remove,
> +	.open			= avs_component_hda_open,
> +	.close			= avs_component_hda_close,
> +	.pointer		= avs_component_pointer,
> +	.mmap			= avs_component_mmap,
> +	.pcm_construct		= avs_component_construct,
> +	/*
> +	 * hda platform component's probe() is dependent on
> +	 * codec->pcm_list_head, it needs to be initialized after codec
> +	 * component. remove_order is here for completeness sake
> +	 */
> +	.probe_order		= SND_SOC_COMP_ORDER_LATE,
> +	.remove_order		= SND_SOC_COMP_ORDER_EARLY,
> +	.module_get_upon_open	= 1,
> +	.topology_name_prefix	= "intel/avs",
> +	.non_legacy_dai_naming	= true,

needed?

> +};
> +
> +int avs_hda_platform_register(struct avs_dev *adev, const char *name)
> +{
> +	return avs_soc_component_register(adev->dev, name,
> +					  &avs_hda_component_driver, NULL, 0);
> +}

  reply	other threads:[~2022-04-26 22:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26 17:23 [PATCH 00/14] ASoC: Intel: avs: Driver core and PCM operations Cezary Rojewski
2022-04-26 17:23 ` [PATCH 01/14] ASoC: Intel: avs: Account for libraries when booting basefw Cezary Rojewski
2022-04-26 21:21   ` Pierre-Louis Bossart
2022-05-01  9:45     ` Cezary Rojewski
2022-05-06 15:25       ` Piotr Maziarz
2022-05-06 15:47         ` Pierre-Louis Bossart
2022-04-26 17:23 ` [PATCH 02/14] ASoC: Intel: avs: Generic soc component driver Cezary Rojewski
2022-04-26 21:33   ` Pierre-Louis Bossart
2022-05-01 10:45     ` Cezary Rojewski
2022-04-26 17:23 ` [PATCH 03/14] ASoC: Intel: avs: Generic PCM FE operations Cezary Rojewski
2022-04-26 17:23 ` [PATCH 04/14] ASoC: Intel: avs: non-HDA PCM BE operations Cezary Rojewski
2022-04-26 21:40   ` Pierre-Louis Bossart
2022-05-01 10:48     ` Cezary Rojewski
2022-04-26 17:23 ` [PATCH 05/14] ASoC: Intel: avs: HDA " Cezary Rojewski
2022-04-26 21:45   ` Pierre-Louis Bossart [this message]
2022-05-01 10:55     ` Cezary Rojewski
2022-04-26 17:23 ` [PATCH 06/14] ASoC: Intel: avs: Coredump and recovery flow Cezary Rojewski
2022-04-26 21:53   ` Pierre-Louis Bossart
2022-05-01 15:32     ` Cezary Rojewski
2022-05-02 13:53       ` Pierre-Louis Bossart
2022-04-26 17:23 ` [PATCH 07/14] ASoC: Intel: avs: Prepare for firmware tracing Cezary Rojewski
2022-04-26 17:23 ` [PATCH 08/14] ASoC: Intel: avs: D0ix power state support Cezary Rojewski
2022-04-26 21:58   ` Pierre-Louis Bossart
2022-04-29 14:19     ` Cezary Rojewski
2022-04-29 14:33       ` Cezary Rojewski
2022-04-26 17:23 ` [PATCH 09/14] ASoC: Intel: avs: Event tracing Cezary Rojewski
2022-04-26 17:23 ` [PATCH 10/14] ASoC: Intel: avs: Machine board registration Cezary Rojewski
2022-04-26 22:12   ` Pierre-Louis Bossart
2022-04-29 14:01     ` Cezary Rojewski
2022-05-04  9:41       ` Amadeusz Sławiński
2022-05-04 11:12         ` Cezary Rojewski
2022-05-04 11:26         ` Péter Ujfalusi
2022-05-04 12:33           ` Cezary Rojewski
2022-04-26 17:23 ` [PATCH 11/14] ASoC: Intel: avs: PCI driver implementation Cezary Rojewski
2022-04-26 17:23 ` [PATCH 12/14] ASoC: Intel: avs: Power management Cezary Rojewski
2022-04-26 22:18   ` Pierre-Louis Bossart
2022-04-29 13:44     ` Cezary Rojewski
2022-04-26 17:23 ` [PATCH 13/14] ASoC: Intel: avs: SKL-based platforms support Cezary Rojewski
2022-04-26 17:23 ` [PATCH 14/14] ASoC: Intel: avs: APL-based " Cezary Rojewski
2022-04-27  8:15 ` [PATCH 00/14] ASoC: Intel: avs: Driver core and PCM operations Cezary Rojewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6331fe1d-3bbf-8ba9-bb81-c670093d41c9@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=cujomalainey@chromium.org \
    --cc=harshapriya.n@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=lma@semihalf.com \
    --cc=rad@semihalf.com \
    --cc=tiwai@suse.com \
    --cc=upstream@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.