phy: rockchip-inno-usb2: Support multi-bit mask properties
authorSamuel Holland <samuel@sholland.org>
Thu, 14 Apr 2022 03:22:55 +0000 (22:22 -0500)
committerVinod Koul <vkoul@kernel.org>
Wed, 20 Apr 2022 09:14:03 +0000 (14:44 +0530)
The "bvalid" and "id" interrupts can trigger on either the rising edge
or the falling edge, so each interrupt has two enable bits and two
status bits. This change allows using a single property for both bits,
checking whether either bit is set.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Tested-by: Michael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.kernel.org/r/20220414032258.40984-5-samuel@sholland.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/rockchip/phy-rockchip-inno-usb2.c

index 3422db56be76b735e02e166d06428eff23a548b1..c694517496f811af624a40fac867553779d05f98 100644 (file)
@@ -253,7 +253,7 @@ static inline bool property_enabled(struct regmap *base,
                return false;
 
        tmp = (orig & mask) >> reg->bitstart;
-       return tmp == reg->enable;
+       return tmp != reg->disable;
 }
 
 static int rockchip_usb2phy_clk480m_prepare(struct clk_hw *hw)