[U-Boot] [PATCH v3]ulpi: add generic ULPI functionality

Jana Rapava fermata7 at gmail.com
Fri Nov 25 19:39:40 CET 2011


2011/11/24 Igor Grinberg <grinberg at compulab.co.il>

> > +/*
> > + * If enable is 0, pull-down resistor not connected to D+, else
> pull-down
> > + * resistor connected to D+.
> > + * Default behaviour is as for enable equal to 1.
> > + */
> > +void ulpi_dp_pulldown(u32 ulpi_viewport, int enable)
> > +{
> > +     if (enable)
> > +             ulpi_write(ulpi_viewport,
> > +                     (u32)&ulpi->otg_ctrl_set, ULPI_OTG_DP_PULLDOWN);
> > +     else
> > +             ulpi_write(ulpi_viewport,
> > +                     (u32)&ulpi->otg_ctrl_clear, ULPI_OTG_DP_PULLDOWN);
> > +}
> > +
> > +/*
> > + * If enable is 0, pull-down resistor not connected to D- else pull-down
> > + * resistor connected to D-.
> > + * Default behaviour is as for enable equal to 1.
> > + */
> > +void ulpi_dm_pulldown(u32 ulpi_viewport, int enable)
> > +{
> > +     if (enable)
> > +             ulpi_write(ulpi_viewport,
> > +                     (u32)&ulpi->otg_ctrl_set, ULPI_OTG_DM_PULLDOWN);
> > +     else
> > +             ulpi_write(ulpi_viewport,
> > +                     (u32)&ulpi->otg_ctrl_clear, ULPI_OTG_DM_PULLDOWN);
> > +}
>
>
> Correct me if I'm wrong, but I don't think there is a use for
> the above functions in separate and the user will have to
> call them both.
> So, can these two functions be united in one,
> say ulpi_pulldown(u32 ..., int enable)?
>
>
If I understand ULPI specification well, the overall effect is the same
when both bits are set to 1 as when they are set to 0.
And default setting is for both bits to be 1, so I don't think that have
one function for both bits make sense.

Regards,
Jana Rapava


More information about the U-Boot mailing list