Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3983699pxf; Tue, 6 Apr 2021 05:23:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAGc1eaTcrgUWY6f816R2QSt2Ofp+f8kgCGU4mmV1tEQtgI6fhc3Acr+ONmD7t+MIPmzDB X-Received: by 2002:a92:3647:: with SMTP id d7mr24838491ilf.264.1617711821338; Tue, 06 Apr 2021 05:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617711821; cv=none; d=google.com; s=arc-20160816; b=CRqF+n91SIj2cKCg//2zpjUTriMk2XRNxooT0CP0oQpLC8a0JUV1aQRG6m/0QrrxIu CiGs9Txh0NfGjTlTSi8cgOa8kxW7jkNMfeW9nSctETAByBRsaQiO0tPOsWK1OYZuGv+o mYOJyZ1PYP/rIUSjFg9bHuD3Bq3l4kBIOvbCZrcvo6spVlv7Tk88KXezo6FJRO9HUejF SmtjwYuvcYQERZVVh1xBQgr6t792PChYyyeZ7HLqNFC++tAvuE9r1fMXCnBXqRHbJ7NP Hg15Zii1IEjm3xeDwGj6C0eCnlF/Wf1dMHlyVusSq2XTrk61N5r4n2lnWLkpQ4U3xyiU jEXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=cvyNyn0AhU638Wkw4TBWnN6NTcrgmnH1NtpieNpIcI4=; b=JBoSrZ07+iTFp+HEjCYs9m4v4pHBtQhjrhXGgRQS+9AzXUYBQItAbkNoaFGViXzy0D aUEcMrhwQFMM1dmS+V1FETNkF3FKJBH/rg7tzhc1vQIhuzkNorWHBvoBfz+OU/lXjolg r0YSvNherPVe2SvoMvxNi/QAyM581Fi+46Kcj6SAWaHnbZQZDAUa67eV45MgnQ3TUuy+ G9NWmdmHJvC+U6x00BKefDXqKZpDTsnpy/GbKp1mB6J9Pt/M3B9rerVQ1G1rXofB9UEa 88VDnp4wJ6D5GgTdGyOZRXqt3yrvfweJvnI+wgLxlM2FRgNO7aynIqkoIOFUoBlW4Jga 8hHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tXIkYEbG; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si201476jan.65.2021.04.06.05.23.28; Tue, 06 Apr 2021 05:23:41 -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=@google.com header.s=20161025 header.b=tXIkYEbG; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243147AbhDFBhL (ORCPT + 99 others); Mon, 5 Apr 2021 21:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243156AbhDFBhD (ORCPT ); Mon, 5 Apr 2021 21:37:03 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 510CEC06178C for ; Mon, 5 Apr 2021 18:36:55 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id k68so11600794qke.2 for ; Mon, 05 Apr 2021 18:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=cvyNyn0AhU638Wkw4TBWnN6NTcrgmnH1NtpieNpIcI4=; b=tXIkYEbGO/n1BZYcS+GPYrSQMVtJkUHdfjI17aMwRTMcKO//QrUMuz2quiVynWs+Wb uQDdk001jiLSuZr6u1vN05h33+6ffxKQTAq/6WNORnEuy8rHrxPg0eI/INEI9H2a89Px 0PjoFnkvnhQXeacWeUIpQBleU2iGcnJgC2+9n7bkZPFyyv/tlg/DLyOitrZIzlTuXCkd rBg4VFtwdTg1gFOdkMdqlul9lHEzNBbqsr8v7IdxiyiH+ghIzdGee9ahAlrqsN+By+J3 nH8CQzSJ2rUQ8xNnxKAMR5yyrLyJz8lRTVYc90rlTmOgJVXCaVoOxiqD4dXo8+CvcWuw klBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=cvyNyn0AhU638Wkw4TBWnN6NTcrgmnH1NtpieNpIcI4=; b=KbK5i74I76lQs6g+TdHpLyq28YrLpDM+HjtAMMz4pNJvZ8ib8vP3f+ofDJWIxIq+zQ 6h3iH9fDJOk1+DamEXJ7/l56RWmKMaZUTF/p6lxd2gmIWxDS2Ci2hkBoZVjus5bIChW+ J4KzdhJFBTcdKCpOT6hdv9dxWkk0JIPPjFTenZ3nxD+gK32PEZeg2pAAPjNcVs1lPX2Y 0Nrr/0lMaQH3JBG47iVm5GNXgDyfZJa79eDgVy8YoSBs605Pvdme/MY/ETP/3Pw+ouKW zqI84Z63y469GUMRrww+JjawoaJ+RBFEQVVbDMBfFwWxDlSbdvZnZFScLZRcUAemYddr ikpA== X-Gm-Message-State: AOAM530KVnVv7sbMhr3bPrWYPqL6FYpxnrAYWB4F8gIBUN2Vez3/yJfm n7kzApFsyZTB+Nfj9VxcB6t+r/tXAvo= X-Received: from badhri.mtv.corp.google.com ([2620:15c:211:201:7080:32f9:cd15:6178]) (user=badhri job=sendgmr) by 2002:a05:6214:d65:: with SMTP id 5mr26223249qvs.56.1617673014522; Mon, 05 Apr 2021 18:36:54 -0700 (PDT) Date: Mon, 5 Apr 2021 18:36:40 -0700 In-Reply-To: <20210406013643.3280369-1-badhri@google.com> Message-Id: <20210406013643.3280369-4-badhri@google.com> Mime-Version: 1.0 References: <20210406013643.3280369-1-badhri@google.com> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog Subject: [PATCH v1 3/6] usb: typec: tcpm: update power supply once partner accepts From: Badhri Jagan Sridharan To: Guenter Roeck , 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 , Badhri Jagan Sridharan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org power_supply_changed needs to be called to notify clients after the partner accepts the requested values for the pps case. Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply") Signed-off-by: Badhri Jagan Sridharan --- 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 d43774cc2ccf..7708b01009cb 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -2564,6 +2564,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: @@ -3132,7 +3133,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; @@ -3557,8 +3557,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.0.208.g409f899ff0-goog