From 8d1d2f8982a8c68a7572a82ebc8409e257e77994 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Mon, 18 Apr 2011 21:13:40 +0000 Subject: AMS: consistently use bitclr32/bitset32/bitmod32 for register CCU_IO (instead of using |= or &= ) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29748 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c | 4 ++-- firmware/target/arm/as3525/sd-as3525.c | 7 +++---- firmware/target/arm/as3525/sd-as3525v2.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'firmware/target/arm') diff --git a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c index 30f2c0df16..7f82b692c7 100644 --- a/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c +++ b/firmware/target/arm/as3525/sansa-fuzev2/button-fuzev2.c @@ -226,7 +226,7 @@ int button_read_device(void) while(delay--) nop; bool ccu_io_bit12 = CCU_IO & (1<<12); - CCU_IO &= ~(1<<12); + bitclr32(&CCU_IO, 1<<12); /* B1 is shared with FM i2c */ bool gpiob_pin0_dir = GPIOB_DIR & (1<<1); @@ -256,7 +256,7 @@ int button_read_device(void) GPIOB_DIR |= 1<<1; if(ccu_io_bit12) - CCU_IO |= 1<<12; + bitset32(&CCU_IO, 1<<12); #ifdef HAS_BUTTON_HOLD #ifndef BOOTLOADER diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c index 4f356c349e..b36c326cb6 100644 --- a/firmware/target/arm/as3525/sd-as3525.c +++ b/firmware/target/arm/as3525/sd-as3525.c @@ -564,8 +564,7 @@ int sd_init(void) bitset32(&CGU_PERI, CGU_NAF_CLOCK_ENABLE); #ifdef HAVE_MULTIDRIVE bitset32(&CGU_PERI, CGU_MCI_CLOCK_ENABLE); - bitclr32(&CCU_IO, 1<<3); /* bits 3:2 = 01, xpd is SD interface */ - bitset32(&CCU_IO, 1<<2); + bitmod32(&CCU_IO, 1<<2, 3<<2); /* bits 3:2 = 01, xpd is SD interface */ #endif semaphore_init(&transfer_completion_signal, 1, 0); @@ -970,7 +969,7 @@ void sd_enable(bool on) #if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) /* buttonlight AMSes need a bit of special handling for the buttonlight * here due to the dual mapping of GPIOD and XPD */ - bitset32(&CCU_IO, 1<<2); /* XPD is SD-MCI interface (b3:2 = 01) */ + bitmod32(&CCU_IO, 1<<2, 3<<2); /* XPD is SD-MCI interface (b3:2 = 01) */ if (buttonlight_is_on) GPIOD_DIR &= ~(1<<7); else @@ -996,7 +995,7 @@ void sd_enable(bool on) #endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */ #if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE) - bitclr32(&CCU_IO, 1<<2); /* XPD is general purpose IO (b3:2 = 00) */ + bitmod32(&CCU_IO, 0<<2, 3<<2); /* XPD is general purpose IO (b3:2 = 00) */ if (buttonlight_is_on) _buttonlight_on(); #endif diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 022bd13b41..8134869c1e 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -753,7 +753,7 @@ int sd_init(void) #ifndef SANSA_CLIPV2 /* Configure XPD for SD-MCI interface */ - bitset32(&CCU_IO, 1<<2); + bitmod32(&CCU_IO, 1<<2, 3<<2); #endif VIC_INT_ENABLE = INTERRUPT_NAND; -- cgit v1.2.3