aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy/ti
diff options
context:
space:
mode:
authorDavid Lechner <david@lechnology.com>2018-02-17 22:22:24 -0500
committerSekhar Nori <nsekhar@ti.com>2018-02-19 05:49:25 -0500
commitbdec5a6b57896da81bc47262868468717a06bb69 (patch)
tree0cc9d80c5ac35d5c4cd205f1c16bbb46e6b1be01 /drivers/phy/ti
parente98bbbf3bd59d5283750e8f56031bd1cc2feafd8 (diff)
ARM: da8xx: use platform data for CFGCHIP syscon regmap
This converts from using a platform device for the CFGCHIP syscon regmap to using platform data to pass the regmap to consumers. A lazy getter function is used so that the regmap will only be created if it is actually used. This function will also be used in the clock init when we convert to the common clock framework. The USB PHY driver is currently the only consumer. This driver is updated to use platform data to get the CFGCHIP regmap instead of syscon_regmap_lookup_by_pdevname(). Signed-off-by: David Lechner <david@lechnology.com> Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/phy/ti')
-rw-r--r--drivers/phy/ti/phy-da8xx-usb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/phy/ti/phy-da8xx-usb.c b/drivers/phy/ti/phy-da8xx-usb.c
index 5bd33d06df95..befb886ff121 100644
--- a/drivers/phy/ti/phy-da8xx-usb.c
+++ b/drivers/phy/ti/phy-da8xx-usb.c
@@ -20,6 +20,7 @@
20#include <linux/mfd/syscon.h> 20#include <linux/mfd/syscon.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/phy/phy.h> 22#include <linux/phy/phy.h>
23#include <linux/platform_data/phy-da8xx-usb.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/regmap.h> 25#include <linux/regmap.h>
25 26
@@ -145,6 +146,7 @@ static struct phy *da8xx_usb_phy_of_xlate(struct device *dev,
145static int da8xx_usb_phy_probe(struct platform_device *pdev) 146static int da8xx_usb_phy_probe(struct platform_device *pdev)
146{ 147{
147 struct device *dev = &pdev->dev; 148 struct device *dev = &pdev->dev;
149 struct da8xx_usb_phy_platform_data *pdata = dev->platform_data;
148 struct device_node *node = dev->of_node; 150 struct device_node *node = dev->of_node;
149 struct da8xx_usb_phy *d_phy; 151 struct da8xx_usb_phy *d_phy;
150 152
@@ -152,11 +154,11 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
152 if (!d_phy) 154 if (!d_phy)
153 return -ENOMEM; 155 return -ENOMEM;
154 156
155 if (node) 157 if (pdata)
158 d_phy->regmap = pdata->cfgchip;
159 else
156 d_phy->regmap = syscon_regmap_lookup_by_compatible( 160 d_phy->regmap = syscon_regmap_lookup_by_compatible(
157 "ti,da830-cfgchip"); 161 "ti,da830-cfgchip");
158 else
159 d_phy->regmap = syscon_regmap_lookup_by_pdevname("syscon");
160 if (IS_ERR(d_phy->regmap)) { 162 if (IS_ERR(d_phy->regmap)) {
161 dev_err(dev, "Failed to get syscon\n"); 163 dev_err(dev, "Failed to get syscon\n");
162 return PTR_ERR(d_phy->regmap); 164 return PTR_ERR(d_phy->regmap);