lkml.org 
[lkml]   [2011]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCHv6 12/19] usb: otg: twl6030: Start using struct usb_otg
    From
    Hi Heikki,

    On Fri, Oct 28, 2011 at 6:05 PM, Heikki Krogerus
    <heikki.krogerus@linux.intel.com> wrote:
    > Use struct usb_otg members with OTG specific functions instead
    > of usb_phy members.
    >
    > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    > Tested-by: Kishon Vijay Abraham I <kishon@ti.com>
    > Cc: Hema HK <hemahk@ti.com>
    > ---
    >  drivers/usb/otg/twl6030-usb.c |  103 ++++++++++++++++++++++------------------
    >  1 files changed, 57 insertions(+), 46 deletions(-)
    >
    > diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
    > index 2f5c299..6de03fd 100644
    > --- a/drivers/usb/otg/twl6030-usb.c
    > +++ b/drivers/usb/otg/twl6030-usb.c
    > @@ -87,7 +87,7 @@
    >  #define        VBUS_DET                        BIT(2)
    >
    >  struct twl6030_usb {
    > -       struct usb_phy  otg;
    > +       struct usb_phy          xceiv;

    here _usb_phy_ is a member of transceiver (by transceiver I mean
    twl6030_usb). This makes _usb_phy_ getting created when you create
    your transceiver object. By this we are actually tying our usb_phy to
    our transceiver. But in hardware, phy and twl6030 are separate
    entities.

    >        struct device           *dev;
    >
    >        /* for vbus reporting with irqs disabled */
    > @@ -107,7 +107,7 @@ struct twl6030_usb {
    >        unsigned long           features;
    >  };
    >
    > -#define xceiv_to_twl(x)                container_of((x), struct twl6030_usb, otg)
    > +#define xceiv_to_twl(x)                container_of((x), struct twl6030_usb, xceiv)
    >
    >  /*-------------------------------------------------------------------------*/
    >
    > @@ -178,9 +178,9 @@ static int twl6030_phy_suspend(struct usb_phy *x, int suspend)
    >        return 0;
    >  }
    >
    > -static int twl6030_start_srp(struct usb_phy *x)
    > +static int twl6030_start_srp(struct usb_otg *otg)
    >  {
    > -       struct twl6030_usb *twl = xceiv_to_twl(x);
    > +       struct twl6030_usb *twl = xceiv_to_twl(otg->xceiv);
    >
    >        twl6030_writeb(twl, TWL_MODULE_USB, 0x24, USB_VBUS_CTRL_SET);
    >        twl6030_writeb(twl, TWL_MODULE_USB, 0x84, USB_VBUS_CTRL_SET);

    Here if you see, start_srp is a otg function and it operates on
    twl6030. Maybe thats why I think, separating usb_phy from twl6030_usb
    should be the first step than separating otg from twl6030_usb.

    Thanks
    Kishon
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2011-11-08 16:01    [W:0.043 / U:29.132 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site