aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-08-06 15:45:35 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:12 -0400
commit794f1d789520d423ef6d90d5390edea5c1b687c2 (patch)
treec6c600391d9880bf5b110b6f3dc352b8cf7beb96
parent79de99e864fb731392bec78f251ce0310fed5d9a (diff)
Staging: sep: We have two different repeats of the same logic
So how about a little helper Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/sep/sep_main_mod.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/staging/sep/sep_main_mod.c b/drivers/staging/sep/sep_main_mod.c
index 7e2fd3d1fbe..b739f7d4629 100644
--- a/drivers/staging/sep/sep_main_mod.c
+++ b/drivers/staging/sep/sep_main_mod.c
@@ -3803,6 +3803,15 @@ static int sep_set_time(unsigned long *address_ptr,
3803 return 0; 3803 return 0;
3804} 3804}
3805 3805
3806static void sep_wait_busy(struct sep_device *dev)
3807{
3808 u32 reg;
3809
3810 do {
3811 reg = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR);
3812 } while (reg);
3813}
3814
3806/* 3815/*
3807 PATCH for configuring the DMA to single burst instead of multi-burst 3816 PATCH for configuring the DMA to single burst instead of multi-burst
3808*/ 3817*/
@@ -3822,9 +3831,7 @@ static void sep_configure_dma_burst(void)
3822 DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3831 DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC,
3823 "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n"); 3832 "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n");
3824 3833
3825 regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR); 3834 sep_wait_busy(sep_dev);
3826 while (regVal)
3827 regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR);
3828 3835
3829 DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3836 DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC,
3830 "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n"); 3837 "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n");
@@ -3834,9 +3841,7 @@ static void sep_configure_dma_burst(void)
3834 3841
3835 /* release the sep busy */ 3842 /* release the sep busy */
3836 sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x0UL); 3843 sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x0UL);
3837 regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR); 3844 sep_wait_busy(sep_dev);
3838 while (regVal != 0x0)
3839 regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR);
3840 3845
3841 DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, 3846 DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC,
3842 "SEP Driver:<-------- sep_configure_dma_burst done \n"); 3847 "SEP Driver:<-------- sep_configure_dma_burst done \n");