From patchwork Thu Oct 25 22:33:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Gupta X-Patchwork-Id: 989396 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="eBL/xOE6"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42h24608CBz9sBN for ; Fri, 26 Oct 2018 09:34:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726787AbeJZHI4 (ORCPT ); Fri, 26 Oct 2018 03:08:56 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:15421 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726246AbeJZHI4 (ORCPT ); Fri, 26 Oct 2018 03:08:56 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 25 Oct 2018 15:34:15 -0700 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 25 Oct 2018 15:34:26 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 25 Oct 2018 15:34:26 -0700 Received: from ajayg.nvidia.com (172.17.171.95) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 25 Oct 2018 22:34:23 +0000 From: To: , , , CC: , , Ajay Gupta Subject: [PATCH v14 0/2] Add support for USB Type-C interface on latest NVIDIA GPU Date: Thu, 25 Oct 2018 15:33:51 -0700 Message-ID: <20181025223353.19339-1-ajayg@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public MIME-Version: 1.0 X-Originating-IP: [172.17.171.95] X-ClientProxiedBy: DRBGMAIL103.nvidia.com (10.18.16.22) To HQMAIL101.nvidia.com (172.20.187.10) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1540506856; bh=2JqpZdC/Z5bd2E/Piyr/086ALaw9Xprpk1CGG5W932Q=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:X-Originating-IP: X-ClientProxiedBy:Content-Type; b=eBL/xOE6Z3lrBSU+S3VMDW3CW5eUVQSnqNW+ZRby5tU77BZJ3P4Kz22JzjtE5uX4d 8Qq07TKGJQZ4Yo+/FiSEYEn1REp593Ru6FI96bAEwMqcPWxD+Y89GXlWrFFHkC70tb AEAvqSjQa1K10u3TYpp6lw8LrTaf4CuQepD5QgYkiL5YTC/3HZ6YNNLJVdANtSyIXY iPEbRor/bphVn4dyXWcEW8ZPibixq8q68eQkIN2rjM/lQCNKF6SB+++UFjXtmbWGCa ljit7YudeZtfzTWHZ03nlul+BxBcJIACXXTVarRtiELcoAIKf8FJS8589nwRbjnRdr 0eRJvhhuzkW9A== Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Ajay Gupta Hi Heikki and Wolfram, These two changes add support for USB Type-C interface on latest NVIDIA GPU card. The Type-C controller used is Cypress CCGx and is over I2C interface. I2C host controller has known limitation of sending STOP after every read. Since each read can be of 4 byte maximum length so there is a limit of 4 byte read. This is mentioned in adapter quirks as "max_read_len = 4" I2C host controller is mainly used for "write-then-read" or "write" messages so added the flag I2C_AQ_COMB_WRITE_THEN_READ in adapter quirks. PATCH[2/2] on ucsi driver now have added logic to check i2c adapter quirks and issues i2c read transfer based on max_read_len quirk settings. This will make sure the read limitation is not affecting I2C host which do not have such limitation. I think the patches should through usb tree because the main functionality is usb Type-C. Thanks Ajay Ajay Gupta (2): i2c: buses: add i2c bus driver for NVIDIA GPU usb: typec: ucsi: add support for Cypress CCGx Documentation/i2c/busses/i2c-nvidia-gpu | 18 ++ MAINTAINERS | 7 + drivers/i2c/busses/Kconfig | 9 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-nvidia-gpu.c | 368 ++++++++++++++++++++++++ drivers/usb/typec/ucsi/Kconfig | 10 + drivers/usb/typec/ucsi/Makefile | 2 + drivers/usb/typec/ucsi/ucsi_ccg.c | 307 ++++++++++++++++++++ 8 files changed, 722 insertions(+) create mode 100644 Documentation/i2c/busses/i2c-nvidia-gpu create mode 100644 drivers/i2c/busses/i2c-nvidia-gpu.c create mode 100644 drivers/usb/typec/ucsi/ucsi_ccg.c