Date:2011-03-05 19:55:14 (9 years 2 months ago)
Author:Peter Zotov
Commit:d8c91dafea444d4d37712900d3fbde8ba7a080f0
Message:Update JZ4740 UDC driver to use new JZ47xx clock system.

Files: drivers/usb/gadget/Kconfig (1 diff)
drivers/usb/gadget/jz4740_udc.c (4 diffs)
drivers/usb/gadget/jz4740_udc.h (1 diff)

Change Details

drivers/usb/gadget/Kconfig
123123#
124124config USB_GADGET_JZ4740
125125    boolean "JZ4740 UDC"
126    depends on MACH_JZ4740
126    depends on MACH_JZ4740 || MACH_JZ4750
127127    select USB_GADGET_SELECTED
128128    select USB_GADGET_DUALSPEED
129129    help
130           Select this to support the Ingenic JZ4740 processor
131           high speed USB device controller.
130       Select this to support high speed USB device controller on
131        Ingenic JZ4740 and compatible processors.
132132
133133config USB_JZ4740
134134    tristate
drivers/usb/gadget/jz4740_udc.c
3838#include <asm/io.h>
3939#include <asm/irq.h>
4040#include <asm/system.h>
41#include <asm/mach-jz4740/clock.h>
4241
4342#include "jz4740_udc.h"
4443
...... 
326325    usb_clearb(dev, JZ_REG_UDC_POWER, USB_POWER_SOFTCONN);
327326
328327    /* Disable the USB PHY */
328    clk_disable(dev->phy_clk);
329
330    /* Disable the UDC */
329331    clk_disable(dev->clk);
330332
331333    dev->ep0state = WAIT_FOR_SETUP;
...... 
382384        flush(ep);
383385    }
384386
385    /* Set this bit to allow the UDC entering low-power mode when
386     * there are no actions on the USB bus.
387     * UDC still works during this bit was set.
387    /* The UDC clock itself is a bit special: if the PHY clock
388     * is enabled, the UDC is clocked too, regardless of the
389     * requested state. Currently the driver turns UDC off
390     * completely while entering suspend mode, and this does not
391     * matter a lot.
388392     */
389    jz4740_clock_udc_enable_auto_suspend();
393    clk_enable(dev->clk);
390394
391395    /* Enable the USB PHY */
392    clk_enable(dev->clk);
396    clk_enable(dev->phy_clk);
393397
394398    /* Disable interrupts */
395399/* usb_writew(dev, JZ_REG_UDC_INTRINE, 0);
...... 
22432247        goto err_device_unregister;
22442248    }
22452249
2250    jz4740_udc->phy_clk = clk_get(&pdev->dev, "udc-phy");
2251    if (IS_ERR(jz4740_udc->phy_clk)) {
2252        ret = PTR_ERR(jz4740_udc->phy_clk);
2253        dev_err(&pdev->dev, "Failed to get udc phy clock: %d\n", ret);
2254        goto err_device_unregister;
2255    }
2256
22462257    platform_set_drvdata(pdev, jz4740_udc);
22472258
22482259    jz4740_udc->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drivers/usb/gadget/jz4740_udc.h
8383    void __iomem *base;
8484    int irq;
8585
86    struct clk *clk;
86    struct clk *clk, *phy_clk;
8787};
8888
8989#define ep_maxpacket(EP) ((EP)->ep.maxpacket)

Archive Download the corresponding diff file



interactive