Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4475536pxv; Tue, 27 Jul 2021 08:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgHd6r3UbNZdQuJ8+B3oo2Ve/O7h6KaYXo8DtZZcaJMqNGNm3Iah+H24bWOYaUhaqP21ss X-Received: by 2002:a05:6e02:1154:: with SMTP id o20mr17069117ill.168.1627398851961; Tue, 27 Jul 2021 08:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627398851; cv=none; d=google.com; s=arc-20160816; b=Ki8ofFPEPAXtBCUGdI+k+eJHZw7cqVdjlmpTj2jjrmpvogToqgA2OJmLaoPzxPqMGz kPSxjkqAoTkh+FlNPJiioPXwMyGLfl/h9NVK1dla+6EZe5GIkLlRA4u6H6XQWtf6wSCx eugL+4fLvHJzJpRlkGhdUVr06bz5AcuUoEru2uHQhLWlwe+U6Lka65n+JTBqweni+zSv 5WAyrShL8W8wrw3elLpyiKahnyfvHCFz6RlP+dbp9R67PkTNjLC2bO0quVSYvoDYAqSg KdDy4V/psg59iLecFtmhfk8U7n7evwuyd10XzBjDLys1xrSVrSFMSxzR9j3woWce4+F5 Og3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=MoBbmwwVoAs+ak0szW1VsZv7qNLKHbGSV3nOAEkfkt8=; b=a1CAGHAIMi2yWvv1jUlZiMkkPklIIlHbwXK7bC+u/er4BzxRWtC0Mp5XIeYh+/mlxZ WPMt7EwVdcjDDZSR0IcjE1nY9pxdA/JyZsz4FMms95Uc8Rc1bWSQYQ/EJekwb0bUTyiZ IbrTP13en3WF1ngnZxTc1w/cBG6EbMRIQ/nYMfC6eTkPX8aefK7qe1+4IKnIk9XFC4Rh MJwliLgzQHIGfgs7D7LKLPUFZztDYvuuXLHDF5twdtaHT1nLzxVyGp9SPqLQetOl2rvr kevuSNQRF3ergXa20Cvetje7i9prrseWShQulGJ0g3etMhus8O/vyWBBA8gLBBGPaI9B 2eaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XfJgoOdY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si560070ilf.64.2021.07.27.08.13.59; Tue, 27 Jul 2021 08:14:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XfJgoOdY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232633AbhG0PNO (ORCPT + 99 others); Tue, 27 Jul 2021 11:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232656AbhG0PNN (ORCPT ); Tue, 27 Jul 2021 11:13:13 -0400 Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93743C061764 for ; Tue, 27 Jul 2021 08:13:13 -0700 (PDT) Received: by mail-qv1-xf49.google.com with SMTP id cb3-20020ad456230000b02903319321d1e3so2693887qvb.14 for ; Tue, 27 Jul 2021 08:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=MoBbmwwVoAs+ak0szW1VsZv7qNLKHbGSV3nOAEkfkt8=; b=XfJgoOdYamR7F+9PsH6kTPjt3ckIavxZN69iGZvVvSPiedLbxaZ3IxwI/k4Mz2h2vX wLLg0vcAcTc9TzTAgLMaBEnBf9L3j6lkndR6b7/aRUnEfdgSGxBCVAtaxpNEiHU2i1tZ 2DFzPMu5MjNpINrDOZSV3cMlRsQx7bDr6dtwkhZApvo6YZ8/ZSUeOe5abI++8Snumh5A lTHEwmu9IsRjywgjrjVlkCzsXQGOfpB8Ctt9wzvdr3o22OxpdDOkhjyHwhLjNGgfXSW4 +pkV2kJHTCGoMIcVOE/0OcnEv/pFpd6KVkBtEJ2M5RlZsMXJ7FKgoL0UZLxFMkloYMKL uiWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=MoBbmwwVoAs+ak0szW1VsZv7qNLKHbGSV3nOAEkfkt8=; b=OmoqE0FH2Ilrf5J7D936X03zdBmE5EE9IJ8Gjo/josoE5TUYbVO2qqqLPxw3gHjraS 7jYRMAVSkUbCvj2PBu3+kxzogKxDTlxp1iMxtvk/SloPbTHUjPKc4XsVMnHRHTX0cv/W 4mDticInFf5xtWqmC1jHQZOvMZYhSY1qTvOJqXWRRSkq+RcXTTeKD7yy/63UENoASxfu TEkdHoXsACWw1DXfudajfxg2LRL1B2Lq3y52lTUJAnEU67aVOxVxGnIFNgF142hPtQTq u1Ig2/BEljT/QchTWXvmlJoEZdLemuYC2+kVzUkPO3zi6zRMqeCjrkzBQ7EJUXhCHOLs 2QYQ== X-Gm-Message-State: AOAM532LBLb7zekuRrhpn792J+BBqlAFiPkhSHIQYb6EBKistxQA+DoP zmIqAmQwSTbjUoBQsBp8P7HpuRgWohYE X-Received: from kyletso.ntc.corp.google.com ([2401:fa00:fc:202:da7f:a21b:ee74:66a2]) (user=kyletso job=sendgmr) by 2002:a05:6214:2482:: with SMTP id gi2mr20396807qvb.51.1627398792472; Tue, 27 Jul 2021 08:13:12 -0700 (PDT) Date: Tue, 27 Jul 2021 23:13:05 +0800 Message-Id: <20210727151307.2178352-1-kyletso@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.432.gabb21c7263-goog Subject: [PATCH v2 0/2] TCPM non-pd mode From: Kyle Tso To: linux@roeck-us.net, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, robh+dt@kernel.org Cc: badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kyle Tso Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The reason for this patch is to let the device/system policy decide whether PD is going to be supported using devicetree properties. A new dt property "pd-supported" is introduced and TCPM uses this property as a flag to decide whether PD is supported. If the flag is false, the RX functionality of the low-level driver will not be enabled. The power negotiation related states will be skipped as well. If the flag is true, everything is as what it was before. If "pd-supported" is not present, and the port is SRC or DRP, another existing dt property "typec-power-opmode" needs to be specified to indicate which Rp value should be used when the port is SRC. changes since v1: - revise the patch to use dt properties Kyle Tso (2): dt-bindings: connector: Add pd-supported property usb: typec: tcpm: Support non-PD mode .../bindings/connector/usb-connector.yaml | 5 + drivers/usb/typec/tcpm/tcpm.c | 108 +++++++++++++----- 2 files changed, 84 insertions(+), 29 deletions(-) -- 2.32.0.432.gabb21c7263-goog