diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
commit | a9c20f5789c13b486d217024a020f9d6163e2d51 (patch) | |
tree | 5da52ca9cc7a28ba21ced042cb739e6160d5f87b /firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c | |
parent | 5f796087b009fee1ae60904b0355cc7febe3330f (diff) | |
download | rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.tar.gz rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.zip |
Gigabeat S:
1) Rework event handling and static registration mechanism. No target-
specific code in mc13783 driver. GPIO event driver interfaces more
cleanly.
2) Somewhat related - enable thread priority for bootloader which is
desireable here (ffs is used for GPIO event enabling anyway and that
goes along with priority).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17593 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c new file mode 100644 index 0000000000..67cfc2d886 --- /dev/null +++ b/firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (c) 2008 by Michael Sevakis | ||
11 | * | ||
12 | * Gigabeat S MC13783 event descriptions | ||
13 | * | ||
14 | * All files in this archive are subject to the GNU General Public License. | ||
15 | * See the file COPYING in the source tree root for full license agreement. | ||
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 "system.h" | ||
23 | #include "mc13783.h" | ||
24 | #include "mc13783-target.h" | ||
25 | #include "adc-target.h" | ||
26 | #include "button-target.h" | ||
27 | #include "usb-target.h" | ||
28 | #include "power-imx31.h" | ||
29 | |||
30 | /* Gigabeat S definitions for static MC13783 event registration */ | ||
31 | |||
32 | static const struct mc13783_event mc13783_events[] = | ||
33 | { | ||
34 | [MC13783_ADCDONE_EVENT] = /* ADC conversion complete */ | ||
35 | { | ||
36 | .set = MC13783_EVENT_SET0, | ||
37 | .mask = MC13783_ADCDONEM, | ||
38 | .callback = adc_done, | ||
39 | }, | ||
40 | [MC13783_ONOFD1_EVENT] = /* Power button */ | ||
41 | { | ||
42 | .set = MC13783_EVENT_SET1, | ||
43 | .mask = MC13783_ONOFD1M, | ||
44 | .callback = button_power_event, | ||
45 | }, | ||
46 | #ifdef HAVE_HEADPHONE_DETECTION | ||
47 | [MC13783_ONOFD2_EVENT] = /* Headphone jack */ | ||
48 | { | ||
49 | .set = MC13783_EVENT_SET1, | ||
50 | .mask = MC13783_ONOFD2M, | ||
51 | .callback = headphone_detect_event, | ||
52 | }, | ||
53 | #endif | ||
54 | [MC13783_CHGDET_EVENT] = /* Charger detection */ | ||
55 | { | ||
56 | .set = MC13783_EVENT_SET0, | ||
57 | .mask = MC13783_CHGDETM, | ||
58 | .callback = charger_detect_event, | ||
59 | }, | ||
60 | [MC13783_USB4V4_EVENT] = /* USB insertion */ | ||
61 | { | ||
62 | .set = MC13783_EVENT_SET0, | ||
63 | .mask = MC13783_USB4V4M, | ||
64 | .callback = usb_connect_event, | ||
65 | }, | ||
66 | }; | ||
67 | |||
68 | const struct mc13783_event_list mc13783_event_list = | ||
69 | { | ||
70 | .count = ARRAYLEN(mc13783_events), | ||
71 | .events = mc13783_events | ||
72 | }; | ||