linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Jiada Wang <jiada_wang@mentor.com>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"perex@perex.cz" <perex@perex.cz>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"vladimir_zapolskiy@mentor.com" <vladimir_zapolskiy@mentor.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH linux-next v3 6/7] ASoC: rsnd: add avb clocks
Date: Wed, 5 Dec 2018 08:58:44 +0000	[thread overview]
Message-ID: <87va48bbpa.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <20181205074932.28098-1-jiada_wang@mentor.com>


Hi Jiada

> There are AVB Counter Clocks in ADG, each clock has 12bits integral
> and 8 bits fractional dividers which operates with S0D1ϕ clock.
> 
> This patch registers 8 AVB Counter Clocks when clock-cells of
> rcar_sound node is 2,
> 
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> ---


> +static void clk_avb_div_write(struct rsnd_adg *adg, u32 data, unsigned int idx)
(snip)
> +static u32 clk_avb_div_read(struct rsnd_adg *adg, unsigned int idx)

As I mentioned before, I think we can avoid confusable parameter by

	static void clk_avb_div_write(struct clk_avb *avb, u32 data)
	static u32 clk_avb_div_read(struct clk_avb)	

	div = clk_avb_div_read(avb);
	clk_avb_div_write(avb, val | div);

> +static struct clk *clk_register_avb(struct device *dev, struct rsnd_adg *adg,
> +				    unsigned int id, spinlock_t *lock)
> +{
> +	struct clk_init_data init;
> +	struct clk_avb *avb;
> +	struct clk *clk;
> +	char name[8];
> +	const char *parent_name;
> +
> +	if (IS_ERR(adg->clkadg))
> +		return ERR_PTR(-ENODEV);

I think adg->clkadg will never hit to IS_ERR().
It will have NULL or correct pointer.

	clk = devm_clk_get(dev, "adg");
	if (!IS_ERR(clk))
		adg->clkadg = clk;

And this "adg" clock is strange.
see below

> +	avb = devm_kzalloc(dev, sizeof(*avb), GFP_KERNEL);
> +	if (!avb)
> +		return ERR_PTR(-ENOMEM);
> +
> +	parent_name = __clk_get_name(adg->clkadg);

This parent_name is very strange to me.
AVB parent clk is "AUDIO_CLK_A/B/C/I" (= clk_a/b/c/i in this driver)
or "AUDIO_CLK_OUT_A/B/C/D" (= audio_clkout/1/2/3 in this driver).
And we don't have "adg" clock.
Please double check it.

Best regards
---
Kuninori Morimoto

  reply	other threads:[~2018-12-05  8:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05  7:49 [PATCH linux-next v3 6/7] ASoC: rsnd: add avb clocks Jiada Wang
2018-12-05  8:58 ` Kuninori Morimoto [this message]
2018-12-05 12:16   ` Jiada Wang
2018-12-06  0:59     ` Kuninori Morimoto
2018-12-06  5:04       ` Jiada Wang
2018-12-06  5:38         ` Kuninori Morimoto
2018-12-06  7:32           ` Jiada Wang

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=87va48bbpa.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jiada_wang@mentor.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=vladimir_zapolskiy@mentor.com \
    /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;
as well as URLs for NNTP newsgroup(s).