From patchwork Wed Apr 15 08:25:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nagarjuna Kristam X-Patchwork-Id: 11490409 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 114D692C for ; Wed, 15 Apr 2020 08:29:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBA49208FE for ; Wed, 15 Apr 2020 08:29:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="lL6Mey68" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2894578AbgDOI3T (ORCPT ); Wed, 15 Apr 2020 04:29:19 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:11451 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2894458AbgDOI1K (ORCPT ); Wed, 15 Apr 2020 04:27:10 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 15 Apr 2020 01:25:07 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Wed, 15 Apr 2020 01:25:19 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Wed, 15 Apr 2020 01:25:19 -0700 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 15 Apr 2020 08:25:19 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 15 Apr 2020 08:25:18 +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, 15 Apr 2020 01:25:18 -0700 From: Nagarjuna Kristam To: , , , , , , CC: , , , , Nagarjuna Kristam Subject: [PATCH V2 0/8] Tegra XUSB charger detect support Date: Wed, 15 Apr 2020 13:55:00 +0530 Message-ID: <1586939108-10075-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=1586939107; bh=O48+NSKb3uOgoUZUlMx/0cvuA3m+UW6/cKABrRYslCI=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=lL6Mey68iGq4mX1QYckeaa8z69223hklD9jcb3zDBCotKmhg77EC5+F+QCXw3auRN qmd1iftCdza2iVUUn7SNTaCrd4edbcv5HvHA2/Y4+IUOwWElv3bjjFkzDvJ8wz6ztV WQIsnI7M2U3yrZc1DXHYKQaEP9TWEzLItMyPo1fm/ViT5i48p9Ui32NGQuUP/JKME8 iCt/G/lNiVGLmabjQcfk8uigJpIdTQL6UE2h4sFyE4ibL/YyKtEo34l6HXuf8QHATw 5+ERvAElNEwSjeo1hD+6zB5LBZAxPdxK+CR1lGPISIrT7JA6MtMK5VEM2FQf4TXywU 24fa2V8kVTRwg== 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. 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/xusb-tegra-cd.c | 300 +++++++++++++++++++++ drivers/phy/tegra/xusb-tegra186.c | 92 +++++-- drivers/phy/tegra/xusb-tegra210.c | 222 +++++++++++---- drivers/phy/tegra/xusb.c | 80 ++++++ drivers/phy/tegra/xusb.h | 22 ++ drivers/usb/gadget/udc/tegra-xudc.c | 16 ++ 8 files changed, 653 insertions(+), 85 deletions(-) create mode 100644 drivers/phy/tegra/xusb-tegra-cd.c