diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2009-02-11 17:11:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:20:33 -0400 |
commit | 551509d267905705f6d723e51ec706916f06b859 (patch) | |
tree | 9dde914015af234cd4c399585037d8dca7d42e78 /drivers/usb/host | |
parent | a78b42824dd7c2b40d72fb01f1b1842f7e845f3a (diff) |
USB: replace uses of __constant_{endian}
The base versions handle constant folding now.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 2 | ||||
-rw-r--r-- | drivers/usb/host/isp1760-hcd.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/oxu210hp-hcd.c | 22 | ||||
-rw-r--r-- | drivers/usb/host/oxu210hp.h | 8 | ||||
-rw-r--r-- | drivers/usb/host/uhci-hcd.h | 10 | ||||
-rw-r--r-- | drivers/usb/host/uhci-q.c | 10 |
7 files changed, 29 insertions, 29 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 1d0b49e3f192..ada5d2ba297b 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -563,7 +563,7 @@ static int qh_unlink_periodic(struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
563 | // and this qh is active in the current uframe | 563 | // and this qh is active in the current uframe |
564 | // (and overlay token SplitXstate is false?) | 564 | // (and overlay token SplitXstate is false?) |
565 | // THEN | 565 | // THEN |
566 | // qh->hw_info1 |= __constant_cpu_to_hc32(1 << 7 /* "ignore" */); | 566 | // qh->hw_info1 |= cpu_to_hc32(1 << 7 /* "ignore" */); |
567 | 567 | ||
568 | /* high bandwidth, or otherwise part of every microframe */ | 568 | /* high bandwidth, or otherwise part of every microframe */ |
569 | if ((period = qh->period) == 0) | 569 | if ((period = qh->period) == 0) |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 9aba560fd569..6cff195e1a36 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -253,7 +253,7 @@ struct ehci_qtd { | |||
253 | 253 | ||
254 | /* | 254 | /* |
255 | * Now the following defines are not converted using the | 255 | * Now the following defines are not converted using the |
256 | * __constant_cpu_to_le32() macro anymore, since we have to support | 256 | * cpu_to_le32() macro anymore, since we have to support |
257 | * "dynamic" switching between be and le support, so that the driver | 257 | * "dynamic" switching between be and le support, so that the driver |
258 | * can be used on one system with SoC EHCI controller using big-endian | 258 | * can be used on one system with SoC EHCI controller using big-endian |
259 | * descriptors as well as a normal little-endian PCI EHCI controller. | 259 | * descriptors as well as a normal little-endian PCI EHCI controller. |
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index 8ee2f4159845..3172c0fd2a6d 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c | |||
@@ -644,7 +644,7 @@ static void transform_add_int(struct isp1760_hcd *priv, struct isp1760_qh *qh, | |||
644 | 644 | ||
645 | if (urb->dev->speed != USB_SPEED_HIGH) { | 645 | if (urb->dev->speed != USB_SPEED_HIGH) { |
646 | /* split */ | 646 | /* split */ |
647 | ptd->dw5 = __constant_cpu_to_le32(0x1c); | 647 | ptd->dw5 = cpu_to_le32(0x1c); |
648 | 648 | ||
649 | if (qh->period >= 32) | 649 | if (qh->period >= 32) |
650 | period = qh->period / 2; | 650 | period = qh->period / 2; |
@@ -1054,7 +1054,7 @@ static void do_atl_int(struct usb_hcd *usb_hcd) | |||
1054 | priv_write_copy(priv, (u32 *)&ptd, usb_hcd->regs + | 1054 | priv_write_copy(priv, (u32 *)&ptd, usb_hcd->regs + |
1055 | atl_regs, sizeof(ptd)); | 1055 | atl_regs, sizeof(ptd)); |
1056 | 1056 | ||
1057 | ptd.dw0 |= __constant_cpu_to_le32(PTD_VALID); | 1057 | ptd.dw0 |= cpu_to_le32(PTD_VALID); |
1058 | priv_write_copy(priv, (u32 *)&ptd, usb_hcd->regs + | 1058 | priv_write_copy(priv, (u32 *)&ptd, usb_hcd->regs + |
1059 | atl_regs, sizeof(ptd)); | 1059 | atl_regs, sizeof(ptd)); |
1060 | 1060 | ||
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 75548f7c716b..2947c69b3476 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
@@ -845,14 +845,14 @@ static inline void qh_update(struct oxu_hcd *oxu, | |||
845 | is_out = !(qtd->hw_token & cpu_to_le32(1 << 8)); | 845 | is_out = !(qtd->hw_token & cpu_to_le32(1 << 8)); |
846 | epnum = (le32_to_cpup(&qh->hw_info1) >> 8) & 0x0f; | 846 | epnum = (le32_to_cpup(&qh->hw_info1) >> 8) & 0x0f; |
847 | if (unlikely(!usb_gettoggle(qh->dev, epnum, is_out))) { | 847 | if (unlikely(!usb_gettoggle(qh->dev, epnum, is_out))) { |
848 | qh->hw_token &= ~__constant_cpu_to_le32(QTD_TOGGLE); | 848 | qh->hw_token &= ~cpu_to_le32(QTD_TOGGLE); |
849 | usb_settoggle(qh->dev, epnum, is_out, 1); | 849 | usb_settoggle(qh->dev, epnum, is_out, 1); |
850 | } | 850 | } |
851 | } | 851 | } |
852 | 852 | ||
853 | /* HC must see latest qtd and qh data before we clear ACTIVE+HALT */ | 853 | /* HC must see latest qtd and qh data before we clear ACTIVE+HALT */ |
854 | wmb(); | 854 | wmb(); |
855 | qh->hw_token &= __constant_cpu_to_le32(QTD_TOGGLE | QTD_STS_PING); | 855 | qh->hw_token &= cpu_to_le32(QTD_TOGGLE | QTD_STS_PING); |
856 | } | 856 | } |
857 | 857 | ||
858 | /* If it weren't for a common silicon quirk (writing the dummy into the qh | 858 | /* If it weren't for a common silicon quirk (writing the dummy into the qh |
@@ -937,7 +937,7 @@ __acquires(oxu->lock) | |||
937 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; | 937 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; |
938 | 938 | ||
939 | /* S-mask in a QH means it's an interrupt urb */ | 939 | /* S-mask in a QH means it's an interrupt urb */ |
940 | if ((qh->hw_info2 & __constant_cpu_to_le32(QH_SMASK)) != 0) { | 940 | if ((qh->hw_info2 & cpu_to_le32(QH_SMASK)) != 0) { |
941 | 941 | ||
942 | /* ... update hc-wide periodic stats (for usbfs) */ | 942 | /* ... update hc-wide periodic stats (for usbfs) */ |
943 | oxu_to_hcd(oxu)->self.bandwidth_int_reqs--; | 943 | oxu_to_hcd(oxu)->self.bandwidth_int_reqs--; |
@@ -981,7 +981,7 @@ static void unlink_async(struct oxu_hcd *oxu, struct ehci_qh *qh); | |||
981 | static void intr_deschedule(struct oxu_hcd *oxu, struct ehci_qh *qh); | 981 | static void intr_deschedule(struct oxu_hcd *oxu, struct ehci_qh *qh); |
982 | static int qh_schedule(struct oxu_hcd *oxu, struct ehci_qh *qh); | 982 | static int qh_schedule(struct oxu_hcd *oxu, struct ehci_qh *qh); |
983 | 983 | ||
984 | #define HALT_BIT __constant_cpu_to_le32(QTD_STS_HALT) | 984 | #define HALT_BIT cpu_to_le32(QTD_STS_HALT) |
985 | 985 | ||
986 | /* Process and free completed qtds for a qh, returning URBs to drivers. | 986 | /* Process and free completed qtds for a qh, returning URBs to drivers. |
987 | * Chases up to qh->hw_current. Returns number of completions called, | 987 | * Chases up to qh->hw_current. Returns number of completions called, |
@@ -1160,7 +1160,7 @@ halt: | |||
1160 | /* should be rare for periodic transfers, | 1160 | /* should be rare for periodic transfers, |
1161 | * except maybe high bandwidth ... | 1161 | * except maybe high bandwidth ... |
1162 | */ | 1162 | */ |
1163 | if ((__constant_cpu_to_le32(QH_SMASK) | 1163 | if ((cpu_to_le32(QH_SMASK) |
1164 | & qh->hw_info2) != 0) { | 1164 | & qh->hw_info2) != 0) { |
1165 | intr_deschedule(oxu, qh); | 1165 | intr_deschedule(oxu, qh); |
1166 | (void) qh_schedule(oxu, qh); | 1166 | (void) qh_schedule(oxu, qh); |
@@ -1350,7 +1350,7 @@ static struct list_head *qh_urb_transaction(struct oxu_hcd *oxu, | |||
1350 | } | 1350 | } |
1351 | 1351 | ||
1352 | /* by default, enable interrupt on urb completion */ | 1352 | /* by default, enable interrupt on urb completion */ |
1353 | qtd->hw_token |= __constant_cpu_to_le32(QTD_IOC); | 1353 | qtd->hw_token |= cpu_to_le32(QTD_IOC); |
1354 | return head; | 1354 | return head; |
1355 | 1355 | ||
1356 | cleanup: | 1356 | cleanup: |
@@ -1539,7 +1539,7 @@ static void qh_link_async(struct oxu_hcd *oxu, struct ehci_qh *qh) | |||
1539 | /* qtd completions reported later by interrupt */ | 1539 | /* qtd completions reported later by interrupt */ |
1540 | } | 1540 | } |
1541 | 1541 | ||
1542 | #define QH_ADDR_MASK __constant_cpu_to_le32(0x7f) | 1542 | #define QH_ADDR_MASK cpu_to_le32(0x7f) |
1543 | 1543 | ||
1544 | /* | 1544 | /* |
1545 | * For control/bulk/interrupt, return QH with these TDs appended. | 1545 | * For control/bulk/interrupt, return QH with these TDs appended. |
@@ -2012,7 +2012,7 @@ static void qh_unlink_periodic(struct oxu_hcd *oxu, struct ehci_qh *qh) | |||
2012 | * and this qh is active in the current uframe | 2012 | * and this qh is active in the current uframe |
2013 | * (and overlay token SplitXstate is false?) | 2013 | * (and overlay token SplitXstate is false?) |
2014 | * THEN | 2014 | * THEN |
2015 | * qh->hw_info1 |= __constant_cpu_to_le32(1 << 7 "ignore"); | 2015 | * qh->hw_info1 |= cpu_to_le32(1 << 7 "ignore"); |
2016 | */ | 2016 | */ |
2017 | 2017 | ||
2018 | /* high bandwidth, or otherwise part of every microframe */ | 2018 | /* high bandwidth, or otherwise part of every microframe */ |
@@ -2057,7 +2057,7 @@ static void intr_deschedule(struct oxu_hcd *oxu, struct ehci_qh *qh) | |||
2057 | * active high speed queues may need bigger delays... | 2057 | * active high speed queues may need bigger delays... |
2058 | */ | 2058 | */ |
2059 | if (list_empty(&qh->qtd_list) | 2059 | if (list_empty(&qh->qtd_list) |
2060 | || (__constant_cpu_to_le32(QH_CMASK) & qh->hw_info2) != 0) | 2060 | || (cpu_to_le32(QH_CMASK) & qh->hw_info2) != 0) |
2061 | wait = 2; | 2061 | wait = 2; |
2062 | else | 2062 | else |
2063 | wait = 55; /* worst case: 3 * 1024 */ | 2063 | wait = 55; /* worst case: 3 * 1024 */ |
@@ -2183,10 +2183,10 @@ static int qh_schedule(struct oxu_hcd *oxu, struct ehci_qh *qh) | |||
2183 | qh->start = frame; | 2183 | qh->start = frame; |
2184 | 2184 | ||
2185 | /* reset S-frame and (maybe) C-frame masks */ | 2185 | /* reset S-frame and (maybe) C-frame masks */ |
2186 | qh->hw_info2 &= __constant_cpu_to_le32(~(QH_CMASK | QH_SMASK)); | 2186 | qh->hw_info2 &= cpu_to_le32(~(QH_CMASK | QH_SMASK)); |
2187 | qh->hw_info2 |= qh->period | 2187 | qh->hw_info2 |= qh->period |
2188 | ? cpu_to_le32(1 << uframe) | 2188 | ? cpu_to_le32(1 << uframe) |
2189 | : __constant_cpu_to_le32(QH_SMASK); | 2189 | : cpu_to_le32(QH_SMASK); |
2190 | qh->hw_info2 |= c_mask; | 2190 | qh->hw_info2 |= c_mask; |
2191 | } else | 2191 | } else |
2192 | oxu_dbg(oxu, "reused qh %p schedule\n", qh); | 2192 | oxu_dbg(oxu, "reused qh %p schedule\n", qh); |
diff --git a/drivers/usb/host/oxu210hp.h b/drivers/usb/host/oxu210hp.h index 8910e271cc7d..1c216ad9aad2 100644 --- a/drivers/usb/host/oxu210hp.h +++ b/drivers/usb/host/oxu210hp.h | |||
@@ -235,21 +235,21 @@ struct ehci_qtd { | |||
235 | } __attribute__ ((aligned(32))); | 235 | } __attribute__ ((aligned(32))); |
236 | 236 | ||
237 | /* mask NakCnt+T in qh->hw_alt_next */ | 237 | /* mask NakCnt+T in qh->hw_alt_next */ |
238 | #define QTD_MASK __constant_cpu_to_le32 (~0x1f) | 238 | #define QTD_MASK cpu_to_le32 (~0x1f) |
239 | 239 | ||
240 | #define IS_SHORT_READ(token) (QTD_LENGTH(token) != 0 && QTD_PID(token) == 1) | 240 | #define IS_SHORT_READ(token) (QTD_LENGTH(token) != 0 && QTD_PID(token) == 1) |
241 | 241 | ||
242 | /* Type tag from {qh, itd, sitd, fstn}->hw_next */ | 242 | /* Type tag from {qh, itd, sitd, fstn}->hw_next */ |
243 | #define Q_NEXT_TYPE(dma) ((dma) & __constant_cpu_to_le32 (3 << 1)) | 243 | #define Q_NEXT_TYPE(dma) ((dma) & cpu_to_le32 (3 << 1)) |
244 | 244 | ||
245 | /* values for that type tag */ | 245 | /* values for that type tag */ |
246 | #define Q_TYPE_QH __constant_cpu_to_le32 (1 << 1) | 246 | #define Q_TYPE_QH cpu_to_le32 (1 << 1) |
247 | 247 | ||
248 | /* next async queue entry, or pointer to interrupt/periodic QH */ | 248 | /* next async queue entry, or pointer to interrupt/periodic QH */ |
249 | #define QH_NEXT(dma) (cpu_to_le32(((u32)dma)&~0x01f)|Q_TYPE_QH) | 249 | #define QH_NEXT(dma) (cpu_to_le32(((u32)dma)&~0x01f)|Q_TYPE_QH) |
250 | 250 | ||
251 | /* for periodic/async schedules and qtd lists, mark end of list */ | 251 | /* for periodic/async schedules and qtd lists, mark end of list */ |
252 | #define EHCI_LIST_END __constant_cpu_to_le32(1) /* "null pointer" to hw */ | 252 | #define EHCI_LIST_END cpu_to_le32(1) /* "null pointer" to hw */ |
253 | 253 | ||
254 | /* | 254 | /* |
255 | * Entries in periodic shadow table are pointers to one of four kinds | 255 | * Entries in periodic shadow table are pointers to one of four kinds |
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h index 7d01c5677f92..26bd1b2bcbfc 100644 --- a/drivers/usb/host/uhci-hcd.h +++ b/drivers/usb/host/uhci-hcd.h | |||
@@ -73,11 +73,11 @@ | |||
73 | #define USBLEGSUP_RWC 0x8f00 /* the R/WC bits */ | 73 | #define USBLEGSUP_RWC 0x8f00 /* the R/WC bits */ |
74 | #define USBLEGSUP_RO 0x5040 /* R/O and reserved bits */ | 74 | #define USBLEGSUP_RO 0x5040 /* R/O and reserved bits */ |
75 | 75 | ||
76 | #define UHCI_PTR_BITS __constant_cpu_to_le32(0x000F) | 76 | #define UHCI_PTR_BITS cpu_to_le32(0x000F) |
77 | #define UHCI_PTR_TERM __constant_cpu_to_le32(0x0001) | 77 | #define UHCI_PTR_TERM cpu_to_le32(0x0001) |
78 | #define UHCI_PTR_QH __constant_cpu_to_le32(0x0002) | 78 | #define UHCI_PTR_QH cpu_to_le32(0x0002) |
79 | #define UHCI_PTR_DEPTH __constant_cpu_to_le32(0x0004) | 79 | #define UHCI_PTR_DEPTH cpu_to_le32(0x0004) |
80 | #define UHCI_PTR_BREADTH __constant_cpu_to_le32(0x0000) | 80 | #define UHCI_PTR_BREADTH cpu_to_le32(0x0000) |
81 | 81 | ||
82 | #define UHCI_NUMFRAMES 1024 /* in the frame list [array] */ | 82 | #define UHCI_NUMFRAMES 1024 /* in the frame list [array] */ |
83 | #define UHCI_MAX_SOF_NUMBER 2047 /* in an SOF packet */ | 83 | #define UHCI_MAX_SOF_NUMBER 2047 /* in an SOF packet */ |
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index 5631d89c8730..58f873679145 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c | |||
@@ -402,7 +402,7 @@ static void uhci_fixup_toggles(struct uhci_qh *qh, int skip_first) | |||
402 | /* Otherwise all the toggles in the URB have to be switched */ | 402 | /* Otherwise all the toggles in the URB have to be switched */ |
403 | } else { | 403 | } else { |
404 | list_for_each_entry(td, &urbp->td_list, list) { | 404 | list_for_each_entry(td, &urbp->td_list, list) { |
405 | td->token ^= __constant_cpu_to_le32( | 405 | td->token ^= cpu_to_le32( |
406 | TD_TOKEN_TOGGLE); | 406 | TD_TOKEN_TOGGLE); |
407 | toggle ^= 1; | 407 | toggle ^= 1; |
408 | } | 408 | } |
@@ -883,7 +883,7 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb, | |||
883 | 883 | ||
884 | uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0); | 884 | uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0); |
885 | wmb(); | 885 | wmb(); |
886 | qh->dummy_td->status |= __constant_cpu_to_le32(TD_CTRL_ACTIVE); | 886 | qh->dummy_td->status |= cpu_to_le32(TD_CTRL_ACTIVE); |
887 | qh->dummy_td = td; | 887 | qh->dummy_td = td; |
888 | 888 | ||
889 | /* Low-speed transfers get a different queue, and won't hog the bus. | 889 | /* Low-speed transfers get a different queue, and won't hog the bus. |
@@ -1003,7 +1003,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb, | |||
1003 | * fast side but not enough to justify delaying an interrupt | 1003 | * fast side but not enough to justify delaying an interrupt |
1004 | * more than 2 or 3 URBs, so we will ignore the URB_NO_INTERRUPT | 1004 | * more than 2 or 3 URBs, so we will ignore the URB_NO_INTERRUPT |
1005 | * flag setting. */ | 1005 | * flag setting. */ |
1006 | td->status |= __constant_cpu_to_le32(TD_CTRL_IOC); | 1006 | td->status |= cpu_to_le32(TD_CTRL_IOC); |
1007 | 1007 | ||
1008 | /* | 1008 | /* |
1009 | * Build the new dummy TD and activate the old one | 1009 | * Build the new dummy TD and activate the old one |
@@ -1015,7 +1015,7 @@ static int uhci_submit_common(struct uhci_hcd *uhci, struct urb *urb, | |||
1015 | 1015 | ||
1016 | uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0); | 1016 | uhci_fill_td(td, 0, USB_PID_OUT | uhci_explen(0), 0); |
1017 | wmb(); | 1017 | wmb(); |
1018 | qh->dummy_td->status |= __constant_cpu_to_le32(TD_CTRL_ACTIVE); | 1018 | qh->dummy_td->status |= cpu_to_le32(TD_CTRL_ACTIVE); |
1019 | qh->dummy_td = td; | 1019 | qh->dummy_td = td; |
1020 | 1020 | ||
1021 | usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), | 1021 | usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), |
@@ -1317,7 +1317,7 @@ static int uhci_submit_isochronous(struct uhci_hcd *uhci, struct urb *urb, | |||
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | /* Set the interrupt-on-completion flag on the last packet. */ | 1319 | /* Set the interrupt-on-completion flag on the last packet. */ |
1320 | td->status |= __constant_cpu_to_le32(TD_CTRL_IOC); | 1320 | td->status |= cpu_to_le32(TD_CTRL_IOC); |
1321 | 1321 | ||
1322 | /* Add the TDs to the frame list */ | 1322 | /* Add the TDs to the frame list */ |
1323 | frame = urb->start_frame; | 1323 | frame = urb->start_frame; |