From: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: Jaehoon Chung
<jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: Re: [RFC PATCH v2 4/4] mmc: dw_mmc-rockchip: disable biu clk and genpd if possible
Date: Fri, 7 Oct 2016 17:01:46 +0800 [thread overview]
Message-ID: <be4ffbce-0ea0-49d6-7fed-a0ed648fa2b9@rock-chips.com> (raw)
In-Reply-To: <b9180674-648a-d2d1-0221-cec90b73adab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
在 2016/10/7 12:15, Jaehoon Chung 写道:
> On 09/30/2016 05:48 PM, Shawn Lin wrote:
>> We could disable biu clk and power-off genpd if gpio
>> card detect available.
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>> ---
>>
>> drivers/mmc/host/dw_mmc-rockchip.c | 18 +++++++++++++++++-
>> 1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
>> index 3ad041c..e7b3b6d 100644
>> --- a/drivers/mmc/host/dw_mmc-rockchip.c
>> +++ b/drivers/mmc/host/dw_mmc-rockchip.c
>> @@ -13,6 +13,7 @@
>> #include <linux/mmc/host.h>
>> #include <linux/mmc/dw_mmc.h>
>> #include <linux/of_address.h>
>> +#include <linux/mmc/slot-gpio.h>
>> #include <linux/pm_runtime.h>
>> #include <linux/slab.h>
>>
>> @@ -366,14 +367,29 @@ static int dw_mci_rockchip_remove(struct platform_device *pdev)
>> static int dw_mci_rockchip_runtime_suspend(struct device *dev)
>> {
>> struct dw_mci *host = dev_get_drvdata(dev);
>> + int ret;
>>
>> - return dw_mci_runtime_suspend(host);
>> + ret = dw_mci_runtime_suspend(host);
>> + if (ret)
>> + return ret;
>> +
>> + if (mmc_can_gpio_cd(host->slot[0]->mmc)) {
>
> Can use cur_slot instead of slot[0]? And doesn't need to check "host->slot[]" or "host->cur_slot"?
yes, we could. I will fix this for RFC-V3. Also I think we could
disable biu_clk and genpd for non-removable devices since in these
cases, we don't have interaction from devices 2 host.. But for sd,
we should consider the card detect interrupt.
>
> Best Regards,
> Jaehoon Chung
>
>> + clk_disable_unprepare(host->biu_clk);
>> + pm_runtime_put(dev);
>> + }
>> +
>> + return 0;
>> }
>>
>> static int dw_mci_rockchip_runtime_resume(struct device *dev)
>> {
>> struct dw_mci *host = dev_get_drvdata(dev);
>>
>> + if (mmc_can_gpio_cd(host->slot[0]->mmc)) {
>> + pm_runtime_get_sync(dev);
>> + clk_prepare_enable(host->biu_clk);
>> + }
>> +
>> return dw_mci_runtime_resume(host);
>> }
>> #endif /* CONFIG_PM */
>>
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>
--
Best Regards
Shawn Lin
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
prev parent reply other threads:[~2016-10-07 9:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 8:48 [RFC PATCH v2 0/4] Init runtime PM support for dw_mmc Shawn Lin
2016-09-30 8:48 ` [RFC PATCH v2 1/4] mmc: dw_mmc: add runtime PM callback Shawn Lin
2016-10-07 4:12 ` Jaehoon Chung
[not found] ` <2dd84d82-a14b-7d5e-80f0-89e6c0b1aaae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-10-07 9:19 ` Shawn Lin
2016-09-30 8:48 ` [RFC PATCH v2 2/4] mmc: dw_mmc-rockchip: add runtime PM support Shawn Lin
2016-09-30 8:48 ` [RFC PATCH v2 3/4] mmc: core: expose the capability of gpio card detect Shawn Lin
2016-09-30 8:48 ` [RFC PATCH v2 4/4] mmc: dw_mmc-rockchip: disable biu clk and genpd if possible Shawn Lin
[not found] ` <1475225317-2815-5-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-10-07 4:15 ` Jaehoon Chung
[not found] ` <b9180674-648a-d2d1-0221-cec90b73adab-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-10-07 9:01 ` Shawn Lin [this message]
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=be4ffbce-0ea0-49d6-7fed-a0ed648fa2b9@rock-chips.com \
--to=shawn.lin-tnx95d0mmh7dzftrwevzcw@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox