Re: [PATCH v2] usb: otg: Move phy interface to separate file.

2012-09-04 Thread Venu Byravarasu

Hi Felipe,

On Monday 03 September 2012 07:43 PM, Felipe Balbi wrote:

* PGP Signed by an unknown key

Hi,

On Wed, Aug 29, 2012 at 12:17:01PM +0530, Venu Byravarasu wrote:

As otg.h is containing lots of phy interface related
stuff, moving all phy interface related stuff to new
file named phy.h

Signed-off-by: Venu Byravarasu 

this doesn't apply to my "xceiv" branch. Please rebase there so I don't
cause any issues to your patch ;-)


Rebased the change in your tree and pushed a patch.
Plz merge.

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


Re: [PATCH v2] usb: otg: Move phy interface to separate file.

2012-09-04 Thread Venu Byravarasu

Hi Felipe,

On Monday 03 September 2012 07:43 PM, Felipe Balbi wrote:

* PGP Signed by an unknown key

Hi,

On Wed, Aug 29, 2012 at 12:17:01PM +0530, Venu Byravarasu wrote:

As otg.h is containing lots of phy interface related
stuff, moving all phy interface related stuff to new
file named phy.h

Signed-off-by: Venu Byravarasu vbyravar...@nvidia.com

this doesn't apply to my xceiv branch. Please rebase there so I don't
cause any issues to your patch ;-)


Rebased the change in your tree and pushed a patch.
Plz merge.

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


Re: [PATCH v2] usb: otg: Move phy interface to separate file.

2012-09-03 Thread Felipe Balbi
Hi,

On Wed, Aug 29, 2012 at 12:17:01PM +0530, Venu Byravarasu wrote:
> As otg.h is containing lots of phy interface related
> stuff, moving all phy interface related stuff to new
> file named phy.h
> 
> Signed-off-by: Venu Byravarasu 

this doesn't apply to my "xceiv" branch. Please rebase there so I don't
cause any issues to your patch ;-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2] usb: otg: Move phy interface to separate file.

2012-09-03 Thread Felipe Balbi
Hi,

On Wed, Aug 29, 2012 at 12:17:01PM +0530, Venu Byravarasu wrote:
 As otg.h is containing lots of phy interface related
 stuff, moving all phy interface related stuff to new
 file named phy.h
 
 Signed-off-by: Venu Byravarasu vbyravar...@nvidia.com

this doesn't apply to my xceiv branch. Please rebase there so I don't
cause any issues to your patch ;-)

-- 
balbi


signature.asc
Description: Digital signature


[PATCH v2] usb: otg: Move phy interface to separate file.

2012-08-29 Thread Venu Byravarasu
As otg.h is containing lots of phy interface related
stuff, moving all phy interface related stuff to new
file named phy.h

Signed-off-by: Venu Byravarasu 
---
delta from v1: 
Removed notifier.h inclusion from otg.h, as it was
already included in phy.h

 include/linux/usb/otg.h |  212 +
 include/linux/usb/phy.h |  222 +++
 2 files changed, 223 insertions(+), 211 deletions(-)
 create mode 100644 include/linux/usb/phy.h

diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 45824be..65a2b6a 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,7 +9,7 @@
 #ifndef __LINUX_USB_OTG_H
 #define __LINUX_USB_OTG_H
 
