[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210212042137.GG103223@roeck-us.net>
Date: Thu, 11 Feb 2021 20:21:37 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Kyle Tso <kyletso@...gle.com>
Cc: heikki.krogerus@...ux.intel.com, gregkh@...uxfoundation.org,
hdegoede@...hat.com, robh+dt@...nel.org, badhri@...gle.com,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v6 7/7] usb: typec: tcpm: Get Sink VDO from fwnode
On Fri, Feb 05, 2021 at 11:34:15AM +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 <kyletso@...gle.com>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> ---
> Changes since v5:
> - no change
>
> 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 b45cd191a8a4..be0b6469dd3d 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -5722,6 +5722,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
>
Powered by blists - more mailing lists