Commit 09928167 authored by Hiroshi DOYU's avatar Hiroshi DOYU Committed by Juha Yrjola

ARM: OMAP: DSPGW: mailbox log cleanup

mailbox log small clean-up
Signed-off-by: default avatarHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@solidboot.com>
parent 303253cc
...@@ -57,10 +57,10 @@ enum dsp_mem_type_e { ...@@ -57,10 +57,10 @@ enum dsp_mem_type_e {
MEM_TYPE_EXTERN, MEM_TYPE_EXTERN,
}; };
enum arm_dsp_dir_e {
DIR_A2D, typedef int __bitwise arm_dsp_dir_t;
DIR_D2A, #define DIR_A2D ((__force arm_dsp_dir_t) 1)
}; #define DIR_D2A ((__force arm_dsp_dir_t) 2)
enum cfgstat_e { enum cfgstat_e {
CFGSTAT_CLEAN = 0, CFGSTAT_CLEAN = 0,
...@@ -163,8 +163,8 @@ extern struct ipbuf_head *bid_to_ipbuf(u16 bid); ...@@ -163,8 +163,8 @@ extern struct ipbuf_head *bid_to_ipbuf(u16 bid);
extern void ipbuf_start(void); extern void ipbuf_start(void);
extern void ipbuf_stop(void); extern void ipbuf_stop(void);
extern int ipbuf_config(u16 ln, u16 lsz, void *base); extern int ipbuf_config(u16 ln, u16 lsz, void *base);
extern int ipbuf_sys_config(void *p, enum arm_dsp_dir_e dir); extern int ipbuf_sys_config(void *p, arm_dsp_dir_t dir);
extern int ipbuf_p_validate(void *p, enum arm_dsp_dir_e dir); extern int ipbuf_p_validate(void *p, arm_dsp_dir_t dir);
extern struct ipbuf_head *get_free_ipbuf(u8 tid); extern struct ipbuf_head *get_free_ipbuf(u8 tid);
extern void release_ipbuf(struct ipbuf_head *ipb_h); extern void release_ipbuf(struct ipbuf_head *ipb_h);
extern void balance_ipbuf(void); extern void balance_ipbuf(void);
...@@ -239,11 +239,6 @@ extern const struct cmdinfo *cmdinfo[]; ...@@ -239,11 +239,6 @@ extern const struct cmdinfo *cmdinfo[];
#define cmd_name(mb) (cmdinfo[(mb).cmd_h]->name) #define cmd_name(mb) (cmdinfo[(mb).cmd_h]->name)
extern char *subcmd_name(struct mbcmd *mb); extern char *subcmd_name(struct mbcmd *mb);
extern void mblog_add(struct mbcmd *mb, enum arm_dsp_dir_e dir); extern void mblog_add(struct mbcmd *mb, arm_dsp_dir_t dir);
#ifdef CONFIG_OMAP_DSP_MBCMD_VERBOSE
extern void mblog_printcmd(struct mbcmd *mb, enum arm_dsp_dir_e dir);
#else /* CONFIG_OMAP_DSP_MBCMD_VERBOSE */
#define mblog_printcmd(mb, dir) do {} while(0)
#endif /* CONFIG_OMAP_DSP_MBCMD_VERBOSE */
extern struct platform_device dsp_device; extern struct platform_device dsp_device;
...@@ -203,7 +203,6 @@ int __dsp_mbcmd_send_exarg(struct mbcmd *mb, struct mb_exarg *arg, ...@@ -203,7 +203,6 @@ int __dsp_mbcmd_send_exarg(struct mbcmd *mb, struct mb_exarg *arg,
mbseq->ad_arm++; mbseq->ad_arm++;
mblog_add(mb, DIR_A2D); mblog_add(mb, DIR_A2D);
mblog_printcmd(mb, DIR_A2D);
ret = mbox_send(mbox_dsp, *(mbox_msg_t *)mb); ret = mbox_send(mbox_dsp, *(mbox_msg_t *)mb);
...@@ -249,7 +248,6 @@ static void mbcmd_receiver(mbox_msg_t msg) ...@@ -249,7 +248,6 @@ static void mbcmd_receiver(mbox_msg_t msg)
(*mbseq_expect)++; (*mbseq_expect)++;
mblog_add(mb, DIR_D2A); mblog_add(mb, DIR_D2A);
mblog_printcmd(mb, DIR_D2A);
/* call handler for the command */ /* call handler for the command */
if (cmdinfo[mb->cmd_h]->handler) if (cmdinfo[mb->cmd_h]->handler)
......
...@@ -126,7 +126,7 @@ free_out: ...@@ -126,7 +126,7 @@ free_out:
return ret; return ret;
} }
int ipbuf_sys_config(void *p, enum arm_dsp_dir_e dir) int ipbuf_sys_config(void *p, arm_dsp_dir_t dir)
{ {
char *dir_str = (dir == DIR_D2A) ? "D2A" : "A2D"; char *dir_str = (dir == DIR_D2A) ? "D2A" : "A2D";
...@@ -161,7 +161,7 @@ int ipbuf_sys_config(void *p, enum arm_dsp_dir_e dir) ...@@ -161,7 +161,7 @@ int ipbuf_sys_config(void *p, enum arm_dsp_dir_e dir)
return 0; return 0;
} }
int ipbuf_p_validate(void *p, enum arm_dsp_dir_e dir) int ipbuf_p_validate(void *p, arm_dsp_dir_t dir)
{ {
char *dir_str = (dir == DIR_D2A) ? "D2A" : "A2D"; char *dir_str = (dir == DIR_D2A) ? "D2A" : "A2D";
......
...@@ -111,7 +111,7 @@ char *subcmd_name(struct mbcmd *mb) ...@@ -111,7 +111,7 @@ char *subcmd_name(struct mbcmd *mb)
struct mblogent { struct mblogent {
unsigned long jiffies; unsigned long jiffies;
mbox_msg_t msg; mbox_msg_t msg;
enum arm_dsp_dir_e dir; arm_dsp_dir_t dir;
}; };
static struct { static struct {
...@@ -123,7 +123,43 @@ static struct { ...@@ -123,7 +123,43 @@ static struct {
.lock = SPIN_LOCK_UNLOCKED, .lock = SPIN_LOCK_UNLOCKED,
}; };
void mblog_add(struct mbcmd *mb, enum arm_dsp_dir_e dir) #ifdef CONFIG_OMAP_DSP_MBCMD_VERBOSE
static inline void mblog_print_cmd(struct mbcmd *mb, arm_dsp_dir_t dir)
{
const struct cmdinfo *ci = cmdinfo[mb->cmd_h];
char *dir_str;
char *subname;
dir_str = (dir == DIR_A2D) ? "sending " : "receiving";
switch (ci->cmd_l_type) {
case CMD_L_TYPE_SUBCMD:
subname = subcmd_name(mb);
if (unlikely(!subname))
subname = "Unknown";
printk(KERN_DEBUG
"mbox: %s seq=%d, cmd=%02x:%02x(%s:%s), data=%04x\n",
dir_str, mb->seq, mb->cmd_h, mb->cmd_l,
ci->name, subname, mb->data);
break;
case CMD_L_TYPE_TID:
printk(KERN_DEBUG
"mbox: %s seq=%d, cmd=%02x:%02x(%s:task %d), data=%04x\n",
dir_str, mb->seq, mb->cmd_h, mb->cmd_l,
ci->name, mb->cmd_l, mb->data);
break;
case CMD_L_TYPE_NULL:
printk(KERN_DEBUG
"mbox: %s seq=%d, cmd=%02x:%02x(%s), data=%04x\n",
dir_str, mb->seq, mb->cmd_h, mb->cmd_l,
ci->name, mb->data);
break;
}
}
#else
static inline void mblog_print_cmd(struct mbcmd *mb, arm_dsp_dir_t dir) { }
#endif
void mblog_add(struct mbcmd *mb, arm_dsp_dir_t dir)
{ {
struct mblogent *ent; struct mblogent *ent;
...@@ -147,6 +183,8 @@ void mblog_add(struct mbcmd *mb, enum arm_dsp_dir_e dir) ...@@ -147,6 +183,8 @@ void mblog_add(struct mbcmd *mb, enum arm_dsp_dir_e dir)
if (++mblog.wp == MBLOG_DEPTH) if (++mblog.wp == MBLOG_DEPTH)
mblog.wp = 0; mblog.wp = 0;
spin_unlock(&mblog.lock); spin_unlock(&mblog.lock);
mblog_print_cmd(mb, dir);
} }
/* /*
...@@ -219,46 +257,6 @@ done: ...@@ -219,46 +257,6 @@ done:
static struct device_attribute dev_attr_mblog = __ATTR_RO(mblog); static struct device_attribute dev_attr_mblog = __ATTR_RO(mblog);
#ifdef CONFIG_OMAP_DSP_MBCMD_VERBOSE
void mblog_printcmd(struct mbcmd *mb, enum arm_dsp_dir_e dir)
{
struct cmdinfo ci_null = {
.name = "Unknown",
.cmd_l_type = CMD_L_TYPE_NULL,
};
const struct cmdinfo *ci;
char *dir_str;
char *subname;
dir_str = (dir == DIR_A2D) ? "sending" : "receiving";
if ((ci = cmdinfo[mb->cmd_h]) == NULL)
ci = &ci_null;
switch (ci->cmd_l_type) {
case CMD_L_TYPE_SUBCMD:
if ((subname = subcmd_name(mb)) == NULL)
subname = "Unknown";
printk(KERN_DEBUG
"mbox: %s cmd=%02x:%02x(%s:%s), data=%04x\n",
dir_str, mb->cmd_h, mb->cmd_l,
ci->name, subname, mb->data);
break;
case CMD_L_TYPE_TID:
printk(KERN_DEBUG
"mbox: %s cmd=%02x:%02x(%s:task %d), data=%04x\n",
dir_str, mb->cmd_h, mb->cmd_l,
ci->name, mb->cmd_l, mb->data);
break;
case CMD_L_TYPE_NULL:
printk(KERN_DEBUG
"mbox: %s cmd=%02x:%02x(%s), data=%04x\n",
dir_str, mb->cmd_h, mb->cmd_l, ci->name, mb->data);
break;
}
}
#endif /* CONFIG_OMAP_DSP_MBCMD_VERBOSE */
void __init mblog_init(void) void __init mblog_init(void)
{ {
device_create_file(&dsp_device.dev, &dev_attr_mblog); device_create_file(&dsp_device.dev, &dev_attr_mblog);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment