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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx> 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.
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux