From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Vinod Koul <vkoul@kernel.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: sanyog.r.kale@intel.com, yung-chuan.liao@linux.intel.com,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soundwire: qcom: add debugfs entry for soundwire register dump
Date: Fri, 1 Oct 2021 06:45:43 -0500 [thread overview]
Message-ID: <ada6763f-7821-6388-2c7a-3a771450c7bf@linux.intel.com> (raw)
In-Reply-To: <YVaMlSbmFnrQyb0u@matsya>
On 9/30/21 11:20 PM, Vinod Koul wrote:
> HI Srini,
>
> On 07-09-21, 11:56, Srinivas Kandagatla wrote:
>> +#ifdef CONFIG_DEBUG_FS
>> +static int swrm_reg_show(struct seq_file *s_file, void *data)
>> +{
>> + struct qcom_swrm_ctrl *swrm = s_file->private;
>> + int reg, reg_val;
>> +
>> + for (reg = 0; reg <= SWR_MSTR_MAX_REG_ADDR; reg += 4) {
>> + swrm->reg_read(swrm, reg, ®_val);
>
> Why not use regmap_read here, that would avoid reading from the bus when
> we already have the values...
It's an indirect read based on regmap.
ctrl->reg_read = qcom_swrm_ahb_reg_read;
ctrl->reg_write = qcom_swrm_ahb_reg_write;
static int qcom_swrm_ahb_reg_read(struct qcom_swrm_ctrl *ctrl, int reg,
u32 *val)
{
struct regmap *wcd_regmap = ctrl->regmap;
int ret;
/* pg register + offset */
ret = regmap_bulk_write(wcd_regmap, SWRM_AHB_BRIDGE_RD_ADDR_0,
(u8 *)®, 4);
if (ret < 0)
return SDW_CMD_FAIL;
ret = regmap_bulk_read(wcd_regmap, SWRM_AHB_BRIDGE_RD_DATA_0,
val, 4);
if (ret < 0)
return SDW_CMD_FAIL;
return SDW_CMD_OK;
}
> Second make sure later when pm_runtime support is added, this take a
> reference ..
Yes indeed, the SoundWire regmap doesn't change the pm_runtime status.
next prev parent reply other threads:[~2021-10-01 11:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 10:56 Srinivas Kandagatla
2021-10-01 4:20 ` Vinod Koul
2021-10-01 11:45 ` Pierre-Louis Bossart [this message]
2021-10-08 10:54 ` Srinivas Kandagatla
2021-10-20 15:24 ` Vinod Koul
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=ada6763f-7821-6388-2c7a-3a771450c7bf@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®