Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14057338ybl; Mon, 30 Dec 2019 03:15:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzjK/a6Q5nxVilSc/gMdbUwdnzHTVuQH9V3CJOBloKTNtnCSoiEQzayDRT38ghALJX5TjXE X-Received: by 2002:a9d:3d0a:: with SMTP id a10mr71102291otc.327.1577704559309; Mon, 30 Dec 2019 03:15:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577704559; cv=none; d=google.com; s=arc-20160816; b=aZ5Pc1AWCzJGwBngGCSvG6ZppiWb42gb0r+nxrf2oVMAGXuUzF3Y2RRfXlHwxBNfDv LMosBeEDnStm/xJGyWCfKjblOy/qrfZRGha3k7faB7pdTYpRX6/TsvwzrUKwuVYooz+3 SFG7lErqBOUMb7slml7kn6kowOwtt0QoaG58BVMKXQ7nFrprQrVFSw7r4Y6d1c0CV4S9 qsy/iob0uO2R13bocO+ecq2qu9ul3rpWjr7PjDuEKC+HMnWT6i5de6itnoAI6dK3QNJi w/i+y2g5GUAv172Q0/ptLi/Kkil5K3+nDx7z/NT4neVSy/RvA++L7SnFyn6AyRIPQ2kC MBmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=D2jh8SUiSch+EQlBoxuXhObFVDKZZymruNR1RbzygjM=; b=XLOaRu+lsuRoUuy7cRZf4owSgl2xORZPuxwKoBo2lRsR3jkVywDTAL07+fBgnDoEsH x47zPRIP+rHHF7AdeZNhBMZ51/DXQ8kekV+5xZaF8tl/arppgmOHsvUMP9sfId5OG++2 yfDkuI/9OHgMzy1Q2ZdSjtIQ7sNslbDOXhtgkL4o/zD/Xze+HlKcgEyAERLFKiwRc+KO q0usDFNBCd6iOh5FRPeJ9huygcvXQUGhamruMXfUeFENYLQ4IsJrPyBgpt00uDb1N8lW pnq2c9XgGUPSBqY+1Xv6CKfNOrSAkytAWjvHwRFt7rpbiOySIXRNN3CKsjjvr6wn/mUO LO7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=VaQ2kZzX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si17090525oij.134.2019.12.30.03.15.29; Mon, 30 Dec 2019 03:15:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=VaQ2kZzX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727578AbfL3LOV (ORCPT + 99 others); Mon, 30 Dec 2019 06:14:21 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:1303 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727508AbfL3LOT (ORCPT ); Mon, 30 Dec 2019 06:14:19 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 30 Dec 2019 03:14:04 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Mon, 30 Dec 2019 03:14:18 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Mon, 30 Dec 2019 03:14:18 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 30 Dec 2019 11:14:18 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 30 Dec 2019 11:14:18 +0000 Received: from nkristam-ubuntu.nvidia.com (Not Verified[10.19.64.167]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 30 Dec 2019 03:14:17 -0800 From: Nagarjuna Kristam To: , , , , , , CC: , , , , Nagarjuna Kristam Subject: [Patch V3 11/18] usb: gadget: tegra-xudc: use phy_set_mode to set/unset device mode Date: Mon, 30 Dec 2019 16:39:48 +0530 Message-ID: <1577704195-2535-12-git-send-email-nkristam@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1577704195-2535-1-git-send-email-nkristam@nvidia.com> References: <1577704195-2535-1-git-send-email-nkristam@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1577704444; bh=D2jh8SUiSch+EQlBoxuXhObFVDKZZymruNR1RbzygjM=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=VaQ2kZzXdANWVvkWZ+kGtZ9Vfex+Af9IKSOyEtsTHn6FR2e1RzDVTxroML2tsAPA7 jM7H2lZoonBjZMkb6/zvHREtVRbtLPs2CyIsqhAsYzIhVsWSWRhVSeU637tFh4RWfk mIx1FQ8OjeqMA38cTNIlMYLXMRJKtSu6SkCVDia9XAYYxa7H6PBTGBWVCTJ7gvNa2c w5Pc2LkBOcQw4KLzbx/9YEiJHgDOLg+/eWdwQqv6G0SQqai+RLN2g+VZ3XJOyW8Wwl /Jgq4HUUYZqDs/wAq+eyEPcOs3SQFmQRBrMd+zbWX7hNlsxG4iC1832s10j7AmDwVE 6FEiiJMhCdYtw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When device mode is set/uset, vbus override activity is done via exported functions from padctl driver. Use phy_set_mode instead. Signed-off-by: Nagarjuna Kristam --- V2-V3: - No changes in this version --- drivers/usb/gadget/udc/tegra-xudc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c index 0f27d57..283c320 100644 --- a/drivers/usb/gadget/udc/tegra-xudc.c +++ b/drivers/usb/gadget/udc/tegra-xudc.c @@ -615,7 +615,7 @@ static void tegra_xudc_device_mode_on(struct tegra_xudc *xudc) dev_dbg(xudc->dev, "device mode on\n"); - tegra_xusb_padctl_set_vbus_override(xudc->padctl, true); + phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG, USB_ROLE_DEVICE); xudc->device_mode = true; @@ -636,7 +636,7 @@ static void tegra_xudc_device_mode_off(struct tegra_xudc *xudc) reinit_completion(&xudc->disconnect_complete); - tegra_xusb_padctl_set_vbus_override(xudc->padctl, false); + phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG, USB_ROLE_NONE); pls = (xudc_readl(xudc, PORTSC) & PORTSC_PLS_MASK) >> PORTSC_PLS_SHIFT; @@ -716,9 +716,11 @@ static void tegra_xudc_plc_reset_work(struct work_struct *work) if (pls == PORTSC_PLS_INACTIVE) { dev_info(xudc->dev, "PLS = Inactive. Toggle VBUS\n"); - tegra_xusb_padctl_set_vbus_override(xudc->padctl, - false); - tegra_xusb_padctl_set_vbus_override(xudc->padctl, true); + phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG, + USB_ROLE_NONE); + phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG, + USB_ROLE_DEVICE); + xudc->wait_csc = false; } } -- 2.7.4