summaryrefslogtreecommitdiffstats
path: root/drivers/usb/typec
diff options
context:
space:
mode:
authorHeikki Krogerus2019-02-01 11:47:56 +0100
committerGreg Kroah-Hartman2019-02-08 10:25:12 +0100
commit81534d5fa973fc10a48c245c08688e61ffe41366 (patch)
tree1470a2fcf8c2518d79aabf365830036bcfceff61 /drivers/usb/typec
parentusb: typec: Prepare alt mode enter/exit reporting for UCSI alt mode support (diff)
downloadkernel-qcow2-linux-81534d5fa973fc10a48c245c08688e61ffe41366.tar.gz
kernel-qcow2-linux-81534d5fa973fc10a48c245c08688e61ffe41366.tar.xz
kernel-qcow2-linux-81534d5fa973fc10a48c245c08688e61ffe41366.zip
usb: typec: ucsi: Remove debug.h file
It's not needed. Moving everything from it to trace.c. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec')
-rw-r--r--drivers/usb/typec/ucsi/debug.h65
-rw-r--r--drivers/usb/typec/ucsi/trace.c59
-rw-r--r--drivers/usb/typec/ucsi/trace.h7
3 files changed, 64 insertions, 67 deletions
diff --git a/drivers/usb/typec/ucsi/debug.h b/drivers/usb/typec/ucsi/debug.h
deleted file mode 100644
index fdeff39df120..000000000000
--- a/drivers/usb/typec/ucsi/debug.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __UCSI_DEBUG_H
-#define __UCSI_DEBUG_H
-
-#include "ucsi.h"
-
-static const char * const ucsi_cmd_strs[] = {
- [0] = "Unknown command",
- [UCSI_PPM_RESET] = "PPM_RESET",
- [UCSI_CANCEL] = "CANCEL",
- [UCSI_CONNECTOR_RESET] = "CONNECTOR_RESET",
- [UCSI_ACK_CC_CI] = "ACK_CC_CI",
- [UCSI_SET_NOTIFICATION_ENABLE] = "SET_NOTIFICATION_ENABLE",
- [UCSI_GET_CAPABILITY] = "GET_CAPABILITY",
- [UCSI_GET_CONNECTOR_CAPABILITY] = "GET_CONNECTOR_CAPABILITY",
- [UCSI_SET_UOM] = "SET_UOM",
- [UCSI_SET_UOR] = "SET_UOR",
- [UCSI_SET_PDM] = "SET_PDM",
- [UCSI_SET_PDR] = "SET_PDR",
- [UCSI_GET_ALTERNATE_MODES] = "GET_ALTERNATE_MODES",
- [UCSI_GET_CAM_SUPPORTED] = "GET_CAM_SUPPORTED",
- [UCSI_GET_CURRENT_CAM] = "GET_CURRENT_CAM",
- [UCSI_SET_NEW_CAM] = "SET_NEW_CAM",
- [UCSI_GET_PDOS] = "GET_PDOS",
- [UCSI_GET_CABLE_PROPERTY] = "GET_CABLE_PROPERTY",
- [UCSI_GET_CONNECTOR_STATUS] = "GET_CONNECTOR_STATUS",
- [UCSI_GET_ERROR_STATUS] = "GET_ERROR_STATUS",
-};
-
-static inline const char *ucsi_cmd_str(u64 raw_cmd)
-{
- u8 cmd = raw_cmd & GENMASK(7, 0);
-
- return ucsi_cmd_strs[(cmd >= ARRAY_SIZE(ucsi_cmd_strs)) ? 0 : cmd];
-}
-
-static const char * const ucsi_ack_strs[] = {
- [0] = "",
- [UCSI_ACK_EVENT] = "event",
- [UCSI_ACK_CMD] = "command",
-};
-
-static inline const char *ucsi_ack_str(u8 ack)
-{
- return ucsi_ack_strs[(ack >= ARRAY_SIZE(ucsi_ack_strs)) ? 0 : ack];
-}
-
-static inline const char *ucsi_cci_str(u32 cci)
-{
- if (cci & GENMASK(7, 0)) {
- if (cci & BIT(29))
- return "Event pending (ACK completed)";
- if (cci & BIT(31))
- return "Event pending (command completed)";
- return "Connector Change";
- }
- if (cci & BIT(29))
- return "ACK completed";
- if (cci & BIT(31))
- return "Command completed";
-
- return "";
-}
-
-#endif /* __UCSI_DEBUG_H */
diff --git a/drivers/usb/typec/ucsi/trace.c b/drivers/usb/typec/ucsi/trace.c
index d9a6ff6e673c..ffa3b4c3f338 100644
--- a/drivers/usb/typec/ucsi/trace.c
+++ b/drivers/usb/typec/ucsi/trace.c
@@ -1,3 +1,62 @@
// SPDX-License-Identifier: GPL-2.0
#define CREATE_TRACE_POINTS
+#include "ucsi.h"
#include "trace.h"
+
+static const char * const ucsi_cmd_strs[] = {
+ [0] = "Unknown command",
+ [UCSI_PPM_RESET] = "PPM_RESET",
+ [UCSI_CANCEL] = "CANCEL",
+ [UCSI_CONNECTOR_RESET] = "CONNECTOR_RESET",
+ [UCSI_ACK_CC_CI] = "ACK_CC_CI",
+ [UCSI_SET_NOTIFICATION_ENABLE] = "SET_NOTIFICATION_ENABLE",
+ [UCSI_GET_CAPABILITY] = "GET_CAPABILITY",
+ [UCSI_GET_CONNECTOR_CAPABILITY] = "GET_CONNECTOR_CAPABILITY",
+ [UCSI_SET_UOM] = "SET_UOM",
+ [UCSI_SET_UOR] = "SET_UOR",
+ [UCSI_SET_PDM] = "SET_PDM",
+ [UCSI_SET_PDR] = "SET_PDR",
+ [UCSI_GET_ALTERNATE_MODES] = "GET_ALTERNATE_MODES",
+ [UCSI_GET_CAM_SUPPORTED] = "GET_CAM_SUPPORTED",
+ [UCSI_GET_CURRENT_CAM] = "GET_CURRENT_CAM",
+ [UCSI_SET_NEW_CAM] = "SET_NEW_CAM",
+ [UCSI_GET_PDOS] = "GET_PDOS",
+ [UCSI_GET_CABLE_PROPERTY] = "GET_CABLE_PROPERTY",
+ [UCSI_GET_CONNECTOR_STATUS] = "GET_CONNECTOR_STATUS",
+ [UCSI_GET_ERROR_STATUS] = "GET_ERROR_STATUS",
+};
+
+const char *ucsi_cmd_str(u64 raw_cmd)
+{
+ u8 cmd = raw_cmd & GENMASK(7, 0);
+
+ return ucsi_cmd_strs[(cmd >= ARRAY_SIZE(ucsi_cmd_strs)) ? 0 : cmd];
+}
+
+static const char * const ucsi_ack_strs[] = {
+ [0] = "",
+ [UCSI_ACK_EVENT] = "event",
+ [UCSI_ACK_CMD] = "command",
+};
+
+const char *ucsi_ack_str(u8 ack)
+{
+ return ucsi_ack_strs[(ack >= ARRAY_SIZE(ucsi_ack_strs)) ? 0 : ack];
+}
+
+const char *ucsi_cci_str(u32 cci)
+{
+ if (cci & GENMASK(7, 0)) {
+ if (cci & BIT(29))
+ return "Event pending (ACK completed)";
+ if (cci & BIT(31))
+ return "Event pending (command completed)";
+ return "Connector Change";
+ }
+ if (cci & BIT(29))
+ return "ACK completed";
+ if (cci & BIT(31))
+ return "Command completed";
+
+ return "";
+}
diff --git a/drivers/usb/typec/ucsi/trace.h b/drivers/usb/typec/ucsi/trace.h
index d5092446ecc6..5e2906df2db7 100644
--- a/drivers/usb/typec/ucsi/trace.h
+++ b/drivers/usb/typec/ucsi/trace.h
@@ -7,8 +7,11 @@
#define __UCSI_TRACE_H
#include <linux/tracepoint.h>
-#include "ucsi.h"
-#include "debug.h"
+
+const char *ucsi_cmd_str(u64 raw_cmd);
+const char *ucsi_ack_str(u8 ack);
+const char *ucsi_cci_str(u32 cci);
+const char *ucsi_recipient_str(u8 recipient);
DECLARE_EVENT_CLASS(ucsi_log_ack,
TP_PROTO(u8 ack),