From: Sascha Hauer <s.hauer@pengutronix.de>
To: linux-usb@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
Peter Chen <peter.chen@kernel.org>,
Peng Fan <peng.fan@oss.nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
devicetree@vger.kernel.org, Sascha Hauer <s.hauer@pengutronix.de>
Subject: [PATCH 4/6] usb: chipidea: usbmisc_imx: Add prefix to register defines
Date: Tue, 11 Oct 2022 10:29:22 +0200 [thread overview]
Message-ID: <20221011082924.884123-5-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20221011082924.884123-1-s.hauer@pengutronix.de>
The driver is used for a broad range of i.MX SoCs and most of the
register defines have a SoC/regname specific prefix to make clear
in which context they should be used. Add such a prefix to the
MX7D_USB_OTG_PHY_CFG1 defines as well.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/usb/chipidea/usbmisc_imx.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 95f2ba01c0df1..63de7d6fea427 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -126,8 +126,8 @@
#define MX7D_USB_OTG_PHY_STATUS_CHRGDET BIT(29)
#define MX7D_USB_OTG_PHY_CFG1 0x30
-#define TXPREEMPAMPTUNE0 GENMASK(29, 28)
-#define TXVREFTUNE0 GENMASK(23, 20)
+#define MX7D_USB_OTG_PHY_CFG1_TXPREEMPAMPTUNE0 GENMASK(29, 28)
+#define MX7D_USB_OTG_PHY_CFG1_TXVREFTUNE0 GENMASK(23, 20)
#define MX6_USB_OTG_WAKEUP_BITS (MX6_BM_WAKEUP_ENABLE | MX6_BM_VBUS_WAKEUP | \
MX6_BM_ID_WAKEUP)
@@ -659,15 +659,19 @@ static int usbmisc_imx7d_init(struct imx_usbmisc_data *data)
/* PHY tuning for signal quality */
reg = readl(usbmisc->base + MX7D_USB_OTG_PHY_CFG1);
if (data->emp_curr_control &&
- FIELD_FIT(TXPREEMPAMPTUNE0, data->emp_curr_control)) {
- reg &= ~TXPREEMPAMPTUNE0;
- reg |= FIELD_PREP(TXPREEMPAMPTUNE0, data->emp_curr_control);
+ FIELD_FIT(MX7D_USB_OTG_PHY_CFG1_TXPREEMPAMPTUNE0,
+ data->emp_curr_control)) {
+ reg &= ~MX7D_USB_OTG_PHY_CFG1_TXPREEMPAMPTUNE0;
+ reg |= FIELD_PREP(MX7D_USB_OTG_PHY_CFG1_TXPREEMPAMPTUNE0,
+ data->emp_curr_control);
}
if (data->dc_vol_level_adjust &&
- FIELD_FIT(TXVREFTUNE0, data->dc_vol_level_adjust)) {
- reg &= ~TXVREFTUNE0;
- reg |= FIELD_PREP(TXVREFTUNE0, data->dc_vol_level_adjust);
+ FIELD_FIT(MX7D_USB_OTG_PHY_CFG1_TXVREFTUNE0,
+ data->dc_vol_level_adjust)) {
+ reg &= ~MX7D_USB_OTG_PHY_CFG1_TXVREFTUNE0;
+ reg |= FIELD_PREP(MX7D_USB_OTG_PHY_CFG1_TXVREFTUNE0,
+ data->dc_vol_level_adjust);
}
writel(reg, usbmisc->base + MX7D_USB_OTG_PHY_CFG1);
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-10-11 8:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-11 8:29 [PATCH 0/6] usb: chipidea: Export more phy tuning parameters to device tree Sascha Hauer
2022-10-11 8:29 ` [PATCH 1/6] usb: chipidea: usbmisc_imx: Fix i.MX53 clock sel masks Sascha Hauer
2022-10-18 8:45 ` Xu Yang
2022-10-11 8:29 ` [PATCH 2/6] usb: chipidea: usbmisc_imx: Fix setting i.MX6SX wakeup source Sascha Hauer
2022-10-18 8:46 ` Xu Yang
2022-10-11 8:29 ` [PATCH 3/6] usb: chipidea: usbmisc_imx: Use GENMASK/FIELD_PREP for bitfields Sascha Hauer
2022-10-18 8:39 ` xu yang
2022-10-11 8:29 ` Sascha Hauer [this message]
2022-10-18 8:49 ` [PATCH 4/6] usb: chipidea: usbmisc_imx: Add prefix to register defines Xu Yang
2022-10-11 8:29 ` [PATCH 5/6] usb: chipidea: usbmisc_imx: Add device tree properties for i.MX7 phy tuning Sascha Hauer
2022-10-11 8:29 ` [PATCH 6/6] dt-bindings: usb: ci-hdrc-usb2: Add more phy tuning properties Sascha Hauer
2022-10-12 16:08 ` Rob Herring
2022-10-13 10:14 ` Sascha Hauer
2022-10-13 20:03 ` Rob Herring
2022-10-17 0:41 ` [PATCH 0/6] usb: chipidea: Export more phy tuning parameters to device tree Peter Chen
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=20221011082924.884123-5-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=devicetree@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=peng.fan@oss.nxp.com \
--cc=peter.chen@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).