Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1251451

Re: [PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan

From Shawn Lin <shawn.lin@rock-chips.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan
Date 2015-10-20 10:50 +0200
Message-ID <qlAMi-6Wk-29@gated-at.bofh.it> (permalink)
References <qlzdx-4QO-45@gated-at.bofh.it> <qlAMi-6Wk-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2015/10/20 15:30, Michal Simek wrote:
> Hi,
>
> On 10/20/2015 09:05 AM, Shawn Lin wrote:
>> This patch adds Generic PHY access for sdhci-of-arasan. Driver
>> can get PHY handler from dt-binding, and power-on/init the PHY.
>> Also we add pm ops for PHY here if CONFIG_PM_SLEEP is enabled.
>> Currently, it's just mandatory for arasan,sdhci-5.1.
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>>
>> Serise-changes: 3
>> - remove phy_init/exit for suspend/resume
>> - adjust phy_int/power_on seq to make code more reasonable
>> - simplify suspend/resume_phy
>>
>> Serise-changes: 2
>> - Keep phy as a mandatory requirement for arasan,sdhci-5.1
>>
>> ---
>>
>> Changes in v2: None
>>
>>   drivers/mmc/host/sdhci-of-arasan.c | 87 ++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 87 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
>> index 75379cb..85bd0f9d 100644
>> --- a/drivers/mmc/host/sdhci-of-arasan.c
>> +++ b/drivers/mmc/host/sdhci-of-arasan.c
>> @@ -21,6 +21,7 @@
>>
>>   #include <linux/module.h>
>>   #include <linux/of_device.h>
>> +#include <linux/phy/phy.h>
>>   #include "sdhci-pltfm.h"
>>
>>   #define SDHCI_ARASAN_CLK_CTRL_OFFSET	0x2c
>> @@ -35,6 +36,7 @@
>>    */
>>   struct sdhci_arasan_data {
>>   	struct clk	*clk_ahb;
>> +	struct phy	*phy;
>>   };
>>
>>   static unsigned int sdhci_arasan_get_timeout_clock(struct sdhci_host *host)
>> @@ -70,6 +72,42 @@ static struct sdhci_pltfm_data sdhci_arasan_pdata = {
>>
>>   #ifdef CONFIG_PM_SLEEP
>>   /**
>> +  * sdhci_arasan_suspend_phy - Suspend phy method for the driver
>> +  * @phy:        Handler of phy structure
>> +  * Returns 0 on success and error value on error
>> +  *
>> +  * Put the phy in a deactive state.
>> +  */
>
> This is not kernel-doc format.
> Try this and fix it.
>
> ./scripts/kernel-doc -man -v drivers/mmc/host/sdhci-of-arasan.c > /dev/null
>

okay, I will try to fix it.

>> +static int sdhci_arasan_suspend_phy(struct phy *phy)
>> +{
>> +	int ret = 0;
>> +
>> +	ret = phy_power_off(phy);
>> +	if (ret)
>> +		phy_power_on(phy);
>
> I am curious about this logic. If power_off fails I would expect that
> phy could still have power_on. Or not?
>

That depends. From "ret", I cannot tell the failure type, whether it's 
caused by *real power off fail* or by other generic phy stuff.

So, I think it's better to power_on it again if we can't guarantee phy's 
state. :)

> Thanks,
> Michal
>
>
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan Shawn Lin <shawn.lin@rock-chips.com> - 2015-10-20 09:10 +0200
  Re: [PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan Ulf Hansson <ulf.hansson@linaro.org> - 2015-10-20 10:40 +0200
    Re: [PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for  sdhci-of-arasan Shawn Lin <shawn.lin@rock-chips.com> - 2015-10-20 11:30 +0200
    Re: [PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for  sdhci-of-arasan Kishon Vijay Abraham I <kishon@ti.com> - 2015-10-20 21:10 +0200
      Re: [PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for  sdhci-of-arasan Shawn Lin <shawn.lin@rock-chips.com> - 2015-10-21 08:40 +0200
  Re: [PATCH v3 2/3] mmc: sdhci-of-arasan: add phy support for  sdhci-of-arasan Shawn Lin <shawn.lin@rock-chips.com> - 2015-10-20 10:50 +0200

csiph-web