diff options
author | Jens Arnold <amiconn@rockbox.org> | 2009-06-12 18:53:44 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2009-06-12 18:53:44 +0000 |
commit | 81b87fe13d6b5f0e8bafd0810f5f8aca2a57bde3 (patch) | |
tree | 3372bcdbc512e2fd79350bf679fb89736e51e78a /firmware/target/coldfire/iaudio/m5 | |
parent | 94823c65ac7555a7ed19521184064255902ff615 (diff) | |
download | rockbox-81b87fe13d6b5f0e8bafd0810f5f8aca2a57bde3.tar.gz rockbox-81b87fe13d6b5f0e8bafd0810f5f8aca2a57bde3.zip |
Add iAudio M5 FM radio mod to the advanced build options. * Unify iAudio audio driver, fmradio i2c driver, and power driver (M5 + X5 only).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21264 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/iaudio/m5')
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/audio-m5.c | 84 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/power-m5.c | 67 |
2 files changed, 0 insertions, 151 deletions
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 | } | ||