mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
UPSTREAM: usb: typec: tcpm: Get Sink VDO from fwnode
Commita079973f46("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> (cherry picked from commitf5d1d63e73https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by: Wang Jie <dave.wang@rock-chips.com> Change-Id: I5ac46e01f3c8f3f616e81097bb013a4603e8fa05 (cherry picked from commit2ab1b9bec3)
This commit is contained in:
@@ -5455,6 +5455,20 @@ sink:
|
||||
port->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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user