15 Jun
2022
15 Jun
'22
12:33 p.m.
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.