Commit graph

2283 commits

Author SHA1 Message Date
Torne Wuff
991e92fd3d New USB charging system, part 1 - API rework and user-visible setting update
1) "Charge during USB connection" option is now tristate: off/on/force. Currently "force" behaves just like "on", but in future it will allow charging even when it was not possible to positively identify a charger.

2) The H300 code has been adjusted to use the new system but there should be no functional differences, it already had the USB charging option and its USB/charging support is hardware controlled.

3) The Gigabeat S code has been adjusted to use the new system: the player now has the USB charging option, which wasn't previously available. The player will only charge at full speed when allowed to do so by a working USB host, so USB AC adapters won't work very well; however, they didn't work before either, so this is not a change in functionality.

4) The iPod Nano 2G code has been adjusted to use the new system: it already had the USB charging option. Using a USB AC adapter won't charge at full speed any more (it did before) - the old implementation was equivalent to the not-yet-implemented "force" option in the new system.

No other target should be affected. Support for the "force" mode and support for at least some other iPod models will come in a future commit :)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26570 a1c6a512-1295-4272-9138-f99709370657
2010-06-05 10:05:27 +00:00
Jens Arnold
c4f88526c7 Port greylib blitting optimisation to clipv2 and Clip+. Actual speedup can't be measured because something is fishy with the cpu clocking (calculated load is negative??)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26562 a1c6a512-1295-4272-9138-f99709370657
2010-06-04 23:12:33 +00:00
Jens Arnold
081bda8ab2 Port greylib blitting optimisation to clipv1.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26557 a1c6a512-1295-4272-9138-f99709370657
2010-06-04 21:12:06 +00:00
Tobias Diedrich
3f44f1c151 Using void instead of unsigned char fixes the strict-aliasing warnings with -Os and gets rid of some casts. And we already use void pointer arithmetic in several other places.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26518 a1c6a512-1295-4272-9138-f99709370657
2010-06-03 18:29:06 +00:00
Rafaël Carré
bf3e50b89b sd-as3525v1: do not disable peripheral clocks in sd_enable()
(forward port of r26481 + cosmetics)
This lead to freezes under various conditons (bug report: FS#11267)

Battery life is almost not (if at all) affected:
- between 4 and 8 minutes less runtime for fuzev1
- 9 minutes less runtime for c200v2 (2 minutes difference on a 2 hours run)

Additional verifications of the runtime (including on other models) wouldn't hurt

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26512 a1c6a512-1295-4272-9138-f99709370657
2010-06-03 13:55:42 +00:00
Michael Sevakis
a34860524b Fix PP5002 builds. Somehow an #else went missing along the line.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26480 a1c6a512-1295-4272-9138-f99709370657
2010-06-02 12:56:05 +00:00
Michael Sevakis
555ad6710f Threading: Split processor support code into respective target files. C files from /target/xxx are included into thread.c because of essential inlining and files are code, not declarations. Copyrights in each new file go to whoever implemented the first functional support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26479 a1c6a512-1295-4272-9138-f99709370657
2010-06-02 12:45:36 +00:00
Tobias Diedrich
253cfbcd47 Prevent a race condition when writing VIC_INT_EN_CLEAR. Should be very difficult to hit in this case though...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26451 a1c6a512-1295-4272-9138-f99709370657
2010-06-01 19:29:01 +00:00
Rafaël Carré
df34a4767f as3525 ascodec: make internal functions statics and remove some details for ascodec-target.h header
reorder static functions to avoid the need for early prototypes
panic if the INT_AUDIO callback could not read the 3 IRQ_ENRD registers

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26445 a1c6a512-1295-4272-9138-f99709370657
2010-06-01 10:16:10 +00:00
Rafaël Carré
dc32a5b14c as3525 PCM: implement locking like done for the gigabeats in r26341
this removes workaround for spurious interrupts added in r26316

side effect: make keyclicks work correctly when used intensively (with
the scrollwheel for example), the clicks should be inserted fast enough
for the PCM fifo to not become empty.

PL190 can cause spurious interrupts if an interrupt is triggered by a
peripheral shortly before the interrupt for this peripheral is cleared
from VIC registers.

As an effect we should only write in VIC_INT_EN_CLEAR after having
disabled the source of the interrupt in the peripheral.

references on PL190 spurious interrupts:
- http://www.embeddedrelated.com/groups/lpc2000/show/14599.php
- http://water.cse.unsw.edu.au/esdk/lpc2/spurious-irq.html

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26444 a1c6a512-1295-4272-9138-f99709370657
2010-06-01 09:39:08 +00:00
Rafaël Carré
acb524e51a sd-as3525v1: set up bank selection data outside of the loop
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26441 a1c6a512-1295-4272-9138-f99709370657
2010-06-01 03:50:52 +00:00
Rob Purchase
a6c1b54d46 Enable IRAM on TCC7801 (Cowon D2) for a 6-12% speedup in codecs that use it, and a small increase in battery life.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26436 a1c6a512-1295-4272-9138-f99709370657
2010-05-31 21:00:25 +00:00
Jens Arnold
64adb32cbf Port the greylib blitting optimisation to m:robe 100. It's even more efficient on monochrome LCDs - about 20% ISR speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26435 a1c6a512-1295-4272-9138-f99709370657
2010-05-31 20:13:27 +00:00
Rafaël Carré
0ea7905395 ARM: use BX when branch to an address in register
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26432 a1c6a512-1295-4272-9138-f99709370657
2010-05-31 15:14:26 +00:00
Jens Arnold
7a1aca46a3 Smaller & faster grey blitting on greyscale ipods, based on an idea by Mike Sevakis. ISR speedup on all greyscale iPods except Mini 2nd Gen is ~10%. No speedup on the latter, because the serial transfer is the limiting factor.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26422 a1c6a512-1295-4272-9138-f99709370657
2010-05-30 22:24:50 +00:00
Bertrik Sikken
a5248a2995 Update Samsung YP-S3 bootloader demo
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26417 a1c6a512-1295-4272-9138-f99709370657
2010-05-30 21:43:14 +00:00
Rafaël Carré
cc07d68866 fuze*/e200v2 YUV lcd code: remove a useless instruction forgotten in r21795
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26399 a1c6a512-1295-4272-9138-f99709370657
2010-05-29 22:42:54 +00:00
Rafaël Carré
9b2527420f Fuze: don't change gate scan position if lcd_set_flip() is not used
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26387 a1c6a512-1295-4272-9138-f99709370657
2010-05-29 17:40:37 +00:00
Rafaël Carré
5ea1fe614a cpucache_invalidate: use bx reg instead of mov pc, reg to return
Using BX has the effect to set the T bit, so it can return to a thumb
function

With this change, rockbox runs fine on Clipv2 built with -mthumb (for
most files which don't use inline 32 bits ARM assembly)

Some other places use code which change the T bit on armv5 but not on
armv4 so armv4 won't run

See FS#6734

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26386 a1c6a512-1295-4272-9138-f99709370657
2010-05-29 17:12:42 +00:00
Rafaël Carré
56220785c1 e200v2: revert r26353
invert setting isn't remembered when backlight goes off and lcd_enable()
is ran again

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26374 a1c6a512-1295-4272-9138-f99709370657
2010-05-29 14:24:10 +00:00
Rafaël Carré
d2f26206ba Fuzev1/v2 : lcd_set_flip()
FS#11329

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26372 a1c6a512-1295-4272-9138-f99709370657
2010-05-29 13:43:18 +00:00
Jack Halpin
8b6356d08a sd-as3525.c: Do not wait for TRAN state after transfer is over.
Waiting for TRAN state after the end of the transfer caused writing problems for some uSD cards.  Removing this wait returns write functionality to those cards.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26365 a1c6a512-1295-4272-9138-f99709370657
2010-05-28 21:47:36 +00:00
Bertrik Sikken
36b4b39a7e Apply FS#9194 - LCD invert for Sansa c200/c200v2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26362 a1c6a512-1295-4272-9138-f99709370657
2010-05-28 19:36:52 +00:00
Bertrik Sikken
36c6f3d13f Restore return statement in kernel-as3525.c that was accidentally removed in r26330. This fixes c200v2 black screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26361 a1c6a512-1295-4272-9138-f99709370657
2010-05-28 19:04:30 +00:00
Michael Chicoine
0ae59df3fa Simplify lcd invert
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26353 a1c6a512-1295-4272-9138-f99709370657
2010-05-28 12:19:26 +00:00
Michael Chicoine
3c1dd03fb3 Simplify lcd_set_flip, lcd_window, and lcd_window_blit
Remove unneeded defines
Whitespace cleanup

Thanks to Rafaël Carré for finding the simpler register settings.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26350 a1c6a512-1295-4272-9138-f99709370657
2010-05-28 05:15:28 +00:00
Rafaël Carré
6921a2b6b9 Merge common LCD code between fuzev1 & fuzev2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26344 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 23:32:38 +00:00
Rafaël Carré
9ff986cdca sd-as3525v2: Include time spent yielding when figuring timeout in sd_wait_for_tran_state()
(apply r23738 to as3525v2 code)
extend the arbitrary delay to 5 seconds, we never know

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26342 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 23:32:29 +00:00
Michael Sevakis
6b6123444e Gigabeat S PCM: Sync some comments to changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26341 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 23:22:55 +00:00
Michael Sevakis
25ebd9832d Gigabeat S PCM: There's no reason to touch any hardware registers in order to lock out PCM callbacks.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26340 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 23:14:39 +00:00
Rafaël Carré
a71929b1a0 as3525: no need to ack TIMER interrupt multiple times
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26330 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 13:42:39 +00:00
Rafaël Carré
2f0f3490d3 Clip*: give lcd_hw_init() INIT_ATTR attribute
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26329 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 12:28:53 +00:00
Rafaël Carré
435e08eae1 mark some functions as init functions (discarded after init() has run)
tick_start, fmradio_i2c_init, pcm_init, pcm_postinit, pcm_play_dma_init

Also add some as3525 target specific functions
Make as3525v2 use this attribute

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26328 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 12:00:29 +00:00
Rafaël Carré
b0146de64c as3525: don't export empty usb_init_device(), declare it as empty inline
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26326 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 12:00:18 +00:00
Rafaël Carré
065ef89479 clipv2: make buttonlight functions static inline one-liners
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26323 a1c6a512-1295-4272-9138-f99709370657
2010-05-27 11:09:12 +00:00
Rafaël Carré
6ca9f232a8 as3525: fix r26308
I2SOUT peri needs to be enabled to set the loopback setting

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26319 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 22:58:55 +00:00
Rafaël Carré
c9133db4b1 as3525: as revealed by r26311, it seems DMAC interrupt can't be masked
Even if we disable it in VIC_INT_EN_CLEAR, it still fires an interrupt
by running the default isr.
Locking requires disabling interrupts completely.
I'm not sure if DMAC is the only interrupt affected or if we can't rely
on VIC_INT_EN_CLEAR to mask interrupts.
If it's the latter, we will need to have special locking scheme for
INT_AUDIO.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26316 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 17:32:50 +00:00
Rafaël Carré
7ad50c6f59 as3525: write irq/fiq handlers in C
Declare VIC registers holding function pointers as volatile pointers to
function pointers and access them directly without casting
UIRQ() is an IRQ handler too, even if it doesn't return

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26313 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 16:03:01 +00:00
Rafaël Carré
f0f5a6419a typo: 'nomasked' -> 'unmasked'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26312 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 14:45:59 +00:00
Rafaël Carré
bdb8ba4ecd as3525: implement pcm_play_dma_get_peak_buffer correctly
give the real amount of bytes left to transfer

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26311 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 12:00:44 +00:00
Rafaël Carré
55d60d4e76 as3525v2: no need to set PMU_GATE bit (bit 3) in PMU_enable register when reading
It's only needed when we'll write to the selected register

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26309 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 11:14:13 +00:00
Rafaël Carré
1c967b788e as3525: move audio loopback handling to audio_set_output_source
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26308 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 11:07:49 +00:00
Michael Sevakis
72ccb14ab1 Gigabeat S: Turn off hardware effects (tone and 3d) when doing digital loopback for FM recording otherwise the signal and levels are poorly represented in monitoring (can't just do ADC->DAC for general FM and get voice too). Some tweaking to input setup to improve gain a tiny bit. A little bit quieter startup too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26300 a1c6a512-1295-4272-9138-f99709370657
2010-05-26 05:13:45 +00:00
Rafaël Carré
ff9474e558 as3525v1: relax a bit requirements in the SD driver
- retry failed commands up to 6 times
- wait at most 5 seconds for the card to go to TRAN state

- wait for the card to be in TRAN state (i.e. not programming) before
  disabling SD clocks (remove the workaround in sd_enable() )

should fix lockups reported on fuzev1 under heavy internal storage + µSD use
(playback + database/pictureflow updating)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26291 a1c6a512-1295-4272-9138-f99709370657
2010-05-25 21:55:09 +00:00
Rafaël Carré
9112b0b1bb as3525v2: do not deselect all cards after a SD transfer
Selecting the right card before the transfer will deselect the other one

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26290 a1c6a512-1295-4272-9138-f99709370657
2010-05-25 20:38:42 +00:00
Rafaël Carré
873dd7becc as3525: find_first_set_bit() isn't built in bootloaders
We assume only one bit is set and use clz to find the most significant
set bit, if there's more than one bit set we'll see it in the panic msg

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26285 a1c6a512-1295-4272-9138-f99709370657
2010-05-25 16:20:04 +00:00
Michael Sevakis
2aed6b0da8 as3525: Fix an oops in converting the recording API to a newer form.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26270 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 22:33:26 +00:00
Szymon Dziok
06601e5fba Vibe 500: fix the scrolling through the lists by implementing BUTTON_REPEAT for the scrollstrip.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26268 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 19:48:06 +00:00
Szymon Dziok
6eed071a6d fix YUV Dither for the other targets too, like in r26064.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26266 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 18:57:11 +00:00
Rafaël Carré
2d40d566d7 as3525: don't destroy status when calculating IRQ number in UIRQ()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26260 a1c6a512-1295-4272-9138-f99709370657
2010-05-24 17:41:47 +00:00