From patchwork Tue Nov 22 22:05:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prashant Malani X-Patchwork-Id: 24603 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2462963wrr; Tue, 22 Nov 2022 14:11:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf7bda84YBuNPK8hd7iZyPGXq/Fsy9eykFPWZSmI1mhQHFxl4Ojts1rmrBF3SjMlu9DfVuDM X-Received: by 2002:a05:6a00:1d83:b0:56d:c342:ea5e with SMTP id z3-20020a056a001d8300b0056dc342ea5emr5914515pfw.71.1669155104473; Tue, 22 Nov 2022 14:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669155104; cv=none; d=google.com; s=arc-20160816; b=QcOLBblDS6XFm7KWVBzzLxkncFxuuWSyrnuJLWyWU8zJvMlfP8kqv7rxZwTC2Rsduz DYMO9ySR502OybfPoeJuFVnPXuIxzgjC9s+h3ZzWwINVriycmhhREcNrLhxwwEZCPX1Y S6TUmbpeZUx5o0dP6j/oUMzKiBW/1Ydez7Xr/5eRMZeyxMjUn0MycCx3rS2C3BGLodVf RjnECNIUZ3sAhfVkrukjj4cohCAIk+qUubrMjPVawwrZSGXFEmS5RI6G3WUySfbfmo22 J+Ky+u0zoHBo2SYIsci7X53QQxiqW3yv7eIdsgwbTKF3ONuLBobSasjzBcnK13tfsLX8 z/9Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G2cfSN1kgZzRzJ6XKptvh9cmk5InXjmHdGYFjwKt+CY=; b=F6Mq8LToXqRgmFxc5pDNe3TuBp8H6Yq9gvgKwlfcrYVfXWBZgAYFzdJqTGAcL9zoRi OsKFXVs1zQyVbRrgBpReu4+ugZZGammrdvYplrSjpje5CPkZtrO9mmtZzmWc2le46fip Sd/ugHOEXsMsNwLe3XO9Z30Yh55QAVUHHvX8DglNsyVuzsBYYrOnJsFsjmDPlhfF5gYU zMLh2YXmfqiD1C7lklScCdfgsg82XLppyFdmGlRGkZ0VBcnzo1a1NbzlRtdhvwArc0qN oTpD0NOpbtSAuq1VkXeSkJZzu7YoN1zRBcrrEpBpqNL96oae2PjHeg/takwdw7bl43uf ddow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Gf538M7G; 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 a9-20020a631a49000000b004611cfaca6asi14715701pgm.381.2022.11.22.14.11.10; Tue, 22 Nov 2022 14:11:44 -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=Gf538M7G; 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 S234817AbiKVWGc (ORCPT + 99 others); Tue, 22 Nov 2022 17:06:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235156AbiKVWGS (ORCPT ); Tue, 22 Nov 2022 17:06:18 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36AFFC7212 for ; Tue, 22 Nov 2022 14:06:17 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id v28so15607581pfi.12 for ; Tue, 22 Nov 2022 14:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G2cfSN1kgZzRzJ6XKptvh9cmk5InXjmHdGYFjwKt+CY=; b=Gf538M7G4fwP+edrCEnC1Y2/ZGyZwVr9nyc+6qCo64Sw5Ip01KNmQoCWjbabYRgX0Q e1bqKvuoxHFYptZnI1X7utko1R5diccxqKmhigd6cixmgSnesF/kGYZ4QnN8BftRlN0Q e++I4Ob8oO8dtXbSw0sP5PdtW7aJEzEVZYAII= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G2cfSN1kgZzRzJ6XKptvh9cmk5InXjmHdGYFjwKt+CY=; b=yZq5YJbA+UCedYHv0/ae5bqx1azk5ASb6Lx1URe+OR4ean9ZVH5yRBZQbRwMIE4VnD pUZl/lS43am4K7a9EMqqMQDVwiw/OFJNZiEne9oapjxelgYKOvMbGzsFIe2KRQg4CNlF yVReXYMNo8SKH3/yHN6nZO3G2c9KwtC+DEwXbkyEXjr8q28/vCo6thSZuNqPNu9OBG8u +Rph7zY3AOfs8n95QIUHZt6hKSWmLW0kJ0/Kx/MhdEx8Vl3Q7wbYsXK0+YvMgZoUs3ZF gdbMublWZ58qg0DGrJTiWRpq97UajIWXCkGCXAJAKkb8nKxBzRme8I/oUMIhx5BFfDBl CzUw== X-Gm-Message-State: ANoB5pno06eJXCJo9ZORX0WOxUyOy+cI94ceAh4nD1eZ8LUBdG9pPPOM 37G1NCP2rwJETx4Zz5vCnOFxmEPuHL6Y3g== X-Received: by 2002:a63:5724:0:b0:46f:9c0c:8674 with SMTP id l36-20020a635724000000b0046f9c0c8674mr7692092pgb.26.1669154777162; Tue, 22 Nov 2022 14:06:17 -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 i24-20020a63e458000000b0042988a04bfdsm9640497pgk.9.2022.11.22.14.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 14:06:16 -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 , Heikki Krogerus , Greg Kroah-Hartman , Guenter Roeck Subject: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Set parent of partner PD object Date: Tue, 22 Nov 2022 22:05:37 +0000 Message-Id: <20221122220538.2991775-3-pmalani@chromium.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog In-Reply-To: <20221122220538.2991775-1-pmalani@chromium.org> References: <20221122220538.2991775-1-pmalani@chromium.org> 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?1750235982622714392?= X-GMAIL-MSGID: =?utf-8?q?1750235982622714392?= In order to tell what Type-C device a PD object belongs to, its parent needs to be set. Use the Type-C partner USB PD registration wrapper to set the parent appropriately for PD objects which are created for connected Type-C partners. Cc: Benson Leung Cc: Heikki Krogerus Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus --- Changes since v1: - Use wrapper function introduced in Patch1 (v2). - Update commit message to reflect that we are using the wrapper. drivers/platform/chrome/cros_ec_typec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 2a7ff14dc37e..d5bc4021aca2 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -968,7 +968,7 @@ static void cros_typec_register_partner_pdos(struct cros_typec_data *typec, if (!resp->source_cap_count && !resp->sink_cap_count) return; - port->partner_pd = usb_power_delivery_register(NULL, &desc); + port->partner_pd = typec_partner_usb_power_delivery_register(port->partner, &desc); if (IS_ERR(port->partner_pd)) { dev_warn(typec->dev, "Failed to register partner PD device, port: %d\n", port_num); return;