Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp87163pxb; Fri, 9 Apr 2021 19:12:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynJVxuwikPD2K6odcmwTsA/6KLrkza3ei+kyv/ff14yKgVWCFM1HPBzfFceAJmVL2/MNqm X-Received: by 2002:a17:902:9f8f:b029:e9:944d:ea99 with SMTP id g15-20020a1709029f8fb02900e9944dea99mr10277079plq.45.1618020721981; Fri, 09 Apr 2021 19:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618020721; cv=none; d=google.com; s=arc-20160816; b=txJWi2ibCVoohKrirL0iva4JS0Qh/Yh150WE1P+9NDsFjZm1xCijnUJBTslKPMwjLk wL+uwJhL7KokH4qKpSTWHxrM17x3Sf9JeC+4eG18qmOMaTHbiNnS6tVGvtHSXYs9a6po HpjzMxORoOHth7GD+MiI2mJKwXfbjAiau4yDCvwl+bPJe6Jd3jby0lwLeGfvhJevPAcE jQSoGD0KdpahZA78iLaw6OH5BWnCQJOJanTnsRfqIZ+R0G6dmMY4R2cqI+fI6Ri0Rq8C 0PWcR5ARwWZqxHW9dOGp3rv6EPdjgy8ijKMC4n4tp5OCo+J1DG5K/fPie3TA05GBgBhx wwGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:sender:dkim-signature; bh=U6rrQYM/aOdKxNAkVD70+rijED5KTHaV9oJ+WzRmtd8=; b=DI9Ph0uJwGDl74ofP1iy7W+lfvCiq5o4/2Pj1tevCdEjFb7VfKzO1xVYoWbfrEKmad AlH430C6Mc7Qeob4Fk5QK1TgmS8b9kAj1impi5UbNvTMQPgDfjTvGpGfMTzh/fHVTxUv hZWf4xyYb4oJNXotwKudPW5YEFNpDErZrJzISKgNpxmpd5cZOWE3+eP8ydUpP+tE/5YR qJHgKmByA4GUqwCMNio1ifnIgzEpRmRPdnBgKBiqSxN5k5W+ldTpw2J2bDrMdFBYfmLU yE7CHsfrRZJksyLsGh+oay4V2kTHUhgUVLRn930yLZHcMcT6ZCA0tzxUWD3AZWCQttpP CgRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ebQYER2l; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si4508569pfu.135.2021.04.09.19.11.49; Fri, 09 Apr 2021 19:12:01 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=ebQYER2l; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233957AbhDJCKr (ORCPT + 99 others); Fri, 9 Apr 2021 22:10:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbhDJCKp (ORCPT ); Fri, 9 Apr 2021 22:10:45 -0400 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85EC5C061762; Fri, 9 Apr 2021 19:10:31 -0700 (PDT) Received: by mail-ot1-x32e.google.com with SMTP id w21-20020a9d63950000b02901ce7b8c45b4so7523556otk.5; Fri, 09 Apr 2021 19:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=U6rrQYM/aOdKxNAkVD70+rijED5KTHaV9oJ+WzRmtd8=; b=ebQYER2lUaG5KMvGP6KcfeGZcPCPZrjbd3TTIlcuaQIHq9KuMf7kyZi8TNNN7EDoli CsJLspd7F/qBL97TfkBpJCQkyDJSIY9F26QzwQbVGdlwNcjg2XAJknSMjsmxSN6bjbme kG0raX4tlHl+am77BxYl/yp6B60MQW7AtC9oDs9HsOfhO/o3/pYCjS49g3vutW0qnP9z hlPAZGNOC3csH/BxTsRopOSm76/UgPZdvj0U4zkFsQTGg3jaEPycpzPNNjTiLNpqKFm0 jqoeSt3P2V1zPeVf6XTEEWzRYx2Zm0sYij8jh7uvF6XISyLbdUadQw3YMXdx0fc3epUD EnOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=U6rrQYM/aOdKxNAkVD70+rijED5KTHaV9oJ+WzRmtd8=; b=p3fgK7G40TNGsLdAqXcqJ1zNHWmEH5oZn7jrj3qgk4eM2LOPoSYWX1gN7rY9aEES// gBGfEbxwKVrI/sFJ9Od0/3L9oH4tPfWXOsQKpbhWVcVLu7V6O6ovigiwz0SN7oJYXxfG gN9KUTxyAuBcFWwxrKaueUmXG8iQ32JLi8tanwFP4tGr2mQx9PCD3wqmsp36TWXokAmB MihPhA1dsTbvBc9JtOPQdOGLThZTE6z9eJE0GigmGbbVKkrrHNYrtjwTo+l2M60v0MNG v21F1JFZ7558Wd37zSSClFNkMA2iDFqg9nB3Kp10GAk4M2AGWZEfRp2mgtkhP/SHR3yO K8bQ== X-Gm-Message-State: AOAM533Nqhti65xjfh1NCVtsg6jrIK4/9GjW4hZZfhGJk0z5erLVAAFb 7D5WeFTNIdsMjdXkcQG8+dPTizk+e3M= X-Received: by 2002:a9d:4816:: with SMTP id c22mr14203394otf.144.1618020630994; Fri, 09 Apr 2021 19:10:30 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 103sm596479otj.41.2021.04.09.19.10.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Apr 2021 19:10:30 -0700 (PDT) Sender: Guenter Roeck Subject: Re: [PATCH v2 3/6] usb: typec: tcpm: update power supply once partner accepts To: Badhri Jagan Sridharan , Heikki Krogerus , Greg Kroah-Hartman , Rob Herring , Adam Thomson Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kyle Tso References: <20210407200723.1914388-1-badhri@google.com> <20210407200723.1914388-3-badhri@google.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkK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LXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <747ab19f-39f3-e065-c01f-bf8ea0650e02@roeck-us.net> Date: Fri, 9 Apr 2021 19:10:28 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210407200723.1914388-3-badhri@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/7/21 1:07 PM, Badhri Jagan Sridharan wrote: > power_supply_changed needs to be called to notify clients > after the partner accepts the requested values for the pps > case. > > Also, remove the redundant power_supply_changed at the end > of the tcpm_reset_port as power_supply_changed is already > called right after usb_type is changed. > > Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") > Signed-off-by: Badhri Jagan Sridharan > Reviewed-by: Adam Thomson Reviewed-by: Guenter Roeck > --- > Changes since V1: > * Updated commit description to clarify Guenter Roeck's concern. > * Added Reviewed-by tags > --- > drivers/usb/typec/tcpm/tcpm.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index b4a40099d7e9..d1d03ee90d8f 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -2568,6 +2568,7 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port, > port->pps_data.max_curr = port->pps_data.req_max_curr; > port->req_supply_voltage = port->pps_data.req_out_volt; > port->req_current_limit = port->pps_data.req_op_curr; > + power_supply_changed(port->psy); > tcpm_set_state(port, SNK_TRANSITION_SINK, 0); > break; > case SOFT_RESET_SEND: > @@ -3136,7 +3137,6 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port) > port->pps_data.req_out_volt)); > port->pps_data.req_op_curr = min(port->pps_data.max_curr, > port->pps_data.req_op_curr); > - power_supply_changed(port->psy); > } > > return src_pdo; > @@ -3561,8 +3561,6 @@ static void tcpm_reset_port(struct tcpm_port *port) > port->sink_cap_done = false; > if (port->tcpc->enable_frs) > port->tcpc->enable_frs(port->tcpc, false); > - > - power_supply_changed(port->psy); > } > > static void tcpm_detach(struct tcpm_port *port) >