diff options
Diffstat (limited to 'firmware/target/coldfire/iaudio')
-rw-r--r-- | firmware/target/coldfire/iaudio/m3/adc-target.h | 3 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m3/power-m3.c | 4 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/power-m5.c | 12 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/x5/power-x5.c | 12 |
4 files changed, 17 insertions, 14 deletions
diff --git a/firmware/target/coldfire/iaudio/m3/adc-target.h b/firmware/target/coldfire/iaudio/m3/adc-target.h index e5ff818647..40ed226bea 100644 --- a/firmware/target/coldfire/iaudio/m3/adc-target.h +++ b/firmware/target/coldfire/iaudio/m3/adc-target.h | |||
@@ -26,4 +26,7 @@ | |||
26 | #define ADC_BATTERY 1 | 26 | #define ADC_BATTERY 1 |
27 | #define ADC_REMOTE 2 | 27 | #define ADC_REMOTE 2 |
28 | 28 | ||
29 | #define NEED_ADC_CLOSE | ||
30 | void adc_close(void); | ||
31 | |||
29 | #endif /* _ADC_TARGET_H_ */ | 32 | #endif /* _ADC_TARGET_H_ */ |
diff --git a/firmware/target/coldfire/iaudio/m3/power-m3.c b/firmware/target/coldfire/iaudio/m3/power-m3.c index 52a5de3460..a7f3fc46be 100644 --- a/firmware/target/coldfire/iaudio/m3/power-m3.c +++ b/firmware/target/coldfire/iaudio/m3/power-m3.c | |||
@@ -36,7 +36,7 @@ void power_init(void) | |||
36 | /* Charger detect */ | 36 | /* Charger detect */ |
37 | and_l(~0x00000020, &GPIO1_ENABLE); | 37 | and_l(~0x00000020, &GPIO1_ENABLE); |
38 | or_l(0x00000020, &GPIO1_FUNCTION); | 38 | or_l(0x00000020, &GPIO1_FUNCTION); |
39 | 39 | ||
40 | /* FIXME: Just disable the multi-colour LED for now. */ | 40 | /* FIXME: Just disable the multi-colour LED for now. */ |
41 | and_l(~0x00000210, &GPIO1_OUT); | 41 | and_l(~0x00000210, &GPIO1_OUT); |
42 | and_l(~0x00008000, &GPIO_OUT); | 42 | and_l(~0x00008000, &GPIO_OUT); |
@@ -61,7 +61,7 @@ void ide_power_enable(bool on) | |||
61 | 61 | ||
62 | bool ide_powered(void) | 62 | bool ide_powered(void) |
63 | { | 63 | { |
64 | return false; | 64 | return (GPIO_OUT & 0x00800000) != 0; |
65 | } | 65 | } |
66 | 66 | ||
67 | void power_off(void) | 67 | void power_off(void) |
diff --git a/firmware/target/coldfire/iaudio/m5/power-m5.c b/firmware/target/coldfire/iaudio/m5/power-m5.c index d33cbec8be..939cae02f2 100644 --- a/firmware/target/coldfire/iaudio/m5/power-m5.c +++ b/firmware/target/coldfire/iaudio/m5/power-m5.c | |||
@@ -38,23 +38,23 @@ void power_init(void) | |||
38 | 38 | ||
39 | bool charger_inserted(void) | 39 | bool charger_inserted(void) |
40 | { | 40 | { |
41 | return (GPIO1_READ & 0x01000000)?true:false; | 41 | return (GPIO1_READ & 0x01000000) != 0; |
42 | } | 42 | } |
43 | 43 | ||
44 | void ide_power_enable(bool on) | 44 | void ide_power_enable(bool on) |
45 | { | 45 | { |
46 | /* GPOOD3 */ | 46 | /* GPOOD3 */ |
47 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); | 47 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); |
48 | if(on) | 48 | pcf50606_write(0x3c, on ? 0x07 : 0x00); |
49 | pcf50606_write(0x3c, 0x07); | ||
50 | else | ||
51 | pcf50606_write(0x3c, 0x00); | ||
52 | set_irq_level(level); | 49 | set_irq_level(level); |
53 | } | 50 | } |
54 | 51 | ||
55 | bool ide_powered(void) | 52 | bool ide_powered(void) |
56 | { | 53 | { |
57 | return false; | 54 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); |
55 | int value = pcf50606_read(0x3c); | ||
56 | set_irq_level(level); | ||
57 | return (value & 0x07) != 0; | ||
58 | } | 58 | } |
59 | 59 | ||
60 | void power_off(void) | 60 | void power_off(void) |
diff --git a/firmware/target/coldfire/iaudio/x5/power-x5.c b/firmware/target/coldfire/iaudio/x5/power-x5.c index cfcb384a24..068b25f577 100644 --- a/firmware/target/coldfire/iaudio/x5/power-x5.c +++ b/firmware/target/coldfire/iaudio/x5/power-x5.c | |||
@@ -38,23 +38,23 @@ void power_init(void) | |||
38 | 38 | ||
39 | bool charger_inserted(void) | 39 | bool charger_inserted(void) |
40 | { | 40 | { |
41 | return (GPIO1_READ & 0x01000000)?true:false; | 41 | return (GPIO1_READ & 0x01000000) != 0; |
42 | } | 42 | } |
43 | 43 | ||
44 | void ide_power_enable(bool on) | 44 | void ide_power_enable(bool on) |
45 | { | 45 | { |
46 | /* GPOOD3 */ | 46 | /* GPOOD3 */ |
47 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); | 47 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); |
48 | if(on) | 48 | pcf50606_write(0x3c, on ? 0x07 : 0x00); |
49 | pcf50606_write(0x3c, 0x07); | ||
50 | else | ||
51 | pcf50606_write(0x3c, 0x00); | ||
52 | set_irq_level(level); | 49 | set_irq_level(level); |
53 | } | 50 | } |
54 | 51 | ||
55 | bool ide_powered(void) | 52 | bool ide_powered(void) |
56 | { | 53 | { |
57 | return false; | 54 | int level = set_irq_level(HIGHEST_IRQ_LEVEL); |
55 | int value = pcf50606_read(0x3c); | ||
56 | set_irq_level(level); | ||
57 | return (value & 0x07) != 0; | ||
58 | } | 58 | } |
59 | 59 | ||
60 | void power_off(void) | 60 | void power_off(void) |