From: Shawn Lin <shawn.lin@rock-chips.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: shawn.lin@rock-chips.com, linux-kernel@vger.kernel.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 2/2] phy: add a driver for the Rockchip SoC internal eMMC PHY
Date: Mon, 4 Jan 2016 16:36:30 +0800 [thread overview]
Message-ID: <568A2F0E.8070608@rock-chips.com> (raw)
In-Reply-To: <568A230F.3000605@ti.com>
Hi Kishon,
On 2016/1/4 15:45, Kishon Vijay Abraham I wrote:
> Hi,
>
> On Tuesday 29 December 2015 07:22 AM, Shawn Lin wrote:
>> This patch to add a generic PHY driver for ROCKCHIP eMMC PHY.
[...]
>> +
>> +struct rockchip_emmc_phy {
>> + unsigned int reg_offset;
>> + struct regmap *reg_base;
>> + struct phy *phy;
>
> The phy looks unnecessary.
right, got it.
>> + bool state;
>
> hmm.. I want to have some sort of state machine in phy core so that individual
> PHY drivers don't have to maintain the state. However I'm not sure if all the
> PHY's will require such mechanism.
>
In general, phy core is the best place to maintain it.
Presumably, phy driver maintainer is much likely to
maintain the corresponding caller driver at the same time, so he/she
should be in charge of maintaining the on/off, init/exit pairs. From
this point, it doesn't need the state machine. But, I'm not sure if the
caller driver will always keep the on/off pairs correct.
Anyway, I will remove it from this driver. And may we request a RFC
for all sub-phy drivers to discuss this issue if we want to add the
state machine into phy core. How about?
>> +};
>> +
>> +static int rockchip_emmc_phy_power(struct rockchip_emmc_phy *rk_phy,
[...]
>> +}
>> +
>> +static int rockchip_emmc_phy_init(struct phy *phy)
>> +{
>> + rockchip_emmc_phy_power_on(phy);
>
> do only phy initialization here, power on can be done later.
yep.
>> + return 0;
>> +}
>> +
>> +static int rockchip_emmc_phy_exit(struct phy *phy)
>> +{
>> + rockchip_emmc_phy_power_off(phy);
>
> same here.
>
> Thanks
> Kishon
>
>
>
--
Best Regards
Shawn Lin
prev parent reply other threads:[~2016-01-04 8:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-29 1:52 [PATCH 2/2] phy: add a driver for the Rockchip SoC internal eMMC PHY Shawn Lin
2016-01-04 7:45 ` Kishon Vijay Abraham I
2016-01-04 8:36 ` 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=568A2F0E.8070608@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.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