=== modified file 'uspace/drv/bus/usb/ohci/ohci_regs.h'
old
|
new
|
|
137 | 137 | |
138 | 138 | /** The first root hub control register */ |
139 | 139 | volatile uint32_t rh_desc_a; |
140 | | #define RHDA_NDS_MASK (0xff) /* Number of downstream ports, max 15 */ |
141 | | #define RHDA_NDS_SHIFT (0) |
| 140 | #define RHDA_NDP_MASK (0xff) /* Number of downstream ports, max 15 */ |
| 141 | #define RHDA_NDP_SHIFT (0) |
142 | 142 | #define RHDA_PSM_FLAG (1 << 8) /* Power switching mode: 0-global, 1-per port*/ |
143 | 143 | #define RHDA_NPS_FLAG (1 << 9) /* No power switch: 1-power on, 0-use PSM*/ |
144 | 144 | #define RHDA_DT_FLAG (1 << 10) /* 1-Compound device, must be 0 */ |
=== modified file 'uspace/drv/bus/usb/ohci/root_hub.c'
old
|
new
|
|
218 | 218 | assert(instance); |
219 | 219 | instance->registers = regs; |
220 | 220 | instance->port_count = |
221 | | (instance->registers->rh_desc_a >> RHDA_NDS_SHIFT) & RHDA_NDS_MASK; |
| 221 | (instance->registers->rh_desc_a >> RHDA_NDP_SHIFT) & RHDA_NDP_MASK; |
222 | 222 | int opResult = rh_init_descriptors(instance); |
223 | 223 | if (opResult != EOK) { |
224 | 224 | return opResult; |
225 | 225 | } |
226 | | // set port power mode to no-power-switching |
| 226 | /* Simulate unplug */ |
| 227 | |
| 228 | /* Enable power-switching */ |
| 229 | instance->registers->rh_desc_a &= ~RHDA_NPS_FLAG; |
| 230 | /* Set power switch to global */ |
| 231 | instance->registers->rh_desc_a &= ~RHDA_PSM_FLAG; |
| 232 | /* Shut down ports */ |
| 233 | instance->registers->rh_status |= RHS_CLEAR_PORT_POWER; |
| 234 | async_usleep(10000); |
| 235 | instance->registers->rh_status |= RHS_SET_PORT_POWER; |
| 236 | |
| 237 | |
| 238 | /* Set port power mode to no-power-switching (always on) */ |
227 | 239 | instance->registers->rh_desc_a |= RHDA_NPS_FLAG; |
| 240 | |
228 | 241 | instance->unfinished_interrupt_transfer = NULL; |
229 | 242 | instance->interrupt_mask_size = (instance->port_count + 8) / 8; |
230 | 243 | instance->interrupt_buffer = malloc(instance->interrupt_mask_size); |