From patchwork Mon Nov 7 13:05:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 81089 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1008161qge; Mon, 7 Nov 2016 05:19:51 -0800 (PST) X-Received: by 10.99.102.69 with SMTP id a66mr10801413pgc.71.1478524791220; Mon, 07 Nov 2016 05:19:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l65si31347005pge.112.2016.11.07.05.19.50; Mon, 07 Nov 2016 05:19:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753350AbcKGNRP (ORCPT + 4 others); Mon, 7 Nov 2016 08:17:15 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37006 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932319AbcKGNFi (ORCPT ); Mon, 7 Nov 2016 08:05:38 -0500 Received: by mail-wm0-f53.google.com with SMTP id t79so175956833wmt.0 for ; Mon, 07 Nov 2016 05:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=D4ztYMCGeVI61l6AxFRDemWQd/XRzB/VXJYPGGZ36g4=; b=CHXRcscxy8iCK5yeQxY3sQbYNcG7473dp1WPglbS/PbIkWQJKcH0MJY0ZD53KP0Cqj Q1dpfbefyYYAHkhvPOqnsSq8uUFIS39FgLksNKYuV3m2v4+gJ/fDLBhzBBTF7njgQQ/M jxMQPm6f56gDVKTQvNWH270ECQPOZzPLXj+EnPGg40BOC5+pRQ8UKdpOSP0adEafsZaL lUdCeepRpxDVeHzpptKWtN3K/aVfW5453Lv/xP0Jbdd06rf4XI84NfddBsPz3vYUx/WB V6WWjcr1NIjslxsRvYorVMaBDS7OnDDW+b4rXWWj3clEs6V4udgPYN/t1wdWFpus5Ekn 7RmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D4ztYMCGeVI61l6AxFRDemWQd/XRzB/VXJYPGGZ36g4=; b=WZFr4Ax3qdSC77+3x9BolU08qESiSM+6m6Mc8oMeRCKPcTJl6IXyYJm3Y6H5OH066f I8UWlZTy2GeCd/H5aQ4dfu2fBZj59SXxnmQsLqGpV7Gk+XRWDUSBSrYwBvCbSvIvCjA5 SRJf30ktfwSVbI2OCTEQLCtrzVrZqpSzMttj09IuQTwZZcgszW9c9e8ZCT9RWTyQckxg Vdu2SQzvtIfly443+tvG0su720C3LzUb/T+dTZZmY6HHndl4yu0bfW1cHA8LLxpsgsVQ TeSpo0Jmm4FchZcQLx9SgCWHDpAovz9PawbZOMHEe8WTaOg+HWc5rdRgyS3KcAJa5cqs cwUQ== X-Gm-Message-State: ABUngvfE5ZoiYUWN7lC0YzFyrew5Pkw6f1HHFaQwp2CueSEx4Q6P28A22fxVMH7nguSRTiSR X-Received: by 10.28.113.76 with SMTP id m73mr437760wmc.114.1478523932563; Mon, 07 Nov 2016 05:05:32 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id y2sm30933952wjx.20.2016.11.07.05.05.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Nov 2016 05:05:32 -0800 (PST) From: Alexandre Bailon To: david@lechnology.com, b-liu@ti.com, balbi@kernel.org Cc: kishon@ti.com, khilman@baylibre.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, nsekhar@ti.com, Alexandre Bailon Subject: [PATCH v5 2/4] phy: da8xx-usb: Configure CFGCHIP2 to support OTG workaround Date: Mon, 7 Nov 2016 14:05:06 +0100 Message-Id: <1478523908-4383-3-git-send-email-abailon@baylibre.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1478523908-4383-1-git-send-email-abailon@baylibre.com> References: <1478523908-4383-1-git-send-email-abailon@baylibre.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- drivers/phy/phy-da8xx-usb.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/phy/phy-da8xx-usb.c b/drivers/phy/phy-da8xx-usb.c index 32ae78c..089c13b 100644 --- a/drivers/phy/phy-da8xx-usb.c +++ b/drivers/phy/phy-da8xx-usb.c @@ -23,6 +23,8 @@ #include #include +#define PHY_INIT_BITS (CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN) + struct da8xx_usb_phy { struct phy_provider *phy_provider; struct phy *usb11_phy; @@ -207,6 +209,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; }