[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yqm1cTfq1AA/mAV5@sirena.org.uk>
Date: Wed, 15 Jun 2022 11:33:21 +0100
From: Mark Brown <broonie@...nel.org>
To: Judy Hsiao <judyhsiao@...omium.org>
Cc: Heiko Stuebner <heiko@...ech.de>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [v1] ASoC: rockchip: i2s: switch BCLK to GPIO
On Wed, Jun 15, 2022 at 04:56:43AM +0000, Judy Hsiao wrote:
> 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");
> +
> + i2s->bclk_on = pinctrl_lookup_state(i2s->pinctrl,
> + "bclk_on");
> + if (IS_ERR_OR_NULL(i2s->bclk_on))
> + dev_err(&pdev->dev, "failed to find i2s default state\n");
> + else
> + dev_dbg(&pdev->dev, "find i2s bclk state\n");
> +
> + 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 gpio state\n");
> + else
> + dev_dbg(&pdev->dev, "find i2s bclk_off state\n");
This should really validate that it's got both on and off states before
we start using these, especially if we only have off, since we might end
up being able to do one side of the switch but not the other which won't
work. I'm also wondering if it's better to just use audio active/idle
states rather than saying purely something for the BCLK - effectively
that's what this is doing and it feels like it might be cleaner and more
future proof for people to disable all the audio pins rather than just
BCLK and then switch them together.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists