[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220816082353.13390-3-jilin@nvidia.com>
Date: Tue, 16 Aug 2022 16:23:53 +0800
From: Jim Lin <jilin@...dia.com>
To: <jckuo@...dia.com>, <thierry.reding@...il.com>,
<jonathanh@...dia.com>
CC: <vkoul@...nel.org>, <balbi@...nel.org>,
<gregkh@...uxfoundation.org>, <jilin@...dia.com>,
<bhsieh@...dia.com>, <linux-phy@...ts.infradead.org>,
<linux-tegra@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-usb@...r.kernel.org>
Subject: [PATCH v2 2/2] usb: gadget: tegra: Reduce pad power
Program USB2 UTMI pad PD controls during port connect/disconnect.
Power down pad after disconnected to save power.
Signed-off-by: Jim Lin <jilin@...dia.com>
---
v2: update copyright year
drivers/usb/gadget/udc/tegra-xudc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index 43f1b0d461c1..e59f19be6327 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -2,7 +2,7 @@
/*
* NVIDIA Tegra XUSB device mode controller
*
- * Copyright (c) 2013-2019, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2015, Google Inc.
*/
@@ -703,6 +703,8 @@ static void tegra_xudc_device_mode_on(struct tegra_xudc *xudc)
pm_runtime_get_sync(xudc->dev);
+ tegra_phy_xusb_utmi_pad_power_on(xudc->curr_utmi_phy);
+
err = phy_power_on(xudc->curr_utmi_phy);
if (err < 0)
dev_err(xudc->dev, "UTMI power on failed: %d\n", err);
@@ -757,6 +759,8 @@ static void tegra_xudc_device_mode_off(struct tegra_xudc *xudc)
/* Make sure interrupt handler has completed before powergating. */
synchronize_irq(xudc->irq);
+ tegra_phy_xusb_utmi_pad_power_down(xudc->curr_utmi_phy);
+
err = phy_power_off(xudc->curr_utmi_phy);
if (err < 0)
dev_err(xudc->dev, "UTMI PHY power off failed: %d\n", err);
--
2.17.1
Powered by blists - more mailing lists