Message ID | 20230302-max9867-v1-0-aa9f7f25db5e@skidata.com |
---|---|
Headers | show |
Series | Add "mclk" support for maxim,max9867 | expand |
On Thu, Mar 02, 2023 at 12:55:03PM +0100, richard.leitner@linux.dev wrote: > + max9867->mclk = devm_clk_get(&i2c->dev, "mclk"); > + if (IS_ERR(max9867->mclk)) > + return PTR_ERR(max9867->mclk); > + ret = clk_prepare_enable(max9867->mclk); > + if (ret < 0) > + dev_err(&i2c->dev, "Failed to enable MCLK: %d\n", ret); > + Nothing ever disables the clock - we need a disable in the remove path at least.
On Thu, Mar 02, 2023 at 12:20:18PM +0000, Mark Brown wrote: > On Thu, Mar 02, 2023 at 12:55:03PM +0100, richard.leitner@linux.dev wrote: > > > + max9867->mclk = devm_clk_get(&i2c->dev, "mclk"); > > + if (IS_ERR(max9867->mclk)) > > + return PTR_ERR(max9867->mclk); > > + ret = clk_prepare_enable(max9867->mclk); > > + if (ret < 0) > > + dev_err(&i2c->dev, "Failed to enable MCLK: %d\n", ret); > > + > > Nothing ever disables the clock - we need a disable in the remove path > at least. Sure. Sorry for missing that. I will send a v2 later today. regards;rl
On 02.03.2023 14:20, Mark Brown wrote: >> + max9867->mclk = devm_clk_get(&i2c->dev, "mclk"); >> + if (IS_ERR(max9867->mclk)) >> + return PTR_ERR(max9867->mclk); >> + ret = clk_prepare_enable(max9867->mclk); >> + if (ret < 0) >> + dev_err(&i2c->dev, "Failed to enable MCLK: %d\n", ret); >> + > Nothing ever disables the clock - we need a disable in the remove path > at least. I don't have the full context of this patch but this diff seems a good candidate for devm_clk_get_enabled().
Hi Claudiu, On Thu, Mar 02, 2023 at 12:45:50PM +0000, Claudiu.Beznea@microchip.com wrote: > On 02.03.2023 14:20, Mark Brown wrote: > >> + max9867->mclk = devm_clk_get(&i2c->dev, "mclk"); > >> + if (IS_ERR(max9867->mclk)) > >> + return PTR_ERR(max9867->mclk); > >> + ret = clk_prepare_enable(max9867->mclk); > >> + if (ret < 0) > >> + dev_err(&i2c->dev, "Failed to enable MCLK: %d\n", ret); > >> + > > Nothing ever disables the clock - we need a disable in the remove path > > at least. > > I don't have the full context of this patch but this diff seems a good > candidate for devm_clk_get_enabled(). Thanks for that pointer, but currently we are thinking of prepare_enable the clock in SND_SOC_BIAS_ON and disable_unprepare it in SND_SOC_BIAS_OFF (similar to wm8731.c). Therefore probe() will only do a devm_clk_get(). Claudiu, Rob: Will this be an acceptable solution? regards;rl
On 02.03.2023 16:46, Richard Leitner wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > Hi Claudiu, > > On Thu, Mar 02, 2023 at 12:45:50PM +0000, Claudiu.Beznea@microchip.com wrote: >> On 02.03.2023 14:20, Mark Brown wrote: >>>> + max9867->mclk = devm_clk_get(&i2c->dev, "mclk"); >>>> + if (IS_ERR(max9867->mclk)) >>>> + return PTR_ERR(max9867->mclk); >>>> + ret = clk_prepare_enable(max9867->mclk); >>>> + if (ret < 0) >>>> + dev_err(&i2c->dev, "Failed to enable MCLK: %d\n", ret); >>>> + >>> Nothing ever disables the clock - we need a disable in the remove path >>> at least. >> >> I don't have the full context of this patch but this diff seems a good >> candidate for devm_clk_get_enabled(). > > Thanks for that pointer, but currently we are thinking of prepare_enable > the clock in SND_SOC_BIAS_ON and disable_unprepare it in SND_SOC_BIAS_OFF > (similar to wm8731.c). > Therefore probe() will only do a devm_clk_get(). Sounds good for me. > > Claudiu, Rob: Will this be an acceptable solution? > > regards;rl
This series adds support for the clocks and clock-names properties in the maxim,max9867 bindings. Furthermore the binding definitions are converted from txt to yaml. The mclk property is needed for one of our boards which uses the the i.MX8MP SAI MCLK as clock for the maxim,max9867. Signed-off-by: Richard Leitner <richard.leitner@skidata.com> --- Benjamin Bara (1): ASoC: maxim,max9867: add "mclk" support Richard Leitner (2): ASoC: dt-bindings: maxim,max9867: convert txt bindings to yaml ASoC: dt-bindings: maxim,max9867: add "mclk" property .../devicetree/bindings/sound/max9867.txt | 17 ------ .../devicetree/bindings/sound/maxim,max9867.yaml | 61 ++++++++++++++++++++++ sound/soc/codecs/max9867.c | 14 ++++- 3 files changed, 74 insertions(+), 18 deletions(-) --- base-commit: c9c3395d5e3dcc6daee66c6908354d47bf98cb0c change-id: 20230302-max9867-49081908a2ab Best regards,