[v1] ASoC: rockchip: i2s: switch BCLK to GPIO

Mark Brown broonie at kernel.org
Wed Jun 15 03:33:21 PDT 2022


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20220615/95ac8ce4/attachment.sig>


More information about the Linux-rockchip mailing list