Commit graph

9810 commits

Author SHA1 Message Date
Amaury Pouly
074e911859 usb_storage: make it a bit more correct
Add stall when unknown SCSI command is hit

Change-Id: Icbeea905cd262ab296fb34470e54c665b8bab488
2013-07-24 23:16:56 +02:00
Amaury Pouly
21c5ffe09a usb_core: rework handling of clear feature
Change-Id: Icb1e973aa5fd8520eff0796aa8164e0a988d9107
2013-07-24 23:16:38 +02:00
Amaury Pouly
c4f2a46e0d imx233: revert volumes to 1dB resolution
Using a better resolution causes havoc in the user interface
because it doesn't properly handle steps and people start to
believe I am responsible for all this mess.

Change-Id: I02b68dce5802692efde3da226eeeb49e4995f97a
2013-07-23 14:12:08 +02:00
Michael Sevakis
9faabb98d4 Fix d2249dc errors
I wonder why it didn't cause more mayhem.

Change-Id: I4a585367d650417b4be3af2a0fe6235d8066c895
2013-07-19 08:37:40 -04:00
Michael Sevakis
d2249dce6f Combine PortalPlayer .lds files into one for app and boot.
These nearly identical files are multiplying like rabbits as PP targets
are added and make SoC-related changes a PITA. Just include the master
.lds file from the target one as was done for bootloader USB.

Change-Id: I65e9e653030f0688b1728e32ada16abf2932e029
2013-07-19 08:18:16 -04:00
Amaury Pouly
47785ca7f9 fuzeplus: add touchpad sensitivity
Change-Id: I0252c0967716a4f1a628191dcde7ffc80279370b
Reviewed-on: http://gerrit.rockbox.org/515
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2013-07-15 18:41:32 +02:00
Michael Sevakis
023f6b6efd Get rid of some superfluous single-purpose functions in playback.
* Remove explicit tracking of elapsed time of previous track.
* Remove function to obtain auto skip flag.
* Most playback events now carry the extra information instead and
  pass 'struct track_event *' for data.
* Tweak scrobbler to use PLAYBACK_EVENT_TRACK_FINISH, which makes
  it cleaner and removes the struct mp3entry.

Change-Id: I500d2abb4056a32646496efc3617406e36811ec5
2013-07-13 00:08:51 -04:00
Amaury Pouly
d85f796890 imx233: fix debug screen keys for the zen x-fi3
Change-Id: I81cfb25d3bd6ff8ec43c64a9f55e1b7bd0ee1473
2013-07-13 03:02:41 +02:00
Amaury Pouly
1a7bf7b91c imx233: fix debug keys for zenxfi2
Change-Id: I535fb611f951244686c60f336a49e068edfaf96a
2013-07-13 02:52:47 +02:00
Amaury Pouly
bbe94e2b24 imx233: fix audio debug screen
Change-Id: Iaadd43a28907ebd425a0b7199f067a4fab8e9653
2013-07-13 02:42:17 +02:00
Amaury Pouly
8c91d05543 imx233: add audioin debug info
Change-Id: Iba6e2b720489c1d2178a44a0a4fe5df2a7540579
2013-07-13 02:42:17 +02:00
Amaury Pouly
15c8ec8987 imx233: don't disable monitor when recording from radio
Change-Id: Ibefb0b12b7ff787f5b8a837cab1f764148a8b0c6
2013-07-13 02:42:17 +02:00
Amaury Pouly
9e535e9864 imx233: fix audio settings, some values were nonsense
Change-Id: Ib9969bf843169cc5ddafd7758b5b5c729b2784f1
2013-07-13 02:42:17 +02:00
Amaury Pouly
352b3876e6 imx233: fix recording volume (tenth-dB -> half-dB)
Change-Id: I6960d3f4bd506713ffb139750fbe581ef66af947
2013-07-13 02:42:17 +02:00
Amaury Pouly
960788343a imx233: correctly select recording source
Change-Id: I651856292922097efe21e01543ae2568dfa13980
2013-07-13 02:42:17 +02:00
Amaury Pouly
a3af301677 imx233: rewrite debug screens
The old code used get_action which is bad because it belongs to
apps/. Instead rewrite a simple version of get_action, also
rewrite the top level handler. Since the number of screens is
becoming quite high, it now shows a list and the user can start
from any screen. Once in a screen and as long as the user presses
select, it will advance to next screen until it finally returns
to the list on cancellation.

