usb: typec: displayport: Move the Configuration VDO helpers to the header
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 1 Feb 2019 10:47:54 +0000 (13:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Feb 2019 09:25:12 +0000 (10:25 +0100)
The helpers used for reading and writing the pin assignment
from and to the Configuration VDO will be useful in GPU
drivers, and also UCSI driver after DisplayPort alt mode
support is added to it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/altmodes/displayport.c
include/linux/usb/typec_dp.h

index 3f06e94771a72d0fe5bff46244af063d96cc8cb8..610d790bc9be1fbe31e23731795a4baad24a3036 100644 (file)
@@ -24,10 +24,6 @@ enum {
        DP_CONF_DUAL_D,
 };
 
-/* Helper for setting/getting the pin assignement value to the configuration */
-#define DP_CONF_SET_PIN_ASSIGN(_a_)    ((_a_) << 8)
-#define DP_CONF_GET_PIN_ASSIGN(_conf_) (((_conf_) & GENMASK(15, 8)) >> 8)
-
 /* Pin assignments that use USB3.1 Gen2 signaling to carry DP protocol */
 #define DP_PIN_ASSIGN_GEN2_BR_MASK     (BIT(DP_PIN_ASSIGN_A) | \
                                         BIT(DP_PIN_ASSIGN_B))
index 55ae781d60a9ea42423c97f39dcf69d73f12a769..7fa12ef8d09a45bfa1534d7edbe74a0f4d60a4f1 100644 (file)
@@ -92,4 +92,8 @@ enum {
 #define DP_CONF_PIN_ASSIGNEMENT_SHIFT  8
 #define DP_CONF_PIN_ASSIGNEMENT_MASK   GENMASK(15, 8)
 
+/* Helper for setting/getting the pin assignement value to the configuration */
+#define DP_CONF_SET_PIN_ASSIGN(_a_)    ((_a_) << 8)
+#define DP_CONF_GET_PIN_ASSIGN(_conf_) (((_conf_) & GENMASK(15, 8)) >> 8)
+
 #endif /* __USB_TYPEC_DP_H */