From patchwork Wed Mar 20 11:44:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 10861443 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 3A08D15AC for ; Wed, 20 Mar 2019 11:44:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1414C296E8 for ; Wed, 20 Mar 2019 11:44:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08747296E9; Wed, 20 Mar 2019 11:44:51 +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=-7.9 required=2.0 tests=BAYES_00,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 95A8529B65 for ; Wed, 20 Mar 2019 11:44:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbfCTLot (ORCPT ); Wed, 20 Mar 2019 07:44:49 -0400 Received: from mga04.intel.com ([192.55.52.120]:46356 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfCTLot (ORCPT ); Wed, 20 Mar 2019 07:44:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 04:44:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,248,1549958400"; d="scan'208";a="156658271" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 20 Mar 2019 04:44:46 -0700 From: Heikki Krogerus To: Ajay Gupta , Michael Hsu Cc: linux-usb@vger.kernel.org Subject: [PATCH v2 0/2] usb: typec: ucsi: Support for DP alt mode Date: Wed, 20 Mar 2019 14:44:43 +0300 Message-Id: <20190320114445.22462-1-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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, This is the second version of my proposal to add alt mode handling to ucsi driver. The problem in the first version was that I was not using the port alt mode that was associated with the partner alt mode (and vise versa), but I was instead searching the alt mode objects in every case separately. So in this version I'm now always using the already associated alternate mode partner in every case, and as far as the UCSI driver (or any other USB Type-C driver) is concerned, that is all that it needs to do. The problem of actually associating the correct alt mode partner object belongs to the Type-C subsystem core code, and any improvements to that code are out side of the scope of this series. I've prepared a patch that allows the alt mode drivers to find the correct port alt mode for the partner alt modes. That should cover SVIDs that define multiple modes (note, DisplayPort Alt mode is not one of those). But as I mentioned above, that is not related to this series. You can check the v1 from here: https://www.spinics.net/lists/linux-usb/msg176703.html thanks, Heikki Krogerus (2): usb: typec: ucsi: Preliminary support for alternate modes usb: typec: ucsi: Support for DisplayPort alt mode drivers/usb/typec/ucsi/Makefile | 15 +- drivers/usb/typec/ucsi/displayport.c | 297 ++++++++++++++++++++++ drivers/usb/typec/ucsi/trace.c | 12 + drivers/usb/typec/ucsi/trace.h | 26 ++ drivers/usb/typec/ucsi/ucsi.c | 366 ++++++++++++++++++++++----- drivers/usb/typec/ucsi/ucsi.h | 93 +++++++ 6 files changed, 738 insertions(+), 71 deletions(-) create mode 100644 drivers/usb/typec/ucsi/displayport.c Tested-By: Ajay Gupta