diff options
-rw-r--r-- | firmware/SOURCES | 17 | ||||
-rw-r--r-- | firmware/export/config-iaudiom5.h | 10 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/audio-iaudio.c (renamed from firmware/target/coldfire/iaudio/x5/audio-x5.c) | 23 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/fmradio_i2c-iaudio.c (renamed from firmware/target/coldfire/iaudio/m3/fmradio_i2c-m3.c) | 0 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m3/audio-m3.c | 116 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/audio-m5.c | 84 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/power-m5.c | 67 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/power-x5m5.c (renamed from firmware/target/coldfire/iaudio/x5/power-x5.c) | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/x5/fmradio_i2c-x5.c | 39 | ||||
-rwxr-xr-x | tools/configure | 43 |
10 files changed, 74 insertions, 327 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index da85a7123a..48e4c77760 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -588,22 +588,22 @@ target/coldfire/ata-as-coldfire.S | |||
588 | target/coldfire/pcf50606-coldfire.c | 588 | target/coldfire/pcf50606-coldfire.c |
589 | target/coldfire/iaudio/adc-iaudio.c | 589 | target/coldfire/iaudio/adc-iaudio.c |
590 | target/coldfire/iaudio/ata-iaudio.c | 590 | target/coldfire/iaudio/ata-iaudio.c |
591 | target/coldfire/iaudio/fmradio_i2c-iaudio.c | ||
591 | target/coldfire/iaudio/lcd-remote-as-iaudio.S | 592 | target/coldfire/iaudio/lcd-remote-as-iaudio.S |
592 | target/coldfire/iaudio/lcd-remote-iaudio.c | 593 | target/coldfire/iaudio/lcd-remote-iaudio.c |
593 | target/coldfire/iaudio/pcf50606-iaudio.c | 594 | target/coldfire/iaudio/pcf50606-iaudio.c |
595 | target/coldfire/iaudio/power-x5m5.c | ||
594 | target/coldfire/iaudio/powermgmt-iaudio.c | 596 | target/coldfire/iaudio/powermgmt-iaudio.c |
595 | target/coldfire/iaudio/system-iaudio.c | 597 | target/coldfire/iaudio/system-iaudio.c |
596 | target/coldfire/iaudio/usb-iaudio.c | 598 | target/coldfire/iaudio/usb-iaudio.c |
597 | target/coldfire/iaudio/x5/backlight-x5.c | 599 | target/coldfire/iaudio/x5/backlight-x5.c |
598 | target/coldfire/iaudio/x5/button-x5.c | 600 | target/coldfire/iaudio/x5/button-x5.c |
599 | target/coldfire/iaudio/x5/ds2411-x5.c | 601 | target/coldfire/iaudio/x5/ds2411-x5.c |
600 | target/coldfire/iaudio/x5/fmradio_i2c-x5.c | ||
601 | target/coldfire/iaudio/x5/lcd-as-x5.S | 602 | target/coldfire/iaudio/x5/lcd-as-x5.S |
602 | target/coldfire/iaudio/x5/lcd-x5.c | 603 | target/coldfire/iaudio/x5/lcd-x5.c |
603 | target/coldfire/iaudio/x5/m5636-x5.c | 604 | target/coldfire/iaudio/x5/m5636-x5.c |
604 | target/coldfire/iaudio/x5/power-x5.c | ||
605 | #ifndef BOOTLOADER | 605 | #ifndef BOOTLOADER |
606 | target/coldfire/iaudio/x5/audio-x5.c | 606 | target/coldfire/iaudio/audio-iaudio.c |
607 | #endif | 607 | #endif |
608 | #endif /* SIMULATOR */ | 608 | #endif /* SIMULATOR */ |
609 | #endif /* IAUDIO_X5 */ | 609 | #endif /* IAUDIO_X5 */ |
@@ -614,19 +614,22 @@ target/coldfire/ata-as-coldfire.S | |||
614 | target/coldfire/pcf50606-coldfire.c | 614 | target/coldfire/pcf50606-coldfire.c |
615 | target/coldfire/iaudio/adc-iaudio.c | 615 | target/coldfire/iaudio/adc-iaudio.c |
616 | target/coldfire/iaudio/ata-iaudio.c | 616 | target/coldfire/iaudio/ata-iaudio.c |
617 | #ifdef HAVE_FMRADIO_IN /* FM radio mod */ | ||
618 | target/coldfire/iaudio/fmradio_i2c-iaudio.c | ||
619 | #endif | ||
617 | target/coldfire/iaudio/lcd-remote-as-iaudio.S | 620 | target/coldfire/iaudio/lcd-remote-as-iaudio.S |
618 | target/coldfire/iaudio/lcd-remote-iaudio.c | 621 | target/coldfire/iaudio/lcd-remote-iaudio.c |
619 | target/coldfire/iaudio/m5/backlight-m5.c | 622 | target/coldfire/iaudio/m5/backlight-m5.c |
620 | target/coldfire/iaudio/m5/button-m5.c | 623 | target/coldfire/iaudio/m5/button-m5.c |
621 | target/coldfire/iaudio/m5/lcd-as-m5.S | 624 | target/coldfire/iaudio/m5/lcd-as-m5.S |
622 | target/coldfire/iaudio/m5/lcd-m5.c | 625 | target/coldfire/iaudio/m5/lcd-m5.c |
623 | target/coldfire/iaudio/m5/power-m5.c | ||
624 | target/coldfire/iaudio/pcf50606-iaudio.c | 626 | target/coldfire/iaudio/pcf50606-iaudio.c |
627 | target/coldfire/iaudio/power-x5m5.c | ||
625 | target/coldfire/iaudio/powermgmt-iaudio.c | 628 | target/coldfire/iaudio/powermgmt-iaudio.c |
626 | target/coldfire/iaudio/system-iaudio.c | 629 | target/coldfire/iaudio/system-iaudio.c |
627 | target/coldfire/iaudio/usb-iaudio.c | 630 | target/coldfire/iaudio/usb-iaudio.c |
628 | #ifndef BOOTLOADER | 631 | #ifndef BOOTLOADER |
629 | target/coldfire/iaudio/m5/audio-m5.c | 632 | target/coldfire/iaudio/audio-iaudio.c |
630 | #endif | 633 | #endif |
631 | #endif /* SIMULATOR */ | 634 | #endif /* SIMULATOR */ |
632 | #endif /* IAUDIO_M5 */ | 635 | #endif /* IAUDIO_M5 */ |
@@ -634,11 +637,11 @@ target/coldfire/iaudio/m5/audio-m5.c | |||
634 | #ifdef IAUDIO_M3 | 637 | #ifdef IAUDIO_M3 |
635 | #ifndef SIMULATOR | 638 | #ifndef SIMULATOR |
636 | target/coldfire/ata-as-coldfire.S | 639 | target/coldfire/ata-as-coldfire.S |
640 | target/coldfire/iaudio/fmradio_i2c-iaudio.c | ||
637 | target/coldfire/iaudio/m3/adc-m3.c | 641 | target/coldfire/iaudio/m3/adc-m3.c |
638 | target/coldfire/iaudio/m3/ata-m3.c | 642 | target/coldfire/iaudio/m3/ata-m3.c |
639 | target/coldfire/iaudio/m3/backlight-m3.c | 643 | target/coldfire/iaudio/m3/backlight-m3.c |
640 | target/coldfire/iaudio/m3/button-m3.c | 644 | target/coldfire/iaudio/m3/button-m3.c |
641 | target/coldfire/iaudio/m3/fmradio_i2c-m3.c | ||
642 | target/coldfire/iaudio/m3/lcd-m3.c | 645 | target/coldfire/iaudio/m3/lcd-m3.c |
643 | target/coldfire/iaudio/m3/lcd-as-m3.S | 646 | target/coldfire/iaudio/m3/lcd-as-m3.S |
644 | target/coldfire/iaudio/m3/power-m3.c | 647 | target/coldfire/iaudio/m3/power-m3.c |
@@ -646,7 +649,7 @@ target/coldfire/iaudio/m3/powermgmt-m3.c | |||
646 | target/coldfire/iaudio/m3/system-m3.c | 649 | target/coldfire/iaudio/m3/system-m3.c |
647 | target/coldfire/iaudio/m3/usb-m3.c | 650 | target/coldfire/iaudio/m3/usb-m3.c |
648 | #ifndef BOOTLOADER | 651 | #ifndef BOOTLOADER |
649 | target/coldfire/iaudio/m3/audio-m3.c | 652 | target/coldfire/iaudio/audio-iaudio.c |
650 | #endif | 653 | #endif |
651 | #endif /* SIMULATOR */ | 654 | #endif /* SIMULATOR */ |
652 | #endif /* IAUDIO_M3 */ | 655 | #endif /* IAUDIO_M3 */ |
diff --git a/firmware/export/config-iaudiom5.h b/firmware/export/config-iaudiom5.h index 0df8414fe9..5d86087d44 100644 --- a/firmware/export/config-iaudiom5.h +++ b/firmware/export/config-iaudiom5.h | |||
@@ -16,7 +16,11 @@ | |||
16 | 16 | ||
17 | /* Define bitmask of input sources - recordable bitmask can be defined | 17 | /* Define bitmask of input sources - recordable bitmask can be defined |
18 | explicitly if different */ | 18 | explicitly if different */ |
19 | #ifdef HAVE_FMRADIO_IN /* FM modded M5 */ | ||
20 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) | ||
21 | #else /* stock M5 */ | ||
19 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) | 22 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) |
23 | #endif | ||
20 | 24 | ||
21 | /* define the bitmask of hardware sample rates */ | 25 | /* define the bitmask of hardware sample rates */ |
22 | #define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11) | 26 | #define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11) |
@@ -109,6 +113,12 @@ | |||
109 | /* The number of bytes reserved for loadable plugins */ | 113 | /* The number of bytes reserved for loadable plugins */ |
110 | #define PLUGIN_BUFFER_SIZE 0x80000 | 114 | #define PLUGIN_BUFFER_SIZE 0x80000 |
111 | 115 | ||
116 | #ifdef HAVE_FMRADIO_IN /* FM modded M5 */ | ||
117 | /* FM Tuner */ | ||
118 | #define CONFIG_TUNER TEA5767 | ||
119 | #define CONFIG_TUNER_XTAL 32768 | ||
120 | #endif | ||
121 | |||
112 | #define HAVE_TLV320 | 122 | #define HAVE_TLV320 |
113 | 123 | ||
114 | /* TLV320 has no tone controls, so we use the software ones */ | 124 | /* TLV320 has no tone controls, so we use the software ones */ |
diff --git a/firmware/target/coldfire/iaudio/x5/audio-x5.c b/firmware/target/coldfire/iaudio/audio-iaudio.c index eb74eaf3b6..ed3a926d72 100644 --- a/firmware/target/coldfire/iaudio/x5/audio-x5.c +++ b/firmware/target/coldfire/iaudio/audio-iaudio.c | |||
@@ -18,6 +18,7 @@ | |||
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "config.h" | ||
21 | #include "system.h" | 22 | #include "system.h" |
22 | #include "cpu.h" | 23 | #include "cpu.h" |
23 | #include "audio.h" | 24 | #include "audio.h" |
@@ -41,9 +42,13 @@ void audio_input_mux(int source, unsigned flags) | |||
41 | { | 42 | { |
42 | /* Prevent pops from unneeded switching */ | 43 | /* Prevent pops from unneeded switching */ |
43 | static int last_source = AUDIO_SRC_PLAYBACK; | 44 | static int last_source = AUDIO_SRC_PLAYBACK; |
45 | #ifdef HAVE_FMRADIO_IN | ||
44 | static bool last_recording = false; | 46 | static bool last_recording = false; |
45 | 47 | ||
46 | bool recording = flags & SRCF_RECORDING; | 48 | bool recording = flags & SRCF_RECORDING; |
49 | #else | ||
50 | (void)flags; | ||
51 | #endif | ||
47 | 52 | ||
48 | switch (source) | 53 | switch (source) |
49 | { | 54 | { |
@@ -76,6 +81,7 @@ void audio_input_mux(int source, unsigned flags) | |||
76 | } | 81 | } |
77 | break; | 82 | break; |
78 | 83 | ||
84 | #ifdef HAVE_FMRADIO_IN | ||
79 | case AUDIO_SRC_FMRADIO: /* recording and playback */ | 85 | case AUDIO_SRC_FMRADIO: /* recording and playback */ |
80 | if (!recording) | 86 | if (!recording) |
81 | audiohw_set_recvol(23, 23, AUDIO_GAIN_LINEIN); | 87 | audiohw_set_recvol(23, 23, AUDIO_GAIN_LINEIN); |
@@ -99,17 +105,34 @@ void audio_input_mux(int source, unsigned flags) | |||
99 | coldfire_set_dataincontrol(0); | 105 | coldfire_set_dataincontrol(0); |
100 | } | 106 | } |
101 | break; | 107 | break; |
108 | #endif /* HAVE_FMRADIO_IN */ | ||
102 | } /* end switch */ | 109 | } /* end switch */ |
103 | 110 | ||
104 | /* set line multiplexer */ | 111 | /* set line multiplexer */ |
112 | #ifdef IAUDIO_M3 | ||
113 | #ifdef HAVE_FMRADIO_IN | ||
114 | if (source == AUDIO_SRC_FMRADIO) | ||
115 | and_l(~(1 << 25), &GPIO1_OUT); /* FM radio */ | ||
116 | else | ||
117 | #endif | ||
118 | or_l((1 << 25), &GPIO1_OUT); /* Line In */ | ||
119 | |||
120 | or_l((1 << 25), &GPIO1_ENABLE); | ||
121 | or_l((1 << 25), &GPIO1_FUNCTION); | ||
122 | |||
123 | #else /* iAudio M5, X5 */ | ||
124 | #ifdef HAVE_FMRADIO_IN | ||
105 | if (source == AUDIO_SRC_FMRADIO) | 125 | if (source == AUDIO_SRC_FMRADIO) |
106 | and_l(~(1 << 29), &GPIO_OUT); /* FM radio */ | 126 | and_l(~(1 << 29), &GPIO_OUT); /* FM radio */ |
107 | else | 127 | else |
128 | #endif | ||
108 | or_l((1 << 29), &GPIO_OUT); /* Line In */ | 129 | or_l((1 << 29), &GPIO_OUT); /* Line In */ |
109 | 130 | ||
110 | or_l((1 << 29), &GPIO_ENABLE); | 131 | or_l((1 << 29), &GPIO_ENABLE); |
111 | or_l((1 << 29), &GPIO_FUNCTION); | 132 | or_l((1 << 29), &GPIO_FUNCTION); |
112 | 133 | ||
134 | #endif /* iAudio M5, X5 */ | ||
135 | |||
113 | last_source = source; | 136 | last_source = source; |
114 | } /* audio_input_mux */ | 137 | } /* audio_input_mux */ |
115 | 138 | ||
diff --git a/firmware/target/coldfire/iaudio/m3/fmradio_i2c-m3.c b/firmware/target/coldfire/iaudio/fmradio_i2c-iaudio.c index 8bc6fb8445..8bc6fb8445 100644 --- a/firmware/target/coldfire/iaudio/m3/fmradio_i2c-m3.c +++ b/firmware/target/coldfire/iaudio/fmradio_i2c-iaudio.c | |||
diff --git a/firmware/target/coldfire/iaudio/m3/audio-m3.c b/firmware/target/coldfire/iaudio/m3/audio-m3.c deleted file mode 100644 index ea401cc40e..0000000000 --- a/firmware/target/coldfire/iaudio/m3/audio-m3.c +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Michael Sevakis | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "system.h" | ||
23 | #include "cpu.h" | ||
24 | #include "audio.h" | ||
25 | #include "sound.h" | ||
26 | |||
27 | void audio_set_output_source(int source) | ||
28 | { | ||
29 | int level = set_irq_level(DMA_IRQ_LEVEL); | ||
30 | unsigned long txsrc; | ||
31 | |||
32 | if ((unsigned)source >= AUDIO_NUM_SOURCES) | ||
33 | txsrc = (3 << 8); /* playback, PDOR3 */ | ||
34 | else | ||
35 | txsrc = (4 << 8); /* recording, iis1RcvData */ | ||
36 | |||
37 | IIS1CONFIG = (IIS1CONFIG & ~(7 << 8)) | txsrc; | ||
38 | restore_irq(level); | ||
39 | } /* audio_set_output_source */ | ||
40 | |||
41 | void audio_input_mux(int source, unsigned flags) | ||
42 | { | ||
43 | /* Prevent pops from unneeded switching */ | ||
44 | static int last_source = AUDIO_SRC_PLAYBACK; | ||
45 | static bool last_recording = false; | ||
46 | |||
47 | bool recording = flags & SRCF_RECORDING; | ||
48 | |||
49 | switch (source) | ||
50 | { | ||
51 | default: /* playback - no recording */ | ||
52 | source = AUDIO_SRC_PLAYBACK; | ||
53 | case AUDIO_SRC_PLAYBACK: | ||
54 | if (source != last_source) | ||
55 | { | ||
56 | audiohw_disable_recording(); | ||
57 | audiohw_set_monitor(false); | ||
58 | coldfire_set_dataincontrol(0); | ||
59 | } | ||
60 | break; | ||
61 | |||
62 | case AUDIO_SRC_MIC: /* recording only */ | ||
63 | if (source != last_source) | ||
64 | { | ||
65 | audiohw_enable_recording(true); /* source mic */ | ||
66 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | ||
67 | coldfire_set_dataincontrol((3 << 14) | (4 << 3)); | ||
68 | } | ||
69 | break; | ||
70 | |||
71 | case AUDIO_SRC_LINEIN: /* recording only */ | ||
72 | if (source != last_source) | ||
73 | { | ||
74 | audiohw_enable_recording(false); /* source line */ | ||
75 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | ||
76 | coldfire_set_dataincontrol((3 << 14) | (4 << 3)); | ||
77 | } | ||
78 | break; | ||
79 | |||
80 | case AUDIO_SRC_FMRADIO: /* recording and playback */ | ||
81 | if (!recording) | ||
82 | audiohw_set_recvol(23, 23, AUDIO_GAIN_LINEIN); | ||
83 | |||
84 | /* I2S recording and analog playback */ | ||
85 | if (source == last_source && recording == last_recording) | ||
86 | break; | ||
87 | |||
88 | last_recording = recording; | ||
89 | |||
90 | if (recording) | ||
91 | { | ||
92 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | ||
93 | coldfire_set_dataincontrol((3 << 14) | (4 << 3)); | ||
94 | audiohw_enable_recording(false); /* source line */ | ||
95 | } | ||
96 | else | ||
97 | { | ||
98 | audiohw_disable_recording(); | ||
99 | audiohw_set_monitor(true); /* analog bypass */ | ||
100 | coldfire_set_dataincontrol(0); | ||
101 | } | ||
102 | break; | ||
103 | } /* end switch */ | ||
104 | |||
105 | /* set line multiplexer */ | ||
106 | if (source == AUDIO_SRC_FMRADIO) | ||
107 | and_l(~(1 << 25), &GPIO1_OUT); /* FM radio */ | ||
108 | else | ||
109 | or_l((1 << 25), &GPIO1_OUT); /* Line In */ | ||
110 | |||
111 | or_l((1 << 25), &GPIO1_ENABLE); | ||
112 | or_l((1 << 25), &GPIO1_FUNCTION); | ||
113 | |||
114 | last_source = source; | ||
115 | } /* audio_input_mux */ | ||
116 | |||
diff --git a/firmware/target/coldfire/iaudio/m5/audio-m5.c b/firmware/target/coldfire/iaudio/m5/audio-m5.c deleted file mode 100644 index 728f9be063..0000000000 --- a/firmware/target/coldfire/iaudio/m5/audio-m5.c +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Michael Sevakis | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "system.h" | ||
22 | #include "cpu.h" | ||
23 | #include "audio.h" | ||
24 | #include "sound.h" | ||
25 | |||
26 | void audio_set_output_source(int source) | ||
27 | { | ||
28 | int level = set_irq_level(DMA_IRQ_LEVEL); | ||
29 | unsigned long txsrc; | ||
30 | |||
31 | if ((unsigned)source >= AUDIO_NUM_SOURCES) | ||
32 | txsrc = (3 << 8); /* playback, PDOR3 */ | ||
33 | else | ||
34 | txsrc = (4 << 8); /* recording, iis1RcvData */ | ||
35 | |||
36 | IIS1CONFIG = (IIS1CONFIG & ~(7 << 8)) | txsrc; | ||
37 | restore_irq(level); | ||
38 | } /* audio_set_output_source */ | ||
39 | |||
40 | void audio_input_mux(int source, unsigned flags) | ||
41 | { | ||
42 | /* Prevent pops from unneeded switching */ | ||
43 | static int last_source = AUDIO_SRC_PLAYBACK; | ||
44 | |||
45 | (void)flags; | ||
46 | |||
47 | switch (source) | ||
48 | { | ||
49 | default: /* playback - no recording */ | ||
50 | source = AUDIO_SRC_PLAYBACK; | ||
51 | case AUDIO_SRC_PLAYBACK: | ||
52 | if (source != last_source) | ||
53 | { | ||
54 | audiohw_disable_recording(); | ||
55 | audiohw_set_monitor(false); | ||
56 | coldfire_set_dataincontrol(0); | ||
57 | } | ||
58 | break; | ||
59 | |||
60 | case AUDIO_SRC_MIC: /* recording only */ | ||
61 | if (source != last_source) | ||
62 | { | ||
63 | audiohw_enable_recording(true); /* source mic */ | ||
64 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | ||
65 | coldfire_set_dataincontrol((3 << 14) | (4 << 3)); | ||
66 | } | ||
67 | break; | ||
68 | |||
69 | case AUDIO_SRC_LINEIN: /* recording only */ | ||
70 | if (source != last_source) | ||
71 | { | ||
72 | audiohw_enable_recording(false); /* source line */ | ||
73 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | ||
74 | coldfire_set_dataincontrol((3 << 14) | (4 << 3)); | ||
75 | } | ||
76 | break; | ||
77 | } /* end switch */ | ||
78 | |||
79 | or_l((1 << 29), &GPIO_OUT); /* Line In */ | ||
80 | or_l((1 << 29), &GPIO_ENABLE); | ||
81 | or_l((1 << 29), &GPIO_FUNCTION); | ||
82 | |||
83 | last_source = source; | ||
84 | } /* audio_input_mux */ | ||
diff --git a/firmware/target/coldfire/iaudio/m5/power-m5.c b/firmware/target/coldfire/iaudio/m5/power-m5.c deleted file mode 100644 index 8bb36c663d..0000000000 --- a/firmware/target/coldfire/iaudio/m5/power-m5.c +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | #include "cpu.h" | ||
23 | #include <stdbool.h> | ||
24 | #include "kernel.h" | ||
25 | #include "system.h" | ||
26 | #include "power.h" | ||
27 | #include "pcf50606.h" | ||
28 | #include "lcd-remote-target.h" | ||
29 | |||
30 | void power_init(void) | ||
31 | { | ||
32 | /* Charger detect */ | ||
33 | and_l(~0x01000000, &GPIO1_ENABLE); | ||
34 | or_l(0x01000000, &GPIO1_FUNCTION); | ||
35 | |||
36 | pcf50606_init(); | ||
37 | } | ||
38 | |||
39 | unsigned int power_input_status(void) | ||
40 | { | ||
41 | return (GPIO1_READ & 0x01000000) ? | ||
42 | POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE; | ||
43 | } | ||
44 | |||
45 | void ide_power_enable(bool on) | ||
46 | { | ||
47 | /* GPOOD3 */ | ||
48 | int level = disable_irq_save(); | ||
49 | pcf50606_write(0x3c, on ? 0x07 : 0x00); | ||
50 | restore_irq(level); | ||
51 | } | ||
52 | |||
53 | bool ide_powered(void) | ||
54 | { | ||
55 | int level = disable_irq_save(); | ||
56 | int value = pcf50606_read(0x3c); | ||
57 | restore_irq(level); | ||
58 | return (value & 0x07) != 0; | ||
59 | } | ||
60 | |||
61 | void power_off(void) | ||
62 | { | ||
63 | lcd_remote_poweroff(); | ||
64 | set_irq_level(DISABLE_INTERRUPTS); | ||
65 | and_l(~0x00000008, &GPIO_OUT); /* Set KEEPACT low */ | ||
66 | asm("halt"); | ||
67 | } | ||
diff --git a/firmware/target/coldfire/iaudio/x5/power-x5.c b/firmware/target/coldfire/iaudio/power-x5m5.c index 4feb9c15d0..e9bdde16ec 100644 --- a/firmware/target/coldfire/iaudio/x5/power-x5.c +++ b/firmware/target/coldfire/iaudio/power-x5m5.c | |||
@@ -66,8 +66,10 @@ void power_off(void) | |||
66 | asm("halt"); | 66 | asm("halt"); |
67 | } | 67 | } |
68 | 68 | ||
69 | #if (CONFIG_TUNER & TEA5767) | ||
69 | bool tuner_power(bool status) | 70 | bool tuner_power(bool status) |
70 | { | 71 | { |
71 | (void)status; | 72 | (void)status; |
72 | return true; | 73 | return true; |
73 | } | 74 | } |
75 | #endif | ||
diff --git a/firmware/target/coldfire/iaudio/x5/fmradio_i2c-x5.c b/firmware/target/coldfire/iaudio/x5/fmradio_i2c-x5.c deleted file mode 100644 index 68baed9bb3..0000000000 --- a/firmware/target/coldfire/iaudio/x5/fmradio_i2c-x5.c +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * Physical interface of the Philips TEA5767 in iAudio x5 | ||
10 | * | ||
11 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | #include "config.h" | ||
23 | |||
24 | #if (CONFIG_TUNER & TEA5767) | ||
25 | |||
26 | #include "i2c-coldfire.h" | ||
27 | |||
28 | int fmradio_i2c_write(unsigned char address, const unsigned char* buf, | ||
29 | int count) | ||
30 | { | ||
31 | return i2c_write(I2C_IFACE_0, address, buf, count); | ||
32 | } | ||
33 | |||
34 | int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) | ||
35 | { | ||
36 | return i2c_read(I2C_IFACE_0, address, buf, count); | ||
37 | } | ||
38 | |||
39 | #endif | ||
diff --git a/tools/configure b/tools/configure index f081b8ba72..50091a5da3 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -321,12 +321,15 @@ whichadvanced () { | |||
321 | if [ "$memory" = "2" ]; then | 321 | if [ "$memory" = "2" ]; then |
322 | printf ", (8)MB MOD" | 322 | printf ", (8)MB MOD" |
323 | fi | 323 | fi |
324 | if [ "$modelname" = "h120" ]; then | ||
325 | printf ", (R)TC MOD" | ||
326 | fi | ||
327 | if [ "$t_model" = "ondio" ]; then | 324 | if [ "$t_model" = "ondio" ]; then |
328 | printf ", (B)acklight MOD" | 325 | printf ", (B)acklight MOD" |
329 | fi | 326 | fi |
327 | if [ "$modelname" = "m5" ]; then | ||
328 | printf ", (F)M radio MOD" | ||
329 | fi | ||
330 | if [ "$modelname" = "h120" ]; then | ||
331 | printf ", (R)TC MOD" | ||
332 | fi | ||
330 | echo "" | 333 | echo "" |
331 | 334 | ||
332 | cont=1 | 335 | cont=1 |
@@ -372,6 +375,22 @@ whichadvanced () { | |||
372 | cont=0 | 375 | cont=0 |
373 | fi | 376 | fi |
374 | ;; | 377 | ;; |
378 | [Bb]) | ||
379 | if [ "$t_model" = "ondio" ]; then | ||
380 | have_backlight="#define HAVE_BACKLIGHT" | ||
381 | echo "Backlight functions enabled" | ||
382 | else | ||
383 | cont=0 | ||
384 | fi | ||
385 | ;; | ||
386 | [Ff]) | ||
387 | if [ "$modelname" = "m5" ]; then | ||
388 | have_fmradio_in="#define HAVE_FMRADIO_IN" | ||
389 | echo "FM radio functions enabled" | ||
390 | else | ||
391 | cont=0 | ||
392 | fi | ||
393 | ;; | ||
375 | [Rr]) | 394 | [Rr]) |
376 | if [ "$modelname" = "h120" ]; then | 395 | if [ "$modelname" = "h120" ]; then |
377 | config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231" | 396 | config_rtc="#define CONFIG_RTC RTC_DS1339_DS3231" |
@@ -381,14 +400,6 @@ whichadvanced () { | |||
381 | cont=0 | 400 | cont=0 |
382 | fi | 401 | fi |
383 | ;; | 402 | ;; |
384 | [Bb]) | ||
385 | if [ "$t_model" = "ondio" ]; then | ||
386 | have_backlight="#define HAVE_BACKLIGHT" | ||
387 | echo "Backlight functions enabled" | ||
388 | else | ||
389 | cont=0 | ||
390 | fi | ||
391 | ;; | ||
392 | *) | 403 | *) |
393 | cont=0 | 404 | cont=0 |
394 | ;; | 405 | ;; |
@@ -2516,6 +2527,7 @@ sed > autoconf.h \ | |||
2516 | -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \ | 2527 | -e "s,@have_rtc_alarm@,$have_rtc_alarm,g" \ |
2517 | -e "s,@RBDIR@,${rbdir},g" \ | 2528 | -e "s,@RBDIR@,${rbdir},g" \ |
2518 | -e "s,@have_backlight@,$have_backlight,g" \ | 2529 | -e "s,@have_backlight@,$have_backlight,g" \ |
2530 | -e "s,@have_fmradio_in@,$have_fmradio_in,g" \ | ||
2519 | <<EOF | 2531 | <<EOF |
2520 | /* This header was made by configure */ | 2532 | /* This header was made by configure */ |
2521 | #ifndef __BUILD_AUTOCONF_H | 2533 | #ifndef __BUILD_AUTOCONF_H |
@@ -2527,13 +2539,16 @@ sed > autoconf.h \ | |||
2527 | /* Define this if you build rockbox to support the logf logging and display */ | 2539 | /* Define this if you build rockbox to support the logf logging and display */ |
2528 | #undef ROCKBOX_HAS_LOGF | 2540 | #undef ROCKBOX_HAS_LOGF |
2529 | 2541 | ||
2542 | /* optional define for a backlight modded Ondio */ | ||
2543 | @have_backlight@ | ||
2544 | |||
2545 | /* optional define for FM radio mod for iAudio M5 */ | ||
2546 | @have_fmradio_in@ | ||
2547 | |||
2530 | /* optional defines for RTC mod for h1x0 */ | 2548 | /* optional defines for RTC mod for h1x0 */ |
2531 | @config_rtc@ | 2549 | @config_rtc@ |
2532 | @have_rtc_alarm@ | 2550 | @have_rtc_alarm@ |
2533 | 2551 | ||
2534 | /* optional define for a backlight modded Ondio */ | ||
2535 | @have_backlight@ | ||
2536 | |||
2537 | /* root of Rockbox */ | 2552 | /* root of Rockbox */ |
2538 | #define ROCKBOX_DIR "/@RBDIR@" | 2553 | #define ROCKBOX_DIR "/@RBDIR@" |
2539 | 2554 | ||