From df72690bd9b55499fed33dcabf2e9bb4df31db0e Mon Sep 17 00:00:00 2001 From: Pratham Pratap Date: Tue, 1 Sep 2020 15:42:19 +0530 Subject: [PATCH] usb: phy: qusb2: Update tune params based on efuse value For 8nm zero value is treated as a valid efuse value and driver should honor this efuse value to update the tune params. This change makes the updation of tune value possible even if the efuse value is zero. Change-Id: I6eac2e2414bf61b89aa41bebbfe56ad10017969e Signed-off-by: Pratham Pratap --- drivers/usb/phy/phy-msm-qusb-v2.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/phy/phy-msm-qusb-v2.c b/drivers/usb/phy/phy-msm-qusb-v2.c index ed8a11c1f690..473576bc1ed0 100644 --- a/drivers/usb/phy/phy-msm-qusb-v2.c +++ b/drivers/usb/phy/phy-msm-qusb-v2.c @@ -431,8 +431,8 @@ static void qusb_phy_get_tune1_param(struct qusb_phy *qphy) bit_mask = (bit_mask << qphy->efuse_num_of_bits) - 1; /* - * if efuse reg is updated (i.e non-zero) then use it to program - * tune parameters + * For 8nm zero is treated as a valid efuse value and driver + * should program the tune1 reg based on efuse value */ qphy->tune_val = readl_relaxed(qphy->efuse_reg); pr_debug("%s(): bit_mask:%d efuse based tune1 value:%d\n", @@ -441,10 +441,8 @@ static void qusb_phy_get_tune1_param(struct qusb_phy *qphy) qphy->tune_val = TUNE_VAL_MASK(qphy->tune_val, qphy->efuse_bit_pos, bit_mask); reg = readb_relaxed(qphy->base + qphy->phy_reg[PORT_TUNE1]); - if (qphy->tune_val) { - reg = reg & 0x0f; - reg |= (qphy->tune_val << 4); - } + reg = reg & 0x0f; + reg |= (qphy->tune_val << 4); qphy->tune_val = reg; }