From: Frank Wunderlich <linux@fw-web.de>
To: u-boot@lists.denx.de
Subject: [RESEND PATCH v2 09/11] usb: xhci: convert to EP_TYPE()
Date: Wed, 2 Sep 2020 08:13:41 +0200 [thread overview]
Message-ID: <20200902061343.3185-9-linux@fw-web.de> (raw)
In-Reply-To: <20200902061343.3185-1-linux@fw-web.de>
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
Use EP_TYPE(type) macro instead of ((type) << EP_TYPE_SHIFT)
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/host/xhci-mem.c | 2 +-
drivers/usb/host/xhci.c | 3 +--
include/usb/xhci.h | 1 -
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index d627aa5555..6292542210 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -825,7 +825,7 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,
/* Step 4 - ring already allocated */
/* Step 5 */
- ep0_ctx->ep_info2 = cpu_to_le32(CTRL_EP << EP_TYPE_SHIFT);
+ ep0_ctx->ep_info2 = cpu_to_le32(EP_TYPE(CTRL_EP));
debug("SPEED = %d\n", speed);
switch (speed) {
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 5f3a0fba4b..6244f25c33 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -618,8 +618,7 @@ static int xhci_set_configuration(struct usb_device *udev)
cpu_to_le32(EP_MAX_ESIT_PAYLOAD_HI(max_esit_payload) |
EP_INTERVAL(interval) | EP_MULT(mult));
- ep_ctx[ep_index]->ep_info2 =
- cpu_to_le32(ep_type << EP_TYPE_SHIFT);
+ ep_ctx[ep_index]->ep_info2 = cpu_to_le32(EP_TYPE(ep_type));
ep_ctx[ep_index]->ep_info2 |=
cpu_to_le32(MAX_PACKET
(get_unaligned(&endpt_desc->wMaxPacketSize)));
diff --git a/include/usb/xhci.h b/include/usb/xhci.h
index 07b1aebc69..c534297cc0 100644
--- a/include/usb/xhci.h
+++ b/include/usb/xhci.h
@@ -636,7 +636,6 @@ struct xhci_ep_ctx {
#define ERROR_COUNT_MASK (0x3)
#define CTX_TO_EP_TYPE(p) (((p) >> 3) & 0x7)
#define EP_TYPE(p) ((p) << 3)
-#define EP_TYPE_SHIFT (3)
#define ISOC_OUT_EP 1
#define BULK_OUT_EP 2
#define INT_OUT_EP 3
--
2.25.1
next prev parent reply other threads:[~2020-09-02 6:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 6:13 [RESEND PATCH v2 01/11] usb: xhci: add a member hci_version in xhci_ctrl struct Frank Wunderlich
2020-09-02 6:13 ` [RESEND PATCH v2 02/11] usb: xhci: create one unified function to calculate TRB TD remainder Frank Wunderlich
2020-09-02 6:13 ` [RESEND PATCH v2 03/11] usb: xhci: add quirks flag to support MediaTek xHCI 0.96 Frank Wunderlich
2020-09-02 6:13 ` [RESEND PATCH v2 04/11] usb: xhci: convert to HCS_MAX_PORTS() Frank Wunderlich
2020-09-04 6:54 ` Bin Meng
2020-09-02 6:13 ` [RESEND PATCH v2 05/11] usb: xhci: convert to TRB_TYPE() Frank Wunderlich
2020-09-04 9:23 ` Bin Meng
2020-09-02 6:13 ` [RESEND PATCH v2 06/11] usb: xhci: convert to TRB_INTR_TARGET() Frank Wunderlich
2020-09-02 6:13 ` [RESEND PATCH v2 07/11] usb: xhci: convert to TRB_LEN() Frank Wunderlich
2020-09-02 6:13 ` [RESEND PATCH v2 08/11] usb: xhci: convert to TRB_TX_TYPE() Frank Wunderlich
2020-09-02 6:13 ` Frank Wunderlich [this message]
2020-09-02 6:13 ` [RESEND PATCH v2 10/11] usb: xhci: use macros with parameter to fill ep_info2 Frank Wunderlich
2020-09-02 6:13 ` [RESEND PATCH v2 11/11] usb: xhci: convert to readx_poll_sleep_timeout() Frank Wunderlich
2020-09-02 10:38 ` [RESEND PATCH v2 01/11] usb: xhci: add a member hci_version in xhci_ctrl struct Marek Vasut
2020-09-02 13:21 ` Bin Meng
2020-09-04 0:59 ` Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200902061343.3185-9-linux@fw-web.de \
--to=linux@fw-web.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox