phy: sun4i-usb: Introduce port2 SIDDQ quirk
authorAndre Przywara <andre.przywara@arm.com>
Mon, 31 Oct 2022 11:13:54 +0000 (11:13 +0000)
committerVinod Koul <vkoul@kernel.org>
Mon, 7 Nov 2022 04:50:25 +0000 (10:20 +0530)
commitb45c6d80325bec2b78c716629a518b6442d8bdc6
tree8953143fd6f61849e4933a296c6bc691a4e9b126
parent6964affe65066651eca21e97247d3b7cac5153dc
phy: sun4i-usb: Introduce port2 SIDDQ quirk

At least the Allwinner H616 SoC requires a weird quirk to make most
USB PHYs work: Only port2 works out of the box, but all other ports
need some help from this port2 to work correctly: The CLK_BUS_PHY2 and
RST_USB_PHY2 clock and reset need to be enabled, and the SIDDQ bit in
the PMU PHY control register needs to be cleared. For this register to
be accessible, CLK_BUS_ECHI2 needs to be ungated. Don't ask ....

Instead of disguising this as some generic feature, treat it more like
a quirk (what it really is):
If the quirk bit is set, and we initialise a PHY other than PHY2, ungate
this one special clock, and clear the SIDDQ bit. We also pick the clock
and reset from PHY2 and enable them as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20221031111358.3387297-4-andre.przywara@arm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/allwinner/phy-sun4i-usb.c