[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8e06da42c86b29dcb645d1bceaedae879e6aeca0.camel@linaro.org>
Date: Sat, 15 Feb 2025 16:09:48 +0000
From: André Draszik <andre.draszik@...aro.org>
To: Krzysztof Kozlowski <krzk@...nel.org>, Marek Szyprowski
<m.szyprowski@...sung.com>, Vinod Koul <vkoul@...nel.org>, Kishon Vijay
Abraham I <kishon@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Sylwester Nawrocki <s.nawrocki@...sung.com>, Alim Akhtar
<alim.akhtar@...sung.com>
Cc: Peter Griffin <peter.griffin@...aro.org>, Tudor Ambarus
<tudor.ambarus@...aro.org>, Sam Protsenko <semen.protsenko@...aro.org>,
Will McVicker <willmcvicker@...gle.com>, Roy Luo <royluo@...gle.com>,
kernel-team@...roid.com, linux-phy@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH v4 6/7] phy: exynos5-usbdrd: subscribe to orientation
notifier if required
Hi Krzysztof,
On Sat, 2025-02-15 at 11:07 +0100, Krzysztof Kozlowski wrote:
> On 14/02/2025 20:30, Marek Szyprowski wrote:
> > On 06.12.2024 17:31, André Draszik wrote:
> > > gs101's SS phy needs to be configured differently based on the
> > > connector orientation, as the SS link can only be established if the
> > > mux is configured correctly.
> > >
> > > The code to handle programming of the mux is in place already, this commit
> > > now adds the missing pieces to subscribe to the Type-C orientation
> > > switch event.
> > >
> > > Note that for this all to work we rely on the USB controller
> > > re-initialising us. It should invoke our .exit() upon cable unplug, and
> > > during cable plug we'll receive the orientation event after which we
> > > expect our .init() to be called.
> > >
> > > Above reinitialisation happens if the DWC3 controller can enter runtime
> > > suspend automatically. For the DWC3 driver, this is an opt-in:
> > > echo auto > /sys/devices/.../11110000.usb/power/control
> > > Once done, things work as long as the UDC is not bound as otherwise it
> > > stays busy because it doesn't cancel / stop outstanding TRBs. For now
> > > we have to manually unbind the UDC in that case:
> > > echo "" > sys/kernel/config/usb_gadget/.../UDC
> > >
> > > Note that if the orientation-switch property is missing from the DT,
> > > the code will behave as before this commit (meaning for gs101 it will
> > > work in SS mode in one orientation only). Other platforms are not
> > > affected either way.
> > >
> > > Signed-off-by: André Draszik <andre.draszik@...aro.org>
> > >
> > > ---
> > > v3:
> > > * drop init to -1 of phy_drd->orientation (Vinod)
> > > * avoid #ifdef and switch to normal conditional IS_ENABLED() for
> > > CONFIG_TYPEC
> > >
> > > v2:
> > > * move #include typec_mux.h from parent patch into this one (Peter)
> > > ---
> > > drivers/phy/samsung/Kconfig | 1 +
> > > drivers/phy/samsung/phy-exynos5-usbdrd.c | 56 ++++++++++++++++++++++++++++++++
> > > 2 files changed, 57 insertions(+)
> > >
> > > diff --git a/drivers/phy/samsung/Kconfig b/drivers/phy/samsung/Kconfig
> > > index f10afa3d7ff5..fc7bd1088576 100644
> > > --- a/drivers/phy/samsung/Kconfig
> > > +++ b/drivers/phy/samsung/Kconfig
> > > @@ -80,6 +80,7 @@ config PHY_EXYNOS5_USBDRD
> > > tristate "Exynos5 SoC series USB DRD PHY driver"
> > > depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> > > depends on HAS_IOMEM
> > > + depends on TYPEC || (TYPEC=n && COMPILE_TEST)
>
> BTW, this syntax never made any sense - it did not work. The optional
> dependency is expressed as:
> depends on TYPEC || !TYPEC
The depends is required to get it to link. PHY_EXYNOS5_USBDRD
defaults to Y, while TYPEC defaults to M in the arm64 defconfig.
Using this expression, PHY_EXYNOS5_USBDRD changes to M.
Otherwise it won't link.
> but what it epxressed is that it is possible to build it without typec
> only for compile test, which is odd if this was meant to be optional.
> And further code:
> if (!IS_ENABLED(CONFIG_TYPEC))
>
> clearly suggests this should be optional.
Yes, it's meant to be optional.
Cheers,
Andre'
Powered by blists - more mailing lists