Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6694243pxv; Thu, 29 Jul 2021 23:19:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLE6s0wPnk9tNGJvejzQDR9JSW/1mG9wZmROVJKSeSHHWevUbvKsg1fqTBnxnew+lEsoDB X-Received: by 2002:a05:6638:4115:: with SMTP id ay21mr844532jab.13.1627625974494; Thu, 29 Jul 2021 23:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627625974; cv=none; d=google.com; s=arc-20160816; b=W0YvUZcflIfZgekqsI7Xq7kGcZDUwyijnyzzndrd/h6iB5xE7Y2ijfy1yfcANpSqQR CqmOk/QV4SOfPR1c65NnIbt90/s51d/stUV1Z8uwj4pGFGM9FA0lHRKoFWEXIqyPSpfi xCbsaZqThHkcCl2gB1Wu7KuwB3FQwDpA6qiL+VzUdO4ocEyTrXUaV0CdHVHVrc7uydRV H2xVgjywm1KK5yRJxylhYwXOmhprP+IimkfW3nbGmqAPdfmYbwxTXlrGYZroI0D0Km9S beMGT9VRJJMEGbB+O7UBPlpzM+1imX42YxNpBkL/Ch2gxt6ruGJPedEuQpMUYmMxLBza pzrQ== 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=vthqjBQ/Q4udWXq8hxDLv4OMPT7q1106HFB0bgOZZVg=; b=S0oHukgXTpSHWFA25la2hOXnq6DGqAMTVYo1pHIhYnqyXKTjMbhSDe9A6YIDytElJ4 iSiMaw+oD0GI6UwP1o82WlFyB+Tkfn/Hty8fdZStWQf7rHc8ANpL2J2e5vVRGlcv8a9a Hctqii2ELEEG6KK/rnNRwXapC++m0n/yWDHsSKl+CgO15JnVdjbqQcKoTUFS3PP7RpWO vBGIH3U0inQ7ivFl3F0sE8oDBYRVRFuEXfyizlJMb4tQmm8Yaf0JEJQC1I7Wgx4zV58O J9vtvW7aioHaVDGnQisyqXpl/MtguKR0ssT2elLeI0CgQ1gPHvsmlRrqMfBzDYaAN9Em lRow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hfCLLYg9; 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 g6si753412ilk.97.2021.07.29.23.19.23; Thu, 29 Jul 2021 23:19:34 -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=hfCLLYg9; 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 S237335AbhG3GSn (ORCPT + 99 others); Fri, 30 Jul 2021 02:18:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237004AbhG3GSm (ORCPT ); Fri, 30 Jul 2021 02:18:42 -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 15EA5C061765 for ; Thu, 29 Jul 2021 23:18:38 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id p71-20020a25424a0000b029056092741626so9188875yba.19 for ; Thu, 29 Jul 2021 23:18: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=vthqjBQ/Q4udWXq8hxDLv4OMPT7q1106HFB0bgOZZVg=; b=hfCLLYg9u/HJ0MTxdrOhdfbc67sC4AG4T9SVaLsYna6Zon0m/LOAbckakXn6IYtYZS rPBFPG0Wc9XdhjWOun0Ga5Em2tuPzWT9lumyBIFLk7iCmThv/wdBF9HOlkRnToNiSHsn NQg1gLOqzn4x+mMiOr0UC5f0lxnd9guWLR4RJ8VaLm0y1GeV801sr2Vxp2QJAYelEkDF IYxOiwpsjrypgfXOf5+fGNsNXGxBwk7wZEiMJhah2bug+xrMXKH2AaaC5rfto9Qv7uPo N7EDaerkIZPS1HiROxcnSHJkyHJSIwwI8VbNvN1c2vyuQfYcJwLCcJiNiG8DDdRhydVW 4HKg== 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=vthqjBQ/Q4udWXq8hxDLv4OMPT7q1106HFB0bgOZZVg=; b=b+Id9+dYNPh+IMPpCQwHEpEdZ3LbHOBfVsFHlhg9J6QhbtVyW5O5XYDXZuxQOKSFCu aYlkMOYEN7tsdOfOtlrc4MSusIVmAlVaxMtSPgMi9Pl4Rzi7TGVNxzabze6QNsavLUK1 8XlqIsdRdSnsV3SDamSDOiwD+Bv+5CWpIsSCYP1JJVTeBa9X+nwIAjpJu7oBk3fMtbzU aQK8xvuEFKlgBb+cm0pFPVZP4W0DhvQ4btUIxjg1prntpNR96cmhnXLBaDLr+3o6OTQj MkFuVwlUE+G6+gPt12fcTIvjDsfR3wpKwi1i4GM9AcQM4vF+OjfWr3nIMfZ8QPqMk+rM MNuQ== X-Gm-Message-State: AOAM533aRGk9L1OeXrO17j9tjt42fAxk2CTF4NrZktqWIR9TKHmpAylL GqNofsfWB3n8qnrGw+n3GEnI0/S/6hDr X-Received: from kyletso.ntc.corp.google.com ([2401:fa00:fc:202:6892:a74:4970:a062]) (user=kyletso job=sendgmr) by 2002:a25:54:: with SMTP id 81mr1165845yba.53.1627625917145; Thu, 29 Jul 2021 23:18:37 -0700 (PDT) Date: Fri, 30 Jul 2021 14:18:30 +0800 Message-Id: <20210730061832.1927936-1-kyletso@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [PATCH v4 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 cover-letter is the same as that in v3 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 a 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 v3: usb: typec: tcpm: Support non-PD mode - commit msg updated - removed unnecessary empty lines - re-factored the code of reading device tree properties and the error handling - removed unnecessay variable initialization - modified the comments 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 | 87 +++++++++++++++---- 2 files changed, 72 insertions(+), 19 deletions(-) -- 2.32.0.554.ge1b32706d8-goog