aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-02-13 14:05:23 +0100
committerVinod Koul <vkoul@kernel.org>2022-02-25 14:28:07 +0530
commitdf37c99815d9e0775e67276d70c93cbc25f31c70 (patch)
treee702cef36338ebff60f10be63c8efdeb00a92511 /drivers/phy
parentphy: ti: tusb1210: Drop tusb->vendor_specific2 != 0 check from tusb1210_power_on() (diff)
downloadlinux-dev-df37c99815d9e0775e67276d70c93cbc25f31c70.tar.xz
linux-dev-df37c99815d9e0775e67276d70c93cbc25f31c70.zip
phy: ti: tusb1210: Add a delay between power-on and restoring the phy-parameters
Now that we actually log errors on ulpi_write failures it becomes clear that the ulpi_write() restoring the phy-parameters on power-on is failing after a suspend/resume add a short delay after driving the cs line high to fix this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220213130524.18748-9-hdegoede@redhat.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/ti/phy-tusb1210.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c
index 04baed24469f..9ef4c5f79b75 100644
--- a/drivers/phy/ti/phy-tusb1210.c
+++ b/drivers/phy/ti/phy-tusb1210.c
@@ -8,6 +8,7 @@
*/
#include <linux/module.h>
#include <linux/bitfield.h>
+#include <linux/delay.h>
#include <linux/ulpi/driver.h>
#include <linux/ulpi/regs.h>
#include <linux/gpio/consumer.h>
@@ -18,6 +19,8 @@
#define TUSB1210_VENDOR_SPECIFIC2_ZHSDRV_MASK GENMASK(5, 4)
#define TUSB1210_VENDOR_SPECIFIC2_DP_MASK BIT(6)
+#define TUSB1210_RESET_TIME_MS 30
+
struct tusb1210 {
struct ulpi *ulpi;
struct phy *phy;
@@ -60,6 +63,8 @@ static int tusb1210_power_on(struct phy *phy)
gpiod_set_value_cansleep(tusb->gpio_reset, 1);
gpiod_set_value_cansleep(tusb->gpio_cs, 1);
+ msleep(TUSB1210_RESET_TIME_MS);
+
/* Restore the optional eye diagram optimization value */
return tusb1210_ulpi_write(tusb, TUSB1210_VENDOR_SPECIFIC2,
tusb->vendor_specific2);