linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 3/7] phy-sun4i-usb: Swap check for disconnect threshold
Date: Sat, 13 Jun 2015 14:37:47 +0200	[thread overview]
Message-ID: <1434199071-22127-4-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1434199071-22127-1-git-send-email-hdegoede@redhat.com>

Before this commit the code for determining the disconnect threshold was
checking for "allwinner,sun4i-a10-usb-phy" or "allwinner,sun6i-a31-usb-phy"
assuming that those where the exception and then newer SoCs would use a
disconnect threshold of 2 like sun7i does. But it turns out that newer
SoCs use a disconnect threshold of 3 and sun5i and sun7i are the
exceptions, so check for those instead.

Here are the settings from the various Allwinner SDK sources:
 sun4i-a10: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun5i-a13: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
 sun6i-a31: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun7i-a20: USBC_Phy_Write(usbc_no, 0x2a, 2, 2);
 sun8i-a23: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun8i-h3:  USBC_Phy_Write(usbc_no, 0x2a, 3, 2);
 sun9i-a80: USBC_Phy_Write(usbc_no, 0x2a, 3, 2);

Note this commit makes no functional changes as currently we only support
sun4i - sun7i.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/phy/phy-sun4i-usb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index 86d9ce1..d78a071 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -447,11 +447,11 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
 	else
 		data->num_phys = 3;
 
-	if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy") ||
-	    of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy"))
-		data->disc_thresh = 3;
-	else
+	if (of_device_is_compatible(np, "allwinner,sun5i-a13-usb-phy") ||
+	    of_device_is_compatible(np, "allwinner,sun7i-a20-usb-phy"))
 		data->disc_thresh = 2;
+	else
+		data->disc_thresh = 3;
 
 	if (of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy"))
 		dedicated_clocks = true;
-- 
2.4.3

  parent reply	other threads:[~2015-06-13 12:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13 12:37 [PATCH v5 0/7] phy-sun4i-usb: Add OTG and newer SoC support Hans de Goede
2015-06-13 12:37 ` [PATCH v5 1/7] phy-sun4i-usb: Add id and vbus detection support for the otg phy (phy0) Hans de Goede
2015-06-13 12:37 ` [PATCH v5 2/7] phy-sun4i-usb: Add extcon " Hans de Goede
2015-06-15  0:39   ` Chanwoo Choi
2015-07-31 14:23   ` [linux-sunxi] " Jonathan Liu
2015-07-31 14:24     ` Hans de Goede
2015-06-13 12:37 ` Hans de Goede [this message]
2015-06-13 12:37 ` [PATCH v5 4/7] phy-sun4i-usb: Add support for the usb-phys on the sun8i-a23 SoC Hans de Goede
2015-06-13 12:37 ` [PATCH v5 5/7] phy-sun4i-usb: Add support for the usb-phys on the sun8i-a33 SoC Hans de Goede
2015-06-13 12:37 ` [PATCH v5 6/7] phy-sun4i-usb: Add support for boards with broken Vusb-detection Hans de Goede
2015-06-13 12:37 ` [PATCH v5 7/7] phy-sun4i-usb: Add support for monitoring vbus via a power-supply Hans de Goede
2015-06-15  5:27 ` [PATCH v5 0/7] phy-sun4i-usb: Add OTG and newer SoC support Kishon Vijay Abraham I
2015-07-15 11:07 ` Kishon Vijay Abraham I

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=1434199071-22127-4-git-send-email-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).