Change-Id: Icbc7676a17e4a6e859b7781a4a471d8303910591
2013-07-13 02:42:17 +02:00
Amaury Pouly
a22855ce61 imx233: add audioout debug info
Change-Id: Iac092de861847e31aba48d2fdc51ae72cd9bd202
2013-07-13 02:42:17 +02:00
Amaury Pouly
3afcb53fb9 imx233: rework power management
The current code was spreaded over power and powermgmt which made
it behave strangely, especially since there are relationships
between power management and frequency scaling. The new code makes
sure power management is initialised before frequency scaling
starts. It also makes sure to start from a known state, thus
fixing potential issue when the bootloader stops in a trickle
state where DCDC is improperly configured.

Change-Id: Ibded2e590e108f6c98daa52d2cf1bd28763c8923
2013-07-07 17:36:21 +02:00
Amaury Pouly
659febc749 imx233: add emi debug info
Change-Id: I33317ae26b70c825d4c5e3aaac364da5e0dc06c2
2013-07-07 17:36:20 +02:00
Thomas Martitz
af4e408555 buflib: Change buflib_available() and add buflib_allocatable().
buflib_allocatable() is what buflib_available() was before (it was in fact
simply renamed). It returns the largest contiguous block of memory. This
can be allocated and will definitely succeed, although larger allocations
may also succeed if the buffer can be compacted and shrinked.

buflib_available() now counts all free bytes, contiguous or not. This
better matches the description and how the caller use it.

Change-Id: I511e4eb5f4cf1821d957b3f4ef8a685ce40fe289
Reviewed-on: http://gerrit.rockbox.org/481
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
2013-07-07 10:46:07 +02:00
Michael Sevakis
d37bf24d90 Enable setting of global output samplerate on certain targets.
Replaces the NATIVE_FREQUENCY constant with a configurable frequency.

The user may select 48000Hz if the hardware supports it. The default is
still 44100Hz and the minimum is 44100Hz. The setting is located in the
playback settings, under "Frequency".

"Frequency" was duplicated in english.lang for now to avoid having to
fix every .lang file for the moment and throwing everything out of sync
because of the new play_frequency feature in features.txt. The next
cleanup should combine it with the one included for recording and
generalize the ID label.

If the hardware doesn't support 48000Hz, no setting will be available.

On particular hardware where very high rates are practical and desireable,
the upper bound can be extended by patching.

The PCM mixer can be configured to play at the full hardware frequency
range. The DSP core can configure to the hardware minimum up to the
maximum playback setting (some buffers must be reserved according to
the maximum rate).

If only 44100Hz is supported or possible on a given target for playback,
using the DSP and mixer at other samperates is possible if the hardware
offers them.

Change-Id: I6023cf0c0baa8bc6292b6919b4dd3618a6a25622
Reviewed-on: http://gerrit.rockbox.org/479
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-07-06 04:22:04 +02:00
Amaury Pouly
20ee453edc imx233: fix sd init sequence
Implement the switch function as specified by the specification,
that is wait for the response AND transfer 64 bytes of data. This
fixes some issue when the SD card take a long time to switch. In
particular waiting 100ms (max per spec) will not work if no data
is transfered in some cases.

Change-Id: Ia22350468018b842e57ce6f6c1a8d676eba97fb8
2013-07-02 00:45:00 +02:00
Amaury Pouly
d8024df105 imx233: implement alarm wake up
This adds the application part of alarm wake up. On some targets
like the Fuze+, it will also require a bootloader change to make
sure that the device doesn't power down on alarm wake up (for
example on the Fuze+ the bootloader requires the power button to
be hold sufficiently long, thus preventing alarm wake up to work)

Change-Id: I5d01957852355fddbd48110d3d75a5533f07879e
2013-07-02 00:45:00 +02:00
Amaury Pouly
2773673733 imx233: fix emi frequency scaling
On the ZEN X-Fi2, the fractiona dividers are gated by the
bootloader and must be ungated before switching emi to pll.

Change-Id: I5df57ed5581054883da4cbb3b4f3ce3539391ab5
2013-07-02 00:45:00 +02:00
Michael Sevakis
4888131972 Update software recording engine to latest codec interface.
Basically, just give it a good rewrite.

