summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-07-19 15:56:15 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-07-19 15:56:15 +0000
commitb221d6d4d4d0ade805d249fdd69a8b8b92769268 (patch)
tree4bf2466a312b51afda062ac1a8c6bbe93619321b
parent25491980d6615098bab331fde65006f7c66eadf3 (diff)
downloadrockbox-b221d6d4d4d0ade805d249fdd69a8b8b92769268.tar.gz
rockbox-b221d6d4d4d0ade805d249fdd69a8b8b92769268.zip
as3525*: use atomic bit manipulation for CCU_IO
fuzev2 button_read_device() runs in interrupt context so writes are atomic git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27494 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/fmradio-i2c-as3525.c8
-rw-r--r--firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c2
-rw-r--r--firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c2
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c8
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/firmware/target/arm/as3525/fmradio-i2c-as3525.c b/firmware/target/arm/as3525/fmradio-i2c-as3525.c
index 9e8dc63144..70287c38b8 100644
--- a/firmware/target/arm/as3525/fmradio-i2c-as3525.c
+++ b/firmware/target/arm/as3525/fmradio-i2c-as3525.c
@@ -158,11 +158,11 @@ void fmradio_i2c_init(void)
158int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) 158int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count)
159{ 159{
160#ifdef SANSA_FUZEV2 160#ifdef SANSA_FUZEV2
161 CCU_IO &= ~(1<<12); 161 bitclr32(&CCU_IO, 1<<12);
162#endif 162#endif
163 int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count); 163 int ret = i2c_write_data(fm_i2c_bus, address, -1, buf, count);
164#ifdef SANSA_FUZEV2 164#ifdef SANSA_FUZEV2
165 CCU_IO |= 1<<12; 165 bitset32(&CCU_IO, 1<<12);
166#endif 166#endif
167 return ret; 167 return ret;
168} 168}
@@ -170,11 +170,11 @@ int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count
170int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) 170int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count)
171{ 171{
172#ifdef SANSA_FUZEV2 172#ifdef SANSA_FUZEV2
173 CCU_IO &= ~(1<<12); 173 bitclr32(&CCU_IO, 1<<12);
174#endif 174#endif
175 int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count); 175 int ret = i2c_read_data(fm_i2c_bus, address, -1, buf, count);
176#ifdef SANSA_FUZEV2 176#ifdef SANSA_FUZEV2
177 CCU_IO |= 1<<12; 177 bitset32(&CCU_IO, 1<<12);
178#endif 178#endif
179 return ret; 179 return ret;
180} 180}
diff --git a/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c b/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c
index 015eebfd87..14c8b77aec 100644
--- a/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c
+++ b/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c
@@ -29,7 +29,7 @@
29void lcd_hw_init(int *offset) 29void lcd_hw_init(int *offset)
30{ 30{
31/* DBOP initialisation, do what OF does */ 31/* DBOP initialisation, do what OF does */
32 CCU_IO |= (1<<12); /* ?? */ 32 bitset32(&CCU_IO, 1<<12); /* ?? */
33 CGU_DBOP |= /*(1<<3)*/ 0x18 | AS3525_DBOP_DIV; 33 CGU_DBOP |= /*(1<<3)*/ 0x18 | AS3525_DBOP_DIV;
34 34
35 DBOP_CTRL = 0x51004; 35 DBOP_CTRL = 0x51004;
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c
index fd6bcb45fc..e87425f762 100644
--- a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c
+++ b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c
@@ -54,7 +54,7 @@ void lcd_write_reg(int reg, int value)
54 54
55static void as3525_dbop_init(void) 55static void as3525_dbop_init(void)
56{ 56{
57 CCU_IO |= 1<<12; 57 bitset32(&CCU_IO, 1<<12);
58 CGU_DBOP |= (1<<4) | (1<<3) | AS3525_DBOP_DIV; 58 CGU_DBOP |= (1<<4) | (1<<3) | AS3525_DBOP_DIV;
59 DBOP_TIMPOL_01 = 0xE12FE12F; 59 DBOP_TIMPOL_01 = 0xE12FE12F;
60 DBOP_TIMPOL_23 = 0xE12F0036; 60 DBOP_TIMPOL_23 = 0xE12F0036;
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 6e5845cf0a..35cb997629 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -564,8 +564,8 @@ int sd_init(void)
564 bitset32(&CGU_PERI, CGU_NAF_CLOCK_ENABLE); 564 bitset32(&CGU_PERI, CGU_NAF_CLOCK_ENABLE);
565#ifdef HAVE_MULTIDRIVE 565#ifdef HAVE_MULTIDRIVE
566 bitset32(&CGU_PERI, CGU_MCI_CLOCK_ENABLE); 566 bitset32(&CGU_PERI, CGU_MCI_CLOCK_ENABLE);
567 CCU_IO &= ~(1<<3); /* bits 3:2 = 01, xpd is SD interface */ 567 bitclr32(&CCU_IO, 1<<3); /* bits 3:2 = 01, xpd is SD interface */
568 CCU_IO |= (1<<2); 568 bitset32(&CCU_IO, 1<<2);
569#endif 569#endif
570 570
571 wakeup_init(&transfer_completion_signal); 571 wakeup_init(&transfer_completion_signal);
@@ -968,7 +968,7 @@ void sd_enable(bool on)
968#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) 968#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE)
969 /* buttonlight AMSes need a bit of special handling for the buttonlight 969 /* buttonlight AMSes need a bit of special handling for the buttonlight
970 * here due to the dual mapping of GPIOD and XPD */ 970 * here due to the dual mapping of GPIOD and XPD */
971 CCU_IO |= (1<<2); /* XPD is SD-MCI interface (b3:2 = 01) */ 971 bitset32(&CCU_IO, 1<<2); /* XPD is SD-MCI interface (b3:2 = 01) */
972 if (buttonlight_is_on) 972 if (buttonlight_is_on)
973 GPIOD_DIR &= ~(1<<7); 973 GPIOD_DIR &= ~(1<<7);
974 else 974 else
@@ -994,7 +994,7 @@ void sd_enable(bool on)
994#endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */ 994#endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */
995 995
996#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) 996#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE)
997 CCU_IO &= ~(1<<2); /* XPD is general purpose IO (b3:2 = 00) */ 997 bitclr32(&CCU_IO, 1<<2); /* XPD is general purpose IO (b3:2 = 00) */
998 if (buttonlight_is_on) 998 if (buttonlight_is_on)
999 _buttonlight_on(); 999 _buttonlight_on();
1000#endif 1000#endif
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index d42a086770..552d88d3bb 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -784,7 +784,7 @@ int sd_init(void)
784 784
785#ifndef SANSA_CLIPV2 785#ifndef SANSA_CLIPV2
786 /* Configure XPD for SD-MCI interface */ 786 /* Configure XPD for SD-MCI interface */
787 CCU_IO |= (1<<2); 787 bitset32(&CCU_IO, 1<<2);
788#endif 788#endif
789 789
790 VIC_INT_ENABLE = INTERRUPT_NAND; 790 VIC_INT_ENABLE = INTERRUPT_NAND;