arm64: dts: rockchip: rk3399-box-rev1: increase drive strength for sd/sdio pin
[firefly-linux-kernel-4.4.55.git] / drivers / usb / host / r8a66597-hcd.c
index 6656dfda5665768930291c591c4121cef282030c..4cbd0633c5c2dbbc1779cc2ae3aa0a4c818bf72e 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
-#include <linux/init.h>
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/list.h>
@@ -95,7 +94,7 @@ static int r8a66597_clock_enable(struct r8a66597 *r8a66597)
        int i = 0;
 
        if (r8a66597->pdata->on_chip) {
-               clk_enable(r8a66597->clk);
+               clk_prepare_enable(r8a66597->clk);
                do {
                        r8a66597_write(r8a66597, SCKE, SYSCFG0);
                        tmp = r8a66597_read(r8a66597, SYSCFG0);
@@ -139,7 +138,7 @@ static void r8a66597_clock_disable(struct r8a66597 *r8a66597)
        udelay(1);
 
        if (r8a66597->pdata->on_chip) {
-               clk_disable(r8a66597->clk);
+               clk_disable_unprepare(r8a66597->clk);
        } else {
                r8a66597_bclr(r8a66597, PLLC, SYSCFG0);
                r8a66597_bclr(r8a66597, XCKE, SYSCFG0);
@@ -2137,12 +2136,13 @@ static int r8a66597_hub_status_data(struct usb_hcd *hcd, char *buf)
 static void r8a66597_hub_descriptor(struct r8a66597 *r8a66597,
                                    struct usb_hub_descriptor *desc)
 {
-       desc->bDescriptorType = 0x29;
+       desc->bDescriptorType = USB_DT_HUB;
        desc->bHubContrCurrent = 0;
        desc->bNbrPorts = r8a66597->max_root_hub;
        desc->bDescLength = 9;
        desc->bPwrOn2PwrGood = 0;
-       desc->wHubCharacteristics = cpu_to_le16(0x0011);
+       desc->wHubCharacteristics =
+               cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM | HUB_CHAR_NO_OCPM);
        desc->u.hs.DeviceRemovable[0] =
                ((1 << r8a66597->max_root_hub) - 1) << 1;
        desc->u.hs.DeviceRemovable[1] = ~0;
@@ -2393,7 +2393,7 @@ static const struct dev_pm_ops r8a66597_dev_pm_ops = {
 
 static int r8a66597_remove(struct platform_device *pdev)
 {
-       struct r8a66597         *r8a66597 = dev_get_drvdata(&pdev->dev);
+       struct r8a66597         *r8a66597 = platform_get_drvdata(pdev);
        struct usb_hcd          *hcd = r8a66597_to_hcd(r8a66597);
 
        del_timer_sync(&r8a66597->rh_timer);
@@ -2466,8 +2466,8 @@ static int r8a66597_probe(struct platform_device *pdev)
        }
        r8a66597 = hcd_to_r8a66597(hcd);
        memset(r8a66597, 0, sizeof(struct r8a66597));
-       dev_set_drvdata(&pdev->dev, r8a66597);
-       r8a66597->pdata = pdev->dev.platform_data;
+       platform_set_drvdata(pdev, r8a66597);
+       r8a66597->pdata = dev_get_platdata(&pdev->dev);
        r8a66597->irq_sense_low = irq_trigger == IRQF_TRIGGER_LOW;
 
        if (r8a66597->pdata->on_chip) {
@@ -2484,9 +2484,8 @@ static int r8a66597_probe(struct platform_device *pdev)
                r8a66597->max_root_hub = 2;
 
        spin_lock_init(&r8a66597->lock);
-       init_timer(&r8a66597->rh_timer);
-       r8a66597->rh_timer.function = r8a66597_timer;
-       r8a66597->rh_timer.data = (unsigned long)r8a66597;
+       setup_timer(&r8a66597->rh_timer, r8a66597_timer,
+                   (unsigned long)r8a66597);
        r8a66597->reg = reg;
 
        /* make sure no interrupts are pending */
@@ -2497,9 +2496,8 @@ static int r8a66597_probe(struct platform_device *pdev)
 
        for (i = 0; i < R8A66597_MAX_NUM_PIPE; i++) {
                INIT_LIST_HEAD(&r8a66597->pipe_queue[i]);
-               init_timer(&r8a66597->td_timer[i]);
-               r8a66597->td_timer[i].function = r8a66597_td_timer;
-               r8a66597->td_timer[i].data = (unsigned long)r8a66597;
+               setup_timer(&r8a66597->td_timer[i], r8a66597_td_timer,
+                           (unsigned long)r8a66597);
                setup_timer(&r8a66597->interval_timer[i],
                                r8a66597_interval_timer,
                                (unsigned long)r8a66597);
@@ -2514,6 +2512,7 @@ static int r8a66597_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "Failed to add hcd\n");
                goto clean_up3;
        }
+       device_wakeup_enable(hcd->self.controller);
 
        return 0;
 
@@ -2534,8 +2533,7 @@ static struct platform_driver r8a66597_driver = {
        .probe =        r8a66597_probe,
        .remove =       r8a66597_remove,
        .driver         = {
-               .name = (char *) hcd_name,
-               .owner  = THIS_MODULE,
+               .name = hcd_name,
                .pm     = R8A66597_DEV_PM_OPS,
        },
 };