All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Afzal Mohammed <afzal@ti.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, spear-devel@list.st.com,
	Paul Walmsley <paul@pwsan.com>,
	Mike Turquette <mturquette@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>, Tony Lindgren <tony@atomide.com>,
	Chao Xie <xiechao.mail@gmail.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Viresh Kumar <viresh.linux@gmail.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Russell King <linux@arm.linux.org.uk>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [PATCH 1/2] clk: divider: prepare for minimum divider
Date: Tue, 22 Jan 2013 10:28:31 -0800	[thread overview]
Message-ID: <50FEDA4F.4060405@codeaurora.org> (raw)
In-Reply-To: <d20165dfc67970c3429b9d95ac9631015f8b2396.1358870920.git.afzal@ti.com>

On 01/22/13 08:39, Afzal Mohammed wrote:
> diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
> index a9204c6..0b34992 100644
> --- a/drivers/clk/clk-divider.c
> +++ b/drivers/clk/clk-divider.c
> @@ -236,7 +236,7 @@ EXPORT_SYMBOL_GPL(clk_divider_ops);
>  
>  static struct clk *_register_divider(struct device *dev, const char *name,
>  		const char *parent_name, unsigned long flags,
> -		void __iomem *reg, u8 shift, u8 width,
> +		void __iomem *reg, u8 shift, u8 width, u8 min_div,
>  		u8 clk_divider_flags, const struct clk_div_table *table,
>  		spinlock_t *lock)
>  {
> @@ -261,6 +261,7 @@ static struct clk *_register_divider(struct device *dev, const char *name,
>  	div->reg = reg;
>  	div->shift = shift;
>  	div->width = width;
> +	div->min_div = min_div;
>  	div->flags = clk_divider_flags;
>  	div->lock = lock;
>  	div->hw.init = &init;
> @@ -284,16 +285,17 @@ static struct clk *_register_divider(struct device *dev, const char *name,
>   * @reg: register address to adjust divider
>   * @shift: number of bits to shift the bitfield
>   * @width: width of the bitfield
> + * @min_div: minimum allowable divider value
>   * @clk_divider_flags: divider-specific flags for this clock
>   * @lock: shared register lock for this clock
>   */
>  struct clk *clk_register_divider(struct device *dev, const char *name,
>  		const char *parent_name, unsigned long flags,
> -		void __iomem *reg, u8 shift, u8 width,
> +		void __iomem *reg, u8 shift, u8 width, u8 min_div,
>  		u8 clk_divider_flags, spinlock_t *lock)
>  {
>  	return _register_divider(dev, name, parent_name, flags, reg, shift,
> -			width, clk_divider_flags, NULL, lock);
> +			width, min_div, clk_divider_flags, NULL, lock);
>  }

Can you make a new function, clk_register_min_divider(), to avoid
disturbing all users of clock dividers that don't have a minimum? Then
the default can be put into the two registration functions in
clk-divider.c and you don't have to change all clock divider users
across the tree.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] clk: divider: prepare for minimum divider
Date: Tue, 22 Jan 2013 10:28:31 -0800	[thread overview]
Message-ID: <50FEDA4F.4060405@codeaurora.org> (raw)
In-Reply-To: <d20165dfc67970c3429b9d95ac9631015f8b2396.1358870920.git.afzal@ti.com>

On 01/22/13 08:39, Afzal Mohammed wrote:
> diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
> index a9204c6..0b34992 100644
> --- a/drivers/clk/clk-divider.c
> +++ b/drivers/clk/clk-divider.c
> @@ -236,7 +236,7 @@ EXPORT_SYMBOL_GPL(clk_divider_ops);
>  
>  static struct clk *_register_divider(struct device *dev, const char *name,
>  		const char *parent_name, unsigned long flags,
> -		void __iomem *reg, u8 shift, u8 width,
> +		void __iomem *reg, u8 shift, u8 width, u8 min_div,
>  		u8 clk_divider_flags, const struct clk_div_table *table,
>  		spinlock_t *lock)
>  {
> @@ -261,6 +261,7 @@ static struct clk *_register_divider(struct device *dev, const char *name,
>  	div->reg = reg;
>  	div->shift = shift;
>  	div->width = width;
> +	div->min_div = min_div;
>  	div->flags = clk_divider_flags;
>  	div->lock = lock;
>  	div->hw.init = &init;
> @@ -284,16 +285,17 @@ static struct clk *_register_divider(struct device *dev, const char *name,
>   * @reg: register address to adjust divider
>   * @shift: number of bits to shift the bitfield
>   * @width: width of the bitfield
> + * @min_div: minimum allowable divider value
>   * @clk_divider_flags: divider-specific flags for this clock
>   * @lock: shared register lock for this clock
>   */
>  struct clk *clk_register_divider(struct device *dev, const char *name,
>  		const char *parent_name, unsigned long flags,
> -		void __iomem *reg, u8 shift, u8 width,
> +		void __iomem *reg, u8 shift, u8 width, u8 min_div,
>  		u8 clk_divider_flags, spinlock_t *lock)
>  {
>  	return _register_divider(dev, name, parent_name, flags, reg, shift,
> -			width, clk_divider_flags, NULL, lock);
> +			width, min_div, clk_divider_flags, NULL, lock);
>  }

Can you make a new function, clk_register_min_divider(), to avoid
disturbing all users of clock dividers that don't have a minimum? Then
the default can be put into the two registration functions in
clk-divider.c and you don't have to change all clock divider users
across the tree.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2013-01-22 18:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 16:39 [PATCH 1/2] clk: divider: prepare for minimum divider Afzal Mohammed
2013-01-22 16:39 ` Afzal Mohammed
2013-01-22 16:39 ` Afzal Mohammed
2013-01-22 16:40 ` [PATCH 2/2] clk: divider: handle " Afzal Mohammed
2013-01-22 16:40   ` Afzal Mohammed
2013-01-22 16:40   ` Afzal Mohammed
2013-01-22 18:28 ` Stephen Boyd [this message]
2013-01-22 18:28   ` [PATCH 1/2] clk: divider: prepare for " 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=50FEDA4F.4060405@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=afzal@ti.com \
    --cc=arnd@arndb.de \
    --cc=haojian.zhuang@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mturquette@linaro.org \
    --cc=paul@pwsan.com \
    --cc=shawn.guo@linaro.org \
    --cc=spear-devel@list.st.com \
    --cc=tony@atomide.com \
    --cc=viresh.linux@gmail.com \
    --cc=xiechao.mail@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.