aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/core/hub.c2
-rw-r--r--drivers/usb/host/ehci-hub.c24
-rw-r--r--drivers/usb/host/isp1362-hcd.c2
-rw-r--r--drivers/usb/host/isp1760-hcd.c18
-rw-r--r--drivers/usb/host/oxu210hp-hcd.c24
-rw-r--r--drivers/usb/host/r8a66597-hcd.c30
-rw-r--r--drivers/usb/host/sl811-hcd.c52
-rw-r--r--drivers/usb/host/xhci-hub.c16
-rw-r--r--drivers/usb/musb/musb_core.c7
-rw-r--r--drivers/usb/musb/musb_virthub.c4
10 files changed, 89 insertions, 90 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 5ac27ed0c63..497dbb29744 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3037,7 +3037,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
3037 3037
3038 /* maybe switch power back on (e.g. root hub was reset) */ 3038 /* maybe switch power back on (e.g. root hub was reset) */
3039 if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2 3039 if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2
3040 && !(portstatus & (1 << USB_PORT_FEAT_POWER))) 3040 && !(portstatus & USB_PORT_STAT_POWER))
3041 set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); 3041 set_port_feature(hdev, port1, USB_PORT_FEAT_POWER);
3042 3042
3043 if (portstatus & USB_PORT_STAT_ENABLE) 3043 if (portstatus & USB_PORT_STAT_ENABLE)
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index c7178bcde67..c44018109a1 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -659,7 +659,7 @@ static int ehci_hub_control (
659 * Even if OWNER is set, so the port is owned by the 659 * Even if OWNER is set, so the port is owned by the
660 * companion controller, khubd needs to be able to clear 660 * companion controller, khubd needs to be able to clear
661 * the port-change status bits (especially 661 * the port-change status bits (especially
662 * USB_PORT_FEAT_C_CONNECTION). 662 * USB_PORT_STAT_C_CONNECTION).
663 */ 663 */
664 664
665 switch (wValue) { 665 switch (wValue) {
@@ -729,12 +729,12 @@ static int ehci_hub_control (
729 729
730 // wPortChange bits 730 // wPortChange bits
731 if (temp & PORT_CSC) 731 if (temp & PORT_CSC)
732 status |= 1 << USB_PORT_FEAT_C_CONNECTION; 732 status |= USB_PORT_STAT_C_CONNECTION << 16;
733 if (temp & PORT_PEC) 733 if (temp & PORT_PEC)
734 status |= 1 << USB_PORT_FEAT_C_ENABLE; 734 status |= USB_PORT_STAT_C_ENABLE << 16;
735 735
736 if ((temp & PORT_OCC) && !ignore_oc){ 736 if ((temp & PORT_OCC) && !ignore_oc){
737 status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; 737 status |= USB_PORT_STAT_C_OVERCURRENT << 16;
738 738
739 /* 739 /*
740 * Hubs should disable port power on over-current. 740 * Hubs should disable port power on over-current.
@@ -791,7 +791,7 @@ static int ehci_hub_control (
791 if ((temp & PORT_RESET) 791 if ((temp & PORT_RESET)
792 && time_after_eq(jiffies, 792 && time_after_eq(jiffies,
793 ehci->reset_done[wIndex])) { 793 ehci->reset_done[wIndex])) {
794 status |= 1 << USB_PORT_FEAT_C_RESET; 794 status |= USB_PORT_STAT_C_RESET << 16;
795 ehci->reset_done [wIndex] = 0; 795 ehci->reset_done [wIndex] = 0;
796 796
797 /* force reset to complete */ 797 /* force reset to complete */
@@ -833,7 +833,7 @@ static int ehci_hub_control (
833 */ 833 */
834 834
835 if (temp & PORT_CONNECT) { 835 if (temp & PORT_CONNECT) {
836 status |= 1 << USB_PORT_FEAT_CONNECTION; 836 status |= USB_PORT_STAT_CONNECTION;
837 // status may be from integrated TT 837 // status may be from integrated TT
838 if (ehci->has_hostpc) { 838 if (ehci->has_hostpc) {
839 temp1 = ehci_readl(ehci, hostpc_reg); 839 temp1 = ehci_readl(ehci, hostpc_reg);
@@ -842,11 +842,11 @@ static int ehci_hub_control (
842 status |= ehci_port_speed(ehci, temp); 842 status |= ehci_port_speed(ehci, temp);
843 } 843 }
844 if (temp & PORT_PE) 844 if (temp & PORT_PE)
845 status |= 1 << USB_PORT_FEAT_ENABLE; 845 status |= USB_PORT_STAT_ENABLE;
846 846
847 /* maybe the port was unsuspended without our knowledge */ 847 /* maybe the port was unsuspended without our knowledge */
848 if (temp & (PORT_SUSPEND|PORT_RESUME)) { 848 if (temp & (PORT_SUSPEND|PORT_RESUME)) {
849 status |= 1 << USB_PORT_FEAT_SUSPEND; 849 status |= USB_PORT_STAT_SUSPEND;
850 } else if (test_bit(wIndex, &ehci->suspended_ports)) { 850 } else if (test_bit(wIndex, &ehci->suspended_ports)) {
851 clear_bit(wIndex, &ehci->suspended_ports); 851 clear_bit(wIndex, &ehci->suspended_ports);
852 ehci->reset_done[wIndex] = 0; 852 ehci->reset_done[wIndex] = 0;
@@ -855,13 +855,13 @@ static int ehci_hub_control (
855 } 855 }
856 856
857 if (temp & PORT_OC) 857 if (temp & PORT_OC)
858 status |= 1 << USB_PORT_FEAT_OVER_CURRENT; 858 status |= USB_PORT_STAT_OVERCURRENT;
859 if (temp & PORT_RESET) 859 if (temp & PORT_RESET)
860 status |= 1 << USB_PORT_FEAT_RESET; 860 status |= USB_PORT_STAT_RESET;
861 if (temp & PORT_POWER) 861 if (temp & PORT_POWER)
862 status |= 1 << USB_PORT_FEAT_POWER; 862 status |= USB_PORT_STAT_POWER;
863 if (test_bit(wIndex, &ehci->port_c_suspend)) 863 if (test_bit(wIndex, &ehci->port_c_suspend))
864 status |= 1 << USB_PORT_FEAT_C_SUSPEND; 864 status |= USB_PORT_STAT_C_SUSPEND << 16;
865 865
866#ifndef VERBOSE_DEBUG 866#ifndef VERBOSE_DEBUG
867 if (status & ~0xffff) /* only if wPortChange is interesting */ 867 if (status & ~0xffff) /* only if wPortChange is interesting */
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index acc157da727..6a6a50849bf 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -1265,7 +1265,7 @@ static int isp1362_urb_enqueue(struct usb_hcd *hcd,
1265 1265
1266 /* don't submit to a dead or disabled port */ 1266 /* don't submit to a dead or disabled port */
1267 if (!((isp1362_hcd->rhport[0] | isp1362_hcd->rhport[1]) & 1267 if (!((isp1362_hcd->rhport[0] | isp1362_hcd->rhport[1]) &
1268 (1 << USB_PORT_FEAT_ENABLE)) || 1268 USB_PORT_STAT_ENABLE) ||
1269 !HC_IS_RUNNING(hcd->state)) { 1269 !HC_IS_RUNNING(hcd->state)) {
1270 kfree(ep); 1270 kfree(ep);
1271 retval = -ENODEV; 1271 retval = -ENODEV;
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
index cfdac6da955..13f7d1200bc 100644
--- a/drivers/usb/host/isp1760-hcd.c
+++ b/drivers/usb/host/isp1760-hcd.c
@@ -1923,7 +1923,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
1923 * Even if OWNER is set, so the port is owned by the 1923 * Even if OWNER is set, so the port is owned by the
1924 * companion controller, khubd needs to be able to clear 1924 * companion controller, khubd needs to be able to clear
1925 * the port-change status bits (especially 1925 * the port-change status bits (especially
1926 * USB_PORT_FEAT_C_CONNECTION). 1926 * USB_PORT_STAT_C_CONNECTION).
1927 */ 1927 */
1928 1928
1929 switch (wValue) { 1929 switch (wValue) {
@@ -1987,7 +1987,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
1987 1987
1988 /* wPortChange bits */ 1988 /* wPortChange bits */
1989 if (temp & PORT_CSC) 1989 if (temp & PORT_CSC)
1990 status |= 1 << USB_PORT_FEAT_C_CONNECTION; 1990 status |= USB_PORT_STAT_C_CONNECTION << 16;
1991 1991
1992 1992
1993 /* whoever resumes must GetPortStatus to complete it!! */ 1993 /* whoever resumes must GetPortStatus to complete it!! */
@@ -2007,7 +2007,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
2007 /* resume completed? */ 2007 /* resume completed? */
2008 else if (time_after_eq(jiffies, 2008 else if (time_after_eq(jiffies,
2009 priv->reset_done)) { 2009 priv->reset_done)) {
2010 status |= 1 << USB_PORT_FEAT_C_SUSPEND; 2010 status |= USB_PORT_STAT_C_SUSPEND << 16;
2011 priv->reset_done = 0; 2011 priv->reset_done = 0;
2012 2012
2013 /* stop resume signaling */ 2013 /* stop resume signaling */
@@ -2031,7 +2031,7 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
2031 if ((temp & PORT_RESET) 2031 if ((temp & PORT_RESET)
2032 && time_after_eq(jiffies, 2032 && time_after_eq(jiffies,
2033 priv->reset_done)) { 2033 priv->reset_done)) {
2034 status |= 1 << USB_PORT_FEAT_C_RESET; 2034 status |= USB_PORT_STAT_C_RESET << 16;
2035 priv->reset_done = 0; 2035 priv->reset_done = 0;
2036 2036
2037 /* force reset to complete */ 2037 /* force reset to complete */
@@ -2062,18 +2062,18 @@ static int isp1760_hub_control(struct usb_hcd *hcd, u16 typeReq,
2062 printk(KERN_ERR "Warning: PORT_OWNER is set\n"); 2062 printk(KERN_ERR "Warning: PORT_OWNER is set\n");
2063 2063
2064 if (temp & PORT_CONNECT) { 2064 if (temp & PORT_CONNECT) {
2065 status |= 1 << USB_PORT_FEAT_CONNECTION; 2065 status |= USB_PORT_STAT_CONNECTION;
2066 /* status may be from integrated TT */ 2066 /* status may be from integrated TT */
2067 status |= ehci_port_speed(priv, temp); 2067 status |= ehci_port_speed(priv, temp);
2068 } 2068 }
2069 if (temp & PORT_PE) 2069 if (temp & PORT_PE)
2070 status |= 1 << USB_PORT_FEAT_ENABLE; 2070 status |= USB_PORT_STAT_ENABLE;
2071 if (temp & (PORT_SUSPEND|PORT_RESUME)) 2071 if (temp & (PORT_SUSPEND|PORT_RESUME))
2072 status |= 1 << USB_PORT_FEAT_SUSPEND; 2072 status |= USB_PORT_STAT_SUSPEND;
2073 if (temp & PORT_RESET) 2073 if (temp & PORT_RESET)
2074 status |= 1 << USB_PORT_FEAT_RESET; 2074 status |= USB_PORT_STAT_RESET;
2075 if (temp & PORT_POWER) 2075 if (temp & PORT_POWER)
2076 status |= 1 << USB_PORT_FEAT_POWER; 2076 status |= USB_PORT_STAT_POWER;
2077 2077
2078 put_unaligned(cpu_to_le32(status), (__le32 *) buf); 2078 put_unaligned(cpu_to_le32(status), (__le32 *) buf);
2079 break; 2079 break;
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index 8f04c0afa59..f608dfd09a8 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -3201,7 +3201,7 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq,
3201 * Even if OWNER is set, so the port is owned by the 3201 * Even if OWNER is set, so the port is owned by the
3202 * companion controller, khubd needs to be able to clear 3202 * companion controller, khubd needs to be able to clear
3203 * the port-change status bits (especially 3203 * the port-change status bits (especially
3204 * USB_PORT_FEAT_C_CONNECTION). 3204 * USB_PORT_STAT_C_CONNECTION).
3205 */ 3205 */
3206 3206
3207 switch (wValue) { 3207 switch (wValue) {
@@ -3263,11 +3263,11 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq,
3263 3263
3264 /* wPortChange bits */ 3264 /* wPortChange bits */
3265 if (temp & PORT_CSC) 3265 if (temp & PORT_CSC)
3266 status |= 1 << USB_PORT_FEAT_C_CONNECTION; 3266 status |= USB_PORT_STAT_C_CONNECTION << 16;
3267 if (temp & PORT_PEC) 3267 if (temp & PORT_PEC)
3268 status |= 1 << USB_PORT_FEAT_C_ENABLE; 3268 status |= USB_PORT_STAT_C_ENABLE << 16;
3269 if ((temp & PORT_OCC) && !ignore_oc) 3269 if ((temp & PORT_OCC) && !ignore_oc)
3270 status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; 3270 status |= USB_PORT_STAT_C_OVERCURRENT << 16;
3271 3271
3272 /* whoever resumes must GetPortStatus to complete it!! */ 3272 /* whoever resumes must GetPortStatus to complete it!! */
3273 if (temp & PORT_RESUME) { 3273 if (temp & PORT_RESUME) {
@@ -3285,7 +3285,7 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq,
3285 /* resume completed? */ 3285 /* resume completed? */
3286 else if (time_after_eq(jiffies, 3286 else if (time_after_eq(jiffies,
3287 oxu->reset_done[wIndex])) { 3287 oxu->reset_done[wIndex])) {
3288 status |= 1 << USB_PORT_FEAT_C_SUSPEND; 3288 status |= USB_PORT_STAT_C_SUSPEND << 16;
3289 oxu->reset_done[wIndex] = 0; 3289 oxu->reset_done[wIndex] = 0;
3290 3290
3291 /* stop resume signaling */ 3291 /* stop resume signaling */
@@ -3308,7 +3308,7 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq,
3308 if ((temp & PORT_RESET) 3308 if ((temp & PORT_RESET)
3309 && time_after_eq(jiffies, 3309 && time_after_eq(jiffies,
3310 oxu->reset_done[wIndex])) { 3310 oxu->reset_done[wIndex])) {
3311 status |= 1 << USB_PORT_FEAT_C_RESET; 3311 status |= USB_PORT_STAT_C_RESET << 16;
3312 oxu->reset_done[wIndex] = 0; 3312 oxu->reset_done[wIndex] = 0;
3313 3313
3314 /* force reset to complete */ 3314 /* force reset to complete */
@@ -3347,20 +3347,20 @@ static int oxu_hub_control(struct usb_hcd *hcd, u16 typeReq,
3347 */ 3347 */
3348 3348
3349 if (temp & PORT_CONNECT) { 3349 if (temp & PORT_CONNECT) {
3350 status |= 1 << USB_PORT_FEAT_CONNECTION; 3350 status |= USB_PORT_STAT_CONNECTION;
3351 /* status may be from integrated TT */ 3351 /* status may be from integrated TT */
3352 status |= oxu_port_speed(oxu, temp); 3352 status |= oxu_port_speed(oxu, temp);
3353 } 3353 }
3354 if (temp & PORT_PE) 3354 if (temp & PORT_PE)
3355 status |= 1 << USB_PORT_FEAT_ENABLE; 3355 status |= USB_PORT_STAT_ENABLE;
3356 if (temp & (PORT_SUSPEND|PORT_RESUME)) 3356 if (temp & (PORT_SUSPEND|PORT_RESUME))
3357 status |= 1 << USB_PORT_FEAT_SUSPEND; 3357 status |= USB_PORT_STAT_SUSPEND;
3358 if (temp & PORT_OC) 3358 if (temp & PORT_OC)
3359 status |= 1 << USB_PORT_FEAT_OVER_CURRENT; 3359 status |= USB_PORT_STAT_OVERCURRENT;
3360 if (temp & PORT_RESET) 3360 if (temp & PORT_RESET)
3361 status |= 1 << USB_PORT_FEAT_RESET; 3361 status |= USB_PORT_STAT_RESET;
3362 if (temp & PORT_POWER) 3362 if (temp & PORT_POWER)
3363 status |= 1 << USB_PORT_FEAT_POWER; 3363 status |= USB_PORT_STAT_POWER;
3364 3364
3365#ifndef OXU_VERBOSE_DEBUG 3365#ifndef OXU_VERBOSE_DEBUG
3366 if (status & ~0xffff) /* only if wPortChange is interesting */ 3366 if (status & ~0xffff) /* only if wPortChange is interesting */
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index a004a122084..6db57ab6079 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -1018,10 +1018,10 @@ static void start_root_hub_sampling(struct r8a66597 *r8a66597, int port,
1018 rh->old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port)) & LNST; 1018 rh->old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port)) & LNST;
1019 rh->scount = R8A66597_MAX_SAMPLING; 1019 rh->scount = R8A66597_MAX_SAMPLING;
1020 if (connect) 1020 if (connect)
1021 rh->port |= 1 << USB_PORT_FEAT_CONNECTION; 1021 rh->port |= USB_PORT_STAT_CONNECTION;
1022 else 1022 else
1023 rh->port &= ~(1 << USB_PORT_FEAT_CONNECTION); 1023 rh->port &= ~USB_PORT_STAT_CONNECTION;
1024 rh->port |= 1 << USB_PORT_FEAT_C_CONNECTION; 1024 rh->port |= USB_PORT_STAT_C_CONNECTION << 16;
1025 1025
1026 r8a66597_root_hub_start_polling(r8a66597); 1026 r8a66597_root_hub_start_polling(r8a66597);
1027} 1027}
@@ -1065,8 +1065,8 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port)
1065 else if (speed == LSMODE) 1065 else if (speed == LSMODE)
1066 rh->port |= USB_PORT_STAT_LOW_SPEED; 1066 rh->port |= USB_PORT_STAT_LOW_SPEED;
1067 1067
1068 rh->port &= ~(1 << USB_PORT_FEAT_RESET); 1068 rh->port &= USB_PORT_STAT_RESET;
1069 rh->port |= 1 << USB_PORT_FEAT_ENABLE; 1069 rh->port |= USB_PORT_STAT_ENABLE;
1070} 1070}
1071 1071
1072/* this function must be called with interrupt disabled */ 1072/* this function must be called with interrupt disabled */
@@ -1705,7 +1705,7 @@ static void r8a66597_root_hub_control(struct r8a66597 *r8a66597, int port)
1705 u16 tmp; 1705 u16 tmp;
1706 struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; 1706 struct r8a66597_root_hub *rh = &r8a66597->root_hub[port];
1707 1707
1708 if (rh->port & (1 << USB_PORT_FEAT_RESET)) { 1708 if (rh->port & USB_PORT_STAT_RESET) {
1709 unsigned long dvstctr_reg = get_dvstctr_reg(port); 1709 unsigned long dvstctr_reg = get_dvstctr_reg(port);
1710 1710
1711 tmp = r8a66597_read(r8a66597, dvstctr_reg); 1711 tmp = r8a66597_read(r8a66597, dvstctr_reg);
@@ -1717,7 +1717,7 @@ static void r8a66597_root_hub_control(struct r8a66597 *r8a66597, int port)
1717 r8a66597_usb_connect(r8a66597, port); 1717 r8a66597_usb_connect(r8a66597, port);
1718 } 1718 }
1719 1719
1720 if (!(rh->port & (1 << USB_PORT_FEAT_CONNECTION))) { 1720 if (!(rh->port & USB_PORT_STAT_CONNECTION)) {
1721 r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); 1721 r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port));
1722 r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port)); 1722 r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port));
1723 } 1723 }
@@ -2185,7 +2185,7 @@ static int r8a66597_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
2185 2185
2186 switch (wValue) { 2186 switch (wValue) {
2187 case USB_PORT_FEAT_ENABLE: 2187 case USB_PORT_FEAT_ENABLE:
2188 rh->port &= ~(1 << USB_PORT_FEAT_POWER); 2188 rh->port &= ~USB_PORT_STAT_POWER;
2189 break; 2189 break;
2190 case USB_PORT_FEAT_SUSPEND: 2190 case USB_PORT_FEAT_SUSPEND:
2191 break; 2191 break;
@@ -2226,12 +2226,12 @@ static int r8a66597_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
2226 break; 2226 break;
2227 case USB_PORT_FEAT_POWER: 2227 case USB_PORT_FEAT_POWER:
2228 r8a66597_port_power(r8a66597, port, 1); 2228 r8a66597_port_power(r8a66597, port, 1);
2229 rh->port |= (1 << USB_PORT_FEAT_POWER); 2229 rh->port |= USB_PORT_STAT_POWER;
2230 break; 2230 break;
2231 case USB_PORT_FEAT_RESET: { 2231 case USB_PORT_FEAT_RESET: {
2232 struct r8a66597_device *dev = rh->dev; 2232 struct r8a66597_device *dev = rh->dev;
2233 2233
2234 rh->port |= (1 << USB_PORT_FEAT_RESET); 2234 rh->port |= USB_PORT_STAT_RESET;
2235 2235
2236 disable_r8a66597_pipe_all(r8a66597, dev); 2236 disable_r8a66597_pipe_all(r8a66597, dev);
2237 free_usb_address(r8a66597, dev, 1); 2237 free_usb_address(r8a66597, dev, 1);
@@ -2269,12 +2269,12 @@ static int r8a66597_bus_suspend(struct usb_hcd *hcd)
2269 struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; 2269 struct r8a66597_root_hub *rh = &r8a66597->root_hub[port];
2270 unsigned long dvstctr_reg = get_dvstctr_reg(port); 2270 unsigned long dvstctr_reg = get_dvstctr_reg(port);
2271 2271
2272 if (!(rh->port & (1 << USB_PORT_FEAT_ENABLE))) 2272 if (!(rh->port & USB_PORT_STAT_ENABLE))
2273 continue; 2273 continue;
2274 2274
2275 dbg("suspend port = %d", port); 2275 dbg("suspend port = %d", port);
2276 r8a66597_bclr(r8a66597, UACT, dvstctr_reg); /* suspend */ 2276 r8a66597_bclr(r8a66597, UACT, dvstctr_reg); /* suspend */
2277 rh->port |= 1 << USB_PORT_FEAT_SUSPEND; 2277 rh->port |= USB_PORT_STAT_SUSPEND;
2278 2278
2279 if (rh->dev->udev->do_remote_wakeup) { 2279 if (rh->dev->udev->do_remote_wakeup) {
2280 msleep(3); /* waiting last SOF */ 2280 msleep(3); /* waiting last SOF */
@@ -2300,12 +2300,12 @@ static int r8a66597_bus_resume(struct usb_hcd *hcd)
2300 struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; 2300 struct r8a66597_root_hub *rh = &r8a66597->root_hub[port];
2301 unsigned long dvstctr_reg = get_dvstctr_reg(port); 2301 unsigned long dvstctr_reg = get_dvstctr_reg(port);
2302 2302
2303 if (!(rh->port & (1 << USB_PORT_FEAT_SUSPEND))) 2303 if (!(rh->port & USB_PORT_STAT_SUSPEND))
2304 continue; 2304 continue;
2305 2305
2306 dbg("resume port = %d", port); 2306 dbg("resume port = %d", port);
2307 rh->port &= ~(1 << USB_PORT_FEAT_SUSPEND); 2307 rh->port &= ~USB_PORT_STAT_SUSPEND;
2308 rh->port |= 1 << USB_PORT_FEAT_C_SUSPEND; 2308 rh->port |= USB_PORT_STAT_C_SUSPEND < 16;
2309 r8a66597_mdfy(r8a66597, RESUME, RESUME | UACT, dvstctr_reg); 2309 r8a66597_mdfy(r8a66597, RESUME, RESUME | UACT, dvstctr_reg);
2310 msleep(50); 2310 msleep(50);
2311 r8a66597_mdfy(r8a66597, UACT, RESUME | UACT, dvstctr_reg); 2311 r8a66597_mdfy(r8a66597, UACT, RESUME | UACT, dvstctr_reg);
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index dcd7fab7179..bcf9f0e809d 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -90,10 +90,10 @@ static void port_power(struct sl811 *sl811, int is_on)
90 90
91 /* hub is inactive unless the port is powered */ 91 /* hub is inactive unless the port is powered */
92 if (is_on) { 92 if (is_on) {
93 if (sl811->port1 & (1 << USB_PORT_FEAT_POWER)) 93 if (sl811->port1 & USB_PORT_STAT_POWER)
94 return; 94 return;
95 95
96 sl811->port1 = (1 << USB_PORT_FEAT_POWER); 96 sl811->port1 = USB_PORT_STAT_POWER;
97 sl811->irq_enable = SL11H_INTMASK_INSRMV; 97 sl811->irq_enable = SL11H_INTMASK_INSRMV;
98 } else { 98 } else {
99 sl811->port1 = 0; 99 sl811->port1 = 0;
@@ -407,7 +407,7 @@ static struct sl811h_ep *start(struct sl811 *sl811, u8 bank)
407 407
408static inline void start_transfer(struct sl811 *sl811) 408static inline void start_transfer(struct sl811 *sl811)
409{ 409{
410 if (sl811->port1 & (1 << USB_PORT_FEAT_SUSPEND)) 410 if (sl811->port1 & USB_PORT_STAT_SUSPEND)
411 return; 411 return;
412 if (sl811->active_a == NULL) { 412 if (sl811->active_a == NULL) {
413 sl811->active_a = start(sl811, SL811_EP_A(SL811_HOST_BUF)); 413 sl811->active_a = start(sl811, SL811_EP_A(SL811_HOST_BUF));
@@ -721,23 +721,23 @@ retry:
721 * force the reset and make khubd clean up later. 721 * force the reset and make khubd clean up later.
722 */ 722 */
723 if (irqstat & SL11H_INTMASK_RD) 723 if (irqstat & SL11H_INTMASK_RD)
724 sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION); 724 sl811->port1 &= ~USB_PORT_STAT_CONNECTION;
725 else 725 else
726 sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION; 726 sl811->port1 |= USB_PORT_STAT_CONNECTION;
727 727
728 sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION; 728 sl811->port1 |= USB_PORT_STAT_C_CONNECTION << 16;
729 729
730 } else if (irqstat & SL11H_INTMASK_RD) { 730 } else if (irqstat & SL11H_INTMASK_RD) {
731 if (sl811->port1 & (1 << USB_PORT_FEAT_SUSPEND)) { 731 if (sl811->port1 & USB_PORT_STAT_SUSPEND) {
732 DBG("wakeup\n"); 732 DBG("wakeup\n");
733 sl811->port1 |= 1 << USB_PORT_FEAT_C_SUSPEND; 733 sl811->port1 |= USB_PORT_STAT_C_SUSPEND << 16;
734 sl811->stat_wake++; 734 sl811->stat_wake++;
735 } else 735 } else
736 irqstat &= ~SL11H_INTMASK_RD; 736 irqstat &= ~SL11H_INTMASK_RD;
737 } 737 }
738 738
739 if (irqstat) { 739 if (irqstat) {
740 if (sl811->port1 & (1 << USB_PORT_FEAT_ENABLE)) 740 if (sl811->port1 & USB_PORT_STAT_ENABLE)
741 start_transfer(sl811); 741 start_transfer(sl811);
742 ret = IRQ_HANDLED; 742 ret = IRQ_HANDLED;
743 if (retries--) 743 if (retries--)
@@ -819,7 +819,7 @@ static int sl811h_urb_enqueue(
819 spin_lock_irqsave(&sl811->lock, flags); 819 spin_lock_irqsave(&sl811->lock, flags);
820 820
821 /* don't submit to a dead or disabled port */ 821 /* don't submit to a dead or disabled port */
822 if (!(sl811->port1 & (1 << USB_PORT_FEAT_ENABLE)) 822 if (!(sl811->port1 & USB_PORT_STAT_ENABLE)
823 || !HC_IS_RUNNING(hcd->state)) { 823 || !HC_IS_RUNNING(hcd->state)) {
824 retval = -ENODEV; 824 retval = -ENODEV;
825 kfree(ep); 825 kfree(ep);
@@ -1119,8 +1119,8 @@ sl811h_timer(unsigned long _sl811)
1119 unsigned long flags; 1119 unsigned long flags;
1120 u8 irqstat; 1120 u8 irqstat;
1121 u8 signaling = sl811->ctrl1 & SL11H_CTL1MASK_FORCE; 1121 u8 signaling = sl811->ctrl1 & SL11H_CTL1MASK_FORCE;
1122 const u32 mask = (1 << USB_PORT_FEAT_CONNECTION) 1122 const u32 mask = USB_PORT_STAT_CONNECTION
1123 | (1 << USB_PORT_FEAT_ENABLE) 1123 | USB_PORT_STAT_ENABLE
1124 | USB_PORT_STAT_LOW_SPEED; 1124 | USB_PORT_STAT_LOW_SPEED;
1125 1125
1126 spin_lock_irqsave(&sl811->lock, flags); 1126 spin_lock_irqsave(&sl811->lock, flags);
@@ -1135,8 +1135,8 @@ sl811h_timer(unsigned long _sl811)
1135 switch (signaling) { 1135 switch (signaling) {
1136 case SL11H_CTL1MASK_SE0: 1136 case SL11H_CTL1MASK_SE0:
1137 DBG("end reset\n"); 1137 DBG("end reset\n");
1138 sl811->port1 = (1 << USB_PORT_FEAT_C_RESET) 1138 sl811->port1 = (USB_PORT_STAT_C_RESET << 16)
1139 | (1 << USB_PORT_FEAT_POWER); 1139 | USB_PORT_STAT_POWER;
1140 sl811->ctrl1 = 0; 1140 sl811->ctrl1 = 0;
1141 /* don't wrongly ack RD */ 1141 /* don't wrongly ack RD */
1142 if (irqstat & SL11H_INTMASK_INSRMV) 1142 if (irqstat & SL11H_INTMASK_INSRMV)
@@ -1144,7 +1144,7 @@ sl811h_timer(unsigned long _sl811)
1144 break; 1144 break;
1145 case SL11H_CTL1MASK_K: 1145 case SL11H_CTL1MASK_K:
1146 DBG("end resume\n"); 1146 DBG("end resume\n");
1147 sl811->port1 &= ~(1 << USB_PORT_FEAT_SUSPEND); 1147 sl811->port1 &= ~USB_PORT_STAT_SUSPEND;
1148 break; 1148 break;
1149 default: 1149 default:
1150 DBG("odd timer signaling: %02x\n", signaling); 1150 DBG("odd timer signaling: %02x\n", signaling);
@@ -1154,9 +1154,9 @@ sl811h_timer(unsigned long _sl811)
1154 1154
1155 if (irqstat & SL11H_INTMASK_RD) { 1155 if (irqstat & SL11H_INTMASK_RD) {
1156 /* usbcore nukes all pending transactions on disconnect */ 1156 /* usbcore nukes all pending transactions on disconnect */
1157 if (sl811->port1 & (1 << USB_PORT_FEAT_CONNECTION)) 1157 if (sl811->port1 & USB_PORT_STAT_CONNECTION)
1158 sl811->port1 |= (1 << USB_PORT_FEAT_C_CONNECTION) 1158 sl811->port1 |= (USB_PORT_STAT_C_CONNECTION << 16)
1159 | (1 << USB_PORT_FEAT_C_ENABLE); 1159 | (USB_PORT_STAT_C_ENABLE << 16);
1160 sl811->port1 &= ~mask; 1160 sl811->port1 &= ~mask;
1161 sl811->irq_enable = SL11H_INTMASK_INSRMV; 1161 sl811->irq_enable = SL11H_INTMASK_INSRMV;
1162 } else { 1162 } else {
@@ -1166,7 +1166,7 @@ sl811h_timer(unsigned long _sl811)
1166 sl811->irq_enable = SL11H_INTMASK_INSRMV | SL11H_INTMASK_RD; 1166 sl811->irq_enable = SL11H_INTMASK_INSRMV | SL11H_INTMASK_RD;
1167 } 1167 }
1168 1168
1169 if (sl811->port1 & (1 << USB_PORT_FEAT_CONNECTION)) { 1169 if (sl811->port1 & USB_PORT_STAT_CONNECTION) {
1170 u8 ctrl2 = SL811HS_CTL2_INIT; 1170 u8 ctrl2 = SL811HS_CTL2_INIT;
1171 1171
1172 sl811->irq_enable |= SL11H_INTMASK_DONE_A; 1172 sl811->irq_enable |= SL11H_INTMASK_DONE_A;
@@ -1233,7 +1233,7 @@ sl811h_hub_control(
1233 1233
1234 switch (wValue) { 1234 switch (wValue) {
1235 case USB_PORT_FEAT_ENABLE: 1235 case USB_PORT_FEAT_ENABLE:
1236 sl811->port1 &= (1 << USB_PORT_FEAT_POWER); 1236 sl811->port1 &= USB_PORT_STAT_POWER;
1237 sl811->ctrl1 = 0; 1237 sl811->ctrl1 = 0;
1238 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); 1238 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1);
1239 sl811->irq_enable = SL11H_INTMASK_INSRMV; 1239 sl811->irq_enable = SL11H_INTMASK_INSRMV;
@@ -1241,7 +1241,7 @@ sl811h_hub_control(
1241 sl811->irq_enable); 1241 sl811->irq_enable);
1242 break; 1242 break;
1243 case USB_PORT_FEAT_SUSPEND: 1243 case USB_PORT_FEAT_SUSPEND:
1244 if (!(sl811->port1 & (1 << USB_PORT_FEAT_SUSPEND))) 1244 if (!(sl811->port1 & USB_PORT_STAT_SUSPEND))
1245 break; 1245 break;
1246 1246
1247 /* 20 msec of resume/K signaling, other irqs blocked */ 1247 /* 20 msec of resume/K signaling, other irqs blocked */
@@ -1290,9 +1290,9 @@ sl811h_hub_control(
1290 goto error; 1290 goto error;
1291 switch (wValue) { 1291 switch (wValue) {
1292 case USB_PORT_FEAT_SUSPEND: 1292 case USB_PORT_FEAT_SUSPEND:
1293 if (sl811->port1 & (1 << USB_PORT_FEAT_RESET)) 1293 if (sl811->port1 & USB_PORT_STAT_RESET)
1294 goto error; 1294 goto error;
1295 if (!(sl811->port1 & (1 << USB_PORT_FEAT_ENABLE))) 1295 if (!(sl811->port1 & USB_PORT_STAT_ENABLE))
1296 goto error; 1296 goto error;
1297 1297
1298 DBG("suspend...\n"); 1298 DBG("suspend...\n");
@@ -1303,9 +1303,9 @@ sl811h_hub_control(
1303 port_power(sl811, 1); 1303 port_power(sl811, 1);
1304 break; 1304 break;
1305 case USB_PORT_FEAT_RESET: 1305 case USB_PORT_FEAT_RESET:
1306 if (sl811->port1 & (1 << USB_PORT_FEAT_SUSPEND)) 1306 if (sl811->port1 & USB_PORT_STAT_SUSPEND)
1307 goto error; 1307 goto error;
1308 if (!(sl811->port1 & (1 << USB_PORT_FEAT_POWER))) 1308 if (!(sl811->port1 & USB_PORT_STAT_POWER))
1309 break; 1309 break;
1310 1310
1311 /* 50 msec of reset/SE0 signaling, irqs blocked */ 1311 /* 50 msec of reset/SE0 signaling, irqs blocked */
@@ -1314,7 +1314,7 @@ sl811h_hub_control(
1314 sl811->irq_enable); 1314 sl811->irq_enable);
1315 sl811->ctrl1 = SL11H_CTL1MASK_SE0; 1315 sl811->ctrl1 = SL11H_CTL1MASK_SE0;
1316 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); 1316 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1);
1317 sl811->port1 |= (1 << USB_PORT_FEAT_RESET); 1317 sl811->port1 |= USB_PORT_STAT_RESET;
1318 mod_timer(&sl811->timer, jiffies 1318 mod_timer(&sl811->timer, jiffies
1319 + msecs_to_jiffies(50)); 1319 + msecs_to_jiffies(50));
1320 break; 1320 break;
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index dd69df1e455..325b47a267b 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -205,27 +205,27 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
205 205
206 /* wPortChange bits */ 206 /* wPortChange bits */
207 if (temp & PORT_CSC) 207 if (temp & PORT_CSC)
208 status |= 1 << USB_PORT_FEAT_C_CONNECTION; 208 status |= USB_PORT_STAT_C_CONNECTION << 16;
209 if (temp & PORT_PEC) 209 if (temp & PORT_PEC)
210 status |= 1 << USB_PORT_FEAT_C_ENABLE; 210 status |= USB_PORT_STAT_C_ENABLE << 16;
211 if ((temp & PORT_OCC)) 211 if ((temp & PORT_OCC))
212 status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT; 212 status |= USB_PORT_STAT_C_OVERCURRENT << 16;
213 /* 213 /*
214 * FIXME ignoring suspend, reset, and USB 2.1/3.0 specific 214 * FIXME ignoring suspend, reset, and USB 2.1/3.0 specific
215 * changes 215 * changes
216 */ 216 */
217 if (temp & PORT_CONNECT) { 217 if (temp & PORT_CONNECT) {
218 status |= 1 << USB_PORT_FEAT_CONNECTION; 218 status |= USB_PORT_STAT_CONNECTION;
219 status |= xhci_port_speed(temp); 219 status |= xhci_port_speed(temp);
220 } 220 }
221 if (temp & PORT_PE) 221 if (temp & PORT_PE)
222 status |= 1 << USB_PORT_FEAT_ENABLE; 222 status |= USB_PORT_STAT_ENABLE;
223 if (temp & PORT_OC) 223 if (temp & PORT_OC)
224 status |= 1 << USB_PORT_FEAT_OVER_CURRENT; 224 status |= USB_PORT_STAT_OVERCURRENT;
225 if (temp & PORT_RESET) 225 if (temp & PORT_RESET)
226 status |= 1 << USB_PORT_FEAT_RESET; 226 status |= USB_PORT_STAT_RESET;
227 if (temp & PORT_POWER) 227 if (temp & PORT_POWER)
228 status |= 1 << USB_PORT_FEAT_POWER; 228 status |= USB_PORT_STAT_POWER;
229 xhci_dbg(xhci, "Get port status returned 0x%x\n", status); 229 xhci_dbg(xhci, "Get port status returned 0x%x\n", status);
230 put_unaligned(cpu_to_le32(status), (__le32 *) buf); 230 put_unaligned(cpu_to_le32(status), (__le32 *) buf);
231 break; 231 break;
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 705cc4ad873..ced6d9ea9af 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -353,8 +353,7 @@ void musb_hnp_stop(struct musb *musb)
353 * which cause occasional OPT A "Did not receive reset after connect" 353 * which cause occasional OPT A "Did not receive reset after connect"
354 * errors. 354 * errors.
355 */ 355 */
356 musb->port1_status &= 356 musb->port1_status &= ~(USB_PORT_STAT_C_CONNECTION << 16);
357 ~(1 << USB_PORT_FEAT_C_CONNECTION);
358} 357}
359 358
360#endif 359#endif
@@ -530,8 +529,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
530 musb_writeb(mbase, MUSB_DEVCTL, devctl); 529 musb_writeb(mbase, MUSB_DEVCTL, devctl);
531 } else { 530 } else {
532 musb->port1_status |= 531 musb->port1_status |=
533 (1 << USB_PORT_FEAT_OVER_CURRENT) 532 USB_PORT_STAT_OVERCURRENT
534 | (1 << USB_PORT_FEAT_C_OVER_CURRENT); 533 | (USB_PORT_STAT_C_OVERCURRENT << 16);
535 } 534 }
536 break; 535 break;
537 default: 536 default:
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
index 7775e1c0a21..92e85e027cf 100644
--- a/drivers/usb/musb/musb_virthub.c
+++ b/drivers/usb/musb/musb_virthub.c
@@ -183,8 +183,8 @@ static void musb_port_reset(struct musb *musb, bool do_reset)
183 183
184void musb_root_disconnect(struct musb *musb) 184void musb_root_disconnect(struct musb *musb)
185{ 185{
186 musb->port1_status = (1 << USB_PORT_FEAT_POWER) 186 musb->port1_status = USB_PORT_STAT_POWER
187 | (1 << USB_PORT_FEAT_C_CONNECTION); 187 | (USB_PORT_STAT_C_CONNECTION << 16);
188 188
189 usb_hcd_poll_rh_status(musb_to_hcd(musb)); 189 usb_hcd_poll_rh_status(musb_to_hcd(musb));
190 musb->is_active = 0; 190 musb->is_active = 0;