diff options
Diffstat (limited to 'firmware/drivers/power.c')
-rw-r--r-- | firmware/drivers/power.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index c0fa57d3b0..14e912d89c 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c | |||
@@ -33,11 +33,11 @@ bool charger_enabled; | |||
33 | void power_init(void) | 33 | void power_init(void) |
34 | { | 34 | { |
35 | #ifdef HAVE_CHARGE_CTRL | 35 | #ifdef HAVE_CHARGE_CTRL |
36 | __set_bit_constant(5, &PBIORL); /* Set charging control bit to output */ | 36 | or_b(0x20, &PBIORL); /* Set charging control bit to output */ |
37 | charger_enable(false); /* Default to charger OFF */ | 37 | charger_enable(false); /* Default to charger OFF */ |
38 | #endif | 38 | #endif |
39 | #ifdef HAVE_ATA_POWER_OFF | 39 | #ifdef HAVE_ATA_POWER_OFF |
40 | __set_bit_constant(5, &PAIORL); | 40 | or_b(0x20, &PAIORL); |
41 | PACR2 &= 0xFBFF; | 41 | PACR2 &= 0xFBFF; |
42 | #endif | 42 | #endif |
43 | } | 43 | } |
@@ -63,12 +63,12 @@ void charger_enable(bool on) | |||
63 | #ifdef HAVE_CHARGE_CTRL | 63 | #ifdef HAVE_CHARGE_CTRL |
64 | if(on) | 64 | if(on) |
65 | { | 65 | { |
66 | __clear_bit_constant(5, &PBDRL); | 66 | and_b(~0x20, &PBDRL); |
67 | charger_enabled = 1; | 67 | charger_enabled = 1; |
68 | } | 68 | } |
69 | else | 69 | else |
70 | { | 70 | { |
71 | __set_bit_constant(5, &PBDRL); | 71 | or_b(0x20, &PBDRL); |
72 | charger_enabled = 0; | 72 | charger_enabled = 0; |
73 | } | 73 | } |
74 | #else | 74 | #else |
@@ -80,9 +80,9 @@ void ide_power_enable(bool on) | |||
80 | { | 80 | { |
81 | #ifdef HAVE_ATA_POWER_OFF | 81 | #ifdef HAVE_ATA_POWER_OFF |
82 | if(on) | 82 | if(on) |
83 | __set_bit_constant(5, &PADRL); | 83 | or_b(0x20, &PADRL); |
84 | else | 84 | else |
85 | __clear_bit_constant(5, &PADRL); | 85 | and_b(~0x20, &PADRL); |
86 | #else | 86 | #else |
87 | on = on; | 87 | on = on; |
88 | #endif | 88 | #endif |
@@ -92,14 +92,14 @@ void power_off(void) | |||
92 | { | 92 | { |
93 | set_irq_level(15); | 93 | set_irq_level(15); |
94 | #ifdef HAVE_POWEROFF_ON_PBDR | 94 | #ifdef HAVE_POWEROFF_ON_PBDR |
95 | __clear_mask_constant(PBDR_BTN_OFF, &PBDRL); | 95 | and_b(~0x10, &PBDRL); |
96 | __set_mask_constant(PBDR_BTN_OFF, &PBIORL); | 96 | or_b(0x10, &PBIORL); |
97 | #elif defined(HAVE_POWEROFF_ON_PB5) | 97 | #elif defined(HAVE_POWEROFF_ON_PB5) |
98 | __clear_bit_constant(5, &PBDRL); | 98 | and_b(~0x20, &PBDRL); |
99 | __set_bit_constant(5, &PBIORL); | 99 | or_b(0x20, &PBIORL); |
100 | #else | 100 | #else |
101 | __clear_bit_constant(11-8, &PADRH); | 101 | and_b(~0x08, &PADRH); |
102 | __set_bit_constant(11-8, &PAIORH); | 102 | or_b(0x08, &PAIORH); |
103 | #endif | 103 | #endif |
104 | while(1); | 104 | while(1); |
105 | } | 105 | } |