Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp119897pxb; Tue, 2 Feb 2021 00:26:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTWTR8CsAsqRR4jyP+57pXdfOS25Q7WnpjnP65RmAhlnNbzgnN2ZlGy3pN9Oawp/qlGzBt X-Received: by 2002:aa7:d692:: with SMTP id d18mr9098810edr.327.1612254392464; Tue, 02 Feb 2021 00:26:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612254392; cv=none; d=google.com; s=arc-20160816; b=DcMDJHuHBJHNT4Ujm/8120LsfXQ4iW0mh+PzxpEcmjqLdLH5bmS2H8biVFasetl6LZ H9Cws1kv8h1xSyO1y+joILqFSm5LaxWOWtZ4ZpHK9OAyYGp3jPCbmSnpvaNxbG6Caf9s XAMHZD1d0vWSy49S9ASg5bROV3pKlIQ34VE6yJt7TPVybFzhlpm9+A1n0+ehRy3YlFAs jXCZBYK5hwmoxBEK74ypBc7y5aKTKisY79/PfSa10Doo2lYv1Aot9LAKyTdprua7bf5e r20qf9rpNRFr9w3OH4lmRoWunaGQRgdi3Loo9FKJ812ZCxSGq6MBgreVHVw0GFxcmlJz kp9Q== 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=9C4FMdY0v7hVGeYIs8/AOxozHy3Rt7RHeNe2BW89zr0=; b=wGZNz8ZXFQ4teAi1wjbqy/b1M8b8WfyYYQT3z3Bsfc5wd/D7RMt/u34jzM6PejdiP5 HhMnImR0xIpdmgSOo97zf7ipHnhHrSklY7Kn7hJe+FvtFOvf0dnqodmfNZXhVkjizhRI 0/RyHjwUq+QEPkfl1bdR1Xingqzmfp6EbBl2sOEIn/wDmQZe+cribKuIlPvr+I7h07Ih 1jghzKdd7xwWQSA7Jbjs+TPHb+QTOTMDFeWO2WN1NgqeQ4xiJZ2Ldd5qVFiyhotg6SXJ 66Crchibkd916Emrtdya3c9cSjxkOLe7vgDbp/GLOj/s7ffVZuBbV/0aeUblBbHQwvvg uNig== 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 y8si2356230edp.207.2021.02.02.00.26.08; Tue, 02 Feb 2021 00:26:32 -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 S229511AbhBBIZF (ORCPT + 99 others); Tue, 2 Feb 2021 03:25:05 -0500 Received: from mga04.intel.com ([192.55.52.120]:51121 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232523AbhBBIYl (ORCPT ); Tue, 2 Feb 2021 03:24:41 -0500 IronPort-SDR: 1QlUrpF0fd4A/GWXDjMR1Bz8RVSrnG4C2JTUWUA7MuEaHqRx318GLby5J/UD6SO0s5PlEOJnPV pCFyDuSnP0pQ== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="178257683" X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="178257683" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2021 00:22:52 -0800 IronPort-SDR: gwp8W19RtNF1YXGS7OUro+/XLRGEhfV2dOwxMUDfgV8wvVwqvM/74C9TBxYgTHBFDBGXRQ3uht 9qRkaWLFcB4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,394,1602572400"; d="scan'208";a="479481915" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 02 Feb 2021 00:22:48 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 02 Feb 2021 10:22:48 +0200 Date: Tue, 2 Feb 2021 10:22:48 +0200 From: Heikki Krogerus To: Kyle Tso Cc: linux@roeck-us.net, gregkh@linuxfoundation.org, hdegoede@redhat.com, robh+dt@kernel.org, badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 3/3] usb: typec: tcpm: Get Sink VDO from fwnode Message-ID: <20210202082248.GC1433721@kuha.fi.intel.com> References: <20210201133421.408508-1-kyletso@google.com> <20210201133421.408508-4-kyletso@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210201133421.408508-4-kyletso@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2021 at 09:34:21PM +0800, Kyle Tso wrote: > Commit a079973f462a ("usb: typec: tcpm: Remove tcpc_config > configuration mechanism") removed the tcpc_config which includes the > Sink VDO and it is not yet added back with fwnode. Add it now. > > Signed-off-by: Kyle Tso Reviewed-by: Heikki Krogerus > --- > Changes since v2: > - use fwnode_property_count_u32 instead to get the count > - revise the error handling > > drivers/usb/typec/tcpm/tcpm.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 979b7ee6473c..9b13e19118f0 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -5677,6 +5677,20 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, > port->new_source_frs_current = frs_current; > } > > + /* sink-vdos is optional */ > + ret = fwnode_property_count_u32(fwnode, "sink-vdos"); > + if (ret < 0) > + ret = 0; > + > + port->nr_snk_vdo = min(ret, VDO_MAX_OBJECTS); > + if (port->nr_snk_vdo) { > + ret = fwnode_property_read_u32_array(fwnode, "sink-vdos", > + port->snk_vdo, > + port->nr_snk_vdo); > + if (ret < 0) > + return ret; > + } > + > return 0; > } > > -- > 2.30.0.365.g02bc693789-goog thanks, -- heikki