Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4023613pxb; Mon, 1 Feb 2021 10:22:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8C0aHV5VePeYWtTVroM3cD2IOVPS9RclU6TYTGxNyHY0QXJPX6p3hKJIQJBawaTKv1WYz X-Received: by 2002:a05:6402:1051:: with SMTP id e17mr1696033edu.245.1612203735431; Mon, 01 Feb 2021 10:22:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612203735; cv=none; d=google.com; s=arc-20160816; b=bkHF7eoVnqK6+JulvUtb9iQ7V/rThkQAtTPfR1/SM0P0f9b2HB5NjXMspgd2oMzzOH am2uEaKlNp3WVmK6P6TooClX6fKt0Eh4Y1sCUg6utFC+Kvyc0Y4+CI1BdYMmrJTN5OOh 52XIOtbqYXjNwtSyRDfM/MIU/4Hhe1VZ3kWo9JWRU/ZB5f4TgYiVAv+P6H9P8CaL8CVr JU7U3Tf5sV6ItEkx5K9vg8YiN20fvOXuyJIf1PrAd2VgYKubs5AtZixFBID3kemqjguL /V6Js9jStHHawlMlTQwmfx+E5Mxe6ueVYj6hyCz6K0+/3F4dlrc++kcbSLP5zjnvilPw zSnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XixCKUy2/OqgDPmJAwVjEUqW79YeMw3WEZYQtp4ikuo=; b=VNEtSU2mkwrCajxD5TK9W+8ex44uN66c8maOt8xG325fS3mK99mjGpkduuJxTUU4Dk eykr39RmkANoj63UPY4USLuxZoG7Qq/sn6XKYwLylo5LWR4uGvQ02dyi5YAszBMwuRNo VH2PrHNF9DcC1wwWFyzUsMaSBwpLSeXbHNPIb52srmZy5oxx+c4ieUMUA0ss11Ivb2RX s4gO5jN80A9Wv+rsgUcujmjCedUEYCTlbzllJbype64C0hbR2UmqZ5Hfsyq2l3MhPwWC P+cxeTF3JuIGnmmbVqPHvr+B6EkzUxJw6YcTKlx3CX4GwJNK8j00BpQ458XCrz133yuG X+eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QDdu2QmB; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf2si11947528ejb.154.2021.02.01.10.21.45; Mon, 01 Feb 2021 10:22:15 -0800 (PST) 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=@chromium.org header.s=google header.b=QDdu2QmB; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232366AbhBASUm (ORCPT + 99 others); Mon, 1 Feb 2021 13:20:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232336AbhBASPl (ORCPT ); Mon, 1 Feb 2021 13:15:41 -0500 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C4FAC061756 for ; Mon, 1 Feb 2021 10:15:22 -0800 (PST) Received: by mail-qv1-xf34.google.com with SMTP id u16so8589889qvo.9 for ; Mon, 01 Feb 2021 10:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XixCKUy2/OqgDPmJAwVjEUqW79YeMw3WEZYQtp4ikuo=; b=QDdu2QmB9mSkqHqWc0ogevcy7vOT7VQEIsx3WeNYhg04V9/wTz8YXY4ySJkCaN5eef i0vFlgRoT4Duz45k2ZxVW5TgqBBup6BmTrvvVpMiaEcmz3AEtNjpdtu7H4s6x+MBb4WO pyEka/KSJh0hKkLoU3dsDHe0MM3Th7eG5qJJI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XixCKUy2/OqgDPmJAwVjEUqW79YeMw3WEZYQtp4ikuo=; b=HVbjHkJ5NXbu0nu1P48t099A42lf6eOy6GCieE312wJnUBZKbpPZoGWb6Q0WnEb8qU Qa+tn2hcyKAUAzNDerkEXf2j2lRp0bDf4cfZSGNGqcMT80ReabxY2347A0Ky6mdHm/kJ QCd+6PH2pxoWkZfPvbkibRI8W8ij9RSmaqS9PtrjMOlnwLJNtvfHWcvkoDLzB4uJJVIQ d3L17YsBx62AU48qvAKx0dYRBo1qzLcCt/o6NpAKBCc3eV6DL/xUGASbjTRdo6iAHPUl Uc7V7gh1RynpOnR5QanAwiO5Rka23NGXSUWrvhQEsgZsNwF4eaUaTHQC4jiNrbqAbZqP o0kg== X-Gm-Message-State: AOAM533bfiEbTH/xXARBWmLXvtCC3/2NaNOHKlZekPSb3ojeArpY/F+c LV9zdt6JiCTVQHl2RlZb8qDj1fYGtU2VjfXUx14OHxun/04= X-Received: by 2002:ad4:4e8a:: with SMTP id dy10mr16589132qvb.36.1612203321657; Mon, 01 Feb 2021 10:15:21 -0800 (PST) MIME-Version: 1.0 References: <20210129061406.2680146-1-bleung@chromium.org> <20210129061406.2680146-7-bleung@chromium.org> In-Reply-To: <20210129061406.2680146-7-bleung@chromium.org> From: Prashant Malani Date: Mon, 1 Feb 2021 10:15:09 -0800 Message-ID: Subject: Re: [PATCH 6/6] platform/chrome: cros_ec_typec: Set opmode to PD on SOP connected To: Benson Leung Cc: Heikki Krogerus , Enric Balletbo i Serra , Greg Kroah-Hartman , "open list:USB NETWORKING DRIVERS" , Linux Kernel Mailing List , Guenter Roeck , Benson Leung Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 28, 2021 at 10:14 PM Benson Leung wrote: > > When SOP Discovery is done, set the opmode to PD if status indicates > SOP is connected. > > SOP connected indicates a PD contract is in place, and is a solid > indication we have transitioned to PD power negotiation, either as > source or sink. > > Signed-off-by: Benson Leung Reviewed-by: Prashant Malani > --- > drivers/platform/chrome/cros_ec_typec.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c > index 6bc6fafd54a4..a7778258d0a0 100644 > --- a/drivers/platform/chrome/cros_ec_typec.c > +++ b/drivers/platform/chrome/cros_ec_typec.c > @@ -900,6 +900,9 @@ static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num > dev_err(typec->dev, "Couldn't parse SOP Disc data, port: %d\n", port_num); > else > typec->ports[port_num]->sop_disc_done = true; > + > + if (resp.sop_connected) > + typec_set_pwr_opmode(typec->ports[port_num]->port, TYPEC_PWR_MODE_PD); > } > > if (resp.events & PD_STATUS_EVENT_SOP_PRIME_DISC_DONE && > -- > 2.30.0.365.g02bc693789-goog >