From a9c20f5789c13b486d217024a020f9d6163e2d51 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 21 May 2008 08:42:11 +0000 Subject: 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 --- .../arm/imx31/gigabeat-s/mc13783-gigabeat-s.c | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c (limited to 'firmware/target/arm/imx31/gigabeat-s/mc13783-gigabeat-s.c') 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (c) 2008 by Michael Sevakis + * + * Gigabeat S MC13783 event descriptions + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "config.h" +#include "system.h" +#include "mc13783.h" +#include "mc13783-target.h" +#include "adc-target.h" +#include "button-target.h" +#include "usb-target.h" +#include "power-imx31.h" + +/* Gigabeat S definitions for static MC13783 event registration */ + +static const struct mc13783_event mc13783_events[] = +{ + [MC13783_ADCDONE_EVENT] = /* ADC conversion complete */ + { + .set = MC13783_EVENT_SET0, + .mask = MC13783_ADCDONEM, + .callback = adc_done, + }, + [MC13783_ONOFD1_EVENT] = /* Power button */ + { + .set = MC13783_EVENT_SET1, + .mask = MC13783_ONOFD1M, + .callback = button_power_event, + }, +#ifdef HAVE_HEADPHONE_DETECTION + [MC13783_ONOFD2_EVENT] = /* Headphone jack */ + { + .set = MC13783_EVENT_SET1, + .mask = MC13783_ONOFD2M, + .callback = headphone_detect_event, + }, +#endif + [MC13783_CHGDET_EVENT] = /* Charger detection */ + { + .set = MC13783_EVENT_SET0, + .mask = MC13783_CHGDETM, + .callback = charger_detect_event, + }, + [MC13783_USB4V4_EVENT] = /* USB insertion */ + { + .set = MC13783_EVENT_SET0, + .mask = MC13783_USB4V4M, + .callback = usb_connect_event, + }, +}; + +const struct mc13783_event_list mc13783_event_list = +{ + .count = ARRAYLEN(mc13783_events), + .events = mc13783_events +}; -- cgit v1.2.3