All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org,
	devicetree@vger.kernel.org, padma.v@samsung.com,
	sbkim73@samsung.com, drake@endlessm.com
Subject: Re: [alsa-devel] [PATCH/RFC 12/14] ASoC: samsung: i2s: Add clock provider for the I2S internal clocks
Date: Wed, 17 Dec 2014 18:00:10 +0100	[thread overview]
Message-ID: <5491B69A.6080901@samsung.com> (raw)
In-Reply-To: <20141212200342.GV11764@sirena.org.uk>

On 12/12/14 21:03, Mark Brown wrote:
> On Thu, Dec 11, 2014 at 06:45:50PM +0100, Sylwester Nawrocki wrote:
> 
>> +Optional Properties:
>>
>>  - samsung,idma-addr: Internal DMA register base address of the audio
>>    sub system(used in secondary sound source).
>>  - pinctrl-0: Should specify pin control groups used for this controller.
>>  - pinctrl-names: Should contain only one value - "default".
>> +- #clock-cells: should be 1, this property must be present if the I2S device
>> +  is a clock provider in terms of the common clock bindings, described in
>> +  ../clock/clock-bindings.txt.
>> +- clock-output-names: from the common clock bindings, names of the CDCLK
>> +  I2S output clocks, suggested values are "i2s_cdclk0", "i2s_cdclk1",
>> +  "i2s_cdclk3" for the I2S0, I2S1, I2S2 devices recpectively.
>> +
> 
> Why not make this mandatory going forwards?  You can add a note saying
> that older DTs may not have it.

I guess that makes more sense, I'll move it to the mandatory properties
section.

>> +The assignment of indices for the I2Sx clock provider is as follows:
>> + 0 - the CDCLK (CODECLKO) gate clock,
>> + 1 - the RCLK prescaler divider clock (corresponding to the IISPSR register),
>> + 2 - the RCLKSRC mux clock (corresponding to RCLKSRC bit in register IISMOD).
> 
> Why use the indicies here, they only seem to add obscurity?

I didn't want to create a separate header file, with all the GPL copyright
notice header etc, for just this enumeration.
Anyway I'll put these as macro definitions into include/dt-bindings/sound
/samsung-i2s.h.

>> +		clk_put(rclksrc);
>> +	}
>> +	/*
> 
> Missing blank line.
> 
>> +	 * Register the mux and div clocks only if both source clocks
>> +	 * are available, i.e. for the I2S0 instance and versions with
>> +	 * QUIRK_NO_MUXPSR quirk not set.
>> +	 */
> 
> Why not proceed even if one is missing?  This repeats in words the if
> statement but doesn't explain why we're doing this.

Right, I should have said here that this is really to distinguish between
I2S0 and I2S1, I2S2. So we register the mux and div clocks only for
the IIS Multi Audio Interface (I2S0) and not for the IIS Bus Interface
(I2S1, I2S2) instances.
However, it seems I got confused by same compatible string set for
I2S0..I2S2 in arch/arm/boot/dts/exynos4.dtsi - "samsung,s5pv210-i2s",
where for I2S1, I2S2 it should be "samsung,s3c6410-i2s". So we have,
for example, QUIRK_NO_MUXPSR set for them. There seems to be no similar
bug in arch/arm/boot/dts/exynos5250.dtsi.
I'll drop that mux input clock test the and fix the compatible strings
for exynos4 in dts.

>> +	ret = of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
>> +				  &i2s->clk_data);
>> +	if (ret < 0) {
>> +		dev_err(dev, "failed to add clock provider\n");
> 
> Best practice is to print the error code.

Yeah, I'll add it.

--
Regards,
Sylwester

  reply	other threads:[~2014-12-17 17:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 17:45 [PATCH/RFC 00/14] ASoC: samsung: Add clk provider for I2S internal clocks Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 01/14] ASoC: samsung: i2s: Remove unused gpios field from struct i2s Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 02/14] ASoC: samsung: i2s: samsung_i2s_get_driver_data() cleanup Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 03/14] ASoC: samsung: i2s: Add return value checks in probe() Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 04/14] ASoC: samsung: i2s: Request memory region in driver probe() Sylwester Nawrocki
2014-12-12 18:49   ` Mark Brown
2014-12-17 15:10     ` Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 05/14] ASoC: samsung: i2s: Move clk_get() to platform " Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 06/14] ASoC: samsung: i2s: Move clk enable to the " Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 07/14] ASoC: samsung: i2s: Add get_other_dai helper function Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 08/14] ASoC: samsung: i2s: Remove an unneeded goto usage Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 09/14] ASoC: samsung: i2s: Add spinlock in place of local_irq_* calls Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 10/14] ASoC: samsung: i2s: Protect access to more registers with a spinlock Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 11/14] ASoC: samsung: odroidx2: Handle I2S CDCLK clock conditionally Sylwester Nawrocki
2014-12-12 18:53   ` Mark Brown
2014-12-17 15:18     ` Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 12/14] ASoC: samsung: i2s: Add clock provider for the I2S internal clocks Sylwester Nawrocki
2014-12-12 20:03   ` [alsa-devel] " Mark Brown
2014-12-17 17:00     ` Sylwester Nawrocki [this message]
2014-12-11 17:45 ` [PATCH/RFC 13/14] ARM: dts: Exynos4 and Odroid X2/U3 sound device nodes update Sylwester Nawrocki
2014-12-11 17:45 ` [PATCH/RFC 14/14] ARM: dts: Switch Odroid X2/U2 to simple-audio-card Sylwester Nawrocki
2014-12-16  3:16 ` [alsa-devel] [PATCH/RFC 00/14] ASoC: samsung: Add clk provider for I2S internal clocks Padma Venkat
2014-12-19 13:53   ` Sylwester Nawrocki

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=5491B69A.6080901@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=drake@endlessm.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=padma.v@samsung.com \
    --cc=sbkim73@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.