[V8 PATCH 01/16] usb: phy: mv_usb2: add PHY driver for marvell usb2 controller

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Mar 6 11:45:20 EST 2013


On Tue, Mar 05, 2013 at 10:03:01AM +0800, Chao Xie wrote:
> On Mon, Mar 4, 2013 at 10:21 PM, Felipe Balbi <balbi at ti.com> wrote:
> > On Wed, Feb 20, 2013 at 11:07:11PM -0500, Chao Xie wrote:
> >> +     for (i = 0; i < mv_phy->clks_num; i++) {
> >> +             mv_phy->clks[i] = devm_clk_get(&pdev->dev,
> >> +                                             pdata->clkname[i]);
> >
> > *NEVER* pass clock names via platform_data, this is utterly wrong.
> >
> without device tree support, the only way we can get the clock is the pdata.
> the use phy have mutiple clocks.
> So what do you suggest to handle it?

Then you don't understand the clk API at all.

Read the documentation in include/linux/clk.h for clk_get().

The first parameter is the device which you're interested in getting the
clock for.

The second parameter defines the INPUT as a string to THAT DEVICE.  It
is specific to the device.  It is NOT the system name of the clock.

So, if you have a function clock and an interface clock to a device,
then use a name like "fck" for the function clock and "ick" for the
interface clock.

Do _NOT_ make the mistake of using "global" clock names.  People have done
that many times in the past and got into horrid sticky problems - and
ended up with _far_ more code than is really necessary if you do things
the right way.



More information about the linux-arm-kernel mailing list