Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openwrt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Freifunk Luebeck
openwrt
Commits
1152f2f1
Commit
1152f2f1
authored
17 years ago
by
Gabor Juhos
Browse files
Options
Downloads
Patches
Plain Diff
fix reset function in USB driver
SVN-Revision: 8332
parent
ce520f54
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
target/linux/adm5120-2.6/files/drivers/usb/host/adm5120-hcd.c
+11
-7
11 additions, 7 deletions
...et/linux/adm5120-2.6/files/drivers/usb/host/adm5120-hcd.c
with
11 additions
and
7 deletions
target/linux/adm5120-2.6/files/drivers/usb/host/adm5120-hcd.c
+
11
−
7
View file @
1152f2f1
...
...
@@ -54,6 +54,7 @@ MODULE_AUTHOR("Jeroen Vreeken (pe1rxq@amsat.org)");
#define ADMHCD_INTMASK 0x00000001
/* Interrupt mask */
#define ADMHCD_REG_HOSTCONTROL 0x10
#define ADMHCD_DMA_EN 0x00000004
/* USB host DMA enable */
#define ADMHCD_STATE_MASK 0x00000003
#define ADMHCD_STATE_RST 0x00000000
/* bus state reset */
#define ADMHCD_STATE_RES 0x00000001
/* bus state resume */
#define ADMHCD_STATE_OP 0x00000002
/* bus state operational */
...
...
@@ -776,7 +777,7 @@ static int admhcd_sw_reset(struct admhcd *ahcd)
static
int
admhcd_reset
(
struct
usb_hcd
*
hcd
)
{
struct
admhcd
*
ahcd
=
hcd_to_admhcd
(
hcd
);
u32
val
=
0
;
u32
state
=
0
;
int
ret
,
timeout
=
15
;
/* ms */
unsigned
long
t
;
...
...
@@ -785,19 +786,22 @@ static int admhcd_reset(struct usb_hcd *hcd)
return
ret
;
t
=
jiffies
+
msecs_to_jiffies
(
timeout
);
while
(
time_before_eq
(
jiffies
,
t
))
{
msleep
(
4
);
do
{
spin_lock_irq
(
&
ahcd
->
lock
);
val
=
admhcd_reg_get
(
ahcd
,
ADMHCD_REG_HOSTCONTROL
)
&
ADMHCD_STATE_RST
;
state
=
admhcd_reg_get
(
ahcd
,
ADMHCD_REG_HOSTCONTROL
);
spin_unlock_irq
(
&
ahcd
->
lock
);
if
(
val
)
state
&=
ADMHCD_STATE_MASK
;
if
(
state
==
ADMHCD_STATE_RST
)
break
;
}
if
(
!
val
)
{
msleep
(
4
);
}
while
(
time_before_eq
(
jiffies
,
t
));
if
(
state
!=
ADMHCD_STATE_RST
)
{
printk
(
KERN_WARNING
"%s: device not ready after %dms
\n
"
,
hcd_name
,
timeout
);
ret
=
-
ENODEV
;
}
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment