@@ -28,8 +28,8 @@
#include <linux/err.h>
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/regulator/consumer.h>
#include <linux/usb/otg.h>
-#include <linux/platform_data/s3c-hsotg.h>
#include "sec_usbphy.h"
@@ -41,7 +41,7 @@ enum sec_cpu_type {
/*
* struct sec_usbphy - transceiver driver state
* @phy: transceiver structure
- * @plat: platform data
+ * @vusbphy: PMU regulator for usb phy
* @dev: The parent device supplied to the probe function
* @clk: usb phy clock
* @regs: usb phy register memory base
@@ -49,7 +49,7 @@ enum sec_cpu_type {
*/
struct sec_usbphy {
struct usb_phy phy;
- struct s3c_usbphy_plat *plat;
+ struct regulator *vusbphy;
struct device *dev;
struct clk *clk;
void __iomem *regs;
@@ -187,8 +187,11 @@ static int sec_usbphy_init(struct usb_phy *phy)
}
/* Disable phy isolation */
- if (sec->plat && sec->plat->pmu_isolation)
- sec->plat->pmu_isolation(false);
+ ret = regulator_enable(sec->vusbphy);
+ if (ret) {
+ dev_err(sec->dev, "Failed to enable regulator for USBPHY\n");
+ return ret;
+ }
/* Initialize usb phy registers */
sec_usbphy_enable(sec);
@@ -208,8 +211,8 @@ static void sec_usbphy_shutdown(struct usb_phy *phy)
sec_usbphy_disable(sec);
/* Enable phy isolation */
- if (sec->plat && sec->plat->pmu_isolation)
- sec->plat->pmu_isolation(true);
+ if (regulator_disable(sec->vusbphy))
+ dev_err(sec->dev, "Failed to disable regulator for USBPHY\n");
/* Disable the phy clock */
sec_usbphy_clk_control(sec, false);
@@ -263,7 +266,6 @@ static int __devinit sec_usbphy_probe(struct
platform_device *pdev)
return -ENOMEM;
sec->dev = &pdev->dev;
- sec->plat = pdata;
sec->regs = phy_base;
sec->phy.dev = sec->dev;