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 v4 07/13] soundwire: Add stream configuration APIs
Date: Sat, 21 Apr 2018 21:43:15 +0530 [thread overview]
Message-ID: <20180421161315.GO6014@localhost> (raw)
In-Reply-To: <bca948a4-a668-73d0-5e6d-63287a21a636@linux.intel.com>
On Sat, Apr 21, 2018 at 06:56:26AM -0700, Pierre-Louis Bossart wrote:
>
> >+static int _sdw_prepare_stream(struct sdw_stream_runtime *stream)
> >+{
> >+ struct sdw_master_runtime *m_rt = stream->m_rt;
> >+ struct sdw_bus *bus = m_rt->bus;
> >+ struct sdw_master_prop *prop = NULL;
> >+ struct sdw_bus_params params;
> >+ int ret;
> >+
> >+ prop = &bus->prop;
> >+ memcpy(¶ms, &bus->params, sizeof(params));
> >+
> >+ /* TODO: Support Asynchronous mode */
> >+ if ((prop->max_freq % stream->params.rate) != 0) {
> >+ dev_err(bus->dev, "Async mode not supported");
> >+ return -EINVAL;
> >+ }
> >+
> >+ /* Increment cumulative bus bandwidth */
> >+ bus->params.bandwidth += m_rt->stream->params.rate *
> >+ m_rt->ch_count * m_rt->stream->params.bps;
>
> This also does not work for device-to-device communication, see e.g.
> the earlier documentation.
Sure it doesn't work for a feature which is **NOT** supported. So I am not
going to do anything here
> ch_count: Number of channels handled by the Master for
> + * this stream, can be zero.
>
> should it be m_rt->stream->params->ch_count?
Not for this case. In future when we support multi-link then yes.
> >+static int _sdw_deprepare_stream(struct sdw_stream_runtime *stream)
> >+{
> >+ struct sdw_master_runtime *m_rt = stream->m_rt;
> >+ struct sdw_bus *bus = m_rt->bus;
> >+ int ret = 0;
> >+
> >+ /* De-prepare port(s) */
> >+ ret = sdw_prep_deprep_ports(m_rt, false);
> >+ if (ret < 0) {
> >+ dev_err(bus->dev, "De-prepare port(s) failed: %d", ret);
> >+ return ret;
> >+ }
> >+
> >+ bus->params.bandwidth -= m_rt->stream->params.rate *
> >+ m_rt->ch_count * m_rt->stream->params.bps;
>
> And same here, the ch_count can be zero.
Same as above..
>
> >+
> >+ if (!bus->params.bandwidth) {
> >+ bus->params.row = 0;
> >+ bus->params.col = 0;
> >+ goto exit;
>
> What is the intent with this test+goto? Shouldn't you program the parameters
> if you want to change the frame shape?
hmmm that seems correct point to me, but then we are going idle and should
ideally power down. Let me check again if that is the reason.
>
> >+ }
> >+
> >+ /* Program params */
> >+ ret = sdw_program_params(bus);
> >+ if (ret < 0) {
> >+ dev_err(bus->dev, "Program params failed: %d", ret);
> >+ return ret;
> >+ }
> >+
> >+ return do_bank_switch(stream);
> >+
> >+exit:
> >+ stream->state = SDW_STREAM_DEPREPARED;
> >+
> >+ return ret;
> >+}
--
~Vinod
next prev parent reply other threads:[~2018-04-21 16:08 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-18 10:58 [PATCH v4 00/13] soundwire: Add stream support Vinod Koul
2018-04-18 10:58 ` [PATCH v4 01/13] Documentation: soundwire: Add more documentation Vinod Koul
2018-04-18 10:58 ` [PATCH v4 02/13] soundwire: Add support for SoundWire stream management Vinod Koul
2018-04-21 13:02 ` Pierre-Louis Bossart
2018-04-21 16:17 ` Vinod Koul
2018-04-23 13:25 ` Pierre-Louis Bossart
2018-04-24 9:02 ` Vinod Koul
2018-04-24 9:25 ` Vinod Koul
2018-04-18 10:58 ` [PATCH v4 03/13] soundwire: Add support for port management Vinod Koul
2018-04-18 10:58 ` [PATCH v4 04/13] soundwire: Add Master and Slave port programming Vinod Koul
2018-04-18 10:58 ` [PATCH v4 05/13] soundwire: Add helpers for ports operations Vinod Koul
2018-04-21 13:39 ` Pierre-Louis Bossart
2018-04-21 15:54 ` Vinod Koul
2018-04-21 13:47 ` Pierre-Louis Bossart
2018-04-21 15:53 ` Vinod Koul
2018-04-23 13:27 ` Pierre-Louis Bossart
2018-04-24 9:03 ` Vinod Koul
2018-04-18 10:58 ` [PATCH v4 06/13] soundwire: Add bank switch routine Vinod Koul
2018-04-18 10:59 ` [PATCH v4 07/13] soundwire: Add stream configuration APIs Vinod Koul
2018-04-21 13:56 ` Pierre-Louis Bossart
2018-04-21 16:13 ` Vinod Koul [this message]
2018-04-23 3:45 ` Sanyog Kale
2018-04-24 9:09 ` Vinod Koul
2018-04-23 13:30 ` Pierre-Louis Bossart
2018-04-18 10:59 ` [PATCH v4 08/13] ASoC: Add SoundWire stream programming interface Vinod Koul
2018-04-21 13:59 ` Pierre-Louis Bossart
2018-04-21 15:58 ` Vinod Koul
2018-04-23 13:33 ` Pierre-Louis Bossart
2018-04-24 9:06 ` Vinod Koul
2018-04-24 23:40 ` Pierre-Louis Bossart
2018-04-25 2:49 ` Vinod Koul
2018-04-25 15:08 ` Pierre-Louis Bossart
2018-04-18 10:59 ` [PATCH v4 09/13] soundwire: Remove cdns_master_ops Vinod Koul
2018-04-18 10:59 ` [PATCH v4 10/13] soundwire: cdns: Add port routines Vinod Koul
2018-04-18 10:59 ` [PATCH v4 11/13] soundwire: cdns: Add stream routines Vinod Koul
2018-04-18 10:59 ` [PATCH v4 12/13] soundwire: intel: Add stream initialization Vinod Koul
2018-04-18 10:59 ` [PATCH v4 13/13] soundwire: intel: Add audio DAI ops Vinod Koul
2018-04-21 14:08 ` [PATCH v4 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=20180421161315.GO6014@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