From: Vinod Koul <vinod.koul@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: ALSA <alsa-devel@alsa-project.org>,
tiwai@suse.de, Greg KH <gregkh@linuxfoundation.org>,
liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
broonie@kernel.org, Sanyog Kale <sanyog.r.kale@intel.com>
Subject: Re: [PATCH v3 02/13] soundwire: Add support for SoundWire stream management
Date: Tue, 17 Apr 2018 09:16:24 +0530 [thread overview]
Message-ID: <20180417034624.GS6014@localhost> (raw)
In-Reply-To: <52ad5fec-c439-0342-9801-855e053aa742@linux.intel.com>
On Mon, Apr 16, 2018 at 06:15:11PM -0500, Pierre-Louis Bossart wrote:
> >+static struct sdw_slave_runtime
> >+*sdw_alloc_slave_rt(struct sdw_slave *slave,
> >+ struct sdw_stream_config *stream_config,
> >+ struct sdw_stream_runtime *stream)
> >+{
> >+ struct sdw_slave_runtime *s_rt = NULL;
> >+
> >+ s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL);
> >+ if (!s_rt)
> >+ return NULL;
> >+
> >+
> remove extra line
ok
> >+static void sdw_release_slave_stream(struct sdw_slave *slave,
> >+ struct sdw_stream_runtime *stream)
> >+{
> >+ struct sdw_slave_runtime *s_rt, *_s_rt;
> >+ struct sdw_master_runtime *m_rt = stream->m_rt;
> >+
> >+ /* Retrieve Slave runtime handle */
> >+ list_for_each_entry_safe(s_rt, _s_rt,
> >+ &m_rt->slave_rt_list, m_rt_node) {
> >+
> >+ if (s_rt->slave == slave) {
> >+ list_del(&s_rt->m_rt_node);
> >+ kfree(s_rt);
> >+ return;
> >+ }
> >+ }
> >+}
> add kernel doc style for sdw_release_master_stream(), with same note that
> it's called with bus_lock held?
done
>
> >+static void sdw_release_master_stream(struct sdw_stream_runtime *stream)
> >+{
> >+ struct sdw_master_runtime *m_rt = stream->m_rt;
> >+ struct sdw_slave_runtime *s_rt, *_s_rt;
> >+
> >+ list_for_each_entry_safe(s_rt, _s_rt,
> >+ &m_rt->slave_rt_list, m_rt_node)
> >+ sdw_release_slave_stream(s_rt->slave, stream);
> So if the release_master_stream is called first it'll call
> sdw_release_slave_stream(), so sdw_stream_remove_slave() will in effect do
> nothing?
>
> I guess it's the dual of what happens for allocation - where the master_rt
> might be allocated by the first slave_add but might be worth a comment or
> two so that people understand the intent and don't believe it's a design
> issue.
Yes makes sense, added now
> >+static int sdw_config_stream(struct device *dev,
> >+ struct sdw_stream_runtime *stream,
> >+ struct sdw_stream_config *stream_config, bool is_slave)
> >+{
> >+
> >+ /*
> >+ * Update the stream rate, channel and bps based on data
> >+ * source. For more than one data source (multilink),
> >+ * match the rate, bps, stream type and increment number of channels.
> >+ */
> >+ if ((stream->params.rate) &&
> >+ (stream->params.rate != stream_config->frame_rate)) {
> >+ dev_err(dev, "rate not matching, stream:%s", stream->name);
> >+ return -EINVAL;
> >+ }
> >+
> >+ if ((stream->params.bps) &&
> >+ (stream->params.bps != stream_config->bps)) {
> >+ dev_err(dev, "bps not matching, stream:%s", stream->name);
> >+ return -EINVAL;
> >+ }
> >+
> >+ stream->type = stream_config->type;
> >+ stream->params.rate = stream_config->frame_rate;
> >+ stream->params.bps = stream_config->bps;
> >+ if (is_slave)
> >+ stream->params.ch_count += stream_config->ch_count;
> I just realized this will not work for device-to-device communication. You
> have to count all TX ports or all RX ports, not the ports for Slaves.
Correct, will update the check when we add support for device-to-device
communication
--
~Vinod
next prev parent reply other threads:[~2018-04-17 3:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 15:23 [PATCH v3 00/13] soundwire: Add stream support Vinod Koul
2018-04-16 15:23 ` [PATCH v3 01/13] Documentation: soundwire: Add more documentation Vinod Koul
2018-04-16 15:23 ` [PATCH v3 02/13] soundwire: Add support for SoundWire stream management Vinod Koul
2018-04-16 23:15 ` Pierre-Louis Bossart
2018-04-17 3:46 ` Vinod Koul [this message]
2018-04-16 15:23 ` [PATCH v3 03/13] soundwire: Add support for port management Vinod Koul
2018-04-16 23:30 ` Pierre-Louis Bossart
2018-04-17 4:11 ` Vinod Koul
2018-04-16 15:23 ` [PATCH v3 04/13] soundwire: Add Master and Slave port programming Vinod Koul
2018-04-16 15:23 ` [PATCH v3 05/13] soundwire: Add helpers for ports operations Vinod Koul
2018-04-16 15:23 ` [PATCH v3 06/13] soundwire: Add bank switch routine Vinod Koul
2018-04-16 15:23 ` [PATCH v3 07/13] soundwire: Add stream configuration APIs Vinod Koul
2018-04-16 15:23 ` [PATCH v3 08/13] ASoC: Add SoundWire stream programming interface Vinod Koul
2018-04-16 23:42 ` Pierre-Louis Bossart
2018-04-17 11:11 ` Mark Brown
2018-04-17 15:49 ` Vinod Koul
2018-04-16 15:23 ` [PATCH v3 09/13] soundwire: Remove cdns_master_ops Vinod Koul
2018-04-16 15:23 ` [PATCH v3 10/13] soundwire: cdns: Add port routines Vinod Koul
2018-04-16 15:23 ` [PATCH v3 11/13] soundwire: cdns: Add stream routines Vinod Koul
2018-04-16 15:23 ` [PATCH v3 12/13] soundwire: intel: Add stream initialization Vinod Koul
2018-04-16 15:23 ` [PATCH v3 13/13] soundwire: intel: Add audio DAI ops Vinod Koul
2018-04-17 0:00 ` [PATCH v3 00/13] soundwire: Add stream support Pierre-Louis Bossart
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=20180417034624.GS6014@localhost \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=tiwai@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).