2012-11-08 15:09:20

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz

From: Vipul Kumar Samar <[email protected]>

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 <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
---
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


2012-11-08 15:09:29

by Viresh Kumar

[permalink] [raw]
Subject: [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume

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 <[email protected]>
---
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

2012-11-20 06:41:26

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz

On 8 November 2012 20:39, Viresh Kumar <[email protected]> wrote:
> From: Vipul Kumar Samar <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Viresh Kumar <[email protected]>

Ping!!

2012-11-26 15:04:52

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz

On 20 November 2012 12:11, Viresh Kumar <[email protected]> wrote:
> On 8 November 2012 20:39, Viresh Kumar <[email protected]> wrote:
>> From: Vipul Kumar Samar <[email protected]>
>>
>> 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 <[email protected]>
>> Signed-off-by: Viresh Kumar <[email protected]>
>
> Ping!!

Hi Chris,

Are you taking these for v3.8?

2012-11-26 15:09:10

by Chris Ball

[permalink] [raw]
Subject: Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz

Hi,

On Thu, Nov 08 2012, Viresh Kumar wrote:
> From: Vipul Kumar Samar <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Viresh Kumar <[email protected]>
> ---
> 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 <[email protected]> <http://printf.net/>
One Laptop Per Child

2012-11-26 15:10:11

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz

On 26 November 2012 20:39, Chris Ball <[email protected]> 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

2012-11-26 15:44:49

by Chris Ball

[permalink] [raw]
Subject: Re: [PATCH 1/2] mmc: sdhci-spear: Initialize sdhci clk to 50 MHz

Hi,

On Thu, Nov 08 2012, Viresh Kumar wrote:
> From: Vipul Kumar Samar <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Viresh Kumar <[email protected]>
> ---
> 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 <[email protected]> <http://printf.net/>
One Laptop Per Child

2012-11-26 15:45:33

by Chris Ball

[permalink] [raw]
Subject: Re: [PATCH 2/2] mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend resume

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 <[email protected]>
> ---
> 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 <[email protected]> <http://printf.net/>
One Laptop Per Child