Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7372a9a0 in mainline


Ignore:
Timestamp:
2011-07-11T18:07:28Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
302f9b2
Parents:
735236a
Message:

OHCI: Root hub: Use define to set power mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/root_hub.c

    r735236a r7372a9a0  
    152152} while (0)
    153153
     154#define OHCI_POWER 2
     155
    154156/** Root hub initialization
    155157 * @return Error code.
     
    172174        instance->interrupt_mask_size = (instance->port_count + 1 + 8) / 8;
    173175        instance->unfinished_interrupt_transfer = NULL;
    174 
     176#if OHCI_POWER == 0
    175177        /* Set port power mode to no power-switching. (always on) */
    176178        instance->registers->rh_desc_a |= RHDA_NPS_FLAG;
     179#elif OHCI_POWER == 1
     180        /* Set port power mode to no ganged power-switching. */
     181        instance->registers->rh_desc_a &= ~RHDA_NPS_FLAG;
     182        instance->registers->rh_desc_a &= ~RHDA_PSM_FLAG;
     183#else
     184        /* Set port power mode to no per port power-switching. */
     185        instance->registers->rh_desc_a &= ~RHDA_NPS_FLAG;
     186        instance->registers->rh_desc_a |= RHDA_PSM_FLAG;
     187
     188#endif
    177189
    178190        rh_init_descriptors(instance);
Note: See TracChangeset for help on using the changeset viewer.