* [PATCH 1/3] phy: rockchip-typec: enable usb3 host during usb3 phy power on
@ 2018-02-08 15:20 Enric Balletbo i Serra
2018-02-08 15:20 ` [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY Enric Balletbo i Serra
[not found] ` <20180208152028.9997-1-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
0 siblings, 2 replies; 11+ messages in thread
From: Enric Balletbo i Serra @ 2018-02-08 15:20 UTC (permalink / raw)
To: Rob Herring, Kishon Vijay Abraham I, Brian Norris
Cc: Heiko Stuebner, dianders-F7+t8E8rja9g9hUCZPvPmw, Chris Zhong,
William wu, hl-TNX95d0MmH7DzftRWevZcw,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-ZGY8ohtN/8qB+jHODAdFcQ
From: William wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
We have forced usb3 to work in usb2 only mode in firmware by setting
usb3tousb2_en (bit3 of GRF_USB3PHY0/1_CON0) to 1, and setting
host_u3_port_disable (bit0 of GRF_USB3OTG0/1_CON1) to 1 and host_u3_port
(bit15~12 of GRF_USB3OTG0/1_CON1) to 0. So we need to re-enable usb3
host.
Note that the RK3399 TRM suggests that we should keep the whole usb3
controller in reset for the duration of the Type-C PHY initialization.
However, it's hard to assert the reset in the current framework of
reset. And according to the TRM, it doesn't require that we should
clear the usb3tousb2 bit before pipe ready. So let's enable the usb3
host after pipe ready to avoid the Type-C PHY initialization failure.
Signed-off-by: William wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
---
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 4 ++++
drivers/phy/rockchip/phy-rockchip-typec.c | 15 +++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 2f2dee0e2f3c..6c72f8aca74c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1438,6 +1438,8 @@
rockchip,grf = <&grf>;
rockchip,typec-conn-dir = <0xe580 0 16>;
rockchip,usb3tousb2-en = <0xe580 3 19>;
+ rockchip,usb3-host-disable = <0x2434 0 16>;
+ rockchip,usb3-host-port = <0x2434 12 28>;
rockchip,external-psm = <0xe588 14 30>;
rockchip,pipe-status = <0xe5c0 0 0>;
rockchip,uphy-dp-sel = <0x6268 19 19>;
@@ -1468,6 +1470,8 @@
rockchip,grf = <&grf>;
rockchip,typec-conn-dir = <0xe58c 0 16>;
rockchip,usb3tousb2-en = <0xe58c 3 19>;
+ rockchip,usb3-host-disable = <0x2444 0 16>;
+ rockchip,usb3-host-port = <0x2444 12 28>;
rockchip,external-psm = <0xe594 14 30>;
rockchip,pipe-status = <0xe5c0 16 16>;
rockchip,uphy-dp-sel = <0x6268 3 19>;
diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
index 3ed44bee0fdc..cc07f528cc48 100644
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
@@ -358,6 +358,8 @@ struct usb3phy_reg {
struct rockchip_usb3phy_port_cfg {
struct usb3phy_reg typec_conn_dir;
struct usb3phy_reg usb3tousb2_en;
+ struct usb3phy_reg usb3_host_disable;
+ struct usb3phy_reg usb3_host_port;
struct usb3phy_reg external_psm;
struct usb3phy_reg pipe_status;
struct usb3phy_reg uphy_dp_sel;
@@ -853,6 +855,9 @@ static int rockchip_usb3_phy_power_on(struct phy *phy)
regmap_read(tcphy->grf_regs, reg->offset, &val);
if (!(val & BIT(reg->enable_bit))) {
tcphy->mode |= new_mode & (MODE_DFP_USB | MODE_UFP_USB);
+ /* enable usb3 host */
+ property_enable(tcphy, &cfg->usb3_host_disable, 0);
+ property_enable(tcphy, &cfg->usb3_host_port, 1);
goto unlock_ret;
}
usleep_range(10, 20);
@@ -1023,6 +1028,16 @@ static int tcphy_parse_dt(struct rockchip_typec_phy *tcphy,
if (ret)
return ret;
+ ret = tcphy_get_param(dev, &cfg->usb3_host_disable,
+ "rockchip,usb3-host-disable");
+ if (ret)
+ return ret;
+
+ ret = tcphy_get_param(dev, &cfg->usb3_host_port,
+ "rockchip,usb3-host-port");
+ if (ret)
+ return ret;
+
ret = tcphy_get_param(dev, &cfg->external_psm,
"rockchip,external-psm");
if (ret)
--
2.15.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY 2018-02-08 15:20 [PATCH 1/3] phy: rockchip-typec: enable usb3 host during usb3 phy power on Enric Balletbo i Serra @ 2018-02-08 15:20 ` Enric Balletbo i Serra 2018-02-08 17:52 ` Rob Herring [not found] ` <20180208152028.9997-1-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> 1 sibling, 1 reply; 11+ messages in thread From: Enric Balletbo i Serra @ 2018-02-08 15:20 UTC (permalink / raw) To: Rob Herring, Kishon Vijay Abraham I, Brian Norris Cc: Heiko Stuebner, dianders, Chris Zhong, William wu, hl, devicetree, linux-arm-kernel, linux-rockchip, linux-kernel, kernel From: William wu <wulf@rock-chips.com> rockchip,usb3-host-disable is the register of type-c phy disable usb3 host rockchip,usb3-host-port is the register of type-c phy usb3 port number Signed-off-by: William wu <wulf@rock-chips.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> --- Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt index c3be83be9615..9085d95d0079 100644 --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. - rockchip,uphy-dp-sel : the register of type-c phy enable DP function for type-c phy0, it must be <0x6268 19 19>; for type-c phy1, it must be <0x6268 3 19>; + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host + for type-c phy0, it must be <0x2434 0 16>; + for type-c phy1, it must be <0x2444 0 16>; + - rockchip,usb3-host-port : the register of type-c phy usb3 port number + for type-c phy0, it must be <0x2434 12 28>; + for type-c phy1, it must be <0x2444 12 28>; Required nodes : a sub-node is required for each port the phy provides. The sub-node name is used to identify dp or usb3 port, -- 2.15.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY 2018-02-08 15:20 ` [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY Enric Balletbo i Serra @ 2018-02-08 17:52 ` Rob Herring [not found] ` <CABGGisyaqV5HtTUL5LdjH3ZcU3_RTPmzMvEAhv5wZjCD_XCujg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Rob Herring @ 2018-02-08 17:52 UTC (permalink / raw) To: Enric Balletbo i Serra Cc: Kishon Vijay Abraham I, Brian Norris, Heiko Stuebner, dianders, Chris Zhong, William wu, hl, devicetree, linux-arm-kernel, linux-rockchip, Linux Kernel Mailing List, kernel On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra <enric.balletbo@collabora.com> wrote: > From: William wu <wulf@rock-chips.com> > > rockchip,usb3-host-disable is the register of type-c phy disable usb3 host > rockchip,usb3-host-port is the register of type-c phy usb3 port number > > Signed-off-by: William wu <wulf@rock-chips.com> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> > --- > Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > index c3be83be9615..9085d95d0079 100644 > --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. > - rockchip,uphy-dp-sel : the register of type-c phy enable DP function > for type-c phy0, it must be <0x6268 19 19>; > for type-c phy1, it must be <0x6268 3 19>; > + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host > + for type-c phy0, it must be <0x2434 0 16>; > + for type-c phy1, it must be <0x2444 0 16>; > + - rockchip,usb3-host-port : the register of type-c phy usb3 port number > + for type-c phy0, it must be <0x2434 12 28>; > + for type-c phy1, it must be <0x2444 12 28>; When does this list stop? Adding properties for various register fields doesn't scale. This information should be in the driver and based on the compatible string if necessary. Rob ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CABGGisyaqV5HtTUL5LdjH3ZcU3_RTPmzMvEAhv5wZjCD_XCujg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY [not found] ` <CABGGisyaqV5HtTUL5LdjH3ZcU3_RTPmzMvEAhv5wZjCD_XCujg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-02-08 21:23 ` Enric Balletbo Serra [not found] ` <CAFqH_53-iN9m=U+WdQh6_rKyxE5c9RUQO9qD1QaY0QePM_pOZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Enric Balletbo Serra @ 2018-02-08 21:23 UTC (permalink / raw) To: Rob Herring Cc: Enric Balletbo i Serra, Kishon Vijay Abraham I, Brian Norris, Heiko Stuebner, Doug Anderson, Chris Zhong, William wu, huang lin, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List, kernel-ZGY8ohtN/8qB+jHODAdFcQ Hi Rob, 2018-02-08 18:52 GMT+01:00 Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: > On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra > <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote: >> From: William wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org> >> >> rockchip,usb3-host-disable is the register of type-c phy disable usb3 host >> rockchip,usb3-host-port is the register of type-c phy usb3 port number >> >> Signed-off-by: William wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org> >> Signed-off-by: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> >> --- >> Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> index c3be83be9615..9085d95d0079 100644 >> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. >> - rockchip,uphy-dp-sel : the register of type-c phy enable DP function >> for type-c phy0, it must be <0x6268 19 19>; >> for type-c phy1, it must be <0x6268 3 19>; >> + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host >> + for type-c phy0, it must be <0x2434 0 16>; >> + for type-c phy1, it must be <0x2444 0 16>; >> + - rockchip,usb3-host-port : the register of type-c phy usb3 port number >> + for type-c phy0, it must be <0x2434 12 28>; >> + for type-c phy1, it must be <0x2444 12 28>; > > When does this list stop? Adding properties for various register > fields doesn't scale. This information should be in the driver and > based on the compatible string if necessary. > I see, seams reasonable to me, is this applicable to the new ones only or I should get rid of all the proprieties like this from the DT (including the old ones)? Thanks, Enric > Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CAFqH_53-iN9m=U+WdQh6_rKyxE5c9RUQO9qD1QaY0QePM_pOZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY [not found] ` <CAFqH_53-iN9m=U+WdQh6_rKyxE5c9RUQO9qD1QaY0QePM_pOZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-02-12 16:43 ` Rob Herring [not found] ` <CAL_JsqLvkPEm1mZaEfEVFEYMoGvOsbSQb8c35UvjmRTCwrCF8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Rob Herring @ 2018-02-12 16:43 UTC (permalink / raw) To: Enric Balletbo Serra Cc: Enric Balletbo i Serra, Kishon Vijay Abraham I, Brian Norris, Heiko Stuebner, Doug Anderson, Chris Zhong, William wu, huang lin, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List, kernel-ZGY8ohtN/8qB+jHODAdFcQ On Thu, Feb 8, 2018 at 3:23 PM, Enric Balletbo Serra <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hi Rob, > > 2018-02-08 18:52 GMT+01:00 Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: >> On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra >> <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote: >>> From: William wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org> >>> >>> rockchip,usb3-host-disable is the register of type-c phy disable usb3 host >>> rockchip,usb3-host-port is the register of type-c phy usb3 port number >>> >>> Signed-off-by: William wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org> >>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> >>> --- >>> Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >>> index c3be83be9615..9085d95d0079 100644 >>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >>> @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. >>> - rockchip,uphy-dp-sel : the register of type-c phy enable DP function >>> for type-c phy0, it must be <0x6268 19 19>; >>> for type-c phy1, it must be <0x6268 3 19>; >>> + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host >>> + for type-c phy0, it must be <0x2434 0 16>; >>> + for type-c phy1, it must be <0x2444 0 16>; >>> + - rockchip,usb3-host-port : the register of type-c phy usb3 port number >>> + for type-c phy0, it must be <0x2434 12 28>; >>> + for type-c phy1, it must be <0x2444 12 28>; >> >> When does this list stop? Adding properties for various register >> fields doesn't scale. This information should be in the driver and >> based on the compatible string if necessary. >> > > I see, seams reasonable to me, is this applicable to the new ones only > or I should get rid of all the proprieties like this from the DT > (including the old ones)? We're already kind of stuck with the existing ones. So it depends if people want to phase them out or not. Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CAL_JsqLvkPEm1mZaEfEVFEYMoGvOsbSQb8c35UvjmRTCwrCF8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY [not found] ` <CAL_JsqLvkPEm1mZaEfEVFEYMoGvOsbSQb8c35UvjmRTCwrCF8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-02-12 21:26 ` Brian Norris [not found] ` <20180212212643.GA37044-1WoqFLEneaORBCj4nEdE8WJtCfot02Oa@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Brian Norris @ 2018-02-12 21:26 UTC (permalink / raw) To: Rob Herring Cc: Enric Balletbo Serra, Enric Balletbo i Serra, Kishon Vijay Abraham I, Heiko Stuebner, Doug Anderson, Chris Zhong, William wu, huang lin, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List, kernel-ZGY8ohtN/8qB+jHODAdFcQ Hi, On Mon, Feb 12, 2018 at 10:43:41AM -0600, Rob Herring wrote: > On Thu, Feb 8, 2018 at 3:23 PM, Enric Balletbo Serra > <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 2018-02-08 18:52 GMT+01:00 Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: > >> On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra > >> <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote: > >>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > >>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > >>> @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. > >>> - rockchip,uphy-dp-sel : the register of type-c phy enable DP function > >>> for type-c phy0, it must be <0x6268 19 19>; > >>> for type-c phy1, it must be <0x6268 3 19>; > >>> + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host > >>> + for type-c phy0, it must be <0x2434 0 16>; > >>> + for type-c phy1, it must be <0x2444 0 16>; > >>> + - rockchip,usb3-host-port : the register of type-c phy usb3 port number > >>> + for type-c phy0, it must be <0x2434 12 28>; > >>> + for type-c phy1, it must be <0x2444 12 28>; > >> > >> When does this list stop? Adding properties for various register > >> fields doesn't scale. This information should be in the driver and > >> based on the compatible string if necessary. > >> > > > > I see, seams reasonable to me, is this applicable to the new ones only > > or I should get rid of all the proprieties like this from the DT > > (including the old ones)? > > We're already kind of stuck with the existing ones. So it depends if > people want to phase them out or not. FWIW, any Chrome{device} using these sort of bindings is perfectly capable of handling changed bindings (we ship DTBs with the kernel). But that's not typically how mainline covers binding deprecation. If we're going to start recommending not putting these offsets in the DT, I'd vote for deprecating them, for consistency. (Otherwise, we'll keep running into this same question.) We only documented the RK3399 ("rockchip,rk3399-typec-phy") binding, so all users should have the same offsets. I dunno if/how we pick a time for eventually removing the bindings entirely. Brian -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <20180212212643.GA37044-1WoqFLEneaORBCj4nEdE8WJtCfot02Oa@public.gmane.org>]
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY [not found] ` <20180212212643.GA37044-1WoqFLEneaORBCj4nEdE8WJtCfot02Oa@public.gmane.org> @ 2018-02-12 22:29 ` Rob Herring [not found] ` <CAL_Jsq+iqc8SB-=8mRbsvBg6XB+hjUcRrbEtUhDWiXVNZetcrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Rob Herring @ 2018-02-12 22:29 UTC (permalink / raw) To: Brian Norris Cc: Enric Balletbo Serra, Enric Balletbo i Serra, Kishon Vijay Abraham I, Heiko Stuebner, Doug Anderson, Chris Zhong, William wu, huang lin, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List, kernel-ZGY8ohtN/8qB+jHODAdFcQ On Mon, Feb 12, 2018 at 3:26 PM, Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote: > Hi, > > On Mon, Feb 12, 2018 at 10:43:41AM -0600, Rob Herring wrote: >> On Thu, Feb 8, 2018 at 3:23 PM, Enric Balletbo Serra >> <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > 2018-02-08 18:52 GMT+01:00 Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: >> >> On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra >> >> <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote: >> >>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> >>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> >>> @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. >> >>> - rockchip,uphy-dp-sel : the register of type-c phy enable DP function >> >>> for type-c phy0, it must be <0x6268 19 19>; >> >>> for type-c phy1, it must be <0x6268 3 19>; >> >>> + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host >> >>> + for type-c phy0, it must be <0x2434 0 16>; >> >>> + for type-c phy1, it must be <0x2444 0 16>; >> >>> + - rockchip,usb3-host-port : the register of type-c phy usb3 port number >> >>> + for type-c phy0, it must be <0x2434 12 28>; >> >>> + for type-c phy1, it must be <0x2444 12 28>; >> >> >> >> When does this list stop? Adding properties for various register >> >> fields doesn't scale. This information should be in the driver and >> >> based on the compatible string if necessary. >> >> >> > >> > I see, seams reasonable to me, is this applicable to the new ones only >> > or I should get rid of all the proprieties like this from the DT >> > (including the old ones)? >> >> We're already kind of stuck with the existing ones. So it depends if >> people want to phase them out or not. > > FWIW, any Chrome{device} using these sort of bindings is perfectly > capable of handling changed bindings (we ship DTBs with the kernel). But > that's not typically how mainline covers binding deprecation. If it's CrOS only that's using these, then it's really up to you all. I guess it depends if many folks are trying to run mainline on CrOS devices and don't necessarily keep things in sync. > If we're going to start recommending not putting these offsets in the > DT, I'd vote for deprecating them, for consistency. (Otherwise, we'll > keep running into this same question.) We only documented the RK3399 > ("rockchip,rk3399-typec-phy") binding, so all users should have the same > offsets. I dunno if/how we pick a time for eventually removing the > bindings entirely. Yes, makes sense. Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CAL_Jsq+iqc8SB-=8mRbsvBg6XB+hjUcRrbEtUhDWiXVNZetcrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY [not found] ` <CAL_Jsq+iqc8SB-=8mRbsvBg6XB+hjUcRrbEtUhDWiXVNZetcrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-02-13 9:18 ` Emil Renner Berthing [not found] ` <CANBLGcykb99SntD=C67_-iUoZZLeFfMw8jZWdF9fmFss3u24iA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Emil Renner Berthing @ 2018-02-13 9:18 UTC (permalink / raw) To: Rob Herring Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-ZGY8ohtN/8qB+jHODAdFcQ, Heiko Stuebner, Enric Balletbo Serra, Brian Norris, Linux Kernel Mailing List, Enric Balletbo i Serra, Doug Anderson, open list:ARM/Rockchip SoC..., Chris Zhong, William wu, Kishon Vijay Abraham I, linux-arm-kernel, huang lin On 12 February 2018 at 23:29, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote: > On Mon, Feb 12, 2018 at 3:26 PM, Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote: >> Hi, >> >> On Mon, Feb 12, 2018 at 10:43:41AM -0600, Rob Herring wrote: >>> On Thu, Feb 8, 2018 at 3:23 PM, Enric Balletbo Serra >>> <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> > 2018-02-08 18:52 GMT+01:00 Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: >>> >> On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra >>> >> <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote: >>> >>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >>> >>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >>> >>> @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. >>> >>> - rockchip,uphy-dp-sel : the register of type-c phy enable DP function >>> >>> for type-c phy0, it must be <0x6268 19 19>; >>> >>> for type-c phy1, it must be <0x6268 3 19>; >>> >>> + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host >>> >>> + for type-c phy0, it must be <0x2434 0 16>; >>> >>> + for type-c phy1, it must be <0x2444 0 16>; >>> >>> + - rockchip,usb3-host-port : the register of type-c phy usb3 port number >>> >>> + for type-c phy0, it must be <0x2434 12 28>; >>> >>> + for type-c phy1, it must be <0x2444 12 28>; >>> >> >>> >> When does this list stop? Adding properties for various register >>> >> fields doesn't scale. This information should be in the driver and >>> >> based on the compatible string if necessary. >>> >> >>> > >>> > I see, seams reasonable to me, is this applicable to the new ones only >>> > or I should get rid of all the proprieties like this from the DT >>> > (including the old ones)? >>> >>> We're already kind of stuck with the existing ones. So it depends if >>> people want to phase them out or not. >> >> FWIW, any Chrome{device} using these sort of bindings is perfectly >> capable of handling changed bindings (we ship DTBs with the kernel). But >> that's not typically how mainline covers binding deprecation. > > If it's CrOS only that's using these, then it's really up to you all. > I guess it depends if many folks are trying to run mainline on CrOS > devices and don't necessarily keep things in sync. For what it's worth I run mainline on my Chromebook Plus (rk3399-gru-kevin), but in order to have a somewhat working setup you need to run 4.16-rc1 + various patches from the rockchip mailing list which means you have to keep up with the latest mainline (both kernel and devicetree) anyway. So I'm all in favour of cleaning up the devicetree. >> If we're going to start recommending not putting these offsets in the >> DT, I'd vote for deprecating them, for consistency. (Otherwise, we'll >> keep running into this same question.) We only documented the RK3399 >> ("rockchip,rk3399-typec-phy") binding, so all users should have the same >> offsets. I dunno if/how we pick a time for eventually removing the >> bindings entirely. > > Yes, makes sense. > > Rob > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CANBLGcykb99SntD=C67_-iUoZZLeFfMw8jZWdF9fmFss3u24iA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY [not found] ` <CANBLGcykb99SntD=C67_-iUoZZLeFfMw8jZWdF9fmFss3u24iA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-02-13 22:08 ` Enric Balletbo Serra [not found] ` <CAFqH_50=d3Z-JWiFnxnCm0pF_bpyWG9-9M1mk5nQUYUwZh-Yyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 11+ messages in thread From: Enric Balletbo Serra @ 2018-02-13 22:08 UTC (permalink / raw) To: Emil Renner Berthing Cc: Rob Herring, Brian Norris, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Heiko Stuebner, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List, Doug Anderson, Kishon Vijay Abraham I, Chris Zhong, Enric Balletbo i Serra, William wu, kernel-ZGY8ohtN/8qB+jHODAdFcQ, linux-arm-kernel, huang lin Hi, 2018-02-13 10:18 GMT+01:00 Emil Renner Berthing <emil.renner.berthing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > On 12 February 2018 at 23:29, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote: >> On Mon, Feb 12, 2018 at 3:26 PM, Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote: >>> Hi, >>> >>> On Mon, Feb 12, 2018 at 10:43:41AM -0600, Rob Herring wrote: >>>> On Thu, Feb 8, 2018 at 3:23 PM, Enric Balletbo Serra >>>> <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> > 2018-02-08 18:52 GMT+01:00 Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: >>>> >> On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra >>>> >> <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote: >>>> >>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >>>> >>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >>>> >>> @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. >>>> >>> - rockchip,uphy-dp-sel : the register of type-c phy enable DP function >>>> >>> for type-c phy0, it must be <0x6268 19 19>; >>>> >>> for type-c phy1, it must be <0x6268 3 19>; >>>> >>> + - rockchip,usb3-host-disable : the register of type-c phy disable usb3 host >>>> >>> + for type-c phy0, it must be <0x2434 0 16>; >>>> >>> + for type-c phy1, it must be <0x2444 0 16>; >>>> >>> + - rockchip,usb3-host-port : the register of type-c phy usb3 port number >>>> >>> + for type-c phy0, it must be <0x2434 12 28>; >>>> >>> + for type-c phy1, it must be <0x2444 12 28>; >>>> >> >>>> >> When does this list stop? Adding properties for various register >>>> >> fields doesn't scale. This information should be in the driver and >>>> >> based on the compatible string if necessary. >>>> >> >>>> > >>>> > I see, seams reasonable to me, is this applicable to the new ones only >>>> > or I should get rid of all the proprieties like this from the DT >>>> > (including the old ones)? >>>> >>>> We're already kind of stuck with the existing ones. So it depends if >>>> people want to phase them out or not. >>> >>> FWIW, any Chrome{device} using these sort of bindings is perfectly >>> capable of handling changed bindings (we ship DTBs with the kernel). But >>> that's not typically how mainline covers binding deprecation. >> >> If it's CrOS only that's using these, then it's really up to you all. >> I guess it depends if many folks are trying to run mainline on CrOS >> devices and don't necessarily keep things in sync. > > For what it's worth I run mainline on my Chromebook Plus (rk3399-gru-kevin), > but in order to have a somewhat working setup you need to run > 4.16-rc1 + various patches from the rockchip mailing list which means > you have to keep up with the latest mainline (both kernel and devicetree) > anyway. So I'm all in favour of cleaning up the devicetree. > >>> If we're going to start recommending not putting these offsets in the >>> DT, I'd vote for deprecating them, for consistency. (Otherwise, we'll >>> keep running into this same question.) We only documented the RK3399 >>> ("rockchip,rk3399-typec-phy") binding, so all users should have the same >>> offsets. I dunno if/how we pick a time for eventually removing the >>> bindings entirely. >> >> Yes, makes sense. >> One question, maybe silly question, that comes to my mind is, as the offsets for same register are different between type-c phy0 and type-c phy1 and there is two instances, the driver needs to know which type-c phyter is and I'm not sure the proper way to do it. It is just check the type-c phyter base address? So if base address is 0xff7c0000 (phy0) we know that we should apply the offsets for phy0 and if base address is 0xff800000 we know that we should apply the offsets for phy1? Best regards, Enric >> Rob >> >> _______________________________________________ >> Linux-rockchip mailing list >> Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org >> http://lists.infradead.org/mailman/listinfo/linux-rockchip -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <CAFqH_50=d3Z-JWiFnxnCm0pF_bpyWG9-9M1mk5nQUYUwZh-Yyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY [not found] ` <CAFqH_50=d3Z-JWiFnxnCm0pF_bpyWG9-9M1mk5nQUYUwZh-Yyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2018-02-13 22:22 ` Heiko Stübner 0 siblings, 0 replies; 11+ messages in thread From: Heiko Stübner @ 2018-02-13 22:22 UTC (permalink / raw) To: Enric Balletbo Serra Cc: Emil Renner Berthing, Rob Herring, Brian Norris, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, open list:ARM/Rockchip SoC..., Linux Kernel Mailing List, Doug Anderson, Kishon Vijay Abraham I, Chris Zhong, Enric Balletbo i Serra, William wu, kernel-ZGY8ohtN/8qB+jHODAdFcQ, linux-arm-kernel, huang lin Hi Enric, Am Dienstag, 13. Februar 2018, 23:08:26 CET schrieb Enric Balletbo Serra: > 2018-02-13 10:18 GMT+01:00 Emil Renner Berthing > > <emil.renner.berthing-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > On 12 February 2018 at 23:29, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote: > >> On Mon, Feb 12, 2018 at 3:26 PM, Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote: > >>> Hi, > >>> > >>> On Mon, Feb 12, 2018 at 10:43:41AM -0600, Rob Herring wrote: > >>>> On Thu, Feb 8, 2018 at 3:23 PM, Enric Balletbo Serra > >>>> > >>>> <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>>> > 2018-02-08 18:52 GMT+01:00 Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>: > >>>> >> On Thu, Feb 8, 2018 at 9:20 AM, Enric Balletbo i Serra > >>>> >> > >>>> >> <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote: > >>>> >>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > >>>> >>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > >>>> >>> @@ -36,6 +36,12 @@ offset, enable bit, write mask bit. > >>>> >>> > >>>> >>> - rockchip,uphy-dp-sel : the register of type-c phy enable DP > >>>> >>> function > >>>> >>> > >>>> >>> for type-c phy0, it must be <0x6268 19 19>; > >>>> >>> for type-c phy1, it must be <0x6268 3 19>; > >>>> >>> > >>>> >>> + - rockchip,usb3-host-disable : the register of type-c phy disable > >>>> >>> usb3 host + for type-c phy0, it must be <0x2434 0 16>; > >>>> >>> + for type-c phy1, it must be <0x2444 0 16>; > >>>> >>> + - rockchip,usb3-host-port : the register of type-c phy usb3 port > >>>> >>> number > >>>> >>> + for type-c phy0, it must be <0x2434 12 28>; > >>>> >>> + for type-c phy1, it must be <0x2444 12 28>; > >>>> >> > >>>> >> When does this list stop? Adding properties for various register > >>>> >> fields doesn't scale. This information should be in the driver and > >>>> >> based on the compatible string if necessary. > >>>> > > >>>> > I see, seams reasonable to me, is this applicable to the new ones > >>>> > only > >>>> > or I should get rid of all the proprieties like this from the DT > >>>> > (including the old ones)? > >>>> > >>>> We're already kind of stuck with the existing ones. So it depends if > >>>> people want to phase them out or not. > >>> > >>> FWIW, any Chrome{device} using these sort of bindings is perfectly > >>> capable of handling changed bindings (we ship DTBs with the kernel). But > >>> that's not typically how mainline covers binding deprecation. > >> > >> If it's CrOS only that's using these, then it's really up to you all. > >> I guess it depends if many folks are trying to run mainline on CrOS > >> devices and don't necessarily keep things in sync. > > > > For what it's worth I run mainline on my Chromebook Plus > > (rk3399-gru-kevin), but in order to have a somewhat working setup you > > need to run > > 4.16-rc1 + various patches from the rockchip mailing list which means > > you have to keep up with the latest mainline (both kernel and devicetree) > > anyway. So I'm all in favour of cleaning up the devicetree. > > > >>> If we're going to start recommending not putting these offsets in the > >>> DT, I'd vote for deprecating them, for consistency. (Otherwise, we'll > >>> keep running into this same question.) We only documented the RK3399 > >>> ("rockchip,rk3399-typec-phy") binding, so all users should have the same > >>> offsets. I dunno if/how we pick a time for eventually removing the > >>> bindings entirely. > >> > >> Yes, makes sense. > > One question, maybe silly question, that comes to my mind is, as the > offsets for same register are different between type-c phy0 and type-c > phy1 and there is two instances, the driver needs to know which type-c > phyter is and I'm not sure the proper way to do it. It is just check > the type-c phyter base address? So if base address is 0xff7c0000 > (phy0) we know that we should apply the offsets for phy0 and if base > address is 0xff800000 we know that we should apply the offsets for > phy1? sounds reasonable and we already did something similar for example for the inno-usb2 phys where you can find the struct rockchip_usb2phy_cfg matching against a reg property. GRF reg offset in that case but matching against the base address for the type-c phy should therefore be fine as well. Heiko -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <20180208152028.9997-1-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>]
* [PATCH 3/3] phy: rockchip-typec: force to USB2 if DP at 4 lanes mode [not found] ` <20180208152028.9997-1-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> @ 2018-02-08 15:20 ` Enric Balletbo i Serra 0 siblings, 0 replies; 11+ messages in thread From: Enric Balletbo i Serra @ 2018-02-08 15:20 UTC (permalink / raw) To: Rob Herring, Kishon Vijay Abraham I, Brian Norris Cc: Heiko Stuebner, dianders-F7+t8E8rja9g9hUCZPvPmw, Chris Zhong, William wu, hl-TNX95d0MmH7DzftRWevZcw, devicetree-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA, kernel-ZGY8ohtN/8qB+jHODAdFcQ From: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> The usb3tousb2_en BIT will be clear to 0 in probe(), it make USB controller work at USB3 mode, and if the USB phy is turned on with DP only mode(4 lanes DP), the rockchip_usb3_phy_power_on() will return directly, so usb3_host_disable and usb3_host_port these 2 BIT will keep a same value as coreboot. In coreboot, these 3 BITs are set as USB2 mode, but now one of the bits is changed to USB3, it make USB controller work at a unknown status. These 3 BITs should be changed to USB2, if the Type-C works at 4 lanes mode, and then switch it back to USB3 mode, when USB disconnect. Signed-off-by: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> --- drivers/phy/rockchip/phy-rockchip-typec.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c index cc07f528cc48..087c754caf25 100644 --- a/drivers/phy/rockchip/phy-rockchip-typec.c +++ b/drivers/phy/rockchip/phy-rockchip-typec.c @@ -821,6 +821,18 @@ static int tcphy_get_mode(struct rockchip_typec_phy *tcphy) return mode; } +static int tcphy_cfg_usb3_to_usb2_only(struct rockchip_typec_phy *tcphy, + bool value) +{ + struct rockchip_usb3phy_port_cfg *cfg = &tcphy->port_cfgs; + + property_enable(tcphy, &cfg->usb3tousb2_en, value); + property_enable(tcphy, &cfg->usb3_host_disable, value); + property_enable(tcphy, &cfg->usb3_host_port, !value); + + return 0; +} + static int rockchip_usb3_phy_power_on(struct phy *phy) { struct rockchip_typec_phy *tcphy = phy_get_drvdata(phy); @@ -838,8 +850,10 @@ static int rockchip_usb3_phy_power_on(struct phy *phy) } /* DP-only mode; fall back to USB2 */ - if (!(new_mode & (MODE_DFP_USB | MODE_UFP_USB))) + if (!(new_mode & (MODE_DFP_USB | MODE_UFP_USB))) { + tcphy_cfg_usb3_to_usb2_only(tcphy, true); goto unlock_ret; + } if (tcphy->mode == new_mode) goto unlock_ret; @@ -855,9 +869,9 @@ static int rockchip_usb3_phy_power_on(struct phy *phy) regmap_read(tcphy->grf_regs, reg->offset, &val); if (!(val & BIT(reg->enable_bit))) { tcphy->mode |= new_mode & (MODE_DFP_USB | MODE_UFP_USB); + /* enable usb3 host */ - property_enable(tcphy, &cfg->usb3_host_disable, 0); - property_enable(tcphy, &cfg->usb3_host_port, 1); + tcphy_cfg_usb3_to_usb2_only(tcphy, false); goto unlock_ret; } usleep_range(10, 20); @@ -878,6 +892,7 @@ static int rockchip_usb3_phy_power_off(struct phy *phy) struct rockchip_typec_phy *tcphy = phy_get_drvdata(phy); mutex_lock(&tcphy->lock); + tcphy_cfg_usb3_to_usb2_only(tcphy, false); if (tcphy->mode == MODE_DISCONNECT) goto unlock; -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-02-13 22:22 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-08 15:20 [PATCH 1/3] phy: rockchip-typec: enable usb3 host during usb3 phy power on Enric Balletbo i Serra
2018-02-08 15:20 ` [PATCH 2/3] Documentation: bindings: add usb3-host-disable and usb3-host-port for Rockchip USB Type-C PHY Enric Balletbo i Serra
2018-02-08 17:52 ` Rob Herring
[not found] ` <CABGGisyaqV5HtTUL5LdjH3ZcU3_RTPmzMvEAhv5wZjCD_XCujg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-08 21:23 ` Enric Balletbo Serra
[not found] ` <CAFqH_53-iN9m=U+WdQh6_rKyxE5c9RUQO9qD1QaY0QePM_pOZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-12 16:43 ` Rob Herring
[not found] ` <CAL_JsqLvkPEm1mZaEfEVFEYMoGvOsbSQb8c35UvjmRTCwrCF8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-12 21:26 ` Brian Norris
[not found] ` <20180212212643.GA37044-1WoqFLEneaORBCj4nEdE8WJtCfot02Oa@public.gmane.org>
2018-02-12 22:29 ` Rob Herring
[not found] ` <CAL_Jsq+iqc8SB-=8mRbsvBg6XB+hjUcRrbEtUhDWiXVNZetcrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-13 9:18 ` Emil Renner Berthing
[not found] ` <CANBLGcykb99SntD=C67_-iUoZZLeFfMw8jZWdF9fmFss3u24iA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-13 22:08 ` Enric Balletbo Serra
[not found] ` <CAFqH_50=d3Z-JWiFnxnCm0pF_bpyWG9-9M1mk5nQUYUwZh-Yyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-13 22:22 ` Heiko Stübner
[not found] ` <20180208152028.9997-1-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-02-08 15:20 ` [PATCH 3/3] phy: rockchip-typec: force to USB2 if DP at 4 lanes mode Enric Balletbo i Serra
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).