Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5079122pxv; Wed, 28 Jul 2021 02:33:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWo9onF/lmGf+JDQYyVX3L0pjJ+BjxfK71x5tl2vCWcrsl+ydsjf4GOF0srtCCq12B16T5 X-Received: by 2002:a05:6402:b2a:: with SMTP id bo10mr25545354edb.215.1627464805038; Wed, 28 Jul 2021 02:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627464805; cv=none; d=google.com; s=arc-20160816; b=Q0MHYriYSNRjM2Gal0CWv5EviW60rp3H5gRt3XVaNyTaWqjB12G3NCqTNVDlE/GT19 kjgxO7xb1NtDW9xcEg2/M3//+6jZ0mJyKbmdJZvUtOcQlGwdFa0f4eiwq3IXNVhCCf83 AqDBsrAEo/1NB8YX/jgsGZyphfl8J6+GSt7jGRrPUaInT+SiGnivtWD/qhCbafmUuS60 7KW4eG5vwLZ6Ve/9WfCx7FI1WagzvXePcJwRuiS+9M0i3cBJxxeQJWyC9zgq4ejDAwnY c+7in3BqEQGJ1H2oY/dUDJXOHnH7zluE6jKhOWaFDnSI7AdQfDD0/DU05dHbTWWW7y4L D+9A== 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=1khUy18ueI16YW+V4Jc14xqEcfZYqzU/8GyELBFAS70=; b=mLjdsQAwasLv0hhdaYECsp+fU8CThR/b7KXq4DcgkjWedfVRi7cRLN5lBzh1y49Up0 UsgyUkhbfLJU+/rEWtBiNSLRH15xFcpXk5UdCk7ujtfmPKclBKOq5eGKBHItYJX5hiEl GenF5WcIvIgKLVGre69iTHivg06TVOLwz4ACyl2fn85Mgh6qf3Sai2xpL7lq3xiYb3RT acL8h97gJDu6ORdN1symIw4LV7TCLRUQF5t33p24qZ7bxXYdeu9yQ/TyFr5tf27dnL7W UVJfB9tbvwZf1zSdJxvdd4FUym2trxCuPLn4U3Tk+WPWrDY6PcEMXNe4NISP6NjswaiR E+/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DadcpphU; 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 gb31si5757624ejc.263.2021.07.28.02.33.01; Wed, 28 Jul 2021 02:33:25 -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=DadcpphU; 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 S231322AbhG1J3k (ORCPT + 99 others); Wed, 28 Jul 2021 05:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbhG1J3j (ORCPT ); Wed, 28 Jul 2021 05:29:39 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D865C061757 for ; Wed, 28 Jul 2021 02:29:38 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id n192-20020a25dac90000b029054c59edf217so2189517ybf.3 for ; Wed, 28 Jul 2021 02:29:38 -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=1khUy18ueI16YW+V4Jc14xqEcfZYqzU/8GyELBFAS70=; b=DadcpphUiTQazdJ6fmCJPl6deN3oInvudZoTj8JXeLCALHLrZ+Jfa0Z3IpCZTWBol6 0n/wx1dUPDhaKe8gZJXqsWTOUq2iQptnGrnqp+k2I7QqIjKRbRPFrAbDVlCZ7Oy3jt6l 9lYbrirHb2e5P5/Iu4BBcpk10huickNhchZlt15skBah1Nhv8p9uTqzPT6xQmvy9H1wD +abOkcSLYB3w/JUImFI9coeZo98OLewAVm83jtGghmL9azYMraJhP0//Nos9EkkpXzhe l7EgmrExNownBurnaoauJmL6aZ2nrWbbxDa1uGv5iROfOcDrKyUJzgErXoXXVC4mFdWZ imnQ== 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=1khUy18ueI16YW+V4Jc14xqEcfZYqzU/8GyELBFAS70=; b=mvlPftV0kej2W5ywUfXNEsFz7DWjcY/n/h8FaPRxeL0MuEVEqZRqJLT7AEHrmdCv0N +CyAcw5mLhIX0FV7dyuZjKxAAVrwTjCgxVZaFlXQW/kl3ksHELnuWAMGmXMdVVb6MpFi 5NGNiraVjkrlK3uWvazLp/L8ms3C2QZ8gLa+ZLN9I0qDm7PXxi7OPTwEK5w3tQUlW9aA +i63XvWfG2iT3uePO8EtRt+21yBo8TzvMMyErm/dWFyU4SV4+4Jqa/oDGr3jDUeN+VJc DRkWeVpELyq/km54YxUP/Qpv++HLa9CTPhyLsF3EgljwhB6ds71AZluZLsIUKrbEIrG1 ip+w== X-Gm-Message-State: AOAM530THNu6ZTLvp5dYHUlGuqtf9sAO6PDYFuV5gOcSWt5510EfPKFI tAdnxaTrX3y5KWVvWEl78V8F98UEsYVS X-Received: from kyletso.ntc.corp.google.com ([2401:fa00:fc:202:da7f:a21b:ee74:66a2]) (user=kyletso job=sendgmr) by 2002:a05:6902:1507:: with SMTP id q7mr37741267ybu.326.1627464577344; Wed, 28 Jul 2021 02:29:37 -0700 (PDT) Date: Wed, 28 Jul 2021 17:29:28 +0800 Message-Id: <20210728092930.2552619-1-kyletso@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.432.gabb21c7263-goog Subject: [PATCH v3 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-unsupported" is introduced and TCPM uses this property as a flag to decide whether PD is supported. If the flag is false (the dt property is not present), 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-unsupported" is 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 v2: - Negated the meaning and the name of the dt property. Now the name is "pd-unsupported" - Changed the control flow if the port is SNK or DRP. Return directly if the flag is false (PD not supported). Read "self-powered" before that. --- cover-letter in v2: --- 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 | 4 + drivers/usb/typec/tcpm/tcpm.c | 88 +++++++++++++++---- 2 files changed, 74 insertions(+), 18 deletions(-) -- 2.32.0.432.gabb21c7263-goog