lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAe_U6Kpwc3XQCjQ9m0hNCn8jmaQPQ+achEVTwD+zSfDNihmdA@mail.gmail.com>
Date:	Tue, 8 Nov 2011 20:28:31 +0530
From:	"ABRAHAM, KISHON VIJAY" <kishon@...com>
To:	Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc:	Felipe Balbi <balbi@...com>, Greg KH <gregkh@...e.de>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	Hema HK <hemahk@...com>
Subject: Re: [PATCHv6 12/19] usb: otg: twl6030: Start using struct usb_otg

Hi Heikki,

On Fri, Oct 28, 2011 at 6:05 PM, Heikki Krogerus
<heikki.krogerus@...ux.intel.com> wrote:
> Use struct usb_otg members with OTG specific functions instead
> of usb_phy members.
>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> Tested-by: Kishon Vijay Abraham I <kishon@...com>
> Cc: Hema HK <hemahk@...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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