[PATCH v2 4/4] usb: chipidea: usbmisc_imx: Add prefix to register defines
Sascha Hauer
s.hauer at pengutronix.de
Tue Oct 18 03:37:25 PDT 2022
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 at pengutronix.de>
Reviewed-by: Xu Yang <xu.yang_2 at nxp.com>
Link: https://lore.kernel.org/r/20221011082924.884123-5-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer at 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 09979264958fc..4e8c7c4952f0b 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
More information about the linux-arm-kernel
mailing list