aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArmando Uribe <x0095078@ti.com>2010-07-22 21:25:28 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-26 18:32:19 -0400
commitc18c9c910dbcc4cc55a440c38fad300f1ecf8dbb (patch)
tree3a2a898a6b1fa60793986590d8f621521486d4d6 /drivers
parent9e342489d7b8a8ac4ba4a728169564e4ab205bbd (diff)
staging: tidspbridge: Change macros to static inline functions in io_sm
This patch change to macros to static inline functions, these macros are used to perform write/read operations in shared memory Signed-off-by: Armando Uribe <x0095078@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/tidspbridge/core/io_sm.c22
-rw-r--r--drivers/staging/tidspbridge/include/dspbridge/io_sm.h3
2 files changed, 14 insertions, 11 deletions
diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c
index 03960bdcc57..e5e368497e0 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -149,6 +149,17 @@ static int register_shm_segs(struct io_mgr *hio_mgr,
149 struct cod_manager *cod_man, 149 struct cod_manager *cod_man,
150 u32 dw_gpp_base_pa); 150 u32 dw_gpp_base_pa);
151 151
152static inline void set_chnl_free(struct shm *sm, u32 chnl)
153{
154 sm->host_free_mask &= ~(1 << chnl);
155}
156
157static inline void set_chnl_busy(struct shm *sm, u32 chnl)
158{
159 sm->host_free_mask |= 1 << chnl;
160}
161
162
152/* 163/*
153 * ======== bridge_io_create ======== 164 * ======== bridge_io_create ========
154 * Create an IO manager object. 165 * Create an IO manager object.
@@ -818,8 +829,7 @@ void io_cancel_chnl(struct io_mgr *hio_mgr, u32 chnl)
818 sm = hio_mgr->shared_mem; 829 sm = hio_mgr->shared_mem;
819 830
820 /* Inform DSP that we have no more buffers on this channel */ 831 /* Inform DSP that we have no more buffers on this channel */
821 IO_AND_VALUE(pio_mgr->hbridge_context, struct shm, sm, host_free_mask, 832 set_chnl_free(sm, chnl);
822 (~(1 << chnl)));
823 833
824 sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS); 834 sm_interrupt_dsp(pio_mgr->hbridge_context, MBX_PCPY_CLASS);
825func_end: 835func_end:
@@ -994,8 +1004,7 @@ void io_request_chnl(struct io_mgr *io_manager, struct chnl_object *pchnl,
994 DBC_ASSERT((pchnl->dw_state == CHNL_STATEREADY) || 1004 DBC_ASSERT((pchnl->dw_state == CHNL_STATEREADY) ||
995 (pchnl->dw_state == CHNL_STATEEOS)); 1005 (pchnl->dw_state == CHNL_STATEEOS));
996 /* Indicate to the DSP we have a buffer available for input */ 1006 /* Indicate to the DSP we have a buffer available for input */
997 IO_OR_VALUE(io_manager->hbridge_context, struct shm, sm, 1007 set_chnl_busy(sm, pchnl->chnl_id);
998 host_free_mask, (1 << pchnl->chnl_id));
999 *mbx_val = MBX_PCPY_CLASS; 1008 *mbx_val = MBX_PCPY_CLASS;
1000 } else if (io_mode == IO_OUTPUT) { 1009 } else if (io_mode == IO_OUTPUT) {
1001 /* 1010 /*
@@ -1156,10 +1165,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
1156 if (!pchnl->pio_requests) 1165 if (!pchnl->pio_requests)
1157 goto func_end; 1166 goto func_end;
1158 if (LST_IS_EMPTY(pchnl->pio_requests)) { 1167 if (LST_IS_EMPTY(pchnl->pio_requests)) {
1159 IO_AND_VALUE(pio_mgr->hbridge_context, 1168 set_chnl_free(sm, pchnl->chnl_id);
1160 struct shm, sm,
1161 host_free_mask,
1162 ~(1 << pchnl->chnl_id));
1163 } 1169 }
1164 clear_chnl = true; 1170 clear_chnl = true;
1165 notify_client = true; 1171 notify_client = true;
diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h
index f1c44f8dae6..841ff9414d5 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h
@@ -33,9 +33,6 @@
33#define DSP_FIELD_ADDR(type, field, base, wordsize) \ 33#define DSP_FIELD_ADDR(type, field, base, wordsize) \
34 ((((s32)&(((type *)0)->field)) / wordsize) + (u32)base) 34 ((((s32)&(((type *)0)->field)) / wordsize) + (u32)base)
35 35
36#define IO_OR_VALUE(context, type, base, field, value) (base->field |= value)
37#define IO_AND_VALUE(context, type, base, field, value) (base->field &= value)
38
39#ifdef CONFIG_TIDSPBRIDGE_DVFS 36#ifdef CONFIG_TIDSPBRIDGE_DVFS
40/* The maximum number of OPPs that are supported */ 37/* The maximum number of OPPs that are supported */
41extern s32 dsp_max_opps; 38extern s32 dsp_max_opps;