Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: rockchip-dp: should be a child device of the GRF

The displayport-phy is fully enclosed in the general register files (GRF).
Therefore as seen from the device-tree it shouldn't be a separate platform-
device but instead a sub-device of the GRF - using the simply-mfd mechanism.

The driver entered the kernel in the current merge-window, so we can still
adapt the binding without needing a fallback, as the binding hasn't been
released with a full kernel yet.

While the edp phy is fully part of the GRF, it doesn't have any separate
register set there, so doesn't get any register-area assigned.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Heiko Stuebner and committed by
Kishon Vijay Abraham I
0311c76e f55532a0

+16 -9
+11 -7
Documentation/devicetree/bindings/phy/rockchip-dp-phy.txt
··· 8 8 of memory mapped region. 9 9 - clock-names: from common clock binding: 10 10 Required elements: "24m" 11 - - rockchip,grf: phandle to the syscon managing the "general register files" 12 11 - #phy-cells : from the generic PHY bindings, must be 0; 13 12 14 13 Example: 15 14 16 - edp_phy: edp-phy { 17 - compatible = "rockchip,rk3288-dp-phy"; 18 - rockchip,grf = <&grf>; 19 - clocks = <&cru SCLK_EDP_24M>; 20 - clock-names = "24m"; 21 - #phy-cells = <0>; 15 + grf: syscon@ff770000 { 16 + compatible = "rockchip,rk3288-grf", "syscon", "simple-mfd"; 17 + 18 + ... 19 + 20 + edp_phy: edp-phy { 21 + compatible = "rockchip,rk3288-dp-phy"; 22 + clocks = <&cru SCLK_EDP_24M>; 23 + clock-names = "24m"; 24 + #phy-cells = <0>; 25 + }; 22 26 };
+5 -2
drivers/phy/phy-rockchip-dp.c
··· 86 86 if (!np) 87 87 return -ENODEV; 88 88 89 + if (!dev->parent || !dev->parent->of_node) 90 + return -ENODEV; 91 + 89 92 dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL); 90 93 if (IS_ERR(dp)) 91 94 return -ENOMEM; ··· 107 104 return ret; 108 105 } 109 106 110 - dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); 107 + dp->grf = syscon_node_to_regmap(dev->parent->of_node); 111 108 if (IS_ERR(dp->grf)) { 112 - dev_err(dev, "rk3288-dp needs rockchip,grf property\n"); 109 + dev_err(dev, "rk3288-dp needs the General Register Files syscon\n"); 113 110 return PTR_ERR(dp->grf); 114 111 } 115 112