[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ada6763f-7821-6388-2c7a-3a771450c7bf@linux.intel.com>
Date: Fri, 1 Oct 2021 06:45:43 -0500
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Vinod Koul <vkoul@...nel.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: sanyog.r.kale@...el.com, yung-chuan.liao@...ux.intel.com,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soundwire: qcom: add debugfs entry for soundwire register
dump
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.
Powered by blists - more mailing lists