From 12375d1d3aa41f7d277a9af584c7b810b636ec95 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 2 Mar 2011 08:49:38 +0000 Subject: Merge functionality of wakeups and semaphores-- fewer APIs and object types. semaphore_wait takes a timeout now so codecs and plugins have to be made incompatible. Don't make semaphores for targets not using them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29492 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c') diff --git a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c index ef45317c3f..e74e227e47 100644 --- a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c @@ -34,7 +34,7 @@ static volatile bool lcd_is_on = false; static struct mutex lcd_mtx; -static struct wakeup lcd_wkup; +static struct semaphore lcd_wkup; static int lcd_count = 0; void lcd_clock_enable(void) @@ -56,7 +56,7 @@ void lcd_init_device(void) lcd_is_on = true; mutex_init(&lcd_mtx); - wakeup_init(&lcd_wkup); + semaphore_init(&lcd_wkup, 1, 0); system_enable_irq(DMA_IRQ(DMA_LCD_CHANNEL)); } @@ -118,7 +118,7 @@ void lcd_update_rect(int x, int y, int width, int height) REG_DMAC_DCCSR(DMA_LCD_CHANNEL) |= DMAC_DCCSR_EN; /* Enable DMA channel */ REG_DMAC_DCMD(DMA_LCD_CHANNEL) |= DMAC_DCMD_TIE; /* Enable DMA interrupt */ - wakeup_wait(&lcd_wkup, TIMEOUT_BLOCK); /* Sleeping in lcd_update() should be safe */ + semaphore_wait(&lcd_wkup, TIMEOUT_BLOCK); /* Sleeping in lcd_update() should be safe */ REG_DMAC_DCCSR(DMA_LCD_CHANNEL) &= ~DMAC_DCCSR_EN; /* Disable DMA channel */ dma_disable(); @@ -145,7 +145,7 @@ void DMA_CALLBACK(DMA_LCD_CHANNEL)(void) if (REG_DMAC_DCCSR(DMA_LCD_CHANNEL) & DMAC_DCCSR_TT) REG_DMAC_DCCSR(DMA_LCD_CHANNEL) &= ~DMAC_DCCSR_TT; - wakeup_signal(&lcd_wkup); + semaphore_release(&lcd_wkup); } /* Update the display. -- cgit v1.2.3