[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4bec03b5-c496-ec0d-b968-d4d0e5d2e782@arm.com>
Date: Thu, 23 Jun 2022 10:15:48 +0100
From: Robin Murphy <robin.murphy@....com>
To: Judy Hsiao <judyhsiao@...omium.org>,
Heiko Stuebner <heiko@...ech.de>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Brian Norris <briannorris@...omium.org>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Chen-Yu Tsai <wenst@...omium.org>, alsa-devel@...a-project.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/3] ASoC: rockchip: i2s: switch BCLK to GPIO
On 2022-06-23 03:11, Judy Hsiao wrote:
[...]
> @@ -736,6 +799,20 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
> }
>
> i2s->bclk_ratio = 64;
> + i2s->pinctrl = devm_pinctrl_get(&pdev->dev);
> + if (IS_ERR(i2s->pinctrl)) {
> + dev_err(&pdev->dev, "failed to find i2s pinctrl\n");
If we're still reworking this, it might be good to set i2s->pinctrl to
NULL here, and similarly free and clear if we fail to get the states in
the other path, so that everywhere else could consistently have just a
simple "if (i2s->pinctrl)" check rather than the "IS_ERR() ||
IS_ERR_OR_NULL()" mess.
> + } else { > + i2s->bclk_on = pinctrl_lookup_state(i2s->pinctrl, "bclk_on");
> + if (!IS_ERR_OR_NULL(i2s->bclk_on)) {
> + i2s->bclk_off = pinctrl_lookup_state(i2s->pinctrl, "bclk_off");
> + if (IS_ERR_OR_NULL(i2s->bclk_off)) {
> + dev_err(&pdev->dev, "failed to find i2s bclk_off\n");
> + goto err_clk;
> + }
> + }
> + i2s_pinctrl_select_bclk_off(i2s);
FWIW it seems a bit odd to call this in the case where we didn't even
get "bclk_on".
Robin.
> + }
>
> dev_set_drvdata(&pdev->dev, i2s);
>
Powered by blists - more mailing lists