All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kukjin Kim <kgene.kim@samsung.com>
To: 'Naveen Krishna Chatradhi' <ch.naveen@samsung.com>,
	jassisinghbrar@gmail.com, sbkim73@samsung.com,
	sw.youn@samsung.com, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: RE: [PATCH v2 1/3] ARM: Samsung: Move duplicate code
Date: Mon, 18 Jul 2011 14:35:32 +0900	[thread overview]
Message-ID: <048401cc450c$85a9e5d0$90fdb170$%kim@samsung.com> (raw)
In-Reply-To: <1308655463-8787-2-git-send-email-ch.naveen@samsung.com>

Naveen Krishna Chatradhi wrote:
> 
> Move the duplicated code for SPDIF ops from S5PV210 and S5PC100.
> So, the same can be used in EXYNOS4.
> 
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> ---
> Note: Moved common code to plat-s5p, as suggested by Kukjin Kim.

Yes, I did :)
Looks ok to me, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> 
>  arch/arm/mach-s5pc100/clock.c              |   37
+---------------------------
>  arch/arm/mach-s5pv210/clock.c              |   37
+---------------------------
>  arch/arm/plat-s5p/clock.c                  |   35
> ++++++++++++++++++++++++++
>  arch/arm/plat-s5p/include/plat/s5p-clock.h |    5 ++++
>  4 files changed, 42 insertions(+), 72 deletions(-)
> 
> diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
> index cd248e6..ff5cbb3 100644
> --- a/arch/arm/mach-s5pc100/clock.c
> +++ b/arch/arm/mach-s5pc100/clock.c
> @@ -910,47 +910,12 @@ struct clksrc_sources clk_src_sclk_spdif = {
>  	.nr_sources	= ARRAY_SIZE(clk_sclk_spdif_list),
>  };
> 
> -static int s5pc100_spdif_set_rate(struct clk *clk, unsigned long rate)
> -{
> -	struct clk *pclk;
> -	int ret;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	ret = pclk->ops->set_rate(pclk, rate);
> -	clk_put(pclk);
> -
> -	return ret;
> -}
> -
> -static unsigned long s5pc100_spdif_get_rate(struct clk *clk)
> -{
> -	struct clk *pclk;
> -	int rate;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	rate = pclk->ops->get_rate(clk);
> -	clk_put(pclk);
> -
> -	return rate;
> -}
> -
> -static struct clk_ops s5pc100_sclk_spdif_ops = {
> -	.set_rate	= s5pc100_spdif_set_rate,
> -	.get_rate	= s5pc100_spdif_get_rate,
> -};
> -
>  static struct clksrc_clk clk_sclk_spdif = {
>  	.clk	= {
>  		.name		= "sclk_spdif",
>  		.ctrlbit	= (1 << 11),
>  		.enable		= s5pc100_sclk1_ctrl,
> -		.ops		= &s5pc100_sclk_spdif_ops,
> +		.ops		= &s5p_sclk_spdif_ops,
>  	},
>  	.sources = &clk_src_sclk_spdif,
>  	.reg_src = { .reg = S5P_CLK_SRC3, .shift = 24, .size = 2 },
> diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
> index b5c95e6..ae72f87 100644
> --- a/arch/arm/mach-s5pv210/clock.c
> +++ b/arch/arm/mach-s5pv210/clock.c
> @@ -686,47 +686,12 @@ static struct clksrc_sources clkset_sclk_spdif = {
>  	.nr_sources	= ARRAY_SIZE(clkset_sclk_spdif_list),
>  };
> 
> -static int s5pv210_spdif_set_rate(struct clk *clk, unsigned long rate)
> -{
> -	struct clk *pclk;
> -	int ret;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	ret = pclk->ops->set_rate(pclk, rate);
> -	clk_put(pclk);
> -
> -	return ret;
> -}
> -
> -static unsigned long s5pv210_spdif_get_rate(struct clk *clk)
> -{
> -	struct clk *pclk;
> -	int rate;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	rate = pclk->ops->get_rate(clk);
> -	clk_put(pclk);
> -
> -	return rate;
> -}
> -
> -static struct clk_ops s5pv210_sclk_spdif_ops = {
> -	.set_rate	= s5pv210_spdif_set_rate,
> -	.get_rate	= s5pv210_spdif_get_rate,
> -};
> -
>  static struct clksrc_clk clk_sclk_spdif = {
>  	.clk		= {
>  		.name		= "sclk_spdif",
>  		.enable		= s5pv210_clk_mask0_ctrl,
>  		.ctrlbit	= (1 << 27),
> -		.ops		= &s5pv210_sclk_spdif_ops,
> +		.ops		= &s5p_sclk_spdif_ops,
>  	},
>  	.sources = &clkset_sclk_spdif,
>  	.reg_src = { .reg = S5P_CLK_SRC6, .shift = 12, .size = 2 },
> diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c
> index 8d081d9..02af235 100644
> --- a/arch/arm/plat-s5p/clock.c
> +++ b/arch/arm/plat-s5p/clock.c
> @@ -168,6 +168,41 @@ unsigned long s5p_epll_get_rate(struct clk *clk)
>  	return clk->rate;
>  }
> 
> +int s5p_spdif_set_rate(struct clk *clk, unsigned long rate)
> +{
> +	struct clk *pclk;
> +	int ret;
> +
> +	pclk = clk_get_parent(clk);
> +	if (IS_ERR(pclk))
> +		return -EINVAL;
> +
> +	ret = pclk->ops->set_rate(pclk, rate);
> +	clk_put(pclk);
> +
> +	return ret;
> +}
> +
> +unsigned long s5p_spdif_get_rate(struct clk *clk)
> +{
> +	struct clk *pclk;
> +	int rate;
> +
> +	pclk = clk_get_parent(clk);
> +	if (IS_ERR(pclk))
> +		return -EINVAL;
> +
> +	rate = pclk->ops->get_rate(clk);
> +	clk_put(pclk);
> +
> +	return rate;
> +}
> +
> +struct clk_ops s5p_sclk_spdif_ops = {
> +	.set_rate	= s5p_spdif_set_rate,
> +	.get_rate	= s5p_spdif_get_rate,
> +};
> +
>  static struct clk *s5p_clks[] __initdata = {
>  	&clk_ext_xtal_mux,
>  	&clk_48m,
> diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-
> s5p/include/plat/s5p-clock.h
> index 2b6dcff..769b5bd 100644
> --- a/arch/arm/plat-s5p/include/plat/s5p-clock.h
> +++ b/arch/arm/plat-s5p/include/plat/s5p-clock.h
> @@ -47,4 +47,9 @@ extern int s5p_gatectrl(void __iomem *reg, struct clk
*clk, int
> enable);
>  extern int s5p_epll_enable(struct clk *clk, int enable);
>  extern unsigned long s5p_epll_get_rate(struct clk *clk);
> 
> +/* SPDIF clk operations common for S5PC100/V210/C110 and Exynos4 */
> +extern int s5p_spdif_set_rate(struct clk *clk, unsigned long rate);
> +extern unsigned long s5p_spdif_get_rate(struct clk *clk);
> +
> +extern struct clk_ops s5p_sclk_spdif_ops;
>  #endif /* __ASM_PLAT_S5P_CLOCK_H */
> --
> 1.7.2.3

WARNING: multiple messages have this Message-ID (diff)
From: kgene.kim@samsung.com (Kukjin Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] ARM: Samsung: Move duplicate code
Date: Mon, 18 Jul 2011 14:35:32 +0900	[thread overview]
Message-ID: <048401cc450c$85a9e5d0$90fdb170$%kim@samsung.com> (raw)
In-Reply-To: <1308655463-8787-2-git-send-email-ch.naveen@samsung.com>

Naveen Krishna Chatradhi wrote:
> 
> Move the duplicated code for SPDIF ops from S5PV210 and S5PC100.
> So, the same can be used in EXYNOS4.
> 
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> ---
> Note: Moved common code to plat-s5p, as suggested by Kukjin Kim.

Yes, I did :)
Looks ok to me, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> 
>  arch/arm/mach-s5pc100/clock.c              |   37
+---------------------------
>  arch/arm/mach-s5pv210/clock.c              |   37
+---------------------------
>  arch/arm/plat-s5p/clock.c                  |   35
> ++++++++++++++++++++++++++
>  arch/arm/plat-s5p/include/plat/s5p-clock.h |    5 ++++
>  4 files changed, 42 insertions(+), 72 deletions(-)
> 
> diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
> index cd248e6..ff5cbb3 100644
> --- a/arch/arm/mach-s5pc100/clock.c
> +++ b/arch/arm/mach-s5pc100/clock.c
> @@ -910,47 +910,12 @@ struct clksrc_sources clk_src_sclk_spdif = {
>  	.nr_sources	= ARRAY_SIZE(clk_sclk_spdif_list),
>  };
> 
> -static int s5pc100_spdif_set_rate(struct clk *clk, unsigned long rate)
> -{
> -	struct clk *pclk;
> -	int ret;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	ret = pclk->ops->set_rate(pclk, rate);
> -	clk_put(pclk);
> -
> -	return ret;
> -}
> -
> -static unsigned long s5pc100_spdif_get_rate(struct clk *clk)
> -{
> -	struct clk *pclk;
> -	int rate;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	rate = pclk->ops->get_rate(clk);
> -	clk_put(pclk);
> -
> -	return rate;
> -}
> -
> -static struct clk_ops s5pc100_sclk_spdif_ops = {
> -	.set_rate	= s5pc100_spdif_set_rate,
> -	.get_rate	= s5pc100_spdif_get_rate,
> -};
> -
>  static struct clksrc_clk clk_sclk_spdif = {
>  	.clk	= {
>  		.name		= "sclk_spdif",
>  		.ctrlbit	= (1 << 11),
>  		.enable		= s5pc100_sclk1_ctrl,
> -		.ops		= &s5pc100_sclk_spdif_ops,
> +		.ops		= &s5p_sclk_spdif_ops,
>  	},
>  	.sources = &clk_src_sclk_spdif,
>  	.reg_src = { .reg = S5P_CLK_SRC3, .shift = 24, .size = 2 },
> diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
> index b5c95e6..ae72f87 100644
> --- a/arch/arm/mach-s5pv210/clock.c
> +++ b/arch/arm/mach-s5pv210/clock.c
> @@ -686,47 +686,12 @@ static struct clksrc_sources clkset_sclk_spdif = {
>  	.nr_sources	= ARRAY_SIZE(clkset_sclk_spdif_list),
>  };
> 
> -static int s5pv210_spdif_set_rate(struct clk *clk, unsigned long rate)
> -{
> -	struct clk *pclk;
> -	int ret;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	ret = pclk->ops->set_rate(pclk, rate);
> -	clk_put(pclk);
> -
> -	return ret;
> -}
> -
> -static unsigned long s5pv210_spdif_get_rate(struct clk *clk)
> -{
> -	struct clk *pclk;
> -	int rate;
> -
> -	pclk = clk_get_parent(clk);
> -	if (IS_ERR(pclk))
> -		return -EINVAL;
> -
> -	rate = pclk->ops->get_rate(clk);
> -	clk_put(pclk);
> -
> -	return rate;
> -}
> -
> -static struct clk_ops s5pv210_sclk_spdif_ops = {
> -	.set_rate	= s5pv210_spdif_set_rate,
> -	.get_rate	= s5pv210_spdif_get_rate,
> -};
> -
>  static struct clksrc_clk clk_sclk_spdif = {
>  	.clk		= {
>  		.name		= "sclk_spdif",
>  		.enable		= s5pv210_clk_mask0_ctrl,
>  		.ctrlbit	= (1 << 27),
> -		.ops		= &s5pv210_sclk_spdif_ops,
> +		.ops		= &s5p_sclk_spdif_ops,
>  	},
>  	.sources = &clkset_sclk_spdif,
>  	.reg_src = { .reg = S5P_CLK_SRC6, .shift = 12, .size = 2 },
> diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c
> index 8d081d9..02af235 100644
> --- a/arch/arm/plat-s5p/clock.c
> +++ b/arch/arm/plat-s5p/clock.c
> @@ -168,6 +168,41 @@ unsigned long s5p_epll_get_rate(struct clk *clk)
>  	return clk->rate;
>  }
> 
> +int s5p_spdif_set_rate(struct clk *clk, unsigned long rate)
> +{
> +	struct clk *pclk;
> +	int ret;
> +
> +	pclk = clk_get_parent(clk);
> +	if (IS_ERR(pclk))
> +		return -EINVAL;
> +
> +	ret = pclk->ops->set_rate(pclk, rate);
> +	clk_put(pclk);
> +
> +	return ret;
> +}
> +
> +unsigned long s5p_spdif_get_rate(struct clk *clk)
> +{
> +	struct clk *pclk;
> +	int rate;
> +
> +	pclk = clk_get_parent(clk);
> +	if (IS_ERR(pclk))
> +		return -EINVAL;
> +
> +	rate = pclk->ops->get_rate(clk);
> +	clk_put(pclk);
> +
> +	return rate;
> +}
> +
> +struct clk_ops s5p_sclk_spdif_ops = {
> +	.set_rate	= s5p_spdif_set_rate,
> +	.get_rate	= s5p_spdif_get_rate,
> +};
> +
>  static struct clk *s5p_clks[] __initdata = {
>  	&clk_ext_xtal_mux,
>  	&clk_48m,
> diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-
> s5p/include/plat/s5p-clock.h
> index 2b6dcff..769b5bd 100644
> --- a/arch/arm/plat-s5p/include/plat/s5p-clock.h
> +++ b/arch/arm/plat-s5p/include/plat/s5p-clock.h
> @@ -47,4 +47,9 @@ extern int s5p_gatectrl(void __iomem *reg, struct clk
*clk, int
> enable);
>  extern int s5p_epll_enable(struct clk *clk, int enable);
>  extern unsigned long s5p_epll_get_rate(struct clk *clk);
> 
> +/* SPDIF clk operations common for S5PC100/V210/C110 and Exynos4 */
> +extern int s5p_spdif_set_rate(struct clk *clk, unsigned long rate);
> +extern unsigned long s5p_spdif_get_rate(struct clk *clk);
> +
> +extern struct clk_ops s5p_sclk_spdif_ops;
>  #endif /* __ASM_PLAT_S5P_CLOCK_H */
> --
> 1.7.2.3

  reply	other threads:[~2011-07-18  5:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21 11:24 [PATCH V2 0/3] ARM: Add SPDIF support for EXYNOS4 Naveen Krishna Chatradhi
2011-06-21 11:24 ` Naveen Krishna Chatradhi
2011-06-21 11:24 ` [PATCH v2 1/3] ARM: Samsung: Move duplicate code Naveen Krishna Chatradhi
2011-06-21 11:24   ` Naveen Krishna Chatradhi
2011-07-18  5:35   ` Kukjin Kim [this message]
2011-07-18  5:35     ` Kukjin Kim
2011-06-21 11:24 ` [PATCH v2 2/3] ARM: EXYNOS4: Add sclk_spdif clocks Naveen Krishna Chatradhi
2011-06-21 11:24   ` Naveen Krishna Chatradhi
2011-07-18  5:33   ` Kukjin Kim
2011-07-18  5:33     ` Kukjin Kim
2011-07-18 11:25     ` Naveen Krishna Ch
2011-07-18 11:25       ` Naveen Krishna Ch
2011-07-20  9:52       ` Naveen Krishna Ch
2011-07-20  9:52         ` Naveen Krishna Ch
2011-06-21 11:24 ` [PATCH v2 3/3] ARM: EXYNOS4: Add EPLL clock operations Naveen Krishna Chatradhi
2011-06-21 11:24   ` Naveen Krishna Chatradhi
2011-06-22  6:51   ` Naveen Krishna Ch
2011-06-22  6:51     ` Naveen Krishna Ch
2011-06-22  8:01     ` Seungwhan Youn
2011-06-22  8:01       ` Seungwhan Youn
2011-06-30  5:51       ` Naveen Krishna Ch
2011-06-30  5:51         ` Naveen Krishna Ch
2011-06-30  7:28         ` Seungwhan Youn
2011-06-30  7:28           ` Seungwhan Youn
2011-07-18  5:52   ` Kukjin Kim
2011-07-18  5:52     ` Kukjin Kim
2011-07-18 11:44     ` Naveen Krishna Ch
2011-07-18 11:44       ` Naveen Krishna Ch
2011-06-30  5:54 ` [PATCH V2 0/3] ARM: Add SPDIF support for EXYNOS4 Naveen Krishna Ch
2011-06-30  5:54   ` Naveen Krishna Ch

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='048401cc450c$85a9e5d0$90fdb170$%kim@samsung.com' \
    --to=kgene.kim@samsung.com \
    --cc=ch.naveen@samsung.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sbkim73@samsung.com \
    --cc=sw.youn@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.