All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: <gregkh@linuxfoundation.org>
Cc: <kishon@ti.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 11/20] phy: da8xx-usb: Configure CFGCHIP2 to support OTG workaround
Date: Fri, 18 Nov 2016 18:58:34 +0530	[thread overview]
Message-ID: <1479475723-4857-12-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1479475723-4857-1-git-send-email-kishon@ti.com>

From: Alexandre Bailon <abailon@baylibre.com>

If we configure the da8xx OTG phy in OTG mode, neither device or host
mode will work. That is because the PHY is not able to detect and notify
the driver that value of ID pin changed.
To work despite this hardware limitation, the da8xx glue implement a
workaround.
But to work, the workaround require the VBUS sense and the session end
comparator to enabled.
Enable them if the phy is configured in OTG mode.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/phy/phy-da8xx-usb.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/phy/phy-da8xx-usb.c b/drivers/phy/phy-da8xx-usb.c
index c85fb0b..1b82bff 100644
--- a/drivers/phy/phy-da8xx-usb.c
+++ b/drivers/phy/phy-da8xx-usb.c
@@ -23,6 +23,8 @@
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 
+#define PHY_INIT_BITS	(CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN)
+
 struct da8xx_usb_phy {
 	struct phy_provider	*phy_provider;
 	struct phy		*usb11_phy;
@@ -208,6 +210,9 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
 			dev_warn(dev, "Failed to create usb20 phy lookup\n");
 	}
 
+	regmap_write_bits(d_phy->regmap, CFGCHIP(2),
+			  PHY_INIT_BITS, PHY_INIT_BITS);
+
 	return 0;
 }
 
-- 
1.7.9.5

  parent reply	other threads:[~2016-11-18 13:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 13:28 [GIT PULL] phy: for 4.10 Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 01/20] Documentation: dt-bindings: update the meson-usb2-phy example Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 02/20] Documentation: dt-bindings: rename meson-usb2-phy to meson8b-usb2-phy Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 03/20] phy: meson: add USB2 PHY support for Meson8b and GXBB Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 04/20] phy: meson8b-usb2: fix missing clk_disable_unprepare() on error Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 05/20] phy: meson8b-usb2: request a shared reset line Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 06/20] phy: rockchip-inno-usb2: support otg-port for rk3399 Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 07/20] phy: rockchip-inno-usb2: correct clk_ops callback Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 08/20] phy: rockchip-inno-usb2: correct 480MHz output clock stable time Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 09/20] phy: phy-miphy365x: Remove miphy365 driver and dt binding documentation Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 10/20] phy: stih41x-usb: Remove usb phy " Kishon Vijay Abraham I
2016-11-18 13:28 ` Kishon Vijay Abraham I [this message]
2016-11-18 13:28 ` [PATCH 12/20] phy: rcar-gen3-usb2: add sysfs for usb role swap Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 13/20] phy: exynos-mipi-video: simplify check for coupled phy status Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 14/20] phy: fix semicolon.cocci warnings Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 15/20] phy: Fix ptr_ret.cocci warnings Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 16/20] phy: fix returnvar.cocci warnings Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 17/20] phy_sun4i_usb: set_mode: Allow using set_mode to force end the current session Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 18/20] phy: phy-twl4030-usb: emit VBUS status events to userspace Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 19/20] phy: rockchip-inno-usb2: fix uninitialized tmout variable Kishon Vijay Abraham I
2016-11-18 13:28 ` [PATCH 20/20] phy: rockchip-inno-usb2: select USB_COMMON Kishon Vijay Abraham I
2016-11-28  7:46 ` [GIT PULL] phy: for 4.10 Greg KH

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=1479475723-4857-12-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.