The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz
@ 2012-11-08 15:09 Viresh Kumar
  2012-11-08 15:09 ` [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume Viresh Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Viresh Kumar @ 2012-11-08 15:09 UTC (permalink / raw)
  To: cjb; +Cc: linux-mmc, linux-kernel, spear-devel, Vipul Kumar Samar,
	Viresh Kumar

From: Vipul Kumar Samar <vipulkumar.samar@st.com>

SPEAr sdhci driver expects the clock to be set to 50 MHz for proper functioning.
This patch sets clk to 50 MHz in probe.

Signed-off-by: Vipul Kumar Samar <vipulkumar.samar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/mmc/host/sdhci-spear.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 6be89c0..fea8bf9 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -146,6 +146,11 @@ static int __devinit sdhci_probe(struct platform_device *pdev)
 		goto put_clk;
 	}
 
+	ret = clk_set_rate(sdhci->clk, 50000000);
+	if (ret)
+		dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n",
+				clk_get_rate(sdhci->clk));
+
 	if (np) {
 		sdhci->data = sdhci_probe_config_dt(pdev);
 		if (IS_ERR(sdhci->data)) {
-- 
1.7.12.rc2.18.g61b472e


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume
  2012-11-08 15:09 [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
@ 2012-11-08 15:09 ` Viresh Kumar
  2012-11-26 15:45   ` Chris Ball
  2012-11-20  6:41 ` [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Viresh Kumar @ 2012-11-08 15:09 UTC (permalink / raw)
  To: cjb; +Cc: linux-mmc, linux-kernel, spear-devel, Viresh Kumar

clk_{un}prepare is mandatory for platforms using common clock framework. Because
for SPEAr we don't do anything in clk_{un}prepare() calls, just call them ones
in probe/remove.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/mmc/host/sdhci-spear.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index fea8bf9..87a7009 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -302,7 +302,7 @@ static int sdhci_suspend(struct device *dev)
 
 	ret = sdhci_suspend_host(host);
 	if (!ret)
-		clk_disable_unprepare(sdhci->clk);
+		clk_disable(sdhci->clk);
 
 	return ret;
 }
@@ -313,7 +313,7 @@ static int sdhci_resume(struct device *dev)
 	struct spear_sdhci *sdhci = dev_get_platdata(dev);
 	int ret;
 
