Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: typec: change altmode SVID to u16 entry

As stated in the changelog for the commit 7b458a4c5d73 ("usb: typec: Add
typec_port_register_altmodes()"), the code should be adjusted according
to the AltMode bindings. As the SVID is 16 bits wide (according to the
USB PD Spec), use fwnode_property_read_u16() to read it.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20231204020303.2287338-3-dmitry.baryshkov@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Baryshkov and committed by
Greg Kroah-Hartman
0dbda971 d1756ac6

+4 -3
+1 -1
drivers/platform/x86/intel/chtwc_int33fe.c
··· 136 136 }; 137 137 138 138 static const struct property_entry dp_altmode_properties[] = { 139 - PROPERTY_ENTRY_U32("svid", 0xff01), 139 + PROPERTY_ENTRY_U16("svid", 0xff01), 140 140 PROPERTY_ENTRY_U32("vdo", 0x0c0086), 141 141 { } 142 142 };
+3 -2
drivers/usb/typec/class.c
··· 2231 2231 struct typec_altmode_desc desc; 2232 2232 struct typec_altmode *alt; 2233 2233 size_t index = 0; 2234 - u32 svid, vdo; 2234 + u16 svid; 2235 + u32 vdo; 2235 2236 int ret; 2236 2237 2237 2238 altmodes_node = device_get_named_child_node(&port->dev, "altmodes"); ··· 2240 2239 return; /* No altmodes specified */ 2241 2240 2242 2241 fwnode_for_each_child_node(altmodes_node, child) { 2243 - ret = fwnode_property_read_u32(child, "svid", &svid); 2242 + ret = fwnode_property_read_u16(child, "svid", &svid); 2244 2243 if (ret) { 2245 2244 dev_err(&port->dev, "Error reading svid for altmode %s\n", 2246 2245 fwnode_get_name(child));