Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp186779pxf; Thu, 8 Apr 2021 00:11:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRPtGjgguZIxjWuyAPzuQaVtCKjK+epm3XNjLWluuxdsz1CwUutWtXSlPc5RGKAv2a8rKr X-Received: by 2002:a63:5148:: with SMTP id r8mr6989110pgl.407.1617865859938; Thu, 08 Apr 2021 00:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617865859; cv=none; d=google.com; s=arc-20160816; b=0zUboIHbYxcSs+5whdZoI5sof8tdQVk2ZTq0FWBg8aR80NXNljlo/J+2JmaecB1oOQ T/5umJ4wQl7vNNXA3dGNe4WPOi5q/uKBu38tx+k6OKfcQYbGMvuNJAX2T47YX4stnSU1 nSnD8XcFSoL3dUO67giYgdYSK01+2tWPGZzvYxBFujeMX/U7tjieyH8qWZPm+G8r4npI lvORdXnp43ZgsFiv+x00/9Oi7VVZrA6NeQENshfr/QB/HEeLe5dO7f3Hk3AvqcD19qo1 7Bp/8IMjC3L/mxSV3iQfCN+rg999muDLdoX5Y00EndP2EuMOOYqgC9ukNMcag9OxlWW8 G2Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=UrGWiGKooYhtABd+pZSY7cE8urE4YGoy7mBlEXjsX7U=; b=bJzDOKjCnC8LB0dfjqQ+CCPyR8dxeP17Ye9HUK40hDqzHRvI1lHbPjgouvn3AFKNMa 3IepHQsku9yQBncvv2r7zSoXClgQV+vtbNP6nH2S2nuXwyhbOflnmYJfHS5pVXV2Gx97 xijgLXrvaojlVWPFDMEJZ3HIdz2AriQYeECoVSyrNQ77ajSaYWd1TWl4CoPs98HJ12AD VRtwUVNxmgxpvdJRtqoNC4ykGfvC+uvY1sWCPcD4BkTLGK2kPQ+sIA3YvyBS1Xs/l/aW q6EtGEiyOG8IcLDZzWQd5F3ItJk90RHfkp8E9ro3k7x5g9qiRhyTtMBJNdIMi8imUci9 N+IA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si31206328pgs.462.2021.04.08.00.10.47; Thu, 08 Apr 2021 00:10:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbhDHHKN (ORCPT + 99 others); Thu, 8 Apr 2021 03:10:13 -0400 Received: from mga11.intel.com ([192.55.52.93]:53177 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbhDHHKK (ORCPT ); Thu, 8 Apr 2021 03:10:10 -0400 IronPort-SDR: /TuYMs7M8N6vpQOPqY4fuFWWEDLLexc19rC1JaD5paiYA69P6/TRe2Nr1U8McPvGmZqHWTQBp7 D1ECadlVS6EA== X-IronPort-AV: E=McAfee;i="6000,8403,9947"; a="190271869" X-IronPort-AV: E=Sophos;i="5.82,205,1613462400"; d="scan'208";a="190271869" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2021 00:10:00 -0700 IronPort-SDR: tOzBnoNL/0LBoJOg9L8l6xsFJKJqpnYabAsM///bAwpBQJ1gsLBVeT6wVPNgstK84sSswIJaIr WxJFFSnEVT5g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,205,1613462400"; d="scan'208";a="519741633" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 08 Apr 2021 00:09:57 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Thu, 08 Apr 2021 10:09:56 +0300 Date: Thu, 8 Apr 2021 10:09:56 +0300 From: Heikki Krogerus To: Badhri Jagan Sridharan Cc: Guenter Roeck , Greg Kroah-Hartman , Rob Herring , Adam Thomson , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kyle Tso Subject: Re: [PATCH v2 3/6] usb: typec: tcpm: update power supply once partner accepts Message-ID: References: <20210407200723.1914388-1-badhri@google.com> <20210407200723.1914388-3-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407200723.1914388-3-badhri@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 07, 2021 at 01:07:20PM -0700, 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: Heikki Krogerus > --- > 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) > -- > 2.31.1.295.g9ea45b61b8-goog -- heikki