aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorRoman Byshko <rbyshko@gmail.com>2014-11-10 13:55:06 -0500
committerKishon Vijay Abraham I <kishon@ti.com>2014-11-13 01:19:23 -0500
commit6827a46f59942208d45e0c40e53f649bfc7792ed (patch)
treef72520e86dd95f58b607d8e07606e72423f33c02 /drivers/phy
parent491e049064a4ea69ba4b35bdf614f12bc762a717 (diff)
phy: sun4i: add support for USB phy0
The driver for sun4i USB phys currently supports only phy1 and phy2 which are used for USB host controllers. This patch adds support for USB phy0, which is used by the musb hdrc USB controller. Signed-off-by: Roman Byshko <rbyshko@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-sun4i-usb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index 0baf5efc8a40..6bd2b0c972cc 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -157,6 +157,10 @@ static int sun4i_usb_phy_init(struct phy *_phy)
157 return ret; 157 return ret;
158 } 158 }
159 159
160 /* Enable USB 45 Ohm resistor calibration */
161 if (phy->index == 0)
162 sun4i_usb_phy_write(phy, PHY_RES45_CAL_EN, 0x01, 1);
163
160 /* Adjust PHY's magnitude and rate */ 164 /* Adjust PHY's magnitude and rate */
161 sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5); 165 sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5);
162 166
@@ -213,7 +217,7 @@ static struct phy *sun4i_usb_phy_xlate(struct device *dev,
213{ 217{
214 struct sun4i_usb_phy_data *data = dev_get_drvdata(dev); 218 struct sun4i_usb_phy_data *data = dev_get_drvdata(dev);
215 219
216 if (WARN_ON(args->args[0] == 0 || args->args[0] >= data->num_phys)) 220 if (args->args[0] >= data->num_phys)
217 return ERR_PTR(-ENODEV); 221 return ERR_PTR(-ENODEV);
218 222
219 return data->phys[args->args[0]].phy; 223 return data->phys[args->args[0]].phy;
@@ -255,8 +259,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
255 if (IS_ERR(data->base)) 259 if (IS_ERR(data->base))
256 return PTR_ERR(data->base); 260 return PTR_ERR(data->base);
257 261
258 /* Skip 0, 0 is the phy for otg which is not yet supported. */ 262 for (i = 0; i < data->num_phys; i++) {
259 for (i = 1; i < data->num_phys; i++) {
260 struct sun4i_usb_phy *phy = data->phys + i; 263 struct sun4i_usb_phy *phy = data->phys + i;
261 char name[16]; 264 char name[16];
262 265