Commit Graph

24 Commits

Author SHA1 Message Date
Solomon Peachy 431caa4311 imx31: Work around an apparently not-quite-kosher abuse of CPP
(we were trying to foward-declare functions from within static
 initializer context.  GCC no longer accepts this)

Change-Id: I58f316ecc84c8ab45fffc054955727a55714b0a3
2020-10-13 15:48:31 -04:00
Michael Sevakis 2220a4b695 Improve imx31 interrupt code for PMIC and GPIO
Fix stuff that was bugging me about the way I did it at first.

While messing around I found RDS code wasn't masking its GPIO
ISR as it should, which might lead to two different interrupts
messing with the static data.

Change-Id: I54626809ea3039a842af0cc9e3e42853326c4193
2017-01-29 19:07:55 -05:00
Michael Sevakis 30c4efcd16 i.MX31: Fix a couple oopses from r31528
Enabled a PMIC event where it should be disabled. Used constant from wrong enum
to get sense bits (??) which messed up main charger detection.

Also remove an obsolete struct declaration.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31536 a1c6a512-1295-4272-9138-f99709370657
2012-01-03 06:13:59 +00:00
Michael Sevakis 5a8da163c8 i.MX31 - Dethreading operations continue
Dispense with "pmic" thread and process PMIC events directly within ISR. Add
sense bit reading as part of the handling.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31528 a1c6a512-1295-4272-9138-f99709370657
2012-01-02 18:32:35 +00:00
Michael Sevakis 292e7cab73 Gigabeat S: PMIC SPI improvement and bugfixes.
Nick some aspects from the as3525 ascodec driver to improve throughput in
the beast's SPI communications by switching tranfer descriptors to the
caller's stack and getting rid of thread synchronization.

Fix a bug that suddenly became obvious that could permanently stall the SPI
driver because all data could be shifted out before the interrupt could get
serviced. In that case, it needs a kick to restart it. Should probably put
the SPI interrupt priority above DVFS.

A tweak to the event registration interface to simplify it.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31353 a1c6a512-1295-4272-9138-f99709370657
2011-12-18 10:41:43 +00:00
Michael Sevakis 931e06de64 i.MX31/Gigabeat S: Actually enable DPTC which can set optimal voltage for 528MHz. Requires an SPI and PMIC interface rework because of the low-latency needs for the DPTC to work best with minimal panicing. SPI can work with multitasking and asynchronously from interrupt handlers or normal code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25800 a1c6a512-1295-4272-9138-f99709370657
2010-05-04 10:07:53 +00:00
Michael Sevakis 87eea33def Gigabeat S (imx31): Begin voltage and frequency scaling code. For now, to avoid overdrive voltage, just lower core voltage to 1.35V since voltage scaling shouldn't be required for frequencies lower than 399 MHz (according to Freescale BSP, which set all working points to 1.35V for those frequencies). Perhaps battery life will improve as well (cross fingers :).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25506 a1c6a512-1295-4272-9138-f99709370657
2010-04-07 03:43:48 +00:00
Michael Sevakis b7f7655dc2 imx31/mc13783: Do some housekeeping with register macros, function names and other defines. No functional changes (except to alter a couple int priorities).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20442 a1c6a512-1295-4272-9138-f99709370657
2009-03-22 01:50:48 +00:00
Michael Sevakis 1dcee69fd2 MC13783 PMIC: Make some defines more strictly correct-- interrupts, etc.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19142 a1c6a512-1295-4272-9138-f99709370657
2008-11-19 06:22:09 +00:00
Michael Sevakis e53fce0279 MC13783 cleanup. Remove functions proving themselves not so useful and add mc13783_write_masked which is pretty useful. Add an error code definition for invalid data.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19132 a1c6a512-1295-4272-9138-f99709370657
2008-11-18 02:19:50 +00:00
Daniel Stenberg 2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Michael Sevakis 804bb8e38d Correct an oopsy when finishing off the MC13783 header. No wonder ADC readings seemed a wee odd.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17597 a1c6a512-1295-4272-9138-f99709370657
2008-05-21 20:59:07 +00:00
Michael Sevakis a9c20f5789 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
2008-05-21 08:42:11 +00:00
Michael Sevakis 3c102ffd4d Fix a couple mistakes. Forgot to add a few definitions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17535 a1c6a512-1295-4272-9138-f99709370657
2008-05-16 08:02:14 +00:00
Michael Sevakis cda664b701 MC13783 (Gigabeat S PMIC): Complete the header file. Distinguish status, sense and mask bit defines to avoid conflicts within the definitions. Much care taken but give a double check before making new use of anything.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17534 a1c6a512-1295-4272-9138-f99709370657
2008-05-16 06:21:11 +00:00
Michael Sevakis 1ec35841d6 Fix yellow.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17444 a1c6a512-1295-4272-9138-f99709370657
2008-05-10 18:32:34 +00:00
Michael Sevakis 25583656d9 Backlight brightness setting for Gigabeat S. Cleanup headers in target backlight file too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17428 a1c6a512-1295-4272-9138-f99709370657
2008-05-08 22:03:49 +00:00
Nils Wallménius 89aca6aa77 Oops, it's called mc13783...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17416 a1c6a512-1295-4272-9138-f99709370657
2008-05-08 15:49:46 +00:00
Nils Wallménius 90a4a43430 Alarm wake up support for Gigabeat S
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17376 a1c6a512-1295-4272-9138-f99709370657
2008-05-05 12:37:42 +00:00
Michael Sevakis 94f7d0f290 UMS for the Gigabeat S. Bootloader USB mode. Has a couple quirks 1) First plug has problems if cold. Replug if it doesn't connect or not at high speed 2) Linux doesn't like the odd bootable flag value used in the partitions so it won't mount but Windows works. Fix minor OTG driver bugs and clean up device memory handling. Generic name for ARC controller driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17154 a1c6a512-1295-4272-9138-f99709370657
2008-04-18 16:42:50 +00:00
Michael Sevakis b12c69bac7 ADC driver for Gigabeat S - a bit on the general side for now. Needs to have scales set properly (what physical value a reading represents isn't clear from the docs or I'm just lazy atm). Throw-in a _bunch_ more reg defines for the PMIC. Show all 16 raw channels values in debug menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17100 a1c6a512-1295-4272-9138-f99709370657
2008-04-13 20:03:08 +00:00
Nils Wallménius 8c5d552ebd Charger detection for Gigabeat S
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17093 a1c6a512-1295-4272-9138-f99709370657
2008-04-13 10:04:21 +00:00
Michael Sevakis a7af9e4a7f Add GPIO manager. Get the PMIC interrupt handling working (along with power button and HP detect). Add some reg field defined instead of using raw numbers. Add PMIC info to debug ports screen. Refine PMIC driver ops a little bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17086 a1c6a512-1295-4272-9138-f99709370657
2008-04-12 16:56:45 +00:00
Michael Sevakis 0b1d7e76d7 Serial driver for imx31. Perhaps not 100% but maybe 80-90% (future developments will tell). Factor-out the mc13783 stuff and make that driver a layer above the SPI. TODO: start processing PMIC interrupts. Start a clkctl API for imx31 (we'll see if this sticks around but it seems reasonable here). Misc. stuff for convenience/neatness.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17070 a1c6a512-1295-4272-9138-f99709370657
2008-04-11 08:51:27 +00:00