[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200313120607.GE4885@vkoul-mobl>
Date: Fri, 13 Mar 2020 17:36:07 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
tiwai@...e.de, broonie@...nel.org, gregkh@...uxfoundation.org,
jank@...ence.com, srinivas.kandagatla@...aro.org,
slawomir.blauciak@...el.com,
Bard liao <yung-chuan.liao@...ux.intel.com>,
Rander Wang <rander.wang@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Hui Wang <hui.wang@...onical.com>,
Rander Wang <rander.wang@...el.com>,
Sanyog Kale <sanyog.r.kale@...el.com>
Subject: Re: [PATCH 03/16] soundwire: cadence: add interface to check clock
status
On 11-03-20, 13:41, Pierre-Louis Bossart wrote:
> From: Rander Wang <rander.wang@...el.com>
>
> If master is in clock stop state, driver can't modify registers
> in master except the registers for clock stop setting.
>
> Signed-off-by: Rander Wang <rander.wang@...el.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> ---
> drivers/soundwire/cadence_master.c | 19 +++++++++++++++++++
> drivers/soundwire/cadence_master.h | 2 ++
> 2 files changed, 21 insertions(+)
>
> diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
> index 941809ea00a8..71cba2585151 100644
> --- a/drivers/soundwire/cadence_master.c
> +++ b/drivers/soundwire/cadence_master.c
> @@ -1207,6 +1207,25 @@ static const struct sdw_master_port_ops cdns_port_ops = {
> .dpn_port_enable_ch = cdns_port_enable,
> };
>
> +/**
> + * sdw_cdns_is_clock_stop: Check clock status
> + *
> + * @cdns: Cadence instance
> + */
> +bool sdw_cdns_is_clock_stop(struct sdw_cdns *cdns)
> +{
> + u32 status;
> +
> + status = cdns_readl(cdns, CDNS_MCP_STAT) & CDNS_MCP_STAT_CLK_STOP;
> + if (status) {
> + dev_dbg(cdns->dev, "Clock is stopped\n");
> + return true;
> + }
This can be further optimized to:
return !!(cdns_readl(cdns, CDNS_MCP_STAT) & CDNS_MCP_STAT_CLK_STOP);
--
~Vinod
Powered by blists - more mailing lists