From patchwork Fri Dec 16 10:46:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 88282 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1329480qgi; Fri, 16 Dec 2016 02:47:10 -0800 (PST) X-Received: by 10.98.80.140 with SMTP id g12mr2402250pfj.54.1481885228481; Fri, 16 Dec 2016 02:47:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si7225079pgc.92.2016.12.16.02.47.08; Fri, 16 Dec 2016 02:47:08 -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 S1760430AbcLPKq7 (ORCPT + 4 others); Fri, 16 Dec 2016 05:46:59 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:33347 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760349AbcLPKqz (ORCPT ); Fri, 16 Dec 2016 05:46:55 -0500 Received: by mail-wm0-f42.google.com with SMTP id c184so13253632wmd.0 for ; Fri, 16 Dec 2016 02:46:37 -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=u30Q30QGWAxtnonYfD9QZmscvv/XXa0iWnMi3kUz4K4=; b=FkVaykrv5xyoI4y7VyDqcymC/NLtkZVm1GPZoPTpPOwcUkY7iLoGTD+8HvyWgpraxZ SxG+s0qbs8G6rwS5bJb1kbogEeZeQozdLpFxeQIUG6l6QGO9OqRce2Ds92RjcVtEKkqR 811QbqTJMi/vO3ZQldD2wKuA0CZeCO3NVDFkakYmxAcoIy9rADDF4m27zoUJ/bE3w2ls X6dLJNyCWhL72yL13EBVvKAURVlebfBw3bQQIScIu80NLXJyWSONWj7dG7LC35tWeF4j f5McgfDK/CqXBPNzv+m2tlZymXkdHjsdeY9J+V7TST60E7gemEenDu/hdpTwDAIzMZ09 B2xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=u30Q30QGWAxtnonYfD9QZmscvv/XXa0iWnMi3kUz4K4=; b=sYVEwPqBgUwHLGNOM2zaOt6BfnsZsZE7AwKWUTRf8sa8kdpfGBWOl02BXPsKD7TxZA R0YczxuQO0FDv47sHAejGa6gSXHd0M+/MHTW6rf0DobLmo+LHcPx08oR8S4CewUUKf35 1DV3fJVlxppDRBZx4rzLHK8U9bo5wPZ/bqFiWJawvNaM6hspFfKgYVyGuWKx0CMQau6b bp0KUMeMD3RWq2Vpn/XYfRe/TmSPHt00tHX42wR4pctMhJK/szz4/xLpMcxB5XXRIKR8 L9oUUem1cuLZpljihBERS6BFu3r5evRvOGyUIAntwcxY+srgA7RFDpnbEVyQhRkZZa5r YDcw== X-Gm-Message-State: AIkVDXL+TSWT6ie+TVfx7+XXdk+1Y7b/QgWR0mbPGYPDWsfuldKgHdCASOYQYGbWWgFKAZ8F X-Received: by 10.28.35.14 with SMTP id j14mr2524747wmj.24.1481885196953; Fri, 16 Dec 2016 02:46:36 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id z6sm6215001wjt.24.2016.12.16.02.46.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Dec 2016 02:46:36 -0800 (PST) From: Alexandre Bailon To: b-liu@ti.com Cc: linux-usb@vger.kernel.org, nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, Alexandre Bailon Subject: [PATCH v2 2/3] usb: musb: Add a quirk to preserve the session during suspend Date: Fri, 16 Dec 2016 11:46:15 +0100 Message-Id: <1481885176-16984-3-git-send-email-abailon@baylibre.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1481885176-16984-1-git-send-email-abailon@baylibre.com> References: <1481885176-16984-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 On da8xx, VBUS is not maintained during suspend when musb is in host mode. On resume, all the connected devices will be disconnected and then will be enumerated again. This happens because MUSB_DEVCTL is cleared during suspend. Add a quirk to not clear MUSB_DEVCTL and then preserve the session during a suspend. Signed-off-by: Alexandre Bailon --- drivers/usb/musb/musb_core.c | 3 ++- drivers/usb/musb/musb_core.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 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/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 56a4b97..c32024e 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2657,7 +2657,8 @@ static int musb_suspend(struct device *dev) musb_platform_disable(musb); musb_disable_interrupts(musb); - musb_writeb(musb->mregs, MUSB_DEVCTL, 0); + if (!(musb->io.quirks & MUSB_PRESERVE_SESSION)) + musb_writeb(musb->mregs, MUSB_DEVCTL, 0); WARN_ON(!list_empty(&musb->pending_list)); spin_lock_irqsave(&musb->lock, flags); diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index a611e2f..d9de3ca 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -172,6 +172,7 @@ struct musb_io; */ struct musb_platform_ops { +#define MUSB_PRESERVE_SESSION BIT(7) #define MUSB_DMA_UX500 BIT(6) #define MUSB_DMA_CPPI41 BIT(5) #define MUSB_DMA_CPPI BIT(4)