forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/usb/c67x00/c67x00-sched.c
....@@ -23,7 +23,7 @@
2323
2424 /* -------------------------------------------------------------------------- */
2525
26
-/**
26
+/*
2727 * struct c67x00_ep_data: Host endpoint data structure
2828 */
2929 struct c67x00_ep_data {
....@@ -34,7 +34,7 @@
3434 u16 next_frame; /* For int/isoc transactions */
3535 };
3636
37
-/**
37
+/*
3838 * struct c67x00_td
3939 *
4040 * Hardware parts are little endiannes, SW in CPU endianess.
....@@ -130,7 +130,7 @@
130130
131131 /* -------------------------------------------------------------------------- */
132132
133
-/**
133
+/*
134134 * dbg_td - Dump the contents of the TD
135135 */
136136 static void dbg_td(struct c67x00_hcd *c67x00, struct c67x00_td *td, char *msg)
....@@ -161,7 +161,7 @@
161161 return c67x00_ll_husb_get_frame(c67x00->sie) & HOST_FRAME_MASK;
162162 }
163163
164
-/**
164
+/*
165165 * frame_add
166166 * Software wraparound for framenumbers.
167167 */
....@@ -170,7 +170,7 @@
170170 return (a + b) & HOST_FRAME_MASK;
171171 }
172172
173
-/**
173
+/*
174174 * frame_after - is frame a after frame b
175175 */
176176 static inline int frame_after(u16 a, u16 b)
....@@ -179,7 +179,7 @@
179179 (HOST_FRAME_MASK / 2);
180180 }
181181
182
-/**
182
+/*
183183 * frame_after_eq - is frame a after or equal to frame b
184184 */
185185 static inline int frame_after_eq(u16 a, u16 b)
....@@ -190,7 +190,7 @@
190190
191191 /* -------------------------------------------------------------------------- */
192192
193
-/**
193
+/*
194194 * c67x00_release_urb - remove link from all tds to this urb
195195 * Disconnects the urb from it's tds, so that it can be given back.
196196 * pre: urb->hcpriv != NULL
....@@ -557,7 +557,7 @@
557557
558558 /* -------------------------------------------------------------------------- */
559559
560
-/**
560
+/*
561561 * td_addr and buf_addr must be word aligned
562562 */
563563 static int c67x00_create_td(struct c67x00_hcd *c67x00, struct urb *urb,
....@@ -685,7 +685,7 @@
685685 return 0;
686686 }
687687
688
-/**
688
+/*
689689 * return 0 in case more bandwidth is available, else errorcode
690690 */
691691 static int c67x00_add_ctrl_urb(struct c67x00_hcd *c67x00, struct urb *urb)
....@@ -710,7 +710,8 @@
710710 if (ret)
711711 return ret;
712712 break;
713
- } /* else fallthrough */
713
+ }
714
+ fallthrough;
714715 case STATUS_STAGE:
715716 pid = !usb_pipeout(urb->pipe) ? USB_PID_OUT : USB_PID_IN;
716717 ret = c67x00_create_td(c67x00, urb, NULL, 0, pid, 1,
....@@ -822,7 +823,7 @@
822823
823824 /* -------------------------------------------------------------------------- */
824825
825
-/**
826
+/*
826827 * Get TD from C67X00
827828 */
828829 static inline void
....@@ -970,7 +971,7 @@
970971
971972 /* -------------------------------------------------------------------------- */
972973
973
-/**
974
+/*
974975 * c67x00_check_td_list - handle tds which have been processed by the c67x00
975976 * pre: current_td == 0
976977 */
....@@ -1045,7 +1046,7 @@
10451046 return !c67x00_ll_husb_get_current_td(c67x00->sie);
10461047 }
10471048
1048
-/**
1049
+/*
10491050 * Send td to C67X00
10501051 */
10511052 static void c67x00_send_td(struct c67x00_hcd *c67x00, struct c67x00_td *td)
....@@ -1081,7 +1082,7 @@
10811082
10821083 /* -------------------------------------------------------------------------- */
10831084
1084
-/**
1085
+/*
10851086 * c67x00_do_work - Schedulers state machine
10861087 */
10871088 static void c67x00_do_work(struct c67x00_hcd *c67x00)
....@@ -1122,9 +1123,9 @@
11221123
11231124 /* -------------------------------------------------------------------------- */
11241125
1125
-static void c67x00_sched_tasklet(unsigned long __c67x00)
1126
+static void c67x00_sched_tasklet(struct tasklet_struct *t)
11261127 {
1127
- struct c67x00_hcd *c67x00 = (struct c67x00_hcd *)__c67x00;
1128
+ struct c67x00_hcd *c67x00 = from_tasklet(c67x00, t, tasklet);
11281129 c67x00_do_work(c67x00);
11291130 }
11301131
....@@ -1135,8 +1136,7 @@
11351136
11361137 int c67x00_sched_start_scheduler(struct c67x00_hcd *c67x00)
11371138 {
1138
- tasklet_init(&c67x00->tasklet, c67x00_sched_tasklet,
1139
- (unsigned long)c67x00);
1139
+ tasklet_setup(&c67x00->tasklet, c67x00_sched_tasklet);
11401140 return 0;
11411141 }
11421142