Software codec recording can be implemented in a more straightforward
and simple manner and made more robust through the better codec
control now available.

Encoded audio buffer uses a packed format instead of fixed-size
chunks and uses smaller data headers leading to more efficient usage.
The greatest benefit is with a VBR format like wavpack which needs
to request a maximum size but only actually ends up committing part
of that request.

No guard buffers are used for either PCM or encoded audio. PCM is
read into the codec's provided buffer and mono conversion done at
that time in the core if required. Any highly-specialized sample
conversion is still done within the codec itself, such as 32-bit
(wavpack) or interleaved mono (mp3).

There is no longer a separate filename array. All metadata goes
onto the main encoded audio buffer, eliminating any predermined
file limit on the buffer as well as not wasting the space for
unused path queue slots.

The core and codec interface is less awkward and a bit more sensible.
Some less useful interface features were removed. Threads are kept
on narrow code paths ie. the audio thread never calls encoding
functions and the codec thread never calls file functions as before.

Codecs no longer call file functions directly. Writes are buffered
in the core and data written to storage in larger chunks to speed up
flushing of data. In fact, codecs are no longer aware of the stream
being a file at all and have no access to the fd.

SPDIF frequency detection no longer requires a restart of recording
or plugging the source before entering the screen. It will poll
for changes and update when stopped or prerecording (which does
discard now-invalid prerecorded data).

I've seen to it that writing a proper header on full disk works
when the format makes it reasonably practical to do so. Other cases
may have incorrect data sizes but sample info will be in tact. File
left that way may play anyway.

mp3_enc.codec acquires the ability to write 'Info' headers with LAME
tags to make it gapless (bonus).

Change-Id: I670685166d5eb32ef58ef317f50b8af766ceb653
Reviewed-on: http://gerrit.rockbox.org/493
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-06-30 00:40:27 +02:00
Michael Sevakis
a9ea1a4269 Fix some whitespace in files changed in following commit.
Change-Id: Ie3f43e43076e0dcae9a10f1b0b9e4698b398acee
Reviewed-on: http://gerrit.rockbox.org/492
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-06-30 00:40:09 +02:00
Marcin Bukat
0b29691324 Move load_firmware() to separate file
The idea is to share loading code between bootloaders and rolo().

Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd
Reviewed-on: http://gerrit.rockbox.org/190
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-06-27 13:50:11 +02:00
Thomas Martitz
46ea8bfe7c buflib: Allow handle to be freed entirely during the shrink callback.
Change-Id: I3a069dcb99bbd4022faf37596b03beb926d2ea82
Reviewed-on: http://gerrit.rockbox.org/480
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
2013-06-24 15:24:34 +02:00
Amaury Pouly
d938ae692c imx233: fix ocotop/debug and usb-core for stmp3600
Currently we don't know where the serial number is stored on the
stmp3600. It is probably using the laser fuses but this needs to
be investigated

Change-Id: I1ac25e38b8f65635abb68788ceb65df0a740dabd
2013-06-24 13:17:17 +02:00
Amaury Pouly
c57b37ab99 imx233: fix debug for stmp3600
The STMP3600 cannot lock some usb bits so there is only a single
status in POWER_STS. Also stmp3600 has no clock bypass and frac
div.

Change-Id: I101f4263bdddeff58e142d10f9b76dd643bf928d
2013-06-20 14:11:58 +02:00
Amaury Pouly
a235200430 zenxfi2: remove lcd yuv blitting code (duplicate from generic)
Change-Id: I2be7d5f9cbc2086673c731e7b76b7d7d6f728f26
2013-06-20 13:49:59 +02:00
Amaury Pouly
7f552f80b8 imx233: allow audio routing driver to have pre/post init functions
Change-Id: Ic1fe8c5bc6c8bf5d449ae44c12cb6cb8df409260
2013-06-18 21:27:29 +02:00
Amaury Pouly
277d358eda imx233: add generic lradc based button driver
This driver does debouncing and best lradc usage and only requires
a sorted table of values to work, this factoring code as much as
possible.

Change-Id: I84b46f4b08094634e1c5deb5ca9ba20763389e66
2013-06-18 16:43:27 +02:00
Amaury Pouly
27aca8f276 imx233: don't dcp on stmp3600, allow touchscreen with HAVE_*
Change-Id: Icb9dd3c9b9abdf1c013a78d67576ac857a7f010f
2013-06-18 16:41:23 +02:00
Amaury Pouly
0b6198f8a8 imx233: add basic ATA driver
The current driver only works in PIO mode.

