Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2862054rdb; Mon, 4 Dec 2023 09:23:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBta88MHFdFT4pzyK1c3/IjB3f2ZI9JFhdwCaUdsi5OIfPQRbBkTNUgSZ8wIFRXj1SJtq7 X-Received: by 2002:a92:520c:0:b0:35d:59a2:1279 with SMTP id g12-20020a92520c000000b0035d59a21279mr6849570ilb.37.1701710602625; Mon, 04 Dec 2023 09:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701710602; cv=none; d=google.com; s=arc-20160816; b=Ni03ex/DeaElP3OyrEnSMVtQEc+hkCWFRzv0RuuTZqWWcsKMzDIYGFeg7/hL+EQi17 fY0qEcDxQ1r0F+7qqKvtWFolwRo9K1rO97Z0cYvHmSSCNy8a07I8LxMql5UnZx6vGc6s t1NndcvYxoCKm4ei6arRy3xNZqNh1SpRqCGu3THzsOS0bIvqGYOOM76p943kSD+VlLCf ceksvkxn9FnMopRV2jsu1X8yFCA6c6qlNuUMn66FTdGmurdRIS5M4+3wO9UOGvpHClmI C8+bPuBrVXh2/ZVgyPJoTD0gluuFBQy19YzpEdRLXcvsQHFsuMhmZp2KK3qJ8S8S+CFP o5RQ== 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:message-id:mime-version:date :dkim-signature; bh=eYIlLpg3I1S2/DCODhdXuDSdzzNMxHCkGt3W+wzu1dA=; fh=gdvDTN+Cm+9LzcJd/caAKD4T07XKqXeUTdaNaPhPksY=; b=Dxf6LHjRNPf3d6h37VNxosWo1GeXahONXFJI+BMoFpT5xuWeVUFnuNnwhxU7RW3pmh evKhwuYtLluCBYgegppj9gxCXfKQrarFJ7lZ8ChhaXlIhPsU0WCabNmBEdgIJtdOt0Gk a/9hIgfnn0LA0FboWPvgKBMjkyoUrpN7RH2+cBVUZrVExHu1cMwz4l13Qsy5QeaefU/U v2Vr3JqmwCg/F5OudyUg8dUz0nj3G5RP8l2iZBEtxoKXgQqRNa2598R8pP3Y19GflrQ4 lRjHcXYcDebIi5+6etVEBfs1HoogN8w60VNvLzz7mW6HwtLM4nRlOtdE30TFhCHtCIHM IVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=icikd9uC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f27-20020a631f1b000000b005b9519d9e3esi2630124pgf.242.2023.12.04.09.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 09:23:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=icikd9uC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 41B3780BDE39; Mon, 4 Dec 2023 09:23:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234959AbjLDRWw (ORCPT + 99 others); Mon, 4 Dec 2023 12:22:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234829AbjLDRWu (ORCPT ); Mon, 4 Dec 2023 12:22:50 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2188109 for ; Mon, 4 Dec 2023 09:22:55 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5ca61d84dc3so62571257b3.0 for ; Mon, 04 Dec 2023 09:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701710575; x=1702315375; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=eYIlLpg3I1S2/DCODhdXuDSdzzNMxHCkGt3W+wzu1dA=; b=icikd9uCz+CQdn/q1kJ8HmrgcZeu8w4F5BJfUq6km+1YOsZRTaBfvXFmJkf8o4NEv3 rxXYqOa09Rg+SZSplEWPWW22ET4qK8t3QMdDuSDFBNHAOlbyhFuOq7BFWpH5Ri0jxlv3 BaD9AeG3pt1dtilxLDl/vBTGGqQ/Zd2brQsVnRh/en1hjEE6yoXJh04+74Ct1pOUZTwb brkB3ywLKnpBsHNeUvQfXcn6W/0surWidQ3lDDzrbxaVjSJHB8HI0MbGL1R9TEsg+tIp 8ZxWFz9S9dYWW/mbnynP58o4mBq6WptV4sBTEalP89xeyfOB+kbWwr70ombkrE+yOsix CMvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701710575; x=1702315375; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eYIlLpg3I1S2/DCODhdXuDSdzzNMxHCkGt3W+wzu1dA=; b=U5nnKgykknZdzNAqpAxTJefDoM5L8xCXgdmDbX9zmszzwMvEhnTEEPsmU10Xno6k9Y ZP3j0pN/EuxU1I+w/hhezGH6pplrOV9qrTYitAwLHW5kTZtpGD6fjZhIv/Pj3t8jKUEx c8Zq3UVQIPuB0AetHwX032a3p1WzZ5XWvrB1W8tVucUk/XG0kBgbviQBW/3p95oDlzKA +U+P8+yH6vhzpHgaEbgyIHMIFK9yNYaEwqJBkAubzfIkffwDZFh2Gg5YJuYGMHDcRgNW hj/BP7YKwPjY3WMKIpknM/jH2lVYA50I3JFIW2ii2+PqNY+XU5Wwbylq760gL+kzO03z T16g== X-Gm-Message-State: AOJu0YwI9sUJh+jz7FkTuOGpBD7qSJ4NeJSyk458OkoJ4TgAxJWruaSg qcvOyTvw5UopOj07vSDcBrYZKtz9qzM4 X-Received: from kyletso-p620lin01.ntc.corp.google.com ([2401:fa00:fc:202:ac51:a57:5e72:a957]) (user=kyletso job=sendgmr) by 2002:a05:690c:300d:b0:5d3:a348:b0b7 with SMTP id ey13-20020a05690c300d00b005d3a348b0b7mr315708ywb.7.1701710575070; Mon, 04 Dec 2023 09:22:55 -0800 (PST) Date: Tue, 5 Dec 2023 01:22:45 +0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog Message-ID: <20231204172247.1087152-1-kyletso@google.com> Subject: [PATCH v4 0/2] mutiple selectable capabilities in tcpm From: Kyle Tso To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org Cc: badhri@google.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Kyle Tso Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 09:23:20 -0800 (PST) updates in v4 dt-bindings: connector: Add child nodes for multiple PD capabilities - Modified the structure as corrected in v2 - Modified the commit message usb: typec: tcpm: Support multiple capabilities - no change --- updates in v3 dt-bindings: connector: Add child nodes for multiple PD capabilities - Updated the commit message - Remain unchanged for the comments about the property/node refactor usb: typec: tcpm: Support multiple capabilities - Changed the error handling and the usage of the APIs - Updated the commit message --- updates in v2 dt-bindings: connector: Add child nodes for multiple PD capabilities - revised the dt-bindings usb: typec: tcpm: Support multiple capabilities - Added missing cleanups in the function tcpm_port_unregister_pd --- Original cover letter: In commit a7cff92f0635 ("usb: typec: USB Power Delivery helpers for ports and partners"), typec_operations has two new ops .pd_get and .pd_set providing selection of different PD capabilities. This commit implements these two ops in tcpm. To support multiple capabilities, new dt-binding properties need to be defined to create a tree structure for the driver to get each set of capabilities one by one. The first tier of the child node under connector is called "capabilities". Under this child node lies several 2nd tier of child nodes whose names are in the pattern of ^caps[0-9]+$. And the source and sink capabilities are placed in these nodes. Kyle Tso (2): dt-bindings: connector: Add child nodes for multiple PD capabilities usb: typec: tcpm: Support multiple capabilities .../bindings/connector/usb-connector.yaml | 78 ++-- drivers/usb/typec/tcpm/tcpm.c | 389 ++++++++++++++---- 2 files changed, 352 insertions(+), 115 deletions(-) -- 2.43.0.rc2.451.g8631bc7472-goog