Permalink
Browse files

usb: pd: Enable log and add log for received message

Domo. I’m USB PD Police👮
  • Loading branch information...
AndroPlus-org committed Jul 30, 2017
1 parent 62194c6 commit 1b067f87b3e45d7bf479be8dc72fb45b64a8dac9
Showing with 22 additions and 2 deletions.
  1. +22 −2 drivers/usb/pd/policy_engine.c
@@ -10,6 +10,8 @@
* GNU General Public License for more details.
*/
#define DEBUG
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/hrtimer.h>
@@ -126,6 +128,23 @@ enum usbpd_control_msg_type {
MSG_SOFT_RESET,
};
static const char * const usbpd_control_msg_type_strings[] = {
"MSG_RESERVED",
"MSG_GOODCRC",
"MSG_GOTOMIN",
"MSG_ACCEPT",
"MSG_REJECT",
"MSG_PING",
"MSG_PS_RDY",
"MSG_GET_SOURCE_CAP",
"MSG_GET_SINK_CAP",
"MSG_DR_SWAP",
"MSG_PR_SWAP",
"MSG_VCONN_SWAP",
"MSG_WAIT",
"MSG_SOFT_RESET",
};
enum usbpd_data_msg_type {
MSG_SOURCE_CAPABILITIES = 1,
MSG_REQUEST,
@@ -316,6 +335,7 @@ struct usbpd {
struct extcon_dev *extcon;
enum usbpd_state current_state;
enum usbpd_control_msg_type received_message;
bool hard_reset_recvd;
struct list_head rx_q;
spinlock_t rx_lock;
@@ -731,8 +751,8 @@ static void phy_msg_received(struct usbpd *pd, enum pd_msg_type type,
list_add_tail(&rx_msg->entry, &pd->rx_q);
spin_unlock_irqrestore(&pd->rx_lock, flags);
usbpd_dbg(&pd->dev, "received message: type(%d) len(%d)\n",
rx_msg->type, rx_msg->len);
usbpd_dbg(&pd->dev, "received message: type(%d) len(%d) %s\n",
rx_msg->type, rx_msg->len, usbpd_control_msg_type_strings[rx_msg->type]);
kick_sm(pd, 0);
}

0 comments on commit 1b067f8

Please sign in to comment.