Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1467577
| From | Guenter Roeck <groeck@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [v13 PATCH 2/5] phy: Add USB Type-C PHY driver for rk3399 |
| Date | 2016-08-22 14:10 +0200 |
| Message-ID | <s8Wdc-66j-35@gated-at.bofh.it> (permalink) |
| References | <s8P21-1r7-5@gated-at.bofh.it> <s8P22-1r7-17@gated-at.bofh.it> <s8Plo-1xL-9@gated-at.bofh.it> <s8Pv4-1AV-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Chris,
On Sun, Aug 21, 2016 at 9:52 PM, Chris <zywang33@126.com> wrote:
> Hi Guenter
>
[ ... ]
>>> +static int rockchip_usb3_phy_power_on(struct phy *phy)
>>> +{
>>> + struct rockchip_typec_phy *tcphy = phy_get_drvdata(phy);
>>> + struct rockchip_usb3phy_port_cfg *cfg = &tcphy->port_cfgs;
>>> + const struct usb3phy_reg *reg = &cfg->pipe_status;
>>> + int timeout, new_mode, ret = 0;
>>> + u32 val;
>>> +
>>> + mutex_lock(&tcphy->lock);
>>> +
>>> + new_mode = tcphy_get_mode(tcphy);
>>> + if (new_mode < 0) {
>>> + ret = new_mode;
>>> + goto unlock_ret;
>>> + }
>>> +
>>> + /* DP-only mode; fall back to USB2 */
>>> + if (!(new_mode & (MODE_DFP_USB | MODE_UFP_USB)))
>>> + goto unlock_ret;
>>> +
>>
>> The rest of the code (calling tcphy_phy_init(), waiting for pipe
>> ready) is not needed in this case ?
>
>
> If there is only DP, the tcphy_phy_init will be called by DP controller, and
> the pipe is for USB3, so do not need do anything, just return a "fake"
> success here.
> And the usb phy power off do nothing. Just make USB controller happier.
>
Yes, you are right. It is a bit confusing (and I had overlooked) that
MODE_DFP_USB is set for both USB2 and USB3 if DP isn't active, but if
DP is active it is only set for USB3.
Guenter
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[v13 PATCH 0/5] Rockchip Type-C and DisplayPort driver Chris Zhong <zyw@rock-chips.com> - 2016-08-22 06:30 +0200
[v13 PATCH 1/5] Documentation: bindings: add dt doc for Rockchip USB Type-C PHY Chris Zhong <zyw@rock-chips.com> - 2016-08-22 06:30 +0200
[v13 PATCH 4/5] Documentation: bindings: add dt documentation for cdn DP controller Chris Zhong <zyw@rock-chips.com> - 2016-08-22 06:30 +0200
[v13 PATCH 2/5] phy: Add USB Type-C PHY driver for rk3399 Chris Zhong <zyw@rock-chips.com> - 2016-08-22 06:30 +0200
Re: [v13 PATCH 2/5] phy: Add USB Type-C PHY driver for rk3399 Guenter Roeck <groeck@google.com> - 2016-08-22 14:10 +0200
[v13.1 PATCH 2/5] phy: Add USB Type-C PHY driver for rk3399 Chris Zhong <zyw@rock-chips.com> - 2016-08-23 07:10 +0200
[v13 PATCH 3/5] arm64: dts: rockchip: add Type-C phy for RK3399 Chris Zhong <zyw@rock-chips.com> - 2016-08-22 06:30 +0200
csiph-web