From patchwork Thu May 14 06:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nagarjuna Kristam X-Patchwork-Id: 11547993 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF3EF60D for ; Thu, 14 May 2020 06:22:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8ACA206D8 for ; Thu, 14 May 2020 06:22:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="Zjl0+N3l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725955AbgENGWu (ORCPT ); Thu, 14 May 2020 02:22:50 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:17875 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbgENGWu (ORCPT ); Thu, 14 May 2020 02:22:50 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 13 May 2020 23:21:35 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 13 May 2020 23:22:50 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 13 May 2020 23:22:50 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 14 May 2020 06:22:50 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 14 May 2020 06:22:49 +0000 Received: from nkristam-ubuntu.nvidia.com (Not Verified[10.19.67.128]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Wed, 13 May 2020 23:22:48 -0700 From: Nagarjuna Kristam To: , , , , , , CC: , , , , Nagarjuna Kristam Subject: [PATCH V3 0/8] Tegra XUSB charger detect support Date: Thu, 14 May 2020 11:52:35 +0530 Message-ID: <1589437363-16727-1-git-send-email-nkristam@nvidia.com> X-Mailer: git-send-email 2.7.4 X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1589437295; bh=dCrSdDPfqMabU4Rtjih+53UFPUq2Jf/3H2721hE+UMo=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=Zjl0+N3ldDdS6Fdqyhin2/sjQ/i9t2fUGxhCN4ag/y3FWawpvpoBvMd2N0UQMiV54 gIKSaKsO7++kZ5OZC6Q4pO+yTzqX7qb99iAZiOcpV72RjpiKzkwDPopwd3UGffmLS1 Q+ZmgCxpzISerxMMXQF/vjYFRt1MYRhJd2+RXT4MUOv6OQoR9o1KTX2kRVfPmZYYTW AEfjYOxZmUYxHWV3qIPIuUrIahKaLkk9VLsb2nsGaXGR809+XbYGGgxmtCWivajwRb +J7VLprt5chwee2cDgUmhNYPji6iyYWkCU/6EYg1tr7JvbXXokSMojRIHlh6UVgJ7p iOtPUYBZNOPGw== Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This patch series adds charger detect support on XUSB hardware used in Tegra210 and Tegra186 SoCs. This patchset is composed with : - dt bindings of XUSB Pad Controller - Tegra XUSB device mode driver to add vbus_draw support - Tegra PHY driver for charger detect support Tests done: - Connect USB cable from ubuntu host to micro-B port of DUT to detect SDP_TYPE charger - Connect USB cable from external powered USB hub(which inturn connects to ubuntu host) to micro-B port of DUT to detect CDP_TYPE charger. - Connect USB cable from USB charger to micro-B port of DUT to detect DCP_TYPE charger. DUT: Jetson-tx1, Jetson tx2. V3: - Added ACKed-by details for PHY driver and DT changes. - Functions and its arguments are aligned. - Tabs are used for alignment of MACRO's - For vbus_draw USDC callback, usb_phy set_power error is propogated. - Fixed various comments given by thierry. V2: - Added ACKed-by details for DT patches. - All patches rebased. Nagarjuna Kristam (8): dt-bindings: phy: tegra-xusb: Add charger-detect property usb: gadget: tegra-xudc: Add vbus_draw support phy: tegra: xusb: Add support for UTMI pad power control phy: tegra: xusb: Add USB2 pad power control support for Tegra210 phy: tegra: xusb: Add soc ops API to enable UTMI PAD protection phy: tegra: xusb: Add support for charger detect phy: tegra: xusb: Enable charger detect for Tegra186 phy: tegra: xusb: Enable charger detect for Tegra210 .../bindings/phy/nvidia,tegra124-xusb-padctl.txt | 4 + drivers/phy/tegra/Makefile | 2 +- drivers/phy/tegra/cd.c | 283 +++++++++++++++++++++ drivers/phy/tegra/xusb-tegra186.c | 92 +++++-- drivers/phy/tegra/xusb-tegra210.c | 223 +++++++++++----- drivers/phy/tegra/xusb.c | 80 ++++++ drivers/phy/tegra/xusb.h | 22 ++ drivers/usb/gadget/udc/tegra-xudc.c | 17 ++ 8 files changed, 638 insertions(+), 85 deletions(-) create mode 100644 drivers/phy/tegra/cd.c