Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3893819pxb; Tue, 10 Nov 2020 02:52:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNUuVNSsKzaffxm3dNa6l3LNbwBRuIq8I5/yrvDrtc0RMwcB837F6v9zUgJoQ1XBaHcCFH X-Received: by 2002:a50:d2c5:: with SMTP id q5mr20357073edg.158.1605005556581; Tue, 10 Nov 2020 02:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605005556; cv=none; d=google.com; s=arc-20160816; b=ysRSWgSAmqjyoeP5IykBqBdo8g/oLHYNzy1NM3Gb2Wgog0sa7tJwNMXi9GuwVl9pr6 wUFwQLemzmqszgoed0EeW9+bYM41r9uU8FnZcovV51OmZEjePAxRBVRXcZUTglH6nSDB yPEuTc3q8pA9yENJlud4E4Fjyp7Piz5MkKApIq1kYHVft8LGgFpOuAxTP9G4RYiLPsXV sXvbPHV+06ISpYzuJKHL2MtQ9sB5Xax77FfpX66RsTGMYkZnevjVRzmWzfl40iZ7q+vu WQ9GIh50w6kFhTRFcZMelD1WX72/EOYQPw/RqIwcCxM3+QVV/E/AyucyArXyolyXZoKP HuJA== 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=MaeRii9f5puRWp362VT5DoPLZhhhSXWIx7THXIZQvXQ=; b=Iv7uOW8IPCqo97brmN9mieMpnvJUIF74nhsg0brAJfi65BVYDLXFGUgexIMM026m59 LIOksgEH1PZRA4UWFrpT+ja9c1jDVn8WOc9wmVgxpuM2yw1EhimIMtruTu9Hdvk3SOKu 1lxF6W+iLlx2jYNsebdFTUi2AljmOJLyVEsHMKrZnC1H0m+ZSWrTvDL4PQCjsQIEKm8Z tBR4aSBxmeVOjrdn1f4CtwzO0fI3LXvQUQrZBa1M4Qk3+MfcvW4dJckgaMnZSA0MnsPU bZ2rrrQQhL+nOYCGEjAtmweu2bTc6r7T6lmyOxUBlLbOMglB9XNpQ0/i7oDH/sVb8Q03 L7lw== 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 i2si8792597ejs.498.2020.11.10.02.52.14; Tue, 10 Nov 2020 02:52:36 -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; 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 S1731017AbgKJKuT (ORCPT + 99 others); Tue, 10 Nov 2020 05:50:19 -0500 Received: from mga04.intel.com ([192.55.52.120]:5635 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730751AbgKJKuT (ORCPT ); Tue, 10 Nov 2020 05:50:19 -0500 IronPort-SDR: F6ozJGXUHb8OME3pEgKX7c3SqtaAl1i02/XeUyxJy+bIpblflpMTr7wVL8aO+HdysEiMbTzi5I RR4en+AU5HQw== X-IronPort-AV: E=McAfee;i="6000,8403,9800"; a="167369971" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="167369971" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 02:50:19 -0800 IronPort-SDR: R4mRClaaVexvWM8Xzc9bwEJH8ERSXmXlauViygka+H/aSC/OWKd7d1O6fNbREzsz+WhyXKj+AS yv0P6qjVIo0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="428325868" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 10 Nov 2020 02:50:16 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 10 Nov 2020 12:50:15 +0200 Date: Tue, 10 Nov 2020 12:50:15 +0200 From: Heikki Krogerus To: Prashant Malani Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, Benson Leung , Enric Balletbo i Serra , Guenter Roeck Subject: Re: [PATCH v2 2/2] platform/chrome: cros_ec_typec: Set partner num_altmodes Message-ID: <20201110105015.GF1224435@kuha.fi.intel.com> References: <20201110061535.2163599-1-pmalani@chromium.org> <20201110061535.2163599-2-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201110061535.2163599-2-pmalani@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 09, 2020 at 10:15:36PM -0800, Prashant Malani wrote: > Set the number of altmodes available for a registered partner using the > Type C connector class framework routine. > > Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus > --- > > Changes in v2: > - Patch introduced for the first time in v2. > > drivers/platform/chrome/cros_ec_typec.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c > index ce031a10eb1b..743a28426f98 100644 > --- a/drivers/platform/chrome/cros_ec_typec.c > +++ b/drivers/platform/chrome/cros_ec_typec.c > @@ -621,6 +621,7 @@ static int cros_typec_register_altmodes(struct cros_typec_data *typec, int port_ > struct cros_typec_altmode_node *node; > struct typec_altmode_desc desc; > struct typec_altmode *amode; > + int num_altmodes = 0; > int ret = 0; > int i, j; > > @@ -647,9 +648,16 @@ static int cros_typec_register_altmodes(struct cros_typec_data *typec, int port_ > > node->amode = amode; > list_add_tail(&node->list, &port->partner_mode_list); > + num_altmodes++; > } > } > > + ret = typec_partner_set_num_altmodes(port->partner, num_altmodes); > + if (ret < 0) { > + dev_err(typec->dev, "Unable to set partner num_altmodes for port: %d\n", port_num); > + goto err_cleanup; > + } > + > return 0; > > err_cleanup: > -- > 2.29.2.222.g5d2a92d10f8-goog thanks, -- heikki