summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8700
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
commit12375d1d3aa41f7d277a9af584c7b810b636ec95 (patch)
treefc9ce8029a6910a8dac71b3bf60c71155a01eea4 /firmware/target/arm/s5l8700
parent05e180a1308a095d51d51d0e047fcd44425ea88f (diff)
downloadrockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.gz
rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.zip
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
Diffstat (limited to 'firmware/target/arm/s5l8700')
-rw-r--r--firmware/target/arm/s5l8700/adc-s5l8700.c8
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/arm/s5l8700/adc-s5l8700.c b/firmware/target/arm/s5l8700/adc-s5l8700.c
index f979a9d54f..270c133e94 100644
--- a/firmware/target/arm/s5l8700/adc-s5l8700.c
+++ b/firmware/target/arm/s5l8700/adc-s5l8700.c
@@ -42,11 +42,11 @@
42 42
43 43
44static struct mutex adc_mtx; 44static struct mutex adc_mtx;
45static struct wakeup adc_wakeup; 45static struct semaphore adc_wakeup;
46 46
47void INT_ADC(void) 47void INT_ADC(void)
48{ 48{
49 wakeup_signal(&adc_wakeup); 49 semaphore_release(&adc_wakeup);
50} 50}
51 51
52unsigned short adc_read(int channel) 52unsigned short adc_read(int channel)
@@ -61,7 +61,7 @@ unsigned short adc_read(int channel)
61 (1 << 0); /* enable start */ 61 (1 << 0); /* enable start */
62 62
63 /* wait for conversion */ 63 /* wait for conversion */
64 wakeup_wait(&adc_wakeup, TIMEOUT_BLOCK); 64 semaphore_wait(&adc_wakeup, TIMEOUT_BLOCK);
65 65
66 /* get the converted data */ 66 /* get the converted data */
67 data = ADCDAT0 & 0x3FF; 67 data = ADCDAT0 & 0x3FF;
@@ -77,7 +77,7 @@ unsigned short adc_read(int channel)
77void adc_init(void) 77void adc_init(void)
78{ 78{
79 mutex_init(&adc_mtx); 79 mutex_init(&adc_mtx);
80 wakeup_init(&adc_wakeup); 80 semaphore_init(&adc_wakeup, 1, 0);
81 81
82 /* enable clock to ADC */ 82 /* enable clock to ADC */
83 PWRCON &= ~(1 << 10); 83 PWRCON &= ~(1 << 10);
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c
index 8a4541a226..9261e5b3a0 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c
@@ -94,9 +94,9 @@ static long nand_last_activity_value = -1;
94static long nand_stack[DEFAULT_STACK_SIZE]; 94static long nand_stack[DEFAULT_STACK_SIZE];
95 95
96static struct mutex nand_mtx; 96static struct mutex nand_mtx;
97static struct wakeup nand_wakeup; 97static struct semaphore nand_complete;
98static struct mutex ecc_mtx; 98static struct mutex ecc_mtx;
99static struct wakeup ecc_wakeup; 99static struct semaphore ecc_complete;
100 100
101static uint8_t nand_data[0x800] STORAGE_ALIGN_ATTR; 101static uint8_t nand_data[0x800] STORAGE_ALIGN_ATTR;
102static uint8_t nand_ctrl[0x200] STORAGE_ALIGN_ATTR; 102static uint8_t nand_ctrl[0x200] STORAGE_ALIGN_ATTR;
@@ -731,9 +731,9 @@ static void nand_thread(void)
731int nand_device_init(void) 731int nand_device_init(void)
732{ 732{
733 mutex_init(&nand_mtx); 733 mutex_init(&nand_mtx);
734 wakeup_init(&nand_wakeup); 734 semaphore_init(&nand_complete, 1, 0);
735 mutex_init(&ecc_mtx); 735 mutex_init(&ecc_mtx);
736 wakeup_init(&ecc_wakeup); 736 semaphore_init(&ecc_complete, 1, 0);
737 737
738 uint32_t type; 738 uint32_t type;
739 uint32_t i, j; 739 uint32_t i, j;