From: Vinod Koul <vkoul@kernel.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: robh@kernel.org, broonie@kernel.org, bgoswami@codeaurora.org,
pierre-louis.bossart@linux.intel.com, devicetree@vger.kernel.org,
lgirdwood@gmail.com, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, spapothi@codeaurora.org
Subject: Re: [PATCH v3 2/2] soundwire: qcom: add support for SoundWire controller
Date: Mon, 21 Oct 2019 10:14:05 +0530 [thread overview]
Message-ID: <20191021044405.GB2654@vkoul-mobl> (raw)
In-Reply-To: <20191011154423.2506-3-srinivas.kandagatla@linaro.org>
On 11-10-19, 16:44, Srinivas Kandagatla wrote:
> +static irqreturn_t qcom_swrm_irq_handler(int irq, void *dev_id)
> +{
> + struct qcom_swrm_ctrl *ctrl = dev_id;
> + u32 sts, value;
> + unsigned long flags;
> +
> + ctrl->reg_read(ctrl, SWRM_INTERRUPT_STATUS, &sts);
> +
> + if (sts & SWRM_INTERRUPT_STATUS_CMD_ERROR) {
> + ctrl->reg_read(ctrl, SWRM_CMD_FIFO_STATUS, &value);
> + dev_err_ratelimited(ctrl->dev,
> + "CMD error, fifo status 0x%x\n",
> + value);
> + ctrl->reg_write(ctrl, SWRM_CMD_FIFO_CMD, 0x1);
> + }
> +
> + if ((sts & SWRM_INTERRUPT_STATUS_NEW_SLAVE_ATTACHED) ||
> + sts & SWRM_INTERRUPT_STATUS_CHANGE_ENUM_SLAVE_STATUS)
> + schedule_work(&ctrl->slave_work);
we are in irq thread, so why not do the work here rather than schedule
it?
> +static int qcom_swrm_compute_params(struct sdw_bus *bus)
> +{
> + struct qcom_swrm_ctrl *ctrl = to_qcom_sdw(bus);
> + struct sdw_master_runtime *m_rt;
> + struct sdw_slave_runtime *s_rt;
> + struct sdw_port_runtime *p_rt;
> + struct qcom_swrm_port_config *pcfg;
> + int i = 0;
> +
> + list_for_each_entry(m_rt, &bus->m_rt_list, bus_node) {
> + list_for_each_entry(p_rt, &m_rt->port_list, port_node) {
> + pcfg = &ctrl->pconfig[p_rt->num - 1];
> + p_rt->transport_params.port_num = p_rt->num;
> + p_rt->transport_params.sample_interval = pcfg->si + 1;
> + p_rt->transport_params.offset1 = pcfg->off1;
> + p_rt->transport_params.offset2 = pcfg->off2;
> + }
> +
> + list_for_each_entry(s_rt, &m_rt->slave_rt_list, m_rt_node) {
> + list_for_each_entry(p_rt, &s_rt->port_list, port_node) {
> + pcfg = &ctrl->pconfig[i];
> + p_rt->transport_params.port_num = p_rt->num;
> + p_rt->transport_params.sample_interval =
> + pcfg->si + 1;
> + p_rt->transport_params.offset1 = pcfg->off1;
> + p_rt->transport_params.offset2 = pcfg->off2;
> + i++;
> + }
Can you explain this one, am not sure I understood this. This fn is
supposed to compute and fill up the params, all I can see is filling up!
> +static const struct snd_soc_dai_ops qcom_swrm_pdm_dai_ops = {
> + .hw_params = qcom_swrm_hw_params,
> + .prepare = qcom_swrm_prepare,
> + .hw_free = qcom_swrm_hw_free,
> + .startup = qcom_swrm_startup,
> + .shutdown = qcom_swrm_shutdown,
> + .set_sdw_stream = qcom_swrm_set_sdw_stream,
why does indent look off to me!
--
~Vinod
next prev parent reply other threads:[~2019-10-21 4:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 15:44 [PATCH v3 0/2] soundwire: Add support to Qualcomm SoundWire master Srinivas Kandagatla
2019-10-11 15:44 ` [PATCH v3 1/2] dt-bindings: soundwire: add bindings for Qcom controller Srinivas Kandagatla
2019-10-14 17:12 ` Rob Herring
2019-10-14 17:34 ` Srinivas Kandagatla
2019-10-15 11:35 ` Rob Herring
2019-10-15 12:22 ` Srinivas Kandagatla
2019-10-15 13:36 ` Rob Herring
2019-10-21 4:27 ` Vinod Koul
2019-10-11 15:44 ` [PATCH v3 2/2] soundwire: qcom: add support for SoundWire controller Srinivas Kandagatla
2019-10-11 17:50 ` Pierre-Louis Bossart
2019-10-14 9:04 ` Srinivas Kandagatla
2019-10-14 15:43 ` [alsa-devel] " Pierre-Louis Bossart
2019-10-21 4:44 ` Vinod Koul [this message]
2019-10-30 14:56 ` Srinivas Kandagatla
2019-10-30 15:18 ` [alsa-devel] " 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=20191021044405.GB2654@vkoul-mobl \
--to=vkoul@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@codeaurora.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=robh@kernel.org \
--cc=spapothi@codeaurora.org \
--cc=srinivas.kandagatla@linaro.org \
/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).