summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c
diff options
context:
space:
mode:
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.c72
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
32static 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
68const struct mc13783_event_list mc13783_event_list =
69{
70 .count = ARRAYLEN(mc13783_events),
71 .events = mc13783_events
72};