From patchwork Fri Oct 26 16:36:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Gupta X-Patchwork-Id: 10657677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2B3E5A4 for ; Fri, 26 Oct 2018 16:37:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C47892BA63 for ; Fri, 26 Oct 2018 16:37:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B58222CAFC; Fri, 26 Oct 2018 16:37:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EA322BA63 for ; Fri, 26 Oct 2018 16:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727436AbeJ0BPB (ORCPT ); Fri, 26 Oct 2018 21:15:01 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:12091 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbeJ0BPB (ORCPT ); Fri, 26 Oct 2018 21:15:01 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 26 Oct 2018 09:37:23 -0700 Received: from HQMAIL101.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 26 Oct 2018 09:37:17 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 26 Oct 2018 09:37:17 -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; Fri, 26 Oct 2018 16:37:14 +0000 From: Ajay Gupta To: , , , CC: , , Ajay Gupta Subject: [PATCH v15 0/2] Add support for USB Type-C interface on latest NVIDIA GPU Date: Fri, 26 Oct 2018 09:36:57 -0700 Message-ID: <20181026163659.21590-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: DRBGMAIL101.nvidia.com (10.18.16.20) To HQMAIL101.nvidia.com (172.20.187.10) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1540571844; bh=oVaJls2BpYAGgpu0EIRxVUf6A90WV7kNK0IB9u8+KzQ=; 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=SRRy40iEaoAQ5czYn/lQbag25LQsrYJghhscWAKuSq/NkmzQkYdO136DtJJ+ubX5B wcnPDd3ASvNK0WGRzJbDuotPqSbm8dlLwKG+0mpp8Psg3L3t2cS5O3fZzG4NiVPrVh yRTvdI26lhrp13Rko6hbBDDK8UqYKwzDnPmmPDkvP3SDE8bVOtbikldHgjeEoWisnk FqnQGVU7IunZ7omrlgcINEiMNGRfJVqzK8nSIGSSnmzdJYw65GCHrMjBT1+bNq6X19 qq1Vh3SDl1lUuRvnrRhDQ7B+loQ/Otd8kFYgM8ow+o1ECG/y1pgkBtqKDXCFCCrN1i E5nSDUiCSpm0A== Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Andy Shevchenko