Skip to content

Commit

Permalink
Merge tag 'phy-for-4.6-rc' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/kishon/linux-phy into usb-linus

Kishon writes:

phy: for 4.6-rc

*) make rockchip-dp and rockchip-emmc PHY child device of
   GRF

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
  • Loading branch information
Greg Kroah-Hartman committed Apr 22, 2016
2 parents 5813dea + 5128de8 commit d40d334
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 18 deletions.
18 changes: 11 additions & 7 deletions Documentation/devicetree/bindings/phy/rockchip-dp-phy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ Required properties:
of memory mapped region.
- clock-names: from common clock binding:
Required elements: "24m"
- rockchip,grf: phandle to the syscon managing the "general register files"
- #phy-cells : from the generic PHY bindings, must be 0;

Example:

edp_phy: edp-phy {
compatible = "rockchip,rk3288-dp-phy";
rockchip,grf = <&grf>;
clocks = <&cru SCLK_EDP_24M>;
clock-names = "24m";
#phy-cells = <0>;
grf: syscon@ff770000 {
compatible = "rockchip,rk3288-grf", "syscon", "simple-mfd";

...

edp_phy: edp-phy {
compatible = "rockchip,rk3288-dp-phy";
clocks = <&cru SCLK_EDP_24M>;
clock-names = "24m";
#phy-cells = <0>;
};
};
22 changes: 14 additions & 8 deletions Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ Rockchip EMMC PHY

Required properties:
- compatible: rockchip,rk3399-emmc-phy
- rockchip,grf : phandle to the syscon managing the "general
register files"
- #phy-cells: must be 0
- reg: PHY configure reg address offset in "general
- reg: PHY register address offset and length in "general
register files"

Example:

emmcphy: phy {
compatible = "rockchip,rk3399-emmc-phy";
rockchip,grf = <&grf>;
reg = <0xf780>;
#phy-cells = <0>;

grf: syscon@ff770000 {
compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
#address-cells = <1>;
#size-cells = <1>;

...

emmcphy: phy@f780 {
compatible = "rockchip,rk3399-emmc-phy";
reg = <0xf780 0x20>;
#phy-cells = <0>;
};
};
7 changes: 5 additions & 2 deletions drivers/phy/phy-rockchip-dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev)
if (!np)
return -ENODEV;

if (!dev->parent || !dev->parent->of_node)
return -ENODEV;

dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
if (IS_ERR(dp))
return -ENOMEM;
Expand All @@ -104,9 +107,9 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev)
return ret;
}

dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
dp->grf = syscon_node_to_regmap(dev->parent->of_node);
if (IS_ERR(dp->grf)) {
dev_err(dev, "rk3288-dp needs rockchip,grf property\n");
dev_err(dev, "rk3288-dp needs the General Register Files syscon\n");
return PTR_ERR(dp->grf);
}

Expand Down
5 changes: 4 additions & 1 deletion drivers/phy/phy-rockchip-emmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev)
struct regmap *grf;
unsigned int reg_offset;

grf = syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,grf");
if (!dev->parent || !dev->parent->of_node)
return -ENODEV;

grf = syscon_node_to_regmap(dev->parent->of_node);
if (IS_ERR(grf)) {
dev_err(dev, "Missing rockchip,grf property\n");
return PTR_ERR(grf);
Expand Down

0 comments on commit d40d334

Please sign in to comment.