提交 8204bd38 编写于 作者: A Armando Uribe 提交者: Greg Kroah-Hartman

staging: tidspbridge: Remove Redundant wrappers

This patch removes redundant wrappers from io_sm.c file
Signed-off-by: NArmando Uribe <x0095078@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 83c720ea
...@@ -230,7 +230,7 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf, ...@@ -230,7 +230,7 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf,
omap_mbox_enable_irq(dev_ctxt->mbox, IRQ_RX); omap_mbox_enable_irq(dev_ctxt->mbox, IRQ_RX);
spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock); spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock);
if (mb_val != 0) if (mb_val != 0)
io_intr_dsp2(chnl_mgr_obj->hio_mgr, mb_val); sm_interrupt_dsp(dev_ctxt, mb_val);
/* Schedule a DPC, to do the actual data transfer */ /* Schedule a DPC, to do the actual data transfer */
if (sched_dpc) if (sched_dpc)
......
...@@ -132,10 +132,6 @@ struct io_mgr { ...@@ -132,10 +132,6 @@ struct io_mgr {
}; };
/* Function Prototypes */ /* Function Prototypes */
static void io_dispatch_chnl(struct io_mgr *pio_mgr,
struct chnl_object *pchnl, u8 io_mode);
static void io_dispatch_msg(struct io_mgr *pio_mgr,
struct msg_mgr *hmsg_mgr);
static void io_dispatch_pm(struct io_mgr *pio_mgr); static void io_dispatch_pm(struct io_mgr *pio_mgr);
static void notify_chnl_complete(struct chnl_object *pchnl, static void notify_chnl_complete(struct chnl_object *pchnl,
struct chnl_irp *chnl_packet_obj); struct chnl_irp *chnl_packet_obj);
...@@ -147,10 +143,6 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr); ...@@ -147,10 +143,6 @@ static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr);
static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr); static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr);
static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj, static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj,
struct chnl_object *pchnl, u32 mask); struct chnl_object *pchnl, u32 mask);
static u32 read_data(struct bridge_dev_context *dev_ctxt, void *dest,
void *src, u32 usize);
static u32 write_data(struct bridge_dev_context *dev_ctxt, void *dest,
void *src, u32 usize);
/* Bus Addr (cached kernel) */ /* Bus Addr (cached kernel) */
static int register_shm_segs(struct io_mgr *hio_mgr, static int register_shm_segs(struct io_mgr *hio_mgr,
...@@ -834,42 +826,6 @@ void io_cancel_chnl(struct io_mgr *hio_mgr, u32 chnl) ...@@ -834,42 +826,6 @@ void io_cancel_chnl(struct io_mgr *hio_mgr, u32 chnl)
return; return;
} }
/*
* ======== io_dispatch_chnl ========
* Proc-copy chanl dispatch.
*/
static void io_dispatch_chnl(struct io_mgr *pio_mgr,
struct chnl_object *pchnl, u8 io_mode)
{
if (!pio_mgr)
goto func_end;
/* See if there is any data available for transfer */
if (io_mode != IO_SERVICE)
goto func_end;
/* Any channel will do for this mode */
input_chnl(pio_mgr, pchnl, io_mode);
output_chnl(pio_mgr, pchnl, io_mode);
func_end:
return;
}
/*
* ======== io_dispatch_msg ========
* Performs I/O dispatch on message queues.
*/
static void io_dispatch_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr)
{
if (!pio_mgr)
goto func_end;
/* We are performing both input and output processing. */
input_msg(pio_mgr, hmsg_mgr);
output_msg(pio_mgr, hmsg_mgr);
func_end:
return;
}
/* /*
* ======== io_dispatch_pm ======== * ======== io_dispatch_pm ========
...@@ -956,10 +912,17 @@ void io_dpc(unsigned long ref_data) ...@@ -956,10 +912,17 @@ void io_dpc(unsigned long ref_data)
pio_mgr->intr_val); pio_mgr->intr_val);
} }
} }
io_dispatch_chnl(pio_mgr, NULL, IO_SERVICE); /* Proc-copy chanel dispatch */
input_chnl(pio_mgr, NULL, IO_SERVICE);
output_chnl(pio_mgr, NULL, IO_SERVICE);
#ifdef CHNL_MESSAGES #ifdef CHNL_MESSAGES
if (msg_mgr_obj) if (msg_mgr_obj) {
io_dispatch_msg(pio_mgr, msg_mgr_obj); /* Perform I/O dispatch on message queues */
input_msg(pio_mgr, msg_mgr_obj);
output_msg(pio_mgr, msg_mgr_obj);
}
#endif #endif
#ifdef CONFIG_TIDSPBRIDGE_DEBUG #ifdef CONFIG_TIDSPBRIDGE_DEBUG
if (pio_mgr->intr_val & MBX_DBG_SYSPRINTF) { if (pio_mgr->intr_val & MBX_DBG_SYSPRINTF) {
...@@ -1162,9 +1125,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, ...@@ -1162,9 +1125,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
* buffer. * buffer.
*/ */
bytes = min(bytes, chnl_packet_obj->byte_size); bytes = min(bytes, chnl_packet_obj->byte_size);
/* Transfer buffer from DSP side */ memcpy(chnl_packet_obj->host_sys_buf,
bytes = read_data(pio_mgr->hbridge_context,
chnl_packet_obj->host_sys_buf,
pio_mgr->input, bytes); pio_mgr->input, bytes);
pchnl->bytes_moved += bytes; pchnl->bytes_moved += bytes;
chnl_packet_obj->byte_size = bytes; chnl_packet_obj->byte_size = bytes;
...@@ -1448,10 +1409,10 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl, ...@@ -1448,10 +1409,10 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
chnl_mgr_obj->dw_output_mask &= ~(1 << chnl_id); chnl_mgr_obj->dw_output_mask &= ~(1 << chnl_id);
/* Transfer buffer to DSP side */ /* Transfer buffer to DSP side */
chnl_packet_obj->byte_size = chnl_packet_obj->byte_size = min(pio_mgr->usm_buf_size,
write_data(pio_mgr->hbridge_context, pio_mgr->output, chnl_packet_obj->byte_size);
chnl_packet_obj->host_sys_buf, min(pio_mgr->usm_buf_size, memcpy(pio_mgr->output, chnl_packet_obj->host_sys_buf,
chnl_packet_obj->byte_size)); chnl_packet_obj->byte_size);
pchnl->bytes_moved += chnl_packet_obj->byte_size; pchnl->bytes_moved += chnl_packet_obj->byte_size;
/* Write all 32 bits of arg */ /* Write all 32 bits of arg */
IO_SET_LONG(pio_mgr->hbridge_context, struct shm, sm, arg, IO_SET_LONG(pio_mgr->hbridge_context, struct shm, sm, arg,
...@@ -1697,34 +1658,7 @@ static int register_shm_segs(struct io_mgr *hio_mgr, ...@@ -1697,34 +1658,7 @@ static int register_shm_segs(struct io_mgr *hio_mgr,
return status; return status;
} }
/*
* ======== read_data ========
* Copies buffers from the shared memory to the host buffer.
*/
static u32 read_data(struct bridge_dev_context *dev_ctxt, void *dest,
void *src, u32 usize)
{
memcpy(dest, src, usize);
return usize;
}
/*
* ======== write_data ========
* Copies buffers from the host side buffer to the shared memory.
*/
static u32 write_data(struct bridge_dev_context *dev_ctxt, void *dest,
void *src, u32 usize)
{
memcpy(dest, src, usize);
return usize;
}
/* ZCPY IO routines. */ /* ZCPY IO routines. */
void io_intr_dsp2(struct io_mgr *pio_mgr, u16 mb_val)
{
sm_interrupt_dsp(pio_mgr->hbridge_context, mb_val);
}
/* /*
* ======== IO_SHMcontrol ======== * ======== IO_SHMcontrol ========
* Sets the requested shm setting. * Sets the requested shm setting.
......
...@@ -287,8 +287,6 @@ extern void io_or_set_value(struct bridge_dev_context *dev_ctxt, ...@@ -287,8 +287,6 @@ extern void io_or_set_value(struct bridge_dev_context *dev_ctxt,
extern void io_and_set_value(struct bridge_dev_context *dev_ctxt, extern void io_and_set_value(struct bridge_dev_context *dev_ctxt,
u32 dsp_addr, u32 value); u32 dsp_addr, u32 value);
extern void io_intr_dsp2(struct io_mgr *pio_mgr, u16 mb_val);
extern void io_sm_init(void); extern void io_sm_init(void);
#ifdef CONFIG_TIDSPBRIDGE_BACKTRACE #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册