diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-21 05:33:25 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-21 05:33:25 -0800 |
| commit | 3e0898136d4fd5d353294351f290fb214cb80eeb (patch) | |
| tree | b3fe24fe9c99c7a14ed019f4799fe8fe6c0fb937 /drivers/usb | |
| parent | 9576ebffd1b780d594ede6ba8c34881e927723e4 (diff) | |
| parent | 4fd545a06e53f21842fb5c4a09693ad211153187 (diff) | |
Merge "USB: qusb: Add support to change TUNEX registers dynamically"
Diffstat (limited to 'drivers/usb')
| -rw-r--r-- | drivers/usb/phy/phy-msm-qusb.c | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy-msm-qusb.c b/drivers/usb/phy/phy-msm-qusb.c index 6430e419fc9c..5867c6c204c9 100644 --- a/drivers/usb/phy/phy-msm-qusb.c +++ b/drivers/usb/phy/phy-msm-qusb.c @@ -72,6 +72,7 @@ #define QUSB2PHY_PORT_TUNE2 0x84 #define QUSB2PHY_PORT_TUNE3 0x88 #define QUSB2PHY_PORT_TUNE4 0x8C +#define QUSB2PHY_PORT_TUNE5 0x90 /* In case Efuse register shows zero, use this value */ #define TUNE2_DEFAULT_HIGH_NIBBLE 0xB @@ -102,10 +103,27 @@ #define QUSB2PHY_REFCLK_ENABLE BIT(0) +unsigned int tune1; +module_param(tune1, uint, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(tune1, "QUSB PHY TUNE1"); + unsigned int tune2; module_param(tune2, uint, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(tune2, "QUSB PHY TUNE2"); +unsigned int tune3; +module_param(tune3, uint, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(tune3, "QUSB PHY TUNE3"); + +unsigned int tune4; +module_param(tune4, uint, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(tune4, "QUSB PHY TUNE4"); + +unsigned int tune5; +module_param(tune5, uint, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(tune5, "QUSB PHY TUNE5"); + + struct qusb_phy { struct usb_phy phy; void __iomem *base; @@ -562,13 +580,29 @@ static int qusb_phy_init(struct usb_phy *phy) qphy->base + QUSB2PHY_PORT_TUNE2); } - /* If tune2 modparam set, override tune2 value */ - if (tune2) { - pr_debug("%s(): (modparam) TUNE2 val:0x%02x\n", - __func__, tune2); + /* If tune modparam set, override tune value */ + + pr_debug("%s():userspecified modparams TUNEX val:0x%x %x %x %x %x\n", + __func__, tune1, tune2, tune3, tune4, tune5); + if (tune1) + writel_relaxed(tune1, + qphy->base + QUSB2PHY_PORT_TUNE1); + + if (tune2) writel_relaxed(tune2, qphy->base + QUSB2PHY_PORT_TUNE2); - } + + if (tune3) + writel_relaxed(tune3, + qphy->base + QUSB2PHY_PORT_TUNE3); + + if (tune4) + writel_relaxed(tune4, + qphy->base + QUSB2PHY_PORT_TUNE4); + + if (tune5) + writel_relaxed(tune5, + qphy->base + QUSB2PHY_PORT_TUNE5); /* ensure above writes are completed before re-enabling PHY */ wmb(); |
