Commit fceecf9
committed
usb: chipidea: core: modernize ulpi reset gpio handling
The ulpi reset gpio code (which is a patch owned by us) was still using
the legacy gpio API which brings some pain from times to times whem
merging to a new kernel version (ex: this merge a macro was dropped from
upstream). Hence, use the proper GPIO consumer API.
On top of that, correctly handle the pin polarity. The pins is active
low so this means we want to request the GPIO asserted to reset the phy
(hence GPIOD_OUT_HIGH) and then bring the device out of reset by
deaserting the pin (hence passing 0 in gpiod_set_value_cansleep().
Things worked because we "cheated" in DT by saying the pin is active
high and then requesting it in the deasserted state (setting the pin to 0
and effectively assert/reset it), Then asserting it by passing 1 to
gpiod_set_value_cansleep() which in fact was deasserting the pin.
While at it, remove the #ifdef and use fsleep() instead of msleep().
Signed-off-by: Nuno Sá <nuno.sa@analog.com>1 parent 5eefac7 commit fceecf9
1 file changed
+18
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
988 | 987 | | |
989 | 988 | | |
990 | 989 | | |
991 | | - | |
992 | | - | |
993 | 990 | | |
994 | 991 | | |
995 | 992 | | |
996 | | - | |
997 | | - | |
| 993 | + | |
998 | 994 | | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1005 | 1007 | | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
1010 | 1012 | | |
1011 | 1013 | | |
1012 | 1014 | | |
| |||
1019 | 1021 | | |
1020 | 1022 | | |
1021 | 1023 | | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | 1024 | | |
1032 | 1025 | | |
1033 | 1026 | | |
| |||
0 commit comments