Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp670785pxb; Tue, 2 Feb 2021 15:03:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdwXw/medU+vRw7NWS9DksoI/lIVPC35wcPdJx5iayaNxqHHn7En0/TGXXiTrQ4Fj62Iei X-Received: by 2002:a17:906:5e45:: with SMTP id b5mr280000eju.69.1612307006267; Tue, 02 Feb 2021 15:03:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612307006; cv=none; d=google.com; s=arc-20160816; b=kv2VZVxeNbuXJ/nV5TiWkWF6CT9iPyfESSGhIvPBpGSm3TiWaYwAcQcRW6Hw6rbMNh /3cZ0a8WWgg8qTHnrbDc9I1RHNKpJ7yfga3prPlGkVqcqyW/juWu45wCElV90TivDwfU EPQc8HJoUjZ+wj/Jfgkgpg09deAGq0y0t0YALjRnnZdLy898IvZf/vJJdJDKNDZdxO25 lxZEQmqENWs60oq7jrda6BA6gkmhLRSSGDU5QuPC969nBCiPVXqXIZm+8xFxwN5j20qV YBGTrCJLHfaK6pfRtT8YhmP4bpjXkzdcEqCoRT3Qt/W1HaQbW9t/9XMPMAr4ELpFIVyW zwfw== 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:sender:dkim-signature; bh=tJ1RjowJP8uP6aGuamfXuNzicvFr4anl7UIOhyimvSM=; b=Opp/Aftqty1ZGjy/mod1VPh9FqhDrW3JbV23f1lKJma8cQQWl8JCSclJIGwC26+1wY ck3bPMBVfPEMiQakMa9tJfUTS3eJyHrXc6eOO1U2rPzqHghLO+/sbOdAC9YDYa09ARDC D/dFWf7P626rbsdbty/r8x2vF2/+dnMgs6VP7Y/N//3Nt54Ej2KmTCs/SGJUNVEfTmKR 8fnef8l/pw/fe9hh4a7n6RJV+YfsCtarVSN0VvxSH1BF80UZimA3Fgnhx5LRYKNFDMfk O8u8OHZqkJtUsinaI3/5F/vf/nMtsa8r2vweGnySa4dYY0qaHm4Rl8y20xFUM0El8i+C TUxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bZaqIqlP; 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 a1si94763ede.520.2021.02.02.15.03.01; Tue, 02 Feb 2021 15:03:26 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=bZaqIqlP; 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 S234266AbhBBQYX (ORCPT + 99 others); Tue, 2 Feb 2021 11:24:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236255AbhBBQVz (ORCPT ); Tue, 2 Feb 2021 11:21:55 -0500 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 F1CE3C061220 for ; Tue, 2 Feb 2021 08:18:08 -0800 (PST) Received: by mail-qk1-x749.google.com with SMTP id y187so17684860qke.20 for ; Tue, 02 Feb 2021 08:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=tJ1RjowJP8uP6aGuamfXuNzicvFr4anl7UIOhyimvSM=; b=bZaqIqlPPqbLYC0Cr7r6Q2eRJOmpXZWUFpKvj0rZR486uxqjXbpMJxZHKo3rm6040d OEx1Heh+JWUXlIy2GaZkuiDz20uIbhQxArX8nktdQTWk1jli26ZkYAlaqTl39hex4nq1 /ZC7lrjP6lh33XKn51dRCMqvxhSVu5yPhUdKl2EqBaamrx05QuT+1eOQvfZU/4nnY048 k6XvMyZCPv7LMD4yistrtaftg5pZIuuFIsZ1Ymy5ble0KUjinVBWL9opXeU0hXEzD8rW ZR+GXZepH87T/w4zgkeCEu4AnMgIQA7IxL9ZG7C5XuqC4adc99l9D6eCP1jgduXnnnJf GE5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=tJ1RjowJP8uP6aGuamfXuNzicvFr4anl7UIOhyimvSM=; b=IXHfOIMjXqXdgvI67S0VUBBahe/kGFs3x8a+A6zh872RGqVXDEAqPVWwS9d2etEXPL c6YqkarnGUEn3dnxkBvRdAK7HzpFWG7xHed6hGv/13HY9g5bTfG4cKG71kFY8nL1UFoE +DaTIwrXQEY++FM+uBE6nQs5KR1c+ID2MME3kWA7SanJNE3IR/0Vm8/TDx6xwVoriMlQ TXoX51d5Qvxg7+kl2/JIGJI1xk1qw567iEnviwCnU7fD1/M2BgKlKra7qNrW8FYF4Q/D i9azxj+MSEA70GEPPI2P/6OKugGBH6iNJVs1wdC5eTMwnIx4IRjbkLlhh/li6ZS/FRoQ 3yjQ== X-Gm-Message-State: AOAM5320AlZq+BIZUo0DVPrUtlVVtabEabX7ugDUbytCvpR1sg7imH3h fT+tiaHIjjEHQhU8X4D+mFTh29Pv3ara Sender: "kyletso via sendgmr" X-Received: from kyletso.ntc.corp.google.com ([2401:fa00:fc:202:dd94:c753:a81d:c855]) (user=kyletso job=sendgmr) by 2002:a05:6214:c27:: with SMTP id a7mr20744200qvd.54.1612282688190; Tue, 02 Feb 2021 08:18:08 -0800 (PST) Date: Wed, 3 Feb 2021 00:17:33 +0800 In-Reply-To: <20210202161733.932215-1-kyletso@google.com> Message-Id: <20210202161733.932215-9-kyletso@google.com> Mime-Version: 1.0 References: <20210202161733.932215-1-kyletso@google.com> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog Subject: [PATCH v5 8/8] usb: typec: tcpm: Get Sink VDO from fwnode From: Kyle Tso To: linux@roeck-us.net, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, hdegoede@redhat.com, robh+dt@kernel.org Cc: badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kyle Tso Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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