Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4825956rwb; Mon, 21 Nov 2022 12:26:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5n1VlXJ6aBBhPuhsHAQbWL+BMj8GY/UtTTzNOlBiRtu9PElC1Y5tuE8k1FLsUJIhdMqHbE X-Received: by 2002:a63:411:0:b0:46f:f4c1:7d34 with SMTP id 17-20020a630411000000b0046ff4c17d34mr1737652pge.75.1669062393572; Mon, 21 Nov 2022 12:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669062393; cv=none; d=google.com; s=arc-20160816; b=JtdCKxglqmEWhFZ79KOH8TrHSGzNORmGO7HgTs3ej1D+sEpjlBhAJqA7Z1lABC7hhN SYQKWWqSq0KG9yXzScoLvlWMopjnMc5SVYAQzOJU1WulKZKMTAUJvD76PnxPfofO14c3 +qTSucdHu6qcOJUz3f8CdDpqsTAO4r8z48JSwkcVhgpp5XhpDIucre6oRzH3XT0iLnvX Wl7vZFyKfrhpx6ONWFtnq3UaG9KRcSyWbMzJ5aGNy7CkU10snwDXe0jkTIuaEUYJlVN5 wJTGGn1v5ufHz/PDxDXjCTGmn19nRffrcMcd/wB7GxgEI9HVssEQgxd6xZkp9OIKgFqO qRPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rq8a2hBX27gcIVHpejpVIZL+hRyBNLYkb+s20L9WV6w=; b=TdTDwn0Re0udcKuDU6F+zHFlKrbYxqknfLMjiAv3Ao33Az1CuOyEVVeL5dph9knm2g m/v6lQcVYVXfJ7zjlHRz6XzUEHeQiQ3MSBPDk2WgpQ4aH/zuGLKzEkshttXJ55rkZMxi d9uaSsVTotOxOFnkiYziYMVbmC6j1Tzu0cBpsXPrOdXxF0L73VLJC46f1mh2G9Rzpf1n 0ghXH9pfp81Qxt+MkZYfiWms/xp8HyBTpjzm8zpUR/Wfqvd3wWRgYN78dcwx+AR8iSOY dEKp24xflOtc7UVZEdb9RTbme/kxnN5rT0+rBA/5oXCTDc0bu1typoFlZFWLiifWQ5gl Xzpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SqLgfLqL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p36-20020a635b24000000b00476d73d3a98si10698024pgb.510.2022.11.21.12.26.22; Mon, 21 Nov 2022 12:26:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SqLgfLqL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbiKUUNy (ORCPT + 91 others); Mon, 21 Nov 2022 15:13:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbiKUUNv (ORCPT ); Mon, 21 Nov 2022 15:13:51 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E07A65133F for ; Mon, 21 Nov 2022 12:13:50 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id y13so12339058pfp.7 for ; Mon, 21 Nov 2022 12:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rq8a2hBX27gcIVHpejpVIZL+hRyBNLYkb+s20L9WV6w=; b=SqLgfLqLWXgmjXhNGZIU6mAMHlKkjWNnbCRUg8OpME4ixk3GEFZq7BLXUUt/sx7273 Nyn6a1zF1thpfbom4ap6EMprRGQurZhAatGX3dXHNO7toAEL3nX138lfDoG5XWZeQdSb HvfdpU8SAyxIFn8FvQ/ZGAFJM1tWhTDOEZ2SA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rq8a2hBX27gcIVHpejpVIZL+hRyBNLYkb+s20L9WV6w=; b=iCu+kmr96iL02xEgD5X+Zyz9y9+jmNDIzLvGf+3QkO/beCtx0Q+QqQy8ajL+yQUsy3 rSutive+BH+fK0Kjb01Z3DfyyPbQ6NfyJJ+0CJ6Nvzl7LGlHu6N+3JiPlW4E4pscRaXo LIQrN8nk1LMJa326fEoXc4FxBScGX3webSqEDfni/rmRXwg7NahAGcJYJkyCkPnciiUy ZPHRT2W5lMGRvo4Ryod3UnIGUJrCIVDylEBQDGuoMoBuRHlntr82oOzpaELiU+2/Ti3R FugNcMjD0+1fBAb6prCJubUoTem3+m5bHlTdH/H9KH6T1RojCKqjYGCOREAj8kaF7rp9 yPTA== X-Gm-Message-State: ANoB5pnxNTPKxaciL9urkQMl8RhqdaowRs2nHcvNFvO3NS5b1WPl6ktE l1lfx0hexMM9OfFRwqWLTBEbLYV8iTWdqg== X-Received: by 2002:aa7:9057:0:b0:573:1d31:2b78 with SMTP id n23-20020aa79057000000b005731d312b78mr2662956pfo.61.1669061630232; Mon, 21 Nov 2022 12:13:50 -0800 (PST) Received: from pmalani.c.googlers.com.com (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id h8-20020a170902f70800b001822121c45asm10178507plo.28.2022.11.21.12.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 12:13:49 -0800 (PST) From: Prashant Malani To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev Cc: Prashant Malani , Benson Leung , Greg Kroah-Hartman , Guenter Roeck , Heikki Krogerus Subject: [PATCH 0/2] platform/chrome: cros_ec_typec: Link PD object to partner Date: Mon, 21 Nov 2022 20:13:34 +0000 Message-Id: <20221121201337.2772216-1-pmalani@chromium.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a short series to link a registered USB PD object to its associated partner device. This is helpful for userspace services (the ChromeOS Type-C daemon, for example), to identify which Type-C peripheral a PD object belongs to, when a uevent for the PD object arrives. The first patch adds a helper to the Type-C class code to access the device struct for a partner. The second patch uses that helper to set the parent for the USB PD object in the port driver code. There was an earlier patch[1] to solve this issue, but it's been jettisoned (on advice from GregKH) in favor of the current approach. [1] https://lore.kernel.org/linux-usb/Y3vNZEuNI3CWzZ0L@chromium.org/T/#m7521020f64d878313d7dd79903ec0e9421aa8737 Series submission suggestions (if the approach is OK): - Patch 1 goes throug the USB tree and Patch 2 goes in the next release cycle through the chrome-platform tree. - Patch 1 and 2 both go through the USB tree. Prashant Malani (2): usb: typec: Add helper to get partner device struct platform/chrome: cros_ec_typec: Set parent of partner PD object drivers/platform/chrome/cros_ec_typec.c | 2 +- drivers/usb/typec/class.c | 13 +++++++++++++ include/linux/usb/typec.h | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) -- 2.38.1.584.g0f3c55d4c2-goog