Commit 0d896538 authored by Peter Chen's avatar Peter Chen Committed by Felipe Balbi

usb: phy: mxs: Add anatop regmap

It is needed by imx6 SoC series, but not for imx23 and imx28.
Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d9c13032
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#define DRIVER_NAME "mxs_phy" #define DRIVER_NAME "mxs_phy"
...@@ -87,6 +89,7 @@ struct mxs_phy { ...@@ -87,6 +89,7 @@ struct mxs_phy {
struct usb_phy phy; struct usb_phy phy;
struct clk *clk; struct clk *clk;
const struct mxs_phy_data *data; const struct mxs_phy_data *data;
struct regmap *regmap_anatop;
}; };
static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
...@@ -197,6 +200,7 @@ static int mxs_phy_probe(struct platform_device *pdev) ...@@ -197,6 +200,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
int ret; int ret;
const struct of_device_id *of_id = const struct of_device_id *of_id =
of_match_device(mxs_phy_dt_ids, &pdev->dev); of_match_device(mxs_phy_dt_ids, &pdev->dev);
struct device_node *np = pdev->dev.of_node;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res); base = devm_ioremap_resource(&pdev->dev, res);
...@@ -216,6 +220,17 @@ static int mxs_phy_probe(struct platform_device *pdev) ...@@ -216,6 +220,17 @@ static int mxs_phy_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
/* Some SoCs don't have anatop registers */
if (of_get_property(np, "fsl,anatop", NULL)) {
mxs_phy->regmap_anatop = syscon_regmap_lookup_by_phandle
(np, "fsl,anatop");
if (IS_ERR(mxs_phy->regmap_anatop)) {
dev_dbg(&pdev->dev,
"failed to find regmap for anatop\n");
return PTR_ERR(mxs_phy->regmap_anatop);
}
}
mxs_phy->phy.io_priv = base; mxs_phy->phy.io_priv = base;
mxs_phy->phy.dev = &pdev->dev; mxs_phy->phy.dev = &pdev->dev;
mxs_phy->phy.label = DRIVER_NAME; mxs_phy->phy.label = DRIVER_NAME;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment