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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux