All of lore.kernel.org
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: Paul Bolle <pebolle@tiscali.nl>
Cc: <mturquette@baylibre.com>, <linux-kernel@vger.kernel.org>,
	<linux-i2c@vger.kernel.org>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Andrey Filippov <andrey@elphel.com>
Subject: Re: [Patch v2] driver/clk/clk-si5338: Add common clock framework driver for si5338
Date: Tue, 16 Jun 2015 08:18:01 -0700	[thread overview]
Message-ID: <55803E29.2040800@freescale.com> (raw)
In-Reply-To: <1434442897.2069.66.camel@x220>

Paul,

Thanks for reviewing.

On 06/16/2015 01:21 AM, Paul Bolle wrote:
> One question and a few nits follow.
> 
> On Mon, 2015-06-15 at 10:07 -0700, York Sun wrote:
>> SI5338 is a programmable clock generator. It has 4 sets of inputs,
>> PLL, multisynth and dividers to make 4 outputs. This driver splits
>> them into multiple clocks to comply with common clock framework.
>>
>> See Documentation/devicetree/bindings/clock/silabs,si5338.txt for
>> details.
>>
>> Signed-off-by: York Sun <yorksun@freescale.com>
>> CC: Mike Turquette <mturquette@linaro.org>
> 
> Apparently that's now mturquette@baylibre.com .

Thanks. Will change.

> 
>> CC: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>> CC: Guenter Roeck <linux@roeck-us.net>
>> CC: Andrey Filippov <andrey@elphel.com>
> 
>> --- a/drivers/clk/Kconfig
>> +++ b/drivers/clk/Kconfig
> 
>>  config COMMON_CLK
>> -	bool
>> +	tristate "Common Clock"
>>  	select HAVE_CLK_PREPARE
>>  	select CLKDEV_LOOKUP
>>  	select SRCU
> 
> Why? The commit explanation doesn't mention this. Did you use an unclean
> tree? If not, you just created over a dozen of new modules:

Thanks for catching this. I was testing building the driver within and outside
of kernel tree for another kernel version. If this driver is built-in, I don't
need to make it tristate. Will revert in next version.

>     $ git grep -nw CONFIG_COMMON_CLK -- "*Makefile*"
>     arch/arm/mach-mmp/Makefile:13:ifeq ($(CONFIG_COMMON_CLK), )
>     arch/arm/mach-shmobile/Makefile:21:ifndef CONFIG_COMMON_CLK
>     arch/powerpc/platforms/512x/Makefile:4:obj-$(CONFIG_COMMON_CLK) += clock-commonclk.o
>     drivers/clk/Makefile:4:obj-$(CONFIG_COMMON_CLK) += clk.o
>     drivers/clk/Makefile:5:obj-$(CONFIG_COMMON_CLK) += clk-divider.o
>     drivers/clk/Makefile:6:obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
>     drivers/clk/Makefile:7:obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o
>     drivers/clk/Makefile:8:obj-$(CONFIG_COMMON_CLK) += clk-gate.o
>     drivers/clk/Makefile:9:obj-$(CONFIG_COMMON_CLK) += clk-mux.o
>     drivers/clk/Makefile:10:obj-$(CONFIG_COMMON_CLK)        += clk-composite.o
>     drivers/clk/Makefile:11:obj-$(CONFIG_COMMON_CLK)        += clk-fractional-divider.o
>     drivers/clk/Makefile:12:obj-$(CONFIG_COMMON_CLK)        += clk-gpio-gate.o
>     drivers/clk/Makefile:14:obj-$(CONFIG_COMMON_CLK)        += clk-conf.o
>     drivers/clk/Makefile:59:ifeq ($(CONFIG_COMMON_CLK), y)
>     drivers/clk/samsung/Makefile:5:obj-$(CONFIG_COMMON_CLK) += clk.o clk-pll.o
>     drivers/gpu/drm/msm/Makefile:53:msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o
>     drivers/sh/Makefile:5:ifneq ($(CONFIG_COMMON_CLK),y)
> 
>> +config COMMON_CLK_SI5338
>> +	tristate "Clock driver for SiLabs 5338"
>> +	depends on I2C
>> +	select REGMAP_I2C
>> +	select RATIONAL
>> +	---help---
>> +	  This driver supports Silicon Labs 5338 programmable clock generators,
>> +	  using common clock framework. It needs parent clock as input(s).
>> +	  Internal clocks are registered with unique names in case multiple
>> +	  devices exist. See devicetree/bindings/clock/silabs,si5338.txt
>> +	  under Documentation for details.
> 
>> --- /dev/null
>> +++ b/drivers/clk/clk-si5338.c
> 
>> +unsigned long si5338_divrefclk_recalc_rate(struct clk_hw *hw,
>> +					   unsigned long parent_rate)
>> +{
>> +	[...]
>> +}
> 
> Can't this be made static? It compiles cleanly with static too. Is there
> some subtle issue I'm missing?
> 

Absolutely. I must have missed them for some functions.


>> +static const struct clk_ops si5338_divrefclk_ops = {
>> +	.recalc_rate = si5338_divrefclk_recalc_rate,
>> +};
> 
>> +unsigned long si5338_divfbclk_recalc_rate(struct clk_hw *hw,
>> +					   unsigned long parent_rate)
>> +{
>> +	[...]
>> +}
> 
> Ditto.
> 
>> +static const struct clk_ops si5338_divfbclk_ops = {
>> +	.recalc_rate = si5338_divfbclk_recalc_rate,
>> +};
> 
>> --- /dev/null
>> +++ b/include/dt-bindings/clock/clk-si5338.h
> 
>> +#ifndef _DT_BINDINGS_CLK_DSI5338_H
>> +#define _DT_BINDINGS_CLK_DSI5338_H
> 
> (I spotted a D that looks odd here.)

Me, too. It takes fresh eyes to spot this non-sense error.

> 
> And git am whines:
>     new blank line at EOF.

Thanks.

York

WARNING: multiple messages have this Message-ID (diff)
From: York Sun <yorksun-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Paul Bolle <pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
Cc: mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Sebastian Hesselbarth
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
	Andrey Filippov <andrey-MoRZu3FOBbXQT0dZR+AlfA@public.gmane.org>
Subject: Re: [Patch v2] driver/clk/clk-si5338: Add common clock framework driver for si5338
Date: Tue, 16 Jun 2015 08:18:01 -0700	[thread overview]
Message-ID: <55803E29.2040800@freescale.com> (raw)
In-Reply-To: <1434442897.2069.66.camel@x220>

Paul,

Thanks for reviewing.

On 06/16/2015 01:21 AM, Paul Bolle wrote:
> One question and a few nits follow.
> 
> On Mon, 2015-06-15 at 10:07 -0700, York Sun wrote:
>> SI5338 is a programmable clock generator. It has 4 sets of inputs,
>> PLL, multisynth and dividers to make 4 outputs. This driver splits
>> them into multiple clocks to comply with common clock framework.
>>
>> See Documentation/devicetree/bindings/clock/silabs,si5338.txt for
>> details.
>>
>> Signed-off-by: York Sun <yorksun-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>> CC: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> Apparently that's now mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org .

Thanks. Will change.

> 
>> CC: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> CC: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
>> CC: Andrey Filippov <andrey-MoRZu3FOBbXQT0dZR+AlfA@public.gmane.org>
> 
>> --- a/drivers/clk/Kconfig
>> +++ b/drivers/clk/Kconfig
> 
>>  config COMMON_CLK
>> -	bool
>> +	tristate "Common Clock"
>>  	select HAVE_CLK_PREPARE
>>  	select CLKDEV_LOOKUP
>>  	select SRCU
> 
> Why? The commit explanation doesn't mention this. Did you use an unclean
> tree? If not, you just created over a dozen of new modules:

Thanks for catching this. I was testing building the driver within and outside
of kernel tree for another kernel version. If this driver is built-in, I don't
need to make it tristate. Will revert in next version.

>     $ git grep -nw CONFIG_COMMON_CLK -- "*Makefile*"
>     arch/arm/mach-mmp/Makefile:13:ifeq ($(CONFIG_COMMON_CLK), )
>     arch/arm/mach-shmobile/Makefile:21:ifndef CONFIG_COMMON_CLK
>     arch/powerpc/platforms/512x/Makefile:4:obj-$(CONFIG_COMMON_CLK) += clock-commonclk.o
>     drivers/clk/Makefile:4:obj-$(CONFIG_COMMON_CLK) += clk.o
>     drivers/clk/Makefile:5:obj-$(CONFIG_COMMON_CLK) += clk-divider.o
>     drivers/clk/Makefile:6:obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
>     drivers/clk/Makefile:7:obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o
>     drivers/clk/Makefile:8:obj-$(CONFIG_COMMON_CLK) += clk-gate.o
>     drivers/clk/Makefile:9:obj-$(CONFIG_COMMON_CLK) += clk-mux.o
>     drivers/clk/Makefile:10:obj-$(CONFIG_COMMON_CLK)        += clk-composite.o
>     drivers/clk/Makefile:11:obj-$(CONFIG_COMMON_CLK)        += clk-fractional-divider.o
>     drivers/clk/Makefile:12:obj-$(CONFIG_COMMON_CLK)        += clk-gpio-gate.o
>     drivers/clk/Makefile:14:obj-$(CONFIG_COMMON_CLK)        += clk-conf.o
>     drivers/clk/Makefile:59:ifeq ($(CONFIG_COMMON_CLK), y)
>     drivers/clk/samsung/Makefile:5:obj-$(CONFIG_COMMON_CLK) += clk.o clk-pll.o
>     drivers/gpu/drm/msm/Makefile:53:msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o
>     drivers/sh/Makefile:5:ifneq ($(CONFIG_COMMON_CLK),y)
> 
>> +config COMMON_CLK_SI5338
>> +	tristate "Clock driver for SiLabs 5338"
>> +	depends on I2C
>> +	select REGMAP_I2C
>> +	select RATIONAL
>> +	---help---
>> +	  This driver supports Silicon Labs 5338 programmable clock generators,
>> +	  using common clock framework. It needs parent clock as input(s).
>> +	  Internal clocks are registered with unique names in case multiple
>> +	  devices exist. See devicetree/bindings/clock/silabs,si5338.txt
>> +	  under Documentation for details.
> 
>> --- /dev/null
>> +++ b/drivers/clk/clk-si5338.c
> 
>> +unsigned long si5338_divrefclk_recalc_rate(struct clk_hw *hw,
>> +					   unsigned long parent_rate)
>> +{
>> +	[...]
>> +}
> 
> Can't this be made static? It compiles cleanly with static too. Is there
> some subtle issue I'm missing?
> 

Absolutely. I must have missed them for some functions.


>> +static const struct clk_ops si5338_divrefclk_ops = {
>> +	.recalc_rate = si5338_divrefclk_recalc_rate,
>> +};
> 
>> +unsigned long si5338_divfbclk_recalc_rate(struct clk_hw *hw,
>> +					   unsigned long parent_rate)
>> +{
>> +	[...]
>> +}
> 
> Ditto.
> 
>> +static const struct clk_ops si5338_divfbclk_ops = {
>> +	.recalc_rate = si5338_divfbclk_recalc_rate,
>> +};
> 
>> --- /dev/null
>> +++ b/include/dt-bindings/clock/clk-si5338.h
> 
>> +#ifndef _DT_BINDINGS_CLK_DSI5338_H
>> +#define _DT_BINDINGS_CLK_DSI5338_H
> 
> (I spotted a D that looks odd here.)

Me, too. It takes fresh eyes to spot this non-sense error.

> 
> And git am whines:
>     new blank line at EOF.

Thanks.

York

  reply	other threads:[~2015-06-16 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 17:07 [Patch v2] driver/clk/clk-si5338: Add common clock framework driver for si5338 York Sun
2015-06-15 17:07 ` York Sun
2015-06-16  8:21 ` Paul Bolle
2015-06-16 15:18   ` York Sun [this message]
2015-06-16 15:18     ` York Sun
2015-06-16 15:38     ` York Sun
2015-06-16 15:38       ` York Sun

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=55803E29.2040800@freescale.com \
    --to=yorksun@freescale.com \
    --cc=andrey@elphel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mturquette@baylibre.com \
    --cc=pebolle@tiscali.nl \
    --cc=sebastian.hesselbarth@gmail.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.