-#include 
+#include 
 
 /* OTG defines lots of enumeration states before device reset */
 enum usb_otg_state {
@@ -35,31 +35,6 @@ enum usb_otg_state {
OTG_STATE_A_VBUS_ERR,
 };
 
-enum usb_phy_events {
-   USB_EVENT_NONE, /* no events or cable disconnected */
-   USB_EVENT_VBUS, /* vbus valid event */
-   USB_EVENT_ID,   /* id was grounded */
-   USB_EVENT_CHARGER,  /* usb dedicated charger */
-   USB_EVENT_ENUMERATED,   /* gadget driver enumerated */
-};
-
-/* associate a type with PHY */
-enum usb_phy_type {
-   USB_PHY_TYPE_UNDEFINED,
-   USB_PHY_TYPE_USB2,
-   USB_PHY_TYPE_USB3,
-};
-
-struct usb_phy;
-
-/* for transceivers connected thru an ULPI interface, the user must
- * provide access ops
- */
-struct usb_phy_io_ops {
-   int (*read)(struct usb_phy *x, u32 reg);
-   int (*write)(struct usb_phy *x, u32 val, u32 reg);
-};
-
 struct usb_otg {
u8  default_a;
 
@@ -85,134 +60,9 @@ struct usb_otg {
 
 };
 
-/*
- * the otg driver needs to interact with both device side and host side
- * usb controllers.  it decides which controller is active at a given
- * moment, using the transceiver, ID signal, HNP and sometimes static
- * configuration information (including "board isn't wired for otg").
- */
-struct usb_phy {
-   struct device   *dev;
-   const char  *label;
-   unsigned int flags;
-
-   enum usb_phy_type   type;
-   enum usb_otg_state  state;
-   enum usb_phy_events last_event;
-
-   struct usb_otg  *otg;
-
-   struct device   *io_dev;
-   struct usb_phy_io_ops   *io_ops;
-   void __iomem*io_priv;
-
-   /* for notification of usb_phy_events */
-   struct atomic_notifier_head notifier;
-
-   /* to pass extra port status to the root hub */
-   u16 port_status;
-   u16 port_change;
-
-   /* to support controllers that have multiple transceivers */
-   struct list_headhead;
-
-   /* initialize/shutdown the OTG controller */
-   int (*init)(struct usb_phy *x);
-   void(*shutdown)(struct usb_phy *x);
-
-   /* effective for B devices, ignored for A-peripheral */
-   int (*set_power)(struct usb_phy *x,
-   unsigned mA);
-
-   /* for non-OTG B devices: set transceiver into suspend mode */
-   int (*set_suspend)(struct usb_phy *x,
-   int suspend);
-
-   /* notify phy connect status change */
-   int (*notify_connect)(struct usb_phy *x, int port);
-   int (*notify_disconnect)(struct usb_phy *x, int port);
-};
-
-
-/* for board-specific init logic */
-extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
-extern void usb_remove_phy(struct usb_phy *);
-
-#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && 
defined(MODULE))
-/* sometimes transceivers are accessed only through e.g. ULPI */
-extern void usb_nop_xceiv_register(void);
-extern void usb_nop_xceiv_unregister(void);
-#else
-static inline void usb_nop_xceiv_register(void)
-{
-}
-
-static inline void usb_nop_xceiv_unregister(void)
-{
-}
-#endif
-
-/* helpers for direct access thru low-level io interface */
-static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
-{
-   if (x->io_ops && x->io_ops->read)
-   return x->io_ops->read(x, reg);
-
-   return -EINVAL;
-}
-
-static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
-{
-   if (x->io_ops && x->io_ops->write)
-   return x->io_ops->write(x, val, reg);
-
-   return -EINVAL;
-}
-
-static inline int
-usb_phy_init(struct usb_phy *x)
-{
-   if (x->init)
-   return x->init(x);
-
-   return 0;
-}
-
-static inline void
-usb_phy_shutdown(struct usb_phy *x)
-{
-   if (x->shutdown)
-   x->shutdown(x);
-}
-
-/* for usb host and peripheral controller drivers */
 #ifdef CONFIG_USB_OTG_UTILS
-extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
-extern struct usb_phy *devm_usb_get_phy(struct device *dev,
-   enum usb_phy_type type);
-extern 

[PATCH v2] usb: otg: Move phy interface to separate file.

2012-08-29 Thread Venu Byravarasu
As otg.h is containing lots of phy interface related
stuff, moving all phy interface related stuff to new
file named phy.h

Signed-off-by: Venu Byravarasu vbyravar...@nvidia.com
---
delta from v1: 
Removed notifier.h inclusion from otg.h, as it was
already included in phy.h

 include/linux/usb/otg.h |  212 +
 include/linux/usb/phy.h |  222 +++
 2 files changed, 223 insertions(+), 211 deletions(-)
 create mode 100644 include/linux/usb/phy.h

diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 45824be..65a2b6a 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,7 +9,7 @@
 #ifndef __LINUX_USB_OTG_H
 #define __LINUX_USB_OTG_H
 
-#include linux/notifier.h
+#include linux/usb/phy.h
 
 /* OTG defines lots of enumeration states before device reset */
 enum usb_otg_state {
@@ -35,31 +35,6 @@ enum usb_otg_state {
OTG_STATE_A_VBUS_ERR,
 };
 
-enum usb_phy_events {
-   USB_EVENT_NONE, /* no events or cable disconnected */
-   USB_EVENT_VBUS, /* vbus valid event */
-   USB_EVENT_ID,   /* id was grounded */
-   USB_EVENT_CHARGER,  /* usb dedicated charger */
-   USB_EVENT_ENUMERATED,   /* gadget driver enumerated */
-};
-
-/* associate a type with PHY */
-enum usb_phy_type {
-   USB_PHY_TYPE_UNDEFINED,
-   USB_PHY_TYPE_USB2,
-   USB_PHY_TYPE_USB3,
-};
-
-struct usb_phy;
-
-/* for transceivers connected thru an ULPI interface, the user must
- * provide access ops
- */
-struct usb_phy_io_ops {
-   int (*read)(struct usb_phy *x, u32 reg);
-   int (*write)(struct usb_phy *x, u32 val, u32 reg);
-};
-
 struct usb_otg {
u8  default_a;
 
@@ -85,134 +60,9 @@ struct usb_otg {
 
 };
 
-/*
- * the otg driver needs to interact with both device side and host side
- * usb controllers.  it decides which controller is active at a given
- * moment, using the transceiver, ID signal, HNP and sometimes static
- * configuration information (including board isn't wired for otg).
- */
-struct usb_phy {
-   struct device   *dev;
-   const char  *label;
-   unsigned int flags;
-
-   enum usb_phy_type   type;
-   enum usb_otg_state  state;
-   enum usb_phy_events last_event;
-
-   struct usb_otg  *otg;
-
-   struct device   *io_dev;
-   struct usb_phy_io_ops   *io_ops;
-   void __iomem*io_priv;
-
-   /* for notification of usb_phy_events */
-   struct atomic_notifier_head notifier;
-
-   /* to pass extra port status to the root hub */
-   u16 port_status;
-   u16 port_change;
-
-   /* to support controllers that have multiple transceivers */
-   struct list_headhead;
-
-   /* initialize/shutdown the OTG controller */
-   int (*init)(struct usb_phy *x);
-   void(*shutdown)(struct usb_phy *x);
-
-   /* effective for B devices, ignored for A-peripheral */
-   int (*set_power)(struct usb_phy *x,
-   unsigned mA);
-
-   /* for non-OTG B devices: set transceiver into suspend mode */
-   int (*set_suspend)(struct usb_phy *x,
-   int suspend);
-
-   /* notify phy connect status change */
-   int (*notify_connect)(struct usb_phy *x, int port);
-   int (*notify_disconnect)(struct usb_phy *x, int port);
-};
-
-
-/* for board-specific init logic */
-extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
-extern void usb_remove_phy(struct usb_phy *);
-
-#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE)  
defined(MODULE))
-/* sometimes transceivers are accessed only through e.g. ULPI */
-extern void usb_nop_xceiv_register(void);
-extern void usb_nop_xceiv_unregister(void);
-#else
-static inline void usb_nop_xceiv_register(void)
-{
-}
-
-static inline void usb_nop_xceiv_unregister(void)
-{
-}
-#endif
-
-/* helpers for direct access thru low-level io interface */
-static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
-{
-   if (x-io_ops  x-io_ops-read)
-   return x-io_ops-read(x, reg);
-
-   return -EINVAL;
-}
-
-static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
-{
-   if (x-io_ops  x-io_ops-write)
-   return x-io_ops-write(x, val, reg);
-
-   return -EINVAL;
-}
-
-static inline int
-usb_phy_init(struct usb_phy *x)
-{
-   if (x-init)
-   return x-init(x);
-
-   return 0;
-}
-
-static inline void
-usb_phy_shutdown(struct usb_phy *x)
-{
-   if (x-shutdown)
-   x-shutdown(x);
-}
-
-/* for usb host and peripheral controller drivers */
 #ifdef CONFIG_USB_OTG_UTILS
-extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
-extern struct usb_phy *devm_usb_get_phy(struct device *dev,
-