[PATCH v2 2/3] USB: phy: move OTG FSM header

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

 



Other USB drivers may want to use OTG final state machine
implementation, so make this header available for them.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@xxxxxxxxxxx>
---
 drivers/usb/phy/phy-fsl-usb.h                      |    1 -
 drivers/usb/phy/phy-fsm-usb.c                      |    2 --
 include/linux/usb/otg.h                            |    1 +
 .../phy-fsm-usb.h => include/linux/usb/otg_fsm.h   |    7 +++++++
 4 files changed, 8 insertions(+), 3 deletions(-)
 rename drivers/usb/phy/phy-fsm-usb.h => include/linux/usb/otg_fsm.h (97%)

diff --git a/drivers/usb/phy/phy-fsl-usb.h b/drivers/usb/phy/phy-fsl-usb.h
index 7365170..b8589c5 100644
--- a/drivers/usb/phy/phy-fsl-usb.h
+++ b/drivers/usb/phy/phy-fsl-usb.h
@@ -15,7 +15,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include "phy-fsm-usb.h"
 #include <linux/usb/otg.h>
 #include <linux/ioctl.h>
 
diff --git a/drivers/usb/phy/phy-fsm-usb.c b/drivers/usb/phy/phy-fsm-usb.c
index 2817b04..e72dbee 100644
--- a/drivers/usb/phy/phy-fsm-usb.c
+++ b/drivers/usb/phy/phy-fsm-usb.c
@@ -29,8 +29,6 @@
 #include <linux/usb/gadget.h>
 #include <linux/usb/otg.h>
 
-#include "phy-fsm-usb.h"
-
 /* Change USB protocol when there is a protocol change */
 static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
 {
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 154332b..ba02706 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,6 +9,7 @@
 #ifndef __LINUX_USB_OTG_H
 #define __LINUX_USB_OTG_H
 
+#include <linux/usb/otg_fsm.h>
 #include <linux/usb/phy.h>
 
 struct usb_otg {
diff --git a/drivers/usb/phy/phy-fsm-usb.h b/include/linux/usb/otg_fsm.h
similarity index 97%
rename from drivers/usb/phy/phy-fsm-usb.h
rename to include/linux/usb/otg_fsm.h
index 12ece58..354e57d 100644
--- a/drivers/usb/phy/phy-fsm-usb.h
+++ b/include/linux/usb/otg_fsm.h
@@ -15,6 +15,9 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifndef __LINUX_USB_OTG_FSM_H
+#define __LINUX_USB_OTG_FSM_H
+
 #undef VERBOSE
 
 #ifdef VERBOSE
@@ -51,6 +54,8 @@ enum otg_fsm_timer {
 	NUM_OTG_FSM_TIMERS,
 };
 
+struct usb_otg;
+
 /* OTG state machine according to the OTG spec */
 struct otg_fsm {
 	/* Input */
@@ -234,3 +239,5 @@ static inline int otg_start_gadget(struct otg_fsm *fsm, int on)
 }
 
 int otg_statemachine(struct otg_fsm *fsm);
+
+#endif /* __LINUX_USB_OTG_FSM_H */
-- 
1.7.9.5


--
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