-	ret = clk_prepare_enable(sdhci->clk);
+	ret = clk_enable(sdhci->clk);
 	if (ret) {
 		dev_dbg(dev, "Resume: Error enabling clock\n");
 		return ret;
-- 
1.7.12.rc2.18.g61b472e


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz
  2012-11-08 15:09 [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
  2012-11-08 15:09 ` [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume Viresh Kumar
@ 2012-11-20  6:41 ` Viresh Kumar
  2012-11-26 15:04   ` Viresh Kumar
  2012-11-26 15:09 ` Chris Ball
  2012-11-26 15:44 ` Chris Ball
  3 siblings, 1 reply; 8+ messages in thread
From: Viresh Kumar @ 2012-11-20  6:41 UTC (permalink / raw)
  To: cjb; +Cc: linux-mmc, linux-kernel, spear-devel, Vipul Kumar Samar,
	Viresh Kumar

On 8 November 2012 20:39, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> From: Vipul Kumar Samar <vipulkumar.samar@st.com>
>
> SPEAr sdhci driver expects the clock to be set to 50 MHz for proper functioning.
> This patch sets clk to 50 MHz in probe.
>
> Signed-off-by: Vipul Kumar Samar <vipulkumar.samar@st.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Ping!!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz
  2012-11-20  6:41 ` [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
@ 2012-11-26 15:04   ` Viresh Kumar
  0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2012-11-26 15:04 UTC (permalink / raw)
  To: cjb; +Cc: linux-mmc, linux-kernel, spear-devel, Vipul Kumar Samar,
	Viresh Kumar

On 20 November 2012 12:11, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 8 November 2012 20:39, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> From: Vipul Kumar Samar <vipulkumar.samar@st.com>
>>
>> SPEAr sdhci driver expects the clock to be set to 50 MHz for proper functioning.
>> This patch sets clk to 50 MHz in probe.
>>
>> Signed-off-by: Vipul Kumar Samar <vipulkumar.samar@st.com>
>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> Ping!!

Hi Chris,

Are you taking these for v3.8?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz
  2012-11-08 15:09 [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
  2012-11-08 15:09 ` [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume Viresh Kumar
  2012-11-20  6:41 ` [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
@ 2012-11-26 15:09 ` Chris Ball
  2012-11-26 15:10   ` Viresh Kumar
  2012-11-26 15:44 ` Chris Ball
  3 siblings, 1 reply; 8+ messages in thread
From: Chris Ball @ 2012-11-26 15:09 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: linux-mmc, linux-kernel, spear-devel, Vipul Kumar Samar

Hi,

On Thu, Nov 08 2012, Viresh Kumar wrote:
> From: Vipul Kumar Samar <vipulkumar.samar@st.com>
>
> SPEAr sdhci driver expects the clock to be set to 50 MHz for proper functioning.
> This patch sets clk to 50 MHz in probe.
>
> Signed-off-by: Vipul Kumar Samar <vipulkumar.samar@st.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/mmc/host/sdhci-spear.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index 6be89c0..fea8bf9 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -146,6 +146,11 @@ static int __devinit sdhci_probe(struct platform_device *pdev)
>  		goto put_clk;
>  	}
>  
> +	ret = clk_set_rate(sdhci->clk, 50000000);
> +	if (ret)
> +		dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n",
> +				clk_get_rate(sdhci->clk));
> +
>  	if (np) {
>  		sdhci->data = sdhci_probe_config_dt(pdev);
>  		if (IS_ERR(sdhci->data)) {

Can I change this to a dev_err()?  No-one's going to see a dev_dbg().

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz
  2012-11-26 15:09 ` Chris Ball
@ 2012-11-26 15:10   ` Viresh Kumar
  0 siblings, 0 replies; 8+ messages in thread
From: Viresh Kumar @ 2012-11-26 15:10 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, linux-kernel, spear-devel, Vipul Kumar Samar

On 26 November 2012 20:39, Chris Ball <cjb@laptop.org> wrote:
> On Thu, Nov 08 2012, Viresh Kumar wrote:
>> +     ret = clk_set_rate(sdhci->clk, 50000000);
>> +     if (ret)
>> +             dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n",
>> +                             clk_get_rate(sdhci->clk));
>> +
>>       if (np) {
>>               sdhci->data = sdhci_probe_config_dt(pdev);
>>               if (IS_ERR(sdhci->data)) {
>
> Can I change this to a dev_err()?  No-one's going to see a dev_dbg().

Yes and thanks :)

--
viresh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz
  2012-11-08 15:09 [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
                   ` (2 preceding siblings ...)
  2012-11-26 15:09 ` Chris Ball
@ 2012-11-26 15:44 ` Chris Ball
  3 siblings, 0 replies; 8+ messages in thread
From: Chris Ball @ 2012-11-26 15:44 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: linux-mmc, linux-kernel, spear-devel, Vipul Kumar Samar

Hi,

On Thu, Nov 08 2012, Viresh Kumar wrote:
> From: Vipul Kumar Samar <vipulkumar.samar@st.com>
>
> SPEAr sdhci driver expects the clock to be set to 50 MHz for proper functioning.
> This patch sets clk to 50 MHz in probe.
>
> Signed-off-by: Vipul Kumar Samar <vipulkumar.samar@st.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/mmc/host/sdhci-spear.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index 6be89c0..fea8bf9 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -146,6 +146,11 @@ static int __devinit sdhci_probe(struct platform_device *pdev)
>  		goto put_clk;
>  	}
>  
> +	ret = clk_set_rate(sdhci->clk, 50000000);
> +	if (ret)
> +		dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n",
> +				clk_get_rate(sdhci->clk));
> +
>  	if (np) {
>  		sdhci->data = sdhci_probe_config_dt(pdev);
>  		if (IS_ERR(sdhci->data)) {

Thanks, pushed to mmc-next for 3.8.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume
  2012-11-08 15:09 ` [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume Viresh Kumar
@ 2012-11-26 15:45   ` Chris Ball
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Ball @ 2012-11-26 15:45 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: linux-mmc, linux-kernel, spear-devel

Hi,

On Thu, Nov 08 2012, Viresh Kumar wrote:
> clk_{un}prepare is mandatory for platforms using common clock framework. Because
> for SPEAr we don't do anything in clk_{un}prepare() calls, just call them ones
> in probe/remove.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/mmc/host/sdhci-spear.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index fea8bf9..87a7009 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -302,7 +302,7 @@ static int sdhci_suspend(struct device *dev)
>  
>  	ret = sdhci_suspend_host(host);
>  	if (!ret)
> -		clk_disable_unprepare(sdhci->clk);
> +		clk_disable(sdhci->clk);
>  
>  	return ret;
>  }
> @@ -313,7 +313,7 @@ static int sdhci_resume(struct device *dev)
>  	struct spear_sdhci *sdhci = dev_get_platdata(dev);
>  	int ret;
>  
> -	ret = clk_prepare_enable(sdhci->clk);
> +	ret = clk_enable(sdhci->clk);
>  	if (ret) {
>  		dev_dbg(dev, "Resume: Error enabling clock\n");
>  		return ret;

Thanks, pushed to mmc-next for 3.8.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-11-26 15:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 15:09 [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
2012-11-08 15:09 ` [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume Viresh Kumar
2012-11-26 15:45   ` Chris Ball
2012-11-20  6:41 ` [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz Viresh Kumar
2012-11-26 15:04   ` Viresh Kumar
2012-11-26 15:09 ` Chris Ball
2012-11-26 15:10   ` Viresh Kumar
2012-11-26 15:44 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox