diff options
Diffstat (limited to 'drivers/usb/otg')
| -rw-r--r-- | drivers/usb/otg/Kconfig | 6 | ||||
| -rw-r--r-- | drivers/usb/otg/ab8500-usb.c | 6 | ||||
| -rw-r--r-- | drivers/usb/otg/fsl_otg.c | 6 | ||||
| -rw-r--r-- | drivers/usb/otg/isp1301_omap.c | 2 | ||||
| -rw-r--r-- | drivers/usb/otg/msm_otg.c | 4 | ||||
| -rw-r--r-- | drivers/usb/otg/mv_otg.c | 18 | ||||
| -rw-r--r-- | drivers/usb/otg/mxs-phy.c | 59 | ||||
| -rw-r--r-- | drivers/usb/otg/nop-usb-xceiv.c | 6 | ||||
| -rw-r--r-- | drivers/usb/otg/twl4030-usb.c | 48 | ||||
| -rw-r--r-- | drivers/usb/otg/twl6030-usb.c | 2 |
10 files changed, 57 insertions, 100 deletions
diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig index d8c8a42bff3e..37962c99ff1e 100644 --- a/drivers/usb/otg/Kconfig +++ b/drivers/usb/otg/Kconfig | |||
| @@ -58,7 +58,7 @@ config USB_ULPI_VIEWPORT | |||
| 58 | 58 | ||
| 59 | config TWL4030_USB | 59 | config TWL4030_USB |
| 60 | tristate "TWL4030 USB Transceiver Driver" | 60 | tristate "TWL4030 USB Transceiver Driver" |
| 61 | depends on TWL4030_CORE && REGULATOR_TWL4030 | 61 | depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS |
| 62 | select USB_OTG_UTILS | 62 | select USB_OTG_UTILS |
| 63 | help | 63 | help |
| 64 | Enable this to support the USB OTG transceiver on TWL4030 | 64 | Enable this to support the USB OTG transceiver on TWL4030 |
| @@ -68,7 +68,7 @@ config TWL4030_USB | |||
| 68 | 68 | ||
| 69 | config TWL6030_USB | 69 | config TWL6030_USB |
| 70 | tristate "TWL6030 USB Transceiver Driver" | 70 | tristate "TWL6030 USB Transceiver Driver" |
| 71 | depends on TWL4030_CORE && OMAP_USB2 | 71 | depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS |
| 72 | select USB_OTG_UTILS | 72 | select USB_OTG_UTILS |
| 73 | help | 73 | help |
| 74 | Enable this to support the USB OTG transceiver on TWL6030 | 74 | Enable this to support the USB OTG transceiver on TWL6030 |
| @@ -110,7 +110,7 @@ config AB8500_USB | |||
| 110 | 110 | ||
| 111 | config FSL_USB2_OTG | 111 | config FSL_USB2_OTG |
| 112 | bool "Freescale USB OTG Transceiver Driver" | 112 | bool "Freescale USB OTG Transceiver Driver" |
| 113 | depends on USB_EHCI_FSL && USB_GADGET_FSL_USB2 && USB_SUSPEND | 113 | depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND |
| 114 | select USB_OTG | 114 | select USB_OTG |
| 115 | select USB_OTG_UTILS | 115 | select USB_OTG_UTILS |
| 116 | help | 116 | help |
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index ae8ad561f083..2d86f26a0183 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c | |||
| @@ -468,7 +468,7 @@ static int ab8500_usb_v2_res_setup(struct platform_device *pdev, | |||
| 468 | return 0; | 468 | return 0; |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | static int __devinit ab8500_usb_probe(struct platform_device *pdev) | 471 | static int ab8500_usb_probe(struct platform_device *pdev) |
| 472 | { | 472 | { |
| 473 | struct ab8500_usb *ab; | 473 | struct ab8500_usb *ab; |
| 474 | struct usb_otg *otg; | 474 | struct usb_otg *otg; |
| @@ -546,7 +546,7 @@ fail0: | |||
| 546 | return err; | 546 | return err; |
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | static int __devexit ab8500_usb_remove(struct platform_device *pdev) | 549 | static int ab8500_usb_remove(struct platform_device *pdev) |
| 550 | { | 550 | { |
| 551 | struct ab8500_usb *ab = platform_get_drvdata(pdev); | 551 | struct ab8500_usb *ab = platform_get_drvdata(pdev); |
| 552 | 552 | ||
| @@ -571,7 +571,7 @@ static int __devexit ab8500_usb_remove(struct platform_device *pdev) | |||
| 571 | 571 | ||
| 572 | static struct platform_driver ab8500_usb_driver = { | 572 | static struct platform_driver ab8500_usb_driver = { |
| 573 | .probe = ab8500_usb_probe, | 573 | .probe = ab8500_usb_probe, |
| 574 | .remove = __devexit_p(ab8500_usb_remove), | 574 | .remove = ab8500_usb_remove, |
| 575 | .driver = { | 575 | .driver = { |
| 576 | .name = "ab8500-usb", | 576 | .name = "ab8500-usb", |
| 577 | .owner = THIS_MODULE, | 577 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/otg/fsl_otg.c index c19d1d7173a9..d16adb41eb21 100644 --- a/drivers/usb/otg/fsl_otg.c +++ b/drivers/usb/otg/fsl_otg.c | |||
| @@ -1110,7 +1110,7 @@ static const struct file_operations otg_fops = { | |||
| 1110 | .release = fsl_otg_release, | 1110 | .release = fsl_otg_release, |
| 1111 | }; | 1111 | }; |
| 1112 | 1112 | ||
| 1113 | static int __devinit fsl_otg_probe(struct platform_device *pdev) | 1113 | static int fsl_otg_probe(struct platform_device *pdev) |
| 1114 | { | 1114 | { |
| 1115 | int ret; | 1115 | int ret; |
| 1116 | 1116 | ||
| @@ -1144,7 +1144,7 @@ static int __devinit fsl_otg_probe(struct platform_device *pdev) | |||
| 1144 | return ret; | 1144 | return ret; |
| 1145 | } | 1145 | } |
| 1146 | 1146 | ||
| 1147 | static int __devexit fsl_otg_remove(struct platform_device *pdev) | 1147 | static int fsl_otg_remove(struct platform_device *pdev) |
| 1148 | { | 1148 | { |
| 1149 | struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; | 1149 | struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; |
| 1150 | 1150 | ||
| @@ -1169,7 +1169,7 @@ static int __devexit fsl_otg_remove(struct platform_device *pdev) | |||
| 1169 | 1169 | ||
| 1170 | struct platform_driver fsl_otg_driver = { | 1170 | struct platform_driver fsl_otg_driver = { |
| 1171 | .probe = fsl_otg_probe, | 1171 | .probe = fsl_otg_probe, |
| 1172 | .remove = __devexit_p(fsl_otg_remove), | 1172 | .remove = fsl_otg_remove, |
| 1173 | .driver = { | 1173 | .driver = { |
| 1174 | .name = driver_name, | 1174 | .name = driver_name, |
| 1175 | .owner = THIS_MODULE, | 1175 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c index ceee2119bffa..af9cb11626b2 100644 --- a/drivers/usb/otg/isp1301_omap.c +++ b/drivers/usb/otg/isp1301_omap.c | |||
| @@ -1493,7 +1493,7 @@ isp1301_start_hnp(struct usb_otg *otg) | |||
| 1493 | 1493 | ||
| 1494 | /*-------------------------------------------------------------------------*/ | 1494 | /*-------------------------------------------------------------------------*/ |
| 1495 | 1495 | ||
| 1496 | static int __devinit | 1496 | static int |
| 1497 | isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id) | 1497 | isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id) |
| 1498 | { | 1498 | { |
| 1499 | int status; | 1499 | int status; |
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c index 9f5fc906041a..3b9f0d951132 100644 --- a/drivers/usb/otg/msm_otg.c +++ b/drivers/usb/otg/msm_otg.c | |||
| @@ -1606,7 +1606,7 @@ free_motg: | |||
| 1606 | return ret; | 1606 | return ret; |
| 1607 | } | 1607 | } |
| 1608 | 1608 | ||
| 1609 | static int __devexit msm_otg_remove(struct platform_device *pdev) | 1609 | static int msm_otg_remove(struct platform_device *pdev) |
| 1610 | { | 1610 | { |
| 1611 | struct msm_otg *motg = platform_get_drvdata(pdev); | 1611 | struct msm_otg *motg = platform_get_drvdata(pdev); |
| 1612 | struct usb_phy *phy = &motg->phy; | 1612 | struct usb_phy *phy = &motg->phy; |
| @@ -1746,7 +1746,7 @@ static const struct dev_pm_ops msm_otg_dev_pm_ops = { | |||
| 1746 | #endif | 1746 | #endif |
| 1747 | 1747 | ||
| 1748 | static struct platform_driver msm_otg_driver = { | 1748 | static struct platform_driver msm_otg_driver = { |
| 1749 | .remove = __devexit_p(msm_otg_remove), | 1749 | .remove = msm_otg_remove, |
| 1750 | .driver = { | 1750 | .driver = { |
| 1751 | .name = DRIVER_NAME, | 1751 | .name = DRIVER_NAME, |
| 1752 | .owner = THIS_MODULE, | 1752 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c index 3f124e8f5792..eace975991a8 100644 --- a/drivers/usb/otg/mv_otg.c +++ b/drivers/usb/otg/mv_otg.c | |||
| @@ -240,7 +240,7 @@ static void otg_clock_enable(struct mv_otg *mvotg) | |||
| 240 | unsigned int i; | 240 | unsigned int i; |
| 241 | 241 | ||
| 242 | for (i = 0; i < mvotg->clknum; i++) | 242 | for (i = 0; i < mvotg->clknum; i++) |
| 243 | clk_enable(mvotg->clk[i]); | 243 | clk_prepare_enable(mvotg->clk[i]); |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | static void otg_clock_disable(struct mv_otg *mvotg) | 246 | static void otg_clock_disable(struct mv_otg *mvotg) |
| @@ -248,7 +248,7 @@ static void otg_clock_disable(struct mv_otg *mvotg) | |||
| 248 | unsigned int i; | 248 | unsigned int i; |
| 249 | 249 | ||
| 250 | for (i = 0; i < mvotg->clknum; i++) | 250 | for (i = 0; i < mvotg->clknum; i++) |
| 251 | clk_disable(mvotg->clk[i]); | 251 | clk_disable_unprepare(mvotg->clk[i]); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | static int mv_otg_enable_internal(struct mv_otg *mvotg) | 254 | static int mv_otg_enable_internal(struct mv_otg *mvotg) |
| @@ -958,16 +958,4 @@ static struct platform_driver mv_otg_driver = { | |||
| 958 | .resume = mv_otg_resume, | 958 | .resume = mv_otg_resume, |
| 959 | #endif | 959 | #endif |
| 960 | }; | 960 | }; |
| 961 | 961 | module_platform_driver(mv_otg_driver); | |
| 962 | static int __init mv_otg_init(void) | ||
| 963 | { | ||
| 964 | return platform_driver_register(&mv_otg_driver); | ||
| 965 | } | ||
| 966 | |||
| 967 | static void __exit mv_otg_exit(void) | ||
| 968 | { | ||
| 969 | platform_driver_unregister(&mv_otg_driver); | ||
| 970 | } | ||
| 971 | |||
| 972 | module_init(mv_otg_init); | ||
| 973 | module_exit(mv_otg_exit); | ||
diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c index 88db976647cf..76302720055a 100644 --- a/drivers/usb/otg/mxs-phy.c +++ b/drivers/usb/otg/mxs-phy.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
| 21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
| 22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
| 23 | #include <linux/workqueue.h> | ||
| 24 | 23 | ||
| 25 | #define DRIVER_NAME "mxs_phy" | 24 | #define DRIVER_NAME "mxs_phy" |
| 26 | 25 | ||
| @@ -35,16 +34,9 @@ | |||
| 35 | #define BM_USBPHY_CTRL_ENUTMILEVEL2 BIT(14) | 34 | #define BM_USBPHY_CTRL_ENUTMILEVEL2 BIT(14) |
| 36 | #define BM_USBPHY_CTRL_ENHOSTDISCONDETECT BIT(1) | 35 | #define BM_USBPHY_CTRL_ENHOSTDISCONDETECT BIT(1) |
| 37 | 36 | ||
| 38 | /* | ||
| 39 | * Amount of delay in miliseconds to safely enable ENHOSTDISCONDETECT bit | ||
| 40 | * so that connection and reset processing can be completed for the root hub. | ||
| 41 | */ | ||
| 42 | #define MXY_PHY_ENHOSTDISCONDETECT_DELAY 250 | ||
| 43 | |||
| 44 | struct mxs_phy { | 37 | struct mxs_phy { |
| 45 | struct usb_phy phy; | 38 | struct usb_phy phy; |
| 46 | struct clk *clk; | 39 | struct clk *clk; |
| 47 | struct delayed_work enhostdiscondetect_work; | ||
| 48 | }; | 40 | }; |
| 49 | 41 | ||
| 50 | #define to_mxs_phy(p) container_of((p), struct mxs_phy, phy) | 42 | #define to_mxs_phy(p) container_of((p), struct mxs_phy, phy) |
| @@ -70,7 +62,6 @@ static int mxs_phy_init(struct usb_phy *phy) | |||
| 70 | 62 | ||
| 71 | clk_prepare_enable(mxs_phy->clk); | 63 | clk_prepare_enable(mxs_phy->clk); |
| 72 | mxs_phy_hw_init(mxs_phy); | 64 | mxs_phy_hw_init(mxs_phy); |
| 73 | INIT_DELAYED_WORK(&mxs_phy->enhostdiscondetect_work, NULL); | ||
| 74 | 65 | ||
| 75 | return 0; | 66 | return 0; |
| 76 | } | 67 | } |
| @@ -85,46 +76,28 @@ static void mxs_phy_shutdown(struct usb_phy *phy) | |||
| 85 | clk_disable_unprepare(mxs_phy->clk); | 76 | clk_disable_unprepare(mxs_phy->clk); |
| 86 | } | 77 | } |
| 87 | 78 | ||
| 88 | static void mxs_phy_enhostdiscondetect_delay(struct work_struct *ws) | 79 | static int mxs_phy_on_connect(struct usb_phy *phy, |
| 80 | enum usb_device_speed speed) | ||
| 89 | { | 81 | { |
| 90 | struct mxs_phy *mxs_phy = container_of(ws, struct mxs_phy, | 82 | dev_dbg(phy->dev, "%s speed device has connected\n", |
| 91 | enhostdiscondetect_work.work); | 83 | (speed == USB_SPEED_HIGH) ? "high" : "non-high"); |
| 92 | |||
| 93 | /* Enable HOSTDISCONDETECT after delay. */ | ||
| 94 | dev_dbg(mxs_phy->phy.dev, "Setting ENHOSTDISCONDETECT\n"); | ||
| 95 | writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT, | ||
| 96 | mxs_phy->phy.io_priv + HW_USBPHY_CTRL_SET); | ||
| 97 | } | ||
| 98 | |||
| 99 | static int mxs_phy_on_connect(struct usb_phy *phy, int port) | ||
| 100 | { | ||
| 101 | struct mxs_phy *mxs_phy = to_mxs_phy(phy); | ||
| 102 | |||
| 103 | dev_dbg(phy->dev, "Connect on port %d\n", port); | ||
| 104 | |||
| 105 | mxs_phy_hw_init(mxs_phy); | ||
| 106 | 84 | ||
| 107 | /* | 85 | if (speed == USB_SPEED_HIGH) |
| 108 | * Delay enabling ENHOSTDISCONDETECT so that connection and | 86 | writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT, |
| 109 | * reset processing can be completed for the root hub. | 87 | phy->io_priv + HW_USBPHY_CTRL_SET); |
| 110 | */ | ||
| 111 | dev_dbg(phy->dev, "Delaying setting ENHOSTDISCONDETECT\n"); | ||
| 112 | PREPARE_DELAYED_WORK(&mxs_phy->enhostdiscondetect_work, | ||
| 113 | mxs_phy_enhostdiscondetect_delay); | ||
| 114 | schedule_delayed_work(&mxs_phy->enhostdiscondetect_work, | ||
| 115 | msecs_to_jiffies(MXY_PHY_ENHOSTDISCONDETECT_DELAY)); | ||
| 116 | 88 | ||
| 117 | return 0; | 89 | return 0; |
| 118 | } | 90 | } |
| 119 | 91 | ||
| 120 | static int mxs_phy_on_disconnect(struct usb_phy *phy, int port) | 92 | static int mxs_phy_on_disconnect(struct usb_phy *phy, |
| 93 | enum usb_device_speed speed) | ||
| 121 | { | 94 | { |
| 122 | dev_dbg(phy->dev, "Disconnect on port %d\n", port); | 95 | dev_dbg(phy->dev, "%s speed device has disconnected\n", |
| 96 | (speed == USB_SPEED_HIGH) ? "high" : "non-high"); | ||
| 123 | 97 | ||
| 124 | /* No need to delay before clearing ENHOSTDISCONDETECT. */ | 98 | if (speed == USB_SPEED_HIGH) |
| 125 | dev_dbg(phy->dev, "Clearing ENHOSTDISCONDETECT\n"); | 99 | writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT, |
| 126 | writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT, | 100 | phy->io_priv + HW_USBPHY_CTRL_CLR); |
| 127 | phy->io_priv + HW_USBPHY_CTRL_CLR); | ||
| 128 | 101 | ||
| 129 | return 0; | 102 | return 0; |
| 130 | } | 103 | } |
| @@ -176,7 +149,7 @@ static int mxs_phy_probe(struct platform_device *pdev) | |||
| 176 | return 0; | 149 | return 0; |
| 177 | } | 150 | } |
| 178 | 151 | ||
| 179 | static int __devexit mxs_phy_remove(struct platform_device *pdev) | 152 | static int mxs_phy_remove(struct platform_device *pdev) |
| 180 | { | 153 | { |
| 181 | platform_set_drvdata(pdev, NULL); | 154 | platform_set_drvdata(pdev, NULL); |
| 182 | 155 | ||
| @@ -191,7 +164,7 @@ MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids); | |||
| 191 | 164 | ||
| 192 | static struct platform_driver mxs_phy_driver = { | 165 | static struct platform_driver mxs_phy_driver = { |
| 193 | .probe = mxs_phy_probe, | 166 | .probe = mxs_phy_probe, |
| 194 | .remove = __devexit_p(mxs_phy_remove), | 167 | .remove = mxs_phy_remove, |
| 195 | .driver = { | 168 | .driver = { |
| 196 | .name = DRIVER_NAME, | 169 | .name = DRIVER_NAME, |
| 197 | .owner = THIS_MODULE, | 170 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index e52e35e7adaf..a3ce24b94a73 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c | |||
| @@ -93,7 +93,7 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host) | |||
| 93 | return 0; | 93 | return 0; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev) | 96 | static int nop_usb_xceiv_probe(struct platform_device *pdev) |
| 97 | { | 97 | { |
| 98 | struct nop_usb_xceiv_platform_data *pdata = pdev->dev.platform_data; | 98 | struct nop_usb_xceiv_platform_data *pdata = pdev->dev.platform_data; |
| 99 | struct nop_usb_xceiv *nop; | 99 | struct nop_usb_xceiv *nop; |
| @@ -141,7 +141,7 @@ exit: | |||
| 141 | return err; | 141 | return err; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | static int __devexit nop_usb_xceiv_remove(struct platform_device *pdev) | 144 | static int nop_usb_xceiv_remove(struct platform_device *pdev) |
| 145 | { | 145 | { |
| 146 | struct nop_usb_xceiv *nop = platform_get_drvdata(pdev); | 146 | struct nop_usb_xceiv *nop = platform_get_drvdata(pdev); |
| 147 | 147 | ||
| @@ -156,7 +156,7 @@ static int __devexit nop_usb_xceiv_remove(struct platform_device *pdev) | |||
| 156 | 156 | ||
| 157 | static struct platform_driver nop_usb_xceiv_driver = { | 157 | static struct platform_driver nop_usb_xceiv_driver = { |
| 158 | .probe = nop_usb_xceiv_probe, | 158 | .probe = nop_usb_xceiv_probe, |
| 159 | .remove = __devexit_p(nop_usb_xceiv_remove), | 159 | .remove = nop_usb_xceiv_remove, |
| 160 | .driver = { | 160 | .driver = { |
| 161 | .name = "nop_usb_xceiv", | 161 | .name = "nop_usb_xceiv", |
| 162 | .owner = THIS_MODULE, | 162 | .owner = THIS_MODULE, |
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index f0d2e7530cfe..0a701938ab53 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c | |||
| @@ -123,10 +123,10 @@ | |||
| 123 | #define PHY_CLK_CTRL_STS 0xFF | 123 | #define PHY_CLK_CTRL_STS 0xFF |
| 124 | #define PHY_DPLL_CLK (1 << 0) | 124 | #define PHY_DPLL_CLK (1 << 0) |
| 125 | 125 | ||
| 126 | /* In module TWL4030_MODULE_PM_MASTER */ | 126 | /* In module TWL_MODULE_PM_MASTER */ |
| 127 | #define STS_HW_CONDITIONS 0x0F | 127 | #define STS_HW_CONDITIONS 0x0F |
| 128 | 128 | ||
| 129 | /* In module TWL4030_MODULE_PM_RECEIVER */ | 129 | /* In module TWL_MODULE_PM_RECEIVER */ |
| 130 | #define VUSB_DEDICATED1 0x7D | 130 | #define VUSB_DEDICATED1 0x7D |
| 131 | #define VUSB_DEDICATED2 0x7E | 131 | #define VUSB_DEDICATED2 0x7E |
| 132 | #define VUSB1V5_DEV_GRP 0x71 | 132 | #define VUSB1V5_DEV_GRP 0x71 |
| @@ -195,14 +195,14 @@ static int twl4030_i2c_write_u8_verify(struct twl4030_usb *twl, | |||
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | #define twl4030_usb_write_verify(twl, address, data) \ | 197 | #define twl4030_usb_write_verify(twl, address, data) \ |
| 198 | twl4030_i2c_write_u8_verify(twl, TWL4030_MODULE_USB, (data), (address)) | 198 | twl4030_i2c_write_u8_verify(twl, TWL_MODULE_USB, (data), (address)) |
| 199 | 199 | ||
| 200 | static inline int twl4030_usb_write(struct twl4030_usb *twl, | 200 | static inline int twl4030_usb_write(struct twl4030_usb *twl, |
| 201 | u8 address, u8 data) | 201 | u8 address, u8 data) |
| 202 | { | 202 | { |
| 203 | int ret = 0; | 203 | int ret = 0; |
| 204 | 204 | ||
| 205 | ret = twl_i2c_write_u8(TWL4030_MODULE_USB, data, address); | 205 | ret = twl_i2c_write_u8(TWL_MODULE_USB, data, address); |
| 206 | if (ret < 0) | 206 | if (ret < 0) |
| 207 | dev_dbg(twl->dev, | 207 | dev_dbg(twl->dev, |
| 208 | "TWL4030:USB:Write[0x%x] Error %d\n", address, ret); | 208 | "TWL4030:USB:Write[0x%x] Error %d\n", address, ret); |
| @@ -227,7 +227,7 @@ static inline int twl4030_readb(struct twl4030_usb *twl, u8 module, u8 address) | |||
| 227 | 227 | ||
| 228 | static inline int twl4030_usb_read(struct twl4030_usb *twl, u8 address) | 228 | static inline int twl4030_usb_read(struct twl4030_usb *twl, u8 address) |
| 229 | { | 229 | { |
| 230 | return twl4030_readb(twl, TWL4030_MODULE_USB, address); | 230 | return twl4030_readb(twl, TWL_MODULE_USB, address); |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | /*-------------------------------------------------------------------------*/ | 233 | /*-------------------------------------------------------------------------*/ |
| @@ -264,8 +264,7 @@ static enum omap_musb_vbus_id_status | |||
| 264 | * signal is active, the OTG module is activated, and | 264 | * signal is active, the OTG module is activated, and |
| 265 | * its interrupt may be raised (may wake the system). | 265 | * its interrupt may be raised (may wake the system). |
| 266 | */ | 266 | */ |
| 267 | status = twl4030_readb(twl, TWL4030_MODULE_PM_MASTER, | 267 | status = twl4030_readb(twl, TWL_MODULE_PM_MASTER, STS_HW_CONDITIONS); |
| 268 | STS_HW_CONDITIONS); | ||
| 269 | if (status < 0) | 268 | if (status < 0) |
| 270 | dev_err(twl->dev, "USB link status err %d\n", status); | 269 | dev_err(twl->dev, "USB link status err %d\n", status); |
| 271 | else if (status & (BIT(7) | BIT(2))) { | 270 | else if (status & (BIT(7) | BIT(2))) { |
| @@ -372,8 +371,7 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on) | |||
| 372 | * SLEEP. We work around this by clearing the bit after usv3v1 | 371 | * SLEEP. We work around this by clearing the bit after usv3v1 |
| 373 | * is re-activated. This ensures that VUSB3V1 is really active. | 372 | * is re-activated. This ensures that VUSB3V1 is really active. |
| 374 | */ | 373 | */ |
| 375 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, | 374 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); |
| 376 | VUSB_DEDICATED2); | ||
| 377 | regulator_enable(twl->usb1v5); | 375 | regulator_enable(twl->usb1v5); |
| 378 | __twl4030_phy_power(twl, 1); | 376 | __twl4030_phy_power(twl, 1); |
| 379 | twl4030_usb_write(twl, PHY_CLK_CTRL, | 377 | twl4030_usb_write(twl, PHY_CLK_CTRL, |
| @@ -419,50 +417,48 @@ static void twl4030_phy_resume(struct twl4030_usb *twl) | |||
| 419 | static int twl4030_usb_ldo_init(struct twl4030_usb *twl) | 417 | static int twl4030_usb_ldo_init(struct twl4030_usb *twl) |
| 420 | { | 418 | { |
| 421 | /* Enable writing to power configuration registers */ | 419 | /* Enable writing to power configuration registers */ |
| 422 | twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, | 420 | twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, |
| 423 | TWL4030_PM_MASTER_KEY_CFG1, | 421 | TWL4030_PM_MASTER_PROTECT_KEY); |
| 424 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
| 425 | 422 | ||
| 426 | twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, | 423 | twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2, |
| 427 | TWL4030_PM_MASTER_KEY_CFG2, | 424 | TWL4030_PM_MASTER_PROTECT_KEY); |
| 428 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
| 429 | 425 | ||
| 430 | /* Keep VUSB3V1 LDO in sleep state until VBUS/ID change detected*/ | 426 | /* Keep VUSB3V1 LDO in sleep state until VBUS/ID change detected*/ |
| 431 | /*twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);*/ | 427 | /*twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);*/ |
| 432 | 428 | ||
| 433 | /* input to VUSB3V1 LDO is from VBAT, not VBUS */ | 429 | /* input to VUSB3V1 LDO is from VBAT, not VBUS */ |
| 434 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1); | 430 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1); |
| 435 | 431 | ||
| 436 | /* Initialize 3.1V regulator */ | 432 | /* Initialize 3.1V regulator */ |
| 437 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_DEV_GRP); | 433 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB3V1_DEV_GRP); |
| 438 | 434 | ||
| 439 | twl->usb3v1 = regulator_get(twl->dev, "usb3v1"); | 435 | twl->usb3v1 = regulator_get(twl->dev, "usb3v1"); |
| 440 | if (IS_ERR(twl->usb3v1)) | 436 | if (IS_ERR(twl->usb3v1)) |
| 441 | return -ENODEV; | 437 | return -ENODEV; |
| 442 | 438 | ||
| 443 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB3V1_TYPE); | 439 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB3V1_TYPE); |
| 444 | 440 | ||
| 445 | /* Initialize 1.5V regulator */ | 441 | /* Initialize 1.5V regulator */ |
| 446 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_DEV_GRP); | 442 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB1V5_DEV_GRP); |
| 447 | 443 | ||
| 448 | twl->usb1v5 = regulator_get(twl->dev, "usb1v5"); | 444 | twl->usb1v5 = regulator_get(twl->dev, "usb1v5"); |
| 449 | if (IS_ERR(twl->usb1v5)) | 445 | if (IS_ERR(twl->usb1v5)) |
| 450 | goto fail1; | 446 | goto fail1; |
| 451 | 447 | ||
| 452 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V5_TYPE); | 448 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB1V5_TYPE); |
| 453 | 449 | ||
| 454 | /* Initialize 1.8V regulator */ | 450 | /* Initialize 1.8V regulator */ |
| 455 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_DEV_GRP); | 451 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB1V8_DEV_GRP); |
| 456 | 452 | ||
| 457 | twl->usb1v8 = regulator_get(twl->dev, "usb1v8"); | 453 | twl->usb1v8 = regulator_get(twl->dev, "usb1v8"); |
| 458 | if (IS_ERR(twl->usb1v8)) | 454 | if (IS_ERR(twl->usb1v8)) |
| 459 | goto fail2; | 455 | goto fail2; |
| 460 | 456 | ||
| 461 | twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB1V8_TYPE); | 457 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB1V8_TYPE); |
| 462 | 458 | ||
| 463 | /* disable access to power configuration registers */ | 459 | /* disable access to power configuration registers */ |
| 464 | twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, | 460 | twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0, |
| 465 | TWL4030_PM_MASTER_PROTECT_KEY); | 461 | TWL4030_PM_MASTER_PROTECT_KEY); |
| 466 | 462 | ||
| 467 | return 0; | 463 | return 0; |
| 468 | 464 | ||
| @@ -579,7 +575,7 @@ static int twl4030_set_host(struct usb_otg *otg, struct usb_bus *host) | |||
| 579 | return 0; | 575 | return 0; |
| 580 | } | 576 | } |
| 581 | 577 | ||
| 582 | static int __devinit twl4030_usb_probe(struct platform_device *pdev) | 578 | static int twl4030_usb_probe(struct platform_device *pdev) |
| 583 | { | 579 | { |
| 584 | struct twl4030_usb_data *pdata = pdev->dev.platform_data; | 580 | struct twl4030_usb_data *pdata = pdev->dev.platform_data; |
| 585 | struct twl4030_usb *twl; | 581 | struct twl4030_usb *twl; |
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c index fcadef7864f1..8cd6cf49bdbd 100644 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c | |||
| @@ -310,7 +310,7 @@ static int twl6030_set_vbus(struct phy_companion *comparator, bool enabled) | |||
| 310 | return 0; | 310 | return 0; |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | static int __devinit twl6030_usb_probe(struct platform_device *pdev) | 313 | static int twl6030_usb_probe(struct platform_device *pdev) |
| 314 | { | 314 | { |
| 315 | u32 ret; | 315 | u32 ret; |
| 316 | struct twl6030_usb *twl; | 316 | struct twl6030_usb *twl; |
