All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org,
	Boris BREZILLON
	<b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Rob Landley <rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver
Date: Thu, 20 Mar 2014 10:37:53 +0800	[thread overview]
Message-ID: <532A5481.6000008@atmel.com> (raw)
In-Reply-To: <20140319102800.GW11706-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

Hi Mark,

On 03/19/2014 06:28 PM, Mark Brown wrote:
> On Wed, Mar 19, 2014 at 01:57:23PM +0800, Bo Shen wrote:
>> On 03/17/2014 07:55 PM, Mark Brown wrote:
>
>>> If this is a clock for the CODEC it should be documented as part of the
>>> binding for the CODEC and connected to the CODEC in the device tree
>>> rather than being part of a machine driver binding.
>
>> This is a optional clock for CODEC which depends on hardware design. There
>> are 3 options for this clock, wm8904 as an example.
>> 1. Using internal FLL, so won't use this clock.
>> 2. Using external oscillator, no need to retrieve this clock.
>> 3. Using SoC provide this clock (we use this case).
>
>> After considering these 3 options, if we put this into CODEC driver to do
>> it, I think it will be more complicate to do logic judgement. Do you think
>> so?
>
> There shouldn't be any meaningful complexity from the above cases -
> cases 2 and 3 are the same and if the clock isn't used at all then it
> can be omitted.  If the FLL is clocked from MCLK then the CODEC driver
> should be able to work out how to configure it easily, the device isn't
> like a digital hub CODEC with lots of clocking options.

For this, in my mind, I think we need add following parameters in DT.
1. sysclk_src_from_fll --> we need do nothing.
2. sysclk_src_from_mclk
    2.1 use_external_xtal --> we need clock_frequency
    2.2 !use_external_xtal --> we need retrieve clock and clock_frequency.

So, the dt may looks like:
for case 1:
wm8904: wm8904@1a {
	reg = <0x1a>;
	sysclk_src_from_fll;
}

for case 2.1:
wm8904: wm8904@1a {
	reg = <0x1a>;
	sysclk_src_from_mclk;
	use_external_xtal;
	clock_frequency = 12000000;
}

for case 2.2:
wm8904: wm8904@1a {
	reg = <0x1a>;
	sysclk_src_from_mclk;
	clocks = <&pck0>;
	clock-names = "mclk";
	clock_frequency = 32768;
}

Does this acceptable? Or any other better suggestion for this?

Best Regards,
Bo Shen

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Bo Shen <voice.shen@atmel.com>
To: Mark Brown <broonie@kernel.org>
Cc: <nicolas.ferre@atmel.com>,
	Boris BREZILLON <b.brezillon@overkiz.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>, Rob Landley <rob@landley.net>,
	<devicetree@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver
Date: Thu, 20 Mar 2014 10:37:53 +0800	[thread overview]
Message-ID: <532A5481.6000008@atmel.com> (raw)
In-Reply-To: <20140319102800.GW11706@sirena.org.uk>

Hi Mark,

On 03/19/2014 06:28 PM, Mark Brown wrote:
> On Wed, Mar 19, 2014 at 01:57:23PM +0800, Bo Shen wrote:
>> On 03/17/2014 07:55 PM, Mark Brown wrote:
>
>>> If this is a clock for the CODEC it should be documented as part of the
>>> binding for the CODEC and connected to the CODEC in the device tree
>>> rather than being part of a machine driver binding.
>
>> This is a optional clock for CODEC which depends on hardware design. There
>> are 3 options for this clock, wm8904 as an example.
>> 1. Using internal FLL, so won't use this clock.
>> 2. Using external oscillator, no need to retrieve this clock.
>> 3. Using SoC provide this clock (we use this case).
>
>> After considering these 3 options, if we put this into CODEC driver to do
>> it, I think it will be more complicate to do logic judgement. Do you think
>> so?
>
> There shouldn't be any meaningful complexity from the above cases -
> cases 2 and 3 are the same and if the clock isn't used at all then it
> can be omitted.  If the FLL is clocked from MCLK then the CODEC driver
> should be able to work out how to configure it easily, the device isn't
> like a digital hub CODEC with lots of clocking options.

For this, in my mind, I think we need add following parameters in DT.
1. sysclk_src_from_fll --> we need do nothing.
2. sysclk_src_from_mclk
    2.1 use_external_xtal --> we need clock_frequency
    2.2 !use_external_xtal --> we need retrieve clock and clock_frequency.

So, the dt may looks like:
for case 1:
wm8904: wm8904@1a {
	reg = <0x1a>;
	sysclk_src_from_fll;
}

for case 2.1:
wm8904: wm8904@1a {
	reg = <0x1a>;
	sysclk_src_from_mclk;
	use_external_xtal;
	clock_frequency = 12000000;
}

for case 2.2:
wm8904: wm8904@1a {
	reg = <0x1a>;
	sysclk_src_from_mclk;
	clocks = <&pck0>;
	clock-names = "mclk";
	clock_frequency = 32768;
}

Does this acceptable? Or any other better suggestion for this?

Best Regards,
Bo Shen


  parent reply	other threads:[~2014-03-20  2:37 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17  9:45 [PATCH 0/8] ARM: at91: sama5d3: enable sound support Bo Shen
2014-03-17  9:45 ` Bo Shen
2014-03-17  9:45 ` Bo Shen
2014-03-17  9:45 ` [PATCH 1/8] ARM: at91: sama5d3: add DMA property for SSC devices Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:47   ` Nicolas Ferre
2014-04-18 20:47     ` Nicolas Ferre
2014-04-18 20:47     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 2/8] ARM: at91: sama5d3: disable sound by default Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:49   ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 3/8] ARM: at91: sama5d3: correct the sound compatible string Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:49   ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 4/8] ARM: at91: sama5d3: add the missing property Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:50   ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 5/8] ARM: at91: sama5d3: clock for ssc from rk pin Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:50   ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 6/8] ASoC: atmel: support CCF based clks Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-03-17  9:55   ` Bo Shen
2014-03-17  9:55     ` Bo Shen
2014-03-17 10:31   ` Boris BREZILLON
2014-03-17  9:45 ` [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver Bo Shen
2014-03-17  9:54   ` Bo Shen
2014-03-17  9:54     ` Bo Shen
2014-03-17 10:02   ` Mark Rutland
     [not found]     ` <20140317100219.GB8070-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-03-17 10:18       ` boris brezillon
2014-03-17 10:18         ` boris brezillon
2014-03-17 10:48         ` Mark Rutland
2014-03-17 11:24           ` Boris BREZILLON
2014-03-17 11:30             ` Mark Rutland
2014-03-17 11:55   ` Mark Brown
2014-03-17 13:44     ` Boris BREZILLON
2014-03-17 15:28       ` Mark Brown
2014-03-19  5:57     ` Bo Shen
2014-03-19  5:57       ` Bo Shen
2014-03-19 10:28       ` Mark Brown
2014-03-19 10:28         ` Mark Brown
     [not found]         ` <20140319102800.GW11706-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-03-20  2:37           ` Bo Shen [this message]
2014-03-20  2:37             ` Bo Shen
2014-03-20 13:47             ` Mark Brown
2014-03-20 13:47               ` Mark Brown
2014-03-21  2:48               ` Bo Shen
2014-03-21  2:48                 ` Bo Shen
2014-03-17  9:45 ` [PATCH 8/8] ARM: at91/dt: add clock properties to the wm8904 codec node Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-03-17  9:55   ` Bo Shen
2014-03-17  9:55     ` Bo Shen
2014-03-17  9:55     ` Bo Shen
     [not found] ` <1395049541-28128-1-git-send-email-voice.shen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2014-04-18 20:35   ` [PATCH 0/8] ARM: at91: sama5d3: enable sound support Nicolas Ferre
2014-04-18 20:35     ` Nicolas Ferre
2014-04-18 20:35     ` Nicolas Ferre
2014-04-18 20:38     ` Mark Brown
2014-04-18 20:38       ` Mark Brown
2014-04-18 20:38       ` Mark Brown
2014-04-18 22:06     ` Boris BREZILLON
2014-04-18 22:06       ` Boris BREZILLON
2014-04-18 22:11       ` Nicolas Ferre
2014-04-18 22:11         ` Nicolas Ferre
2014-04-18 22:11         ` Nicolas Ferre

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=532A5481.6000008@atmel.com \
    --to=voice.shen-aife0yeh4naavxtiumwx3w@public.gmane.org \
    --cc=b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 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.