aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-fsm-usb.h
diff options
context:
space:
mode:
authorAnton Tikhomirov <av.tikhomirov@samsung.com>2013-10-02 23:42:04 -0400
committerFelipe Balbi <balbi@ti.com>2013-10-04 10:44:44 -0400
commitda8cc16724da2965c94ca15e1377cb9939776dda (patch)
tree5adbb04d75a23aa202109dd2f25668634ea9177c /drivers/usb/phy/phy-fsm-usb.h
parentf8cffc84a2ff8efc2ecca6128485877109e499f5 (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.h28
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 fbe586206f33..75344bec4679 100644
--- a/drivers/usb/phy/phy-fsm-usb.h
+++ b/drivers/usb/phy/phy-fsm-usb.h
@@ -83,13 +83,13 @@ struct otg_fsm {
83}; 83};
84 84
85struct otg_fsm_ops { 85struct otg_fsm_ops {
86 void (*chrg_vbus)(int on); 86 void (*chrg_vbus)(struct otg_fsm *fsm, int on);
87 void (*drv_vbus)(int on); 87 void (*drv_vbus)(struct otg_fsm *fsm, int on);
88 void (*loc_conn)(int on); 88 void (*loc_conn)(struct otg_fsm *fsm, int on);
89 void (*loc_sof)(int on); 89 void (*loc_sof)(struct otg_fsm *fsm, int on);
90 void (*start_pulse)(void); 90 void (*start_pulse)(struct otg_fsm *fsm);
91 void (*add_timer)(void *timer); 91 void (*add_timer)(struct otg_fsm *fsm, void *timer);
92 void (*del_timer)(void *timer); 92 void (*del_timer)(struct otg_fsm *fsm, void *timer);
93 int (*start_host)(struct otg_fsm *fsm, int on); 93 int (*start_host)(struct otg_fsm *fsm, int on);
94 int (*start_gadget)(struct otg_fsm *fsm, int on); 94 int (*start_gadget)(struct otg_fsm *fsm, int on);
95}; 95};
@@ -97,14 +97,14 @@ struct otg_fsm_ops {
97 97
98static inline void otg_chrg_vbus(struct otg_fsm *fsm, int on) 98static inline void otg_chrg_vbus(struct otg_fsm *fsm, int on)
99{ 99{
100 fsm->ops->chrg_vbus(on); 100 fsm->ops->chrg_vbus(fsm, on);
101} 101}
102 102
103static inline void otg_drv_vbus(struct otg_fsm *fsm, int on) 103static inline void otg_drv_vbus(struct otg_fsm *fsm, int on)
104{ 104{
105 if (fsm->drv_vbus != on) { 105 if (fsm->drv_vbus != on) {
106 fsm->drv_vbus = on; 106 fsm->drv_vbus = on;
107 fsm->ops->drv_vbus(on); 107 fsm->ops->drv_vbus(fsm, on);
108 } 108 }
109} 109}
110 110
@@ -112,7 +112,7 @@ static inline void otg_loc_conn(struct otg_fsm *fsm, int on)
112{ 112{
113 if (fsm->loc_conn != on) { 113 if (fsm->loc_conn != on) {
114 fsm->loc_conn = on; 114 fsm->loc_conn = on;
115 fsm->ops->loc_conn(on); 115 fsm->ops->loc_conn(fsm, on);
116 } 116 }
117} 117}
118 118
@@ -120,23 +120,23 @@ static inline void otg_loc_sof(struct otg_fsm *fsm, int on)
120{ 120{
121 if (fsm->loc_sof != on) { 121 if (fsm->loc_sof != on) {
122 fsm->loc_sof = on; 122 fsm->loc_sof = on;
123 fsm->ops->loc_sof(on); 123 fsm->ops->loc_sof(fsm, on);
124 } 124 }
125} 125}
126 126
127static inline void otg_start_pulse(struct otg_fsm *fsm) 127static inline void otg_start_pulse(struct otg_fsm *fsm)
128{ 128{
129 fsm->ops->start_pulse(); 129 fsm->ops->start_pulse(fsm);
130} 130}
131 131
132static inline void otg_add_timer(struct otg_fsm *fsm, void *timer) 132static inline void otg_add_timer(struct otg_fsm *fsm, void *timer)
133{ 133{
134 fsm->ops->add_timer(timer); 134 fsm->ops->add_timer(fsm, timer);
135} 135}
136 136
137static inline void otg_del_timer(struct otg_fsm *fsm, void *timer) 137static inline void otg_del_timer(struct otg_fsm *fsm, void *timer)
138{ 138{
139 fsm->ops->del_timer(timer); 139 fsm->ops->del_timer(fsm, timer);
140} 140}
141 141
142int otg_statemachine(struct otg_fsm *fsm); 142int otg_statemachine(struct otg_fsm *fsm);