summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-fsm-usb.h
diff options
context:
space:
mode:
authorAnton Tikhomirov <av.tikhomirov@samsung.com>2013-10-03 12:42:04 +0900
committerFelipe Balbi <balbi@ti.com>2013-10-04 09:44:46 -0500
commitf6de27eed372f41646b7bd95d6903923f5308517 (patch)
tree16ec735ae61a94ff35dd15474a92e54c0b73cca7 /drivers/usb/phy/phy-fsm-usb.h
parent425d710172cee47ed5e18eefd3308d88643de76d (diff)
downloadtalos-op-linux-f6de27eed372f41646b7bd95d6903923f5308517.tar.gz
talos-op-linux-f6de27eed372f41646b7bd95d6903923f5308517.zip
usb: phy: Fix OTG FSM timer handling
Get rid of using OTG driver specific timers by passing timer type to corresponding callbacks. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-fsm-usb.h')
-rw-r--r--drivers/usb/phy/phy-fsm-usb.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/usb/phy/phy-fsm-usb.h b/drivers/usb/phy/phy-fsm-usb.h
index 157f10672767..b47b32c6ed1f 100644
--- a/drivers/usb/phy/phy-fsm-usb.h
+++ b/drivers/usb/phy/phy-fsm-usb.h
@@ -34,6 +34,17 @@
#define PROTO_HOST (1)
#define PROTO_GADGET (2)
+enum otg_fsm_timer {
+ A_WAIT_VRISE,
+ A_WAIT_BCON,
+ A_AIDL_BDIS,
+ B_ASE0_BRST,
+ B_SE0_SRP,
+ B_SRP_FAIL,
+ A_WAIT_ENUM,
+ NUM_OTG_FSM_TIMERS,
+};
+
/* OTG state machine according to the OTG spec */
struct otg_fsm {
/* Input */
@@ -88,8 +99,8 @@ struct otg_fsm_ops {
void (*loc_conn)(struct otg_fsm *fsm, int on);
void (*loc_sof)(struct otg_fsm *fsm, int on);
void (*start_pulse)(struct otg_fsm *fsm);
- void (*add_timer)(struct otg_fsm *fsm, void *timer);
- void (*del_timer)(struct otg_fsm *fsm, void *timer);
+ void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
+ void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
int (*start_host)(struct otg_fsm *fsm, int on);
int (*start_gadget)(struct otg_fsm *fsm, int on);
};
@@ -144,7 +155,7 @@ static inline int otg_start_pulse(struct otg_fsm *fsm)
return 0;
}
-static inline int otg_add_timer(struct otg_fsm *fsm, void *timer)
+static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer)
{
if (!fsm->ops->add_timer)
return -EOPNOTSUPP;
@@ -152,7 +163,7 @@ static inline int otg_add_timer(struct otg_fsm *fsm, void *timer)
return 0;
}
-static inline int otg_del_timer(struct otg_fsm *fsm, void *timer)
+static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer)
{
if (!fsm->ops->del_timer)
return -EOPNOTSUPP;
@@ -175,8 +186,3 @@ static inline int otg_start_gadget(struct otg_fsm *fsm, int on)
}
int otg_statemachine(struct otg_fsm *fsm);
-
-/* Defined by device specific driver, for different timer implementation */
-extern struct fsl_otg_timer *a_wait_vrise_tmr, *a_wait_bcon_tmr,
- *a_aidl_bdis_tmr, *b_ase0_brst_tmr, *b_se0_srp_tmr, *b_srp_fail_tmr,
- *a_wait_enum_tmr;
OpenPOWER on IntegriCloud