From patchwork Mon Nov 21 20:13:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prashant Malani X-Patchwork-Id: 2025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1814597wrr; Mon, 21 Nov 2022 12:25:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf71zgNmbmSoMWeRzbfFPcl1vEraeMGTlT7yiByD+AJrzudboLAbct8PxRr8ph6G53l7Xl6S X-Received: by 2002:a05:6a00:22ca:b0:56e:64c8:f222 with SMTP id f10-20020a056a0022ca00b0056e64c8f222mr22070367pfj.71.1669062353104; Mon, 21 Nov 2022 12:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669062353; cv=none; d=google.com; s=arc-20160816; b=Zepee7z3ZmjOrpHrfIWZ5WfBh5XZIBBvSgQESwqAsjz+INWVJm7EfXq5nnze5TgkUZ +b5qwqWU7Jc7yCjigsEz6MStx+Skqc3aymFcorCvN+GwPIbTt/yJI1IYS/iafBr2uJNX R95LsxFY9ozOvB9C82Qu0yaJHff7EMmG36sotD8uj+vEqyMGvzfR+E0W+Ola2cLrFnlM ahOKh20Xsns88Mf1xyXL2GVC+GH2Dw/6JbBjZnZic8dxFy1DAR6JL/h0OUOf6ofKI8xT UreZqZGxWMaPMI6Pm1SrwxpAdRrEBKXSEmn5qsn1yDOZSE6UYOUpqgSXzgPtyaJ1yAnp JWgA== 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 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.25.39; Mon, 21 Nov 2022 12:25:53 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750138726230013619?= X-GMAIL-MSGID: =?utf-8?q?1750138726230013619?= 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(-)