From: Heiko Stuebner <heiko@sntech.de>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: linux-kernel@vger.kernel.org, amstan@chromium.org,
groeck@google.com, kieran.bingham@ideasonboard.com,
kernel@collabora.com, bleung@chromium.org,
Kishon Vijay Abraham I <kishon@ti.com>,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/4] phy: rockchip-inno-usb2: allow to force the B-Device Session Valid bit.
Date: Wed, 15 Aug 2018 12:36:59 +0200 [thread overview]
Message-ID: <2399692.mpX5uTAn2d@phil> (raw)
In-Reply-To: <72ca2b54-785c-8fe3-b472-5b8837afe00a@collabora.com>
Am Mittwoch, 15. August 2018, 12:34:42 CEST schrieb Enric Balletbo i Serra:
> Hi Heiko,
>
> On 15/08/18 12:18, Heiko Stuebner wrote:
> > Hi Enric,
> >
> > Am Mittwoch, 15. August 2018, 11:59:33 CEST schrieb Enric Balletbo i Serra:
> >> The OTG disconnection event is generated after the presence/abscense of
> >> an ID connection, but some platforms doesn't have the ID pin connected, so
> >> the event is not generated. In such case, for detecting the disconnection
> >> event, we can get the cable state from an extcon driver. We need, though,
> >> to force to set the B-Device Session Valid bit on the PHY to have the
> >> device respond to setup address. Otherwise, the following error is
> >> shown:
> >>
> >> usb 2-2: Device not responding to setup address.
> >> usb 2-2: device not accepting address 14, error -71
> >> usb usb2-port2: unable to enumerate USB device
> >>
> >> The patch allows to tell the PHY to force the B-Device Session Valid bit
> >> when the OTG role is device and clear that bit if the OTG role is host.
> >>
> >> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> >
> >> @@ -1024,6 +1051,12 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
> >> INIT_DELAYED_WORK(&rport->chg_work, rockchip_chg_detect_work);
> >> INIT_DELAYED_WORK(&rport->otg_sm_work, rockchip_usb2phy_otg_sm_work);
> >>
> >> + rport->force_bvalid = false;
> >> + if (of_device_is_compatible(rphy->dev->of_node,
> >> + "rockchip,rk3399-usb2phy"))
> >> + rport->force_bvalid = of_property_read_bool(child_np,
> >> + "rockchip,force-bvalid");
> >
> > That feels a bit clumsy, especially as the rk3399 seems to have the id
>
> Agree, It is, let me explain :)
>
> Ideally we shouldn't have this check, to get rid of this check I only need the
> offsets for bvalid_session register for all the compatibles and fill in phy
> configuration data (rk3228_phy_cfgs, &rk3328_phy_cfgs, rk3366_phy_cfgs,
> rv1108_phy_cfgs)
>
> To be honest I didn't look if all the datasheets are public available, let me do
> some research. Or, if anyone has the datasheet and can tell where the
> bvalid_session bit is I can fill all the data.
Or just always check for the presence of the property and just make the
driver warn if that bvalid_session setting is not available for that soc yet.
From the TRMs I have your rk3399 bvalid_session settings seems to live
in the depths of the undocumented inno-phy regs, so that will probably
be the same for other socs using that phy.
Heiko
WARNING: multiple messages have this Message-ID (diff)
From: heiko@sntech.de (Heiko Stuebner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] phy: rockchip-inno-usb2: allow to force the B-Device Session Valid bit.
Date: Wed, 15 Aug 2018 12:36:59 +0200 [thread overview]
Message-ID: <2399692.mpX5uTAn2d@phil> (raw)
In-Reply-To: <72ca2b54-785c-8fe3-b472-5b8837afe00a@collabora.com>
Am Mittwoch, 15. August 2018, 12:34:42 CEST schrieb Enric Balletbo i Serra:
> Hi Heiko,
>
> On 15/08/18 12:18, Heiko Stuebner wrote:
> > Hi Enric,
> >
> > Am Mittwoch, 15. August 2018, 11:59:33 CEST schrieb Enric Balletbo i Serra:
> >> The OTG disconnection event is generated after the presence/abscense of
> >> an ID connection, but some platforms doesn't have the ID pin connected, so
> >> the event is not generated. In such case, for detecting the disconnection
> >> event, we can get the cable state from an extcon driver. We need, though,
> >> to force to set the B-Device Session Valid bit on the PHY to have the
> >> device respond to setup address. Otherwise, the following error is
> >> shown:
> >>
> >> usb 2-2: Device not responding to setup address.
> >> usb 2-2: device not accepting address 14, error -71
> >> usb usb2-port2: unable to enumerate USB device
> >>
> >> The patch allows to tell the PHY to force the B-Device Session Valid bit
> >> when the OTG role is device and clear that bit if the OTG role is host.
> >>
> >> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> >
> >> @@ -1024,6 +1051,12 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
> >> INIT_DELAYED_WORK(&rport->chg_work, rockchip_chg_detect_work);
> >> INIT_DELAYED_WORK(&rport->otg_sm_work, rockchip_usb2phy_otg_sm_work);
> >>
> >> + rport->force_bvalid = false;
> >> + if (of_device_is_compatible(rphy->dev->of_node,
> >> + "rockchip,rk3399-usb2phy"))
> >> + rport->force_bvalid = of_property_read_bool(child_np,
> >> + "rockchip,force-bvalid");
> >
> > That feels a bit clumsy, especially as the rk3399 seems to have the id
>
> Agree, It is, let me explain :)
>
> Ideally we shouldn't have this check, to get rid of this check I only need the
> offsets for bvalid_session register for all the compatibles and fill in phy
> configuration data (rk3228_phy_cfgs, &rk3328_phy_cfgs, rk3366_phy_cfgs,
> rv1108_phy_cfgs)
>
> To be honest I didn't look if all the datasheets are public available, let me do
> some research. Or, if anyone has the datasheet and can tell where the
> bvalid_session bit is I can fill all the data.
Or just always check for the presence of the property and just make the
driver warn if that bvalid_session setting is not available for that soc yet.
>From the TRMs I have your rk3399 bvalid_session settings seems to live
in the depths of the undocumented inno-phy regs, so that will probably
be the same for other socs using that phy.
Heiko
next prev parent reply other threads:[~2018-08-15 10:36 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 9:59 [PATCH 0/4] phy: rockchip-inno-usb2: document improvements and allow to force B-device valid session bit Enric Balletbo i Serra
2018-08-15 9:59 ` Enric Balletbo i Serra
2018-08-15 9:59 ` [PATCH 1/4] phy: rockchip-inno-usb2: fix misspelling and kernel-doc documentation Enric Balletbo i Serra
2018-08-15 9:59 ` Enric Balletbo i Serra
2018-08-15 10:31 ` Heiko Stuebner
2018-08-15 10:31 ` Heiko Stuebner
2019-01-08 17:35 ` Enric Balletbo Serra
2019-01-08 17:35 ` Enric Balletbo Serra
2019-01-08 17:38 ` Heiko Stübner
2019-01-08 17:38 ` Heiko Stübner
2018-08-15 9:59 ` [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties Enric Balletbo i Serra
2018-08-15 9:59 ` Enric Balletbo i Serra
2018-08-15 10:29 ` Heiko Stuebner
2018-08-15 10:29 ` Heiko Stuebner
2018-08-15 11:08 ` Enric Balletbo i Serra
2018-08-15 11:08 ` Enric Balletbo i Serra
2018-08-15 11:22 ` Heiko Stuebner
2018-08-15 11:22 ` Heiko Stuebner
2018-08-15 22:21 ` Rob Herring
2018-08-15 22:21 ` Rob Herring
2018-08-16 8:38 ` Enric Balletbo i Serra
2018-08-16 8:38 ` Enric Balletbo i Serra
2018-08-15 9:59 ` [PATCH 3/4] phy: rockchip-inno-usb2: allow to force the B-Device Session Valid bit Enric Balletbo i Serra
2018-08-15 9:59 ` Enric Balletbo i Serra
2018-08-15 10:18 ` Heiko Stuebner
2018-08-15 10:18 ` Heiko Stuebner
2018-08-15 10:34 ` Enric Balletbo i Serra
2018-08-15 10:34 ` Enric Balletbo i Serra
2018-08-15 10:36 ` Heiko Stuebner [this message]
2018-08-15 10:36 ` Heiko Stuebner
2018-08-15 9:59 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Enric Balletbo i Serra
2018-08-15 9:59 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip, force-bvalid property Enric Balletbo i Serra
2018-08-15 10:34 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Heiko Stuebner
2018-08-15 10:34 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip, force-bvalid property Heiko Stuebner
2018-08-15 22:26 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Rob Herring
2018-08-15 22:26 ` Rob Herring
2019-01-10 9:06 ` Enric Balletbo Serra
2019-01-10 9:06 ` Enric Balletbo Serra
2019-01-10 12:31 ` Heiko Stuebner
2019-01-10 12:31 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip, force-bvalid property Heiko Stuebner
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=2399692.mpX5uTAn2d@phil \
--to=heiko@sntech.de \
--cc=amstan@chromium.org \
--cc=bleung@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=groeck@google.com \
--cc=kernel@collabora.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.