On Wed, 25 Mar 2009, Magnus Lilja wrote: > Hi > > 2009/2/11 Guennadi Liakhovetski <lg@xxxxxxx>: > > MPC8313 / MPC8349 PPC SoCs and i.MX31 ARM SoCs use the same USB device > > core, extend the driver to support i.MX31. We just have to disable using > > usb_sys_interface and add clock management. > > > > Signed-off-by: Guennadi Liakhovetski <lg@xxxxxxx> > > --- > > diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c > > index f3c6703..f6b95a1 100644 > > --- a/drivers/usb/gadget/fsl_usb2_udc.c > > +++ b/drivers/usb/gadget/fsl_usb2_udc.c > > +static int mxc_udc_init(struct platform_device *pdev) > > +{ > > + struct fsl_usb2_platform_data *pdata; > > + unsigned long freq; > > + int ret; > > + > > + pdata = pdev->dev.platform_data; > > + > > + mxc_ahb_clk = clk_get(NULL, "usb_ahb_clk"); > > + if (IS_ERR(mxc_ahb_clk)) > > + return PTR_ERR(mxc_ahb_clk); > > + > > + ret = clk_enable(mxc_ahb_clk); > > + if (ret < 0) { > > + dev_err(&pdev->dev, "clk_enable(\"usb_ahb_clk\") failed\n"); > > + goto eenahb; > > + } > > + > > + /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ > > + mxc_usb_clk = clk_get(NULL, "usb_clk"); > > + if (IS_ERR(mxc_usb_clk)) { > > + dev_err(&pdev->dev, "clk_get(\"usb_usb_clk\") failed\n"); > > + ret = PTR_ERR(mxc_usb_clk); > > + goto egusb; > > + } > > + > > + freq = clk_get_rate(mxc_usb_clk); > > + if ((freq < 59999000) || (freq > 60001000)) > > + dev_warn(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq); > > + > > + /* Turn off the usbpll for ulpi transceivers */ > > + if (pdata->phy_mode != FSL_USB2_PHY_ULPI) { > > + ret = clk_enable(mxc_usb_clk); > > I'm a bit confused by the comment "Turn off....". To me it seems like > you enable the usb_clk for non-ulpi transceivers, instead of turning > it off for ulpi. Yes, you're right. This will be fixed in the next revision - when we fix the clock issue. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@xxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html