lkml.org 
[lkml]   [2022]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-06-15 12:34    [W:0.034 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site