mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jai Luthra <j-luthra@ti.com>
To: Francesco Dolcini <francesco@dolcini.it>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: Francesco Dolcini <francesco.dolcini@toradex.com>,
	<linux-kernel@vger.kernel.org>, <linux-clk@vger.kernel.org>
Subject: Re: [PATCH v1] clk: keystone: syscon-clk: Fix audio refclk
Date: Mon, 31 Jul 2023 16:07:52 +0530	[thread overview]
Message-ID: <857a5ea2-1440-58ee-3a42-c16a1c2f3849@ti.com> (raw)
In-Reply-To: <20230728222639.110409-1-francesco@dolcini.it>


[-- Attachment #1.1.1: Type: text/plain, Size: 2018 bytes --]

Hi Francesco,

On 29/07/23 03:56, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> Audio REFCLK's are not working correctly, trying to use them lead to the
> following errors:
> 
> [    6.575277] of_clk_hw_onecell_get: invalid index 4294934528
> [    6.581515] wm8904 1-001a: Failed to get MCLK
> [    6.586290] wm8904: probe of 1-001a failed with error -2
> 
> The issue is that Audio REFCLK has #clock-cells = 0 [1], while the driver
> is registering those clocks assuming they have one cells. Fix this by
> registering the clock with of_clk_hw_simple_get() when there is only one
> instance, e.g. "audio_refclk".

Good catch, I didn't encounter the dmesg error during my tests - 
probably because of zero-initialized structs so idx = 0.

> 
> [1] Documentation/devicetree/bindings/clock/ti,am62-audio-refclk.yaml
> 
> Fixes: 6acab96ee337 ("clk: keystone: syscon-clk: Add support for audio refclk")
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Reviewed-by: Jai Luthra <j-luthra@ti.com>

> ---
>   drivers/clk/keystone/syscon-clk.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/keystone/syscon-clk.c b/drivers/clk/keystone/syscon-clk.c
> index d33f74119488..6b335ce5cc26 100644
> --- a/drivers/clk/keystone/syscon-clk.c
> +++ b/drivers/clk/keystone/syscon-clk.c
> @@ -151,8 +151,12 @@ static int ti_syscon_gate_clk_probe(struct platform_device *pdev)
>   				 data[i].name);
>   	}
>   
> -	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
> -					   hw_data);
> +	if (num_clks == 1)
> +		return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
> +						   hw_data->hws[0]);
> +	else
> +		return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
> +						   hw_data);
>   }
>   
>   #define TI_SYSCON_CLK_GATE(_name, _offset, _bit_idx)	\

-- 
Thanks,
Jai

GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 4947 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-07-31 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 22:26 Francesco Dolcini
2023-07-31 10:37 ` Jai Luthra [this message]
2023-08-05  1:12 ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=857a5ea2-1440-58ee-3a42-c16a1c2f3849@ti.com \
    --to=j-luthra@ti.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=ssantosh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®