Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0da445a authored by Heiko Stuebner's avatar Heiko Stuebner Committed by Kishon Vijay Abraham I
Browse files

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



The usb-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.

As the usb-phy is part of the kernel for some releases now, we keep
the old (and now deprecated) binding for compatibility purposes.

Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent f2e60041
Loading
Loading
Loading
Loading
+17 −10
Original line number Diff line number Diff line
@@ -5,11 +5,13 @@ Required properties:
     "rockchip,rk3066a-usb-phy"
     "rockchip,rk3188-usb-phy"
     "rockchip,rk3288-usb-phy"
 - rockchip,grf : phandle to the syscon managing the "general
   register files"
 - #address-cells: should be 1
 - #size-cells: should be 0

Deprecated properties:
 - rockchip,grf : phandle to the syscon managing the "general
   register files" - phy should be a child of the GRF instead

Sub-nodes:
Each PHY should be represented as a sub-node.

@@ -28,9 +30,13 @@ Optional Properties:

Example:

grf: syscon@ff770000 {
	compatible = "rockchip,rk3288-grf", "syscon", "simple-mfd";

...

	usbphy: phy {
		compatible = "rockchip,rk3288-usb-phy";
	rockchip,grf = <&grf>;
		#address-cells = <1>;
		#size-cells = <0>;

@@ -39,3 +45,4 @@ usbphy: phy {
			reg = <0x320>;
		};
	};
};
+12 −3
Original line number Diff line number Diff line
@@ -397,8 +397,13 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev)
	phy_base->pdata = match->data;

	phy_base->dev = dev;
	phy_base->reg_base = syscon_regmap_lookup_by_phandle(dev->of_node,
							     "rockchip,grf");
	phy_base->reg_base = ERR_PTR(-ENODEV);
	if (dev->parent && dev->parent->of_node)
		phy_base->reg_base = syscon_node_to_regmap(
						dev->parent->of_node);
	if (IS_ERR(phy_base->reg_base))
		phy_base->reg_base = syscon_regmap_lookup_by_phandle(
						dev->of_node, "rockchip,grf");
	if (IS_ERR(phy_base->reg_base)) {
		dev_err(&pdev->dev, "Missing rockchip,grf property\n");
		return PTR_ERR(phy_base->reg_base);
@@ -463,6 +468,10 @@ static int __init rockchip_init_usb_uart(void)
		return -ENOTSUPP;
	}

	grf = ERR_PTR(-ENODEV);
	if (np->parent)
		grf = syscon_node_to_regmap(np->parent);
	if (IS_ERR(grf))
		grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
	if (IS_ERR(grf)) {
		pr_err("%s: Missing rockchip,grf property, %lu\n",