diff options
author | Anton Tikhomirov <av.tikhomirov@samsung.com> | 2013-10-03 12:42:04 +0900 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-10-04 09:44:44 -0500 |
commit | da8cc16724da2965c94ca15e1377cb9939776dda (patch) | |
tree | 5adbb04d75a23aa202109dd2f25668634ea9177c /drivers/usb/phy/phy-fsm-usb.h | |
parent | f8cffc84a2ff8efc2ecca6128485877109e499f5 (diff) |
usb: phy: Pass OTG FSM pointer to callback functions
struct otg_fsm may be embedded to device's context structure.
The callbacks may require pointer to struct otg_fsm to obtain
necessary data for its operation (example: regulator reference
for drv_vbus()).
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.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/usb/phy/phy-fsm-usb.h b/drivers/usb/phy/phy-fsm-usb.h index fbe586206f3..75344bec467 100644 --- a/drivers/usb/phy/phy-fsm-usb.h +++ b/drivers/usb/phy/phy-fsm-usb.h @@ -83,13 +83,13 @@ struct otg_fsm { }; struct otg_fsm_ops { - void (*chrg_vbus)(int on); - void (*drv_vbus)(int on); - void (*loc_conn)(int on); - void (*loc_sof)(int on); - void (*start_pulse)(void); - void (*add_timer)(void *timer); - void (*del_timer)(void *timer); + void (*chrg_vbus)(struct otg_fsm *fsm, int on); + void (*drv_vbus)(struct otg_fsm *fsm, int on); + 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); int (*start_host)(struct otg_fsm *fsm, int on); int (*start_gadget)(struct otg_fsm *fsm, int on); }; @@ -97,14 +97,14 @@ struct otg_fsm_ops { static inline void otg_chrg_vbus(struct otg_fsm *fsm, int on) { - fsm->ops->chrg_vbus(on); + fsm->ops->chrg_vbus(fsm, on); } static inline void otg_drv_vbus(struct otg_fsm *fsm, int on) { if (fsm->drv_vbus != on) { fsm->drv_vbus = on; - fsm->ops->drv_vbus(on); + fsm->ops->drv_vbus(fsm, on); } } @@ -112,7 +112,7 @@ static inline void otg_loc_conn(struct otg_fsm *fsm, int on) { if (fsm->loc_conn != on) { fsm->loc_conn = on; - fsm->ops->loc_conn(on); + fsm->ops->loc_conn(fsm, on); } } @@ -120,23 +120,23 @@ static inline void otg_loc_sof(struct otg_fsm *fsm, int on) { if (fsm->loc_sof != on) { fsm->loc_sof = on; - fsm->ops->loc_sof(on); + fsm->ops->loc_sof(fsm, on); } } static inline void otg_start_pulse(struct otg_fsm *fsm) { - fsm->ops->start_pulse(); + fsm->ops->start_pulse(fsm); } static inline void otg_add_timer(struct otg_fsm *fsm, void *timer) { - fsm->ops->add_timer(timer); + fsm->ops->add_timer(fsm, timer); } static inline void otg_del_timer(struct otg_fsm *fsm, void *timer) { - fsm->ops->del_timer(timer); + fsm->ops->del_timer(fsm, timer); } int otg_statemachine(struct otg_fsm *fsm); |