platform/chrome: cros_ec_typec: Register plug altmodes
authorPrashant Malani <pmalani@chromium.org>
Mon, 16 Nov 2020 20:11:58 +0000 (12:11 -0800)
committerBenson Leung <bleung@chromium.org>
Tue, 5 Jan 2021 19:07:40 +0000 (11:07 -0800)
commit1563090965421f7e96cc006c150180f1526a24f7
tree967adba7511be4dec462537cfaefdac4f0188da1
parentf4edab68e10119a71a9e62a7fe537685d0f41478
platform/chrome: cros_ec_typec: Register plug altmodes

Modify the altmode registration (and unregistration) code so that it
can be used by both partners and plugs.

Then, add code to register plug altmodes using the newly parameterized
function. Also set the number of alternate modes for the plug using the
associated Type C connector class function
typec_plug_set_num_altmodes().

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20201116201150.2919178-12-pmalani@chromium.org
drivers/platform/chrome/cros_ec_typec.c