[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190926125538.GF29696@kadam>
Date: Thu, 26 Sep 2019 15:55:38 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Ravulapati Vishnu vardhan rao
<Vishnuvardhanrao.Ravulapati@....com>
Cc: Alexander.Deucher@....com,
Vijendar Mukunda <vijendar.mukunda@....com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Maruthi Bayyavarapu <maruthi.bayyavarapu@....com>,
YueHaibing <yuehaibing@...wei.com>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Colin Ian King <colin.king@...onical.com>,
"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..."
<alsa-devel@...a-project.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/5] ASoC: amd: ACP powergating should be done by
controller
On Fri, Sep 27, 2019 at 04:37:39AM +0530, Ravulapati Vishnu vardhan rao wrote:
> +static int acp3x_power_on(void __iomem *acp3x_base)
> +{
> + u32 val;
> + u32 timeout = 0;
> + int ret = 0;
> +
> + val = rv_readl(acp3x_base + mmACP_PGFSM_STATUS);
> + if (val) {
Flip this around.
if (!val)
return 0;
> + if (!((val & ACP_PGFSM_STATUS_MASK) ==
> + ACP_POWER_ON_IN_PROGRESS))
Use != insead of !(foo == bar).
if ((val & ACP_PGFSM_STATUS_MASK) != ACP_POWER_ON_IN_PROGRESS)
> + rv_writel(ACP_PGFSM_CNTL_POWER_ON_MASK,
> + acp3x_base + mmACP_PGFSM_CONTROL);
> + while (true) {
> + val = rv_readl(acp3x_base + mmACP_PGFSM_STATUS);
> + if (!val)
> + break;
return 0;
> + udelay(1);
> + if (timeout > 500) {
if (timeout++ > 500) {
> + pr_err("ACP is Not Powered ON\n");
We print two error messages. :/
> + ret = -ETIMEDOUT;
return -ETIMOUT;
> + break;
> + }
> + timeout++;
> + }
> + if (ret) {
> + pr_err("ACP is not powered on status:%d\n", ret);
> + return ret;
> + }
> + }
> + return ret;
> +}
regards,
dan carpenter
Powered by blists - more mailing lists