Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1091716pxu; Thu, 17 Dec 2020 01:48:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNLy8nRr39D/qOOzl+k1h8Z7F2MQ2FeXL1DL/3u9Tx4i7nPcdMzChaawK/4p8BuHETeX+n X-Received: by 2002:a50:f1c7:: with SMTP id y7mr22148585edl.184.1608198527879; Thu, 17 Dec 2020 01:48:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608198527; cv=none; d=google.com; s=arc-20160816; b=od8bnIZL9cEK0Cx0/dK6n3wwMuXDj+XJjeDe2SHfCCdSAkiHWw3/XKeY8TUaal8+dh wkcGasBskh6TB8JpfL57pPvg/KmLbObKRr7wwUsMVPHPKlKd6K/rnMNczZMGKxOCv8fL vdXSJfEFOatbow0t0CUGuXaGGQfbyeG3KHpYl2X9Gf/cDp7AAl2EBl7xkvf7sGnr66wL xXI6JvA0yQHxxJGwtyw04KI8+toeFexxkKaMKNzUu0pnCO+YdHp2VMarYKEwqaukZpHL sFiGXqo9ccQThjMVdZxrpmtkcaxFTLKD5C55X83Ts5IJIyCwF/5J2qdp8s3he7jpqxxu tzPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SQW682SNhDsjl2P24nfgF7SWJzhlw6l3S/bWSyN4tX0=; b=jj+QXabqTsYNRTDl4StZ1rKmTMQr991/tPnptonPq4dN911BjgvhR9EPkV2NjAqO7K 4VsyHwn5jJKj0g31Bw1TVYOPYuakwUihnmvf+mYLMZjo6idpo/Fa7nbepAFzyjlzpMvy rEVxdiqhF4gMxmPDeczbsqf3KHy4EaX4n+3076m8P3wzT22fgjm8NH/N93qONcMPB7n+ M/KcpiTvxNg1Rq2k5qW8HMjlMnvu5SqadzsifoECtYO0QQcFQ01AbhPoPDpoz7SaAlc1 E+3jAps4IwlJIcjZTBlebUNV2vgaKzawE/LwRCmnC5Qhm/g8txYZ1E791JMyQYTmsnRx urgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zz0Ic5MU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si4206389edf.23.2020.12.17.01.48.25; Thu, 17 Dec 2020 01:48:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zz0Ic5MU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728070AbgLQJq2 (ORCPT + 99 others); Thu, 17 Dec 2020 04:46:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbgLQJqK (ORCPT ); Thu, 17 Dec 2020 04:46:10 -0500 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEB36C061257; Thu, 17 Dec 2020 01:44:53 -0800 (PST) Received: by mail-lf1-x133.google.com with SMTP id o19so30119897lfo.1; Thu, 17 Dec 2020 01:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SQW682SNhDsjl2P24nfgF7SWJzhlw6l3S/bWSyN4tX0=; b=Zz0Ic5MU75un02Irbv+4P5nyuVMS34Rn01jo5JTUhlMxrt5PUfeahRj/L9atQKClEC nUkZzol6MdScqj9YqT7I4uRCaq3gI7HsRHEkE/95QHo3Xxj6nL+qsOtytQyt657i0vi0 S3Y5JATqZpo8qpMdjaD+ksvo0ng4rXhYwBb5uroEF8F+CR503w7xmPbky2awhPqMMAwA srqSpvATnqytTq8I+f4gLPhiFRA69q5P/qZNmKb5imA1xa5B2guX4m8RGi8abLlo7ZR8 chDMRzePY074v0HzC6NEvJXslKuEZva7TTUBspBFe6CCCJOYJykdMDALkUmNCx1w6lrE luzQ== 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:mime-version:content-transfer-encoding; bh=SQW682SNhDsjl2P24nfgF7SWJzhlw6l3S/bWSyN4tX0=; b=WwosMHLe/4NsLdiiTVI/1aImDQFMdv2vXT/Jx8NvE3bGnnbjM6Xyc6zC4aOnjMnPI1 YzAT25cZ2mnTgrkQI7JIu40hQXFMlgtOqghDbfx7T2PmnfhwT+RMclP097MWYAXdvSK6 6B5PiJSUFmhPdcTGQ50A93qs2tXuQInk2x2xK3YJH5RTR5jVnv0jT8ufNMMx0FGV3Xum rSIwGPVhJZeeorMmAdw2JqS5U5Sr2jCJMnal25lrwYm9TSn6cKOcibqjfJC2g+dgXhKU Ap2Te3aXuw6QqDSfX46vv9C4r5WslQ/QG9EzHzJUcUqQSy03FJHubn2GnDeX1QFsz2wO 90DQ== X-Gm-Message-State: AOAM531yhTOFKErUAyHFGgC4LnZJfB8URwumPUEGJoTuG8DbiDGrhlji xj3Dx3sqBwMHqll5iu+fNYg= X-Received: by 2002:a19:4cc:: with SMTP id 195mr14418347lfe.498.1608198292419; Thu, 17 Dec 2020 01:44:52 -0800 (PST) Received: from localhost.localdomain (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.gmail.com with ESMTPSA id u19sm613917lji.2.2020.12.17.01.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 01:44:51 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Peter Chen , Greg Kroah-Hartman , Alan Stern , Felipe Balbi , Matt Merhar , Nicolas Chauvet , Peter Geis , Ion Agorria Cc: linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/8] usb: chipidea: tegra: Support runtime PM Date: Thu, 17 Dec 2020 12:40:05 +0300 Message-Id: <20201217094007.19336-7-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201217094007.19336-1-digetx@gmail.com> References: <20201217094007.19336-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tegra PHY driver now supports waking up controller from a low power mode. Enable runtime PM in order to put controller into the LPM during idle. Tested-by: Matt Merhar Tested-by: Nicolas Chauvet Tested-by: Peter Geis Tested-by: Ion Agorria Signed-off-by: Dmitry Osipenko --- drivers/usb/chipidea/ci_hdrc_tegra.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c index 5fccdeeefc64..655671159511 100644 --- a/drivers/usb/chipidea/ci_hdrc_tegra.c +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c @@ -38,21 +38,24 @@ struct tegra_usb_soc_info { static const struct tegra_usb_soc_info tegra20_ehci_soc_info = { .flags = CI_HDRC_REQUIRES_ALIGNED_DMA | - CI_HDRC_OVERRIDE_PHY_CONTROL, + CI_HDRC_OVERRIDE_PHY_CONTROL | + CI_HDRC_SUPPORTS_RUNTIME_PM, .dr_mode = USB_DR_MODE_HOST, .txfifothresh = 10, }; static const struct tegra_usb_soc_info tegra30_ehci_soc_info = { .flags = CI_HDRC_REQUIRES_ALIGNED_DMA | - CI_HDRC_OVERRIDE_PHY_CONTROL, + CI_HDRC_OVERRIDE_PHY_CONTROL | + CI_HDRC_SUPPORTS_RUNTIME_PM, .dr_mode = USB_DR_MODE_HOST, .txfifothresh = 16, }; static const struct tegra_usb_soc_info tegra_udc_soc_info = { .flags = CI_HDRC_REQUIRES_ALIGNED_DMA | - CI_HDRC_OVERRIDE_PHY_CONTROL, + CI_HDRC_OVERRIDE_PHY_CONTROL | + CI_HDRC_SUPPORTS_RUNTIME_PM, .dr_mode = USB_DR_MODE_UNKNOWN, }; @@ -323,6 +326,10 @@ static int tegra_usb_probe(struct platform_device *pdev) usb->data.hub_control = tegra_ehci_hub_control; usb->data.notify_event = tegra_usb_notify_event; + /* Tegra PHY driver currently doesn't support LPM for ULPI */ + if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_ULPI) + usb->data.flags &= ~CI_HDRC_SUPPORTS_RUNTIME_PM; + usb->dev = ci_hdrc_add_device(&pdev->dev, pdev->resource, pdev->num_resources, &usb->data); if (IS_ERR(usb->dev)) { -- 2.29.2