Change-Id: I1cf2eaedcce0172a254c3bab0e1257886226d3a0
2013-06-18 16:41:13 +02:00
Amaury Pouly
bbb789120c imx233: add uartdbg driver
The driver is current unused and very minimal. It can used on
targets which have an accessible UART port and it will be used on
some creative targets as backlight control.

Change-Id: Id710d63574aadb0a2d7327b03187506b469470b1
2013-06-18 16:24:28 +02:00
Amaury Pouly
4962854005 imx233: add stmp3600 and stmp3700 pin descriptions
Change-Id: I1f64b669eac688583f27dde5216e40f7333de0b6
2013-06-18 16:21:38 +02:00
Amaury Pouly
ea8b22a9b6 zenxfi3: drop audio routing driver in favor of the generic one
Change-Id: Ia104c148f9139434d2c70190d2834b06de20de23
2013-06-18 16:19:28 +02:00
Amaury Pouly
11c907a83c zenxfi2: drop audio routing driver in favor of the generic one
Change-Id: I8186f4b8e7cdc5abc549dffb033178921f447998
2013-06-18 16:18:08 +02:00
Amaury Pouly
d997dafb6c fuzeplus: drop audio routing driver in favor of the generic one
Change-Id: I89828ef858606bf09e115ff9c27ff9ecc8bf8b8e
2013-06-18 16:15:07 +02:00
Amaury Pouly
e735ce4693 imx233: introduce generic audio routing driver
Change-Id: Icd439e02dd9835778d2733fc01a9306552b36966
2013-06-18 16:11:51 +02:00
Amaury Pouly
d8368d58b0 imx233: add recording side and 3d to codec driver
Change-Id: I3587434749c401a28c6e77bd30395e7df15f2e8a
2013-06-18 16:09:07 +02:00
Amaury Pouly
7fb0b893f9 imx233: implement recording side of pcm
Although everything is implemented, recording still doesn't work,
dma is stuck. Add code for reference until this get a proper fix.

Change-Id: Ifc016b00876230c6d337a5cd4f8bb90b856efac8
2013-06-18 15:45:58 +02:00
Amaury Pouly
ac4e76d072 imx233: implement audioin
Change-Id: I0cf896f59fd2176217d0dd1f6032c3463b936669
2013-06-18 15:43:43 +02:00
Amaury Pouly
57bb7b2d27 imx233: rework touchscreen driver
The old driver didn't behave nicely because it waiting for
stability which could never arrive on some gestures. The new one
uses a fixed delay and averaging.

Change-Id: I8ff80f373b6792e6d5fc3cfe41b709642e61c38b
2013-06-18 15:34:54 +02:00
Amaury Pouly
0173f6edf5 imx233: fix soc header for stmp3600 and stmp3700
Document various register macros (autogenerated). Fix memory map
for stmp3700, make framebuffer size configurable and cache aligned
and fix the PHYSICAL_ADDR macro.

Change-Id: I40a2875fb3eb35c6fce1158db37dbc0c1a10c68e
2013-06-18 15:33:07 +02:00
Amaury Pouly
9c965c88b4 fuze+: fix lcd code which got broken in 52426d0
The lcd data line were not setup as input anymore, making register
reading plain broken and probably lead to bad lcd detection.

Change-Id: I281460f845537c58045f3893261ded5c9c6e53b5
2013-06-18 13:08:38 +02:00
Amaury Pouly
dafc359fad imx233: fix system for stmp3600 and stmp3700
Change-Id: I2b425b56358ed21269beae27a4afb490939b7f9d
2013-06-17 00:29:26 +02:00
Amaury Pouly
8d7cc320b7 imx233: only do power management on imx233
Power management is somewhat different on stmp3700 which doesn't
have the 4.2V rail and completely different on stmp3600 which has
several DCDC. Currently only handle imx233.

Change-Id: Ic7815141286117b74022ffc53cfa48664fd7faac
2013-06-17 00:29:25 +02:00
Amaury Pouly
2ed36fc4a2 imx233: clarity comment about errata
Change-Id: I3309ce112762f09fcf6bce9d416dbf4b0aa2f197
2013-06-17 00:29:25 +02:00