mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
usb: typec: tcpm: Get Sink VDO from fwnode
Commit a079973f46
("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.
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210205033415.3320439-8-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
630dce2810
commit
f5d1d63e73
1 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue