mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 07:31:15 +00:00
usb: xhci: convert to HCS_MAX_PORTS()
Use HCS_MAX_PORTS(p) instead of ((p & HCS_MAX_PORTS_MASK) >> HCS_MAX_PORTS_SHIFT) Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
740820519c
commit
86d1fa17fb
2 changed files with 1 additions and 4 deletions
|
@ -1257,8 +1257,7 @@ static int xhci_lowlevel_init(struct xhci_ctrl *ctrl)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
reg = xhci_readl(&hccr->cr_hcsparams1);
|
reg = xhci_readl(&hccr->cr_hcsparams1);
|
||||||
descriptor.hub.bNbrPorts = ((reg & HCS_MAX_PORTS_MASK) >>
|
descriptor.hub.bNbrPorts = HCS_MAX_PORTS(reg);
|
||||||
HCS_MAX_PORTS_SHIFT);
|
|
||||||
printf("Register %x NbrPorts %d\n", reg, descriptor.hub.bNbrPorts);
|
printf("Register %x NbrPorts %d\n", reg, descriptor.hub.bNbrPorts);
|
||||||
|
|
||||||
/* Port Indicators */
|
/* Port Indicators */
|
||||||
|
|
|
@ -101,8 +101,6 @@ struct xhci_hccr {
|
||||||
/* bits 8:18, Max Interrupters */
|
/* bits 8:18, Max Interrupters */
|
||||||
#define HCS_MAX_INTRS(p) (((p) >> 8) & 0x7ff)
|
#define HCS_MAX_INTRS(p) (((p) >> 8) & 0x7ff)
|
||||||
/* bits 24:31, Max Ports - max value is 0x7F = 127 ports */
|
/* bits 24:31, Max Ports - max value is 0x7F = 127 ports */
|
||||||
#define HCS_MAX_PORTS_SHIFT 24
|
|
||||||
#define HCS_MAX_PORTS_MASK (0xff << HCS_MAX_PORTS_SHIFT)
|
|
||||||
#define HCS_MAX_PORTS(p) (((p) >> 24) & 0xff)
|
#define HCS_MAX_PORTS(p) (((p) >> 24) & 0xff)
|
||||||
|
|
||||||
/* HCSPARAMS2 - hcs_params2 - bitmasks */
|
/* HCSPARAMS2 - hcs_params2 - bitmasks */
|
||||||
|
|
Loading…
Reference in a new issue