From patchwork Tue Jan 26 08:45:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Tso X-Patchwork-Id: 12047529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 949EFC433DB for ; Tue, 26 Jan 2021 17:19:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CDD72083E for ; Tue, 26 Jan 2021 17:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390355AbhAZRSa (ORCPT ); Tue, 26 Jan 2021 12:18:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390382AbhAZIql (ORCPT ); Tue, 26 Jan 2021 03:46:41 -0500 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA616C061786 for ; Tue, 26 Jan 2021 00:45:53 -0800 (PST) Received: by mail-pf1-x44a.google.com with SMTP id x206so7721158pfc.16 for ; Tue, 26 Jan 2021 00:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=TvDirtp33tQ52/+xfhxSiL9lDOUp03iq0TnEaNmWwQQ=; b=bo/qYJO/oWZGzk/RT0zMkXs3Ry7yVRr04zttXknovn8ZuFXa85/EcnqhgYLpg/kLbC ZWi25BKBWd+66y9XCGYfS6iWMVwQyMFbxQnPtFE8O4lfNB667xGyiY56IChHH5YB/1Nr xVMu7drtb+kPwQrKYh2Sw6cQ9XyZIw3C/RCMG0kob1M7vsf9ESRo+z08g+QqZ2eFABBj z/a75c12n1yZwUHSTUZm5dRT4imd4DyIWQZav4p6wRf1k7jP9DU2GkqN9z+2VY2meGig SYmGDNQNvt73YAgmYVacSqt671mlNnaohCuusHnX1z3PrqM7efAL/R9V5CEAK4bL1z52 Mjog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=TvDirtp33tQ52/+xfhxSiL9lDOUp03iq0TnEaNmWwQQ=; b=Ld7Ut6laLhmVhphz04454z5FDxsh9kXJWRxBOAbS7Nt3TfIomHShsPxkvnX+j8UkR0 bse+ZW25GWOXq+BXlTGk7a19h0n2+VHHOZ9lsYEmGMsw95yOH97lN4adkVYrrQRhDxL2 xUt7vFVs1ShUOjdRAn8FOo1SsAignPYnLHG6x3OpUEwRVLWWZDOMP5ron+CrMavTO1Xf zPlCFXPx9R81SVTyonJu3xQi91jsiI2vBK9tYdD3wbHJUGe7/wYo7wBhA+/oRct/HE+Q kAHkVMoLXTU6en42ZQl6Kxwt6nYvFVEgvqs/MGoMWX4USkFsTBC6ZkZkeOY3RUlCs02z tprg== X-Gm-Message-State: AOAM532OA9Z0GT/Jj/ib56zlakKPrz3GRau2yx9wBwUBahN2gSrvsrLW s/AB35QOmz9/xxjpBHNDZI/Uyp/sFN0i X-Google-Smtp-Source: ABdhPJwpx0HIv3y1JBgyuhRp7JMI+b0CQQDa80hg7y5P3WpuD9CFOIEDueuJD8x6PH4eP17R4/5Rq0r2uH0y Sender: "kyletso via sendgmr" X-Received: from kyletso.ntc.corp.google.com ([2401:fa00:fc:202:4430:c29c:1e76:3e65]) (user=kyletso job=sendgmr) by 2002:a17:90b:3789:: with SMTP id mz9mr5203328pjb.4.1611650753479; Tue, 26 Jan 2021 00:45:53 -0800 (PST) Date: Tue, 26 Jan 2021 16:45:41 +0800 Message-Id: <20210126084544.682641-1-kyletso@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH 0/3] common SVDM version and VDO from dt From: Kyle Tso To: linux@roeck-us.net, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, robh+dt@kernel.org, hdegoede@redhat.com, badhri@google.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kyle Tso Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The correct SVDM version we should use is the lowest common version between the port partners (plug) as stated in the PD3 Spec 6.4.4.2.3. It is determined in the Discovery Identity command so cache it and set the value to the version field of the VDM header in every later SVDM. Like the previous patch "usb: typec: tcpm: Create legacy PDOs for PD2 connection" (https://lore.kernel.org/linux-usb/20210115163311.391332-1-kyletso@google.com/) The field is changed before sending it out of the port. I know this is not a good idea but at least it works. The other two patches are about to get the VDO from fwnode so as to give more flexibility. Kyle Tso (3): usb: typec: Determine common SVDM Versions dt-bindings: connector: Add SVDM VDO properties usb: typec: tcpm: Get Sink VDO from fwnode drivers/usb/typec/altmodes/displayport.c | 6 ++- drivers/usb/typec/class.c | 8 ++-- drivers/usb/typec/tcpm/tcpm.c | 56 ++++++++++++++++++++---- drivers/usb/typec/ucsi/displayport.c | 12 +++-- include/dt-bindings/usb/pd.h | 53 +++++++++++++++++++++- include/linux/usb/pd_vdo.h | 40 ++++++++++++----- 6 files changed, 147 insertions(+), 28 deletions(-)