android: Update to SDK r16 and ndk r8d.

SDK r17 is out, however there it only ships a x86 system image for r16 so
it's preferable.

Change-Id: Idc4d375debf407a36c2dc6421420bdbd74ab25ca
iPod Classic/6G: fix battery voltage ADC scale

Scale battery voltage ADC readings by 1023 instead of 1000,
using ADC1 (substractor) instead of ADC0 (multiplicator) to
get better resolution.

Percent charge/discharge tables are also modified to return
a similar value than the old ones.

Change-Id: I2951c75faa02f4302599ec24f9156cfd209c36eb
iPod Classic/6G: support USB suspend mode

Actually Rockbox does not use this mode, it is supported by
other iPods, so implemented on Classic as well.

Change-Id: Ia6578506df27a95a7f7522b3034b764631a8bb3a
iPod Classic/6G: PCM support for all CS42L55 rates

pcm_dma_apply_settings(): sets the configured PCM frequency,
all native CS42L55 sample rates are available.

Change-Id: I2fcd5581457a669c3044516804cb64fb972218d0
imxtools/nwztools: fix compilation for windows

There is a windows port of the sg_utils library for scsi pass-
through. This little changes make it compile under mingw. A better
fix would be to implement direct ioctl on both windows and linux
but that's already better than nothing

Change-Id: I0d77cd1bad69806a66f0590362f165f24fa240e9
imx233: implement emi frequency scaling (disabled by default)

CPU frequency scaling is basically useless without scaling the
memory frequency. On the i.MX233, the EMI (external memory
interface) and DRAM blocks are responsable for the DDR settings.
This commits implements emi frequency scaling. Only some settings
are implemented and the timings values only apply to mDDR
(extracted from Sigmatel linux port) and have been checked to
work on the Fuze+ and Zen X-Fi2/3. This feature is still disabled
by default but I expected some battery life savings by boosting
higher to 454MHz and unboosting lower to 64MHz.
Note that changing the emi frequency is particularly tricky and
to avoid writing it entirely in assembly we rely on the compiler
to not use the stack except in the prolog and epilog (because
it's in dram which is disabled when doing the change) and to put
constant pools in iram which should always be true if the
compiler isn't completely dumb and since the code itself is put
in iram. If this proves to be insufficient, one can always switch
the stack to the irq stack since interrupts are disabled during
the change.

Change-Id: If6ef5357f7ff091130ca1063e48536c6028f23ba
imx233: modify arm cache timings on frequency switch

The manual recommands to tweak the arm cache settings on frequency
changes. The meaning of these values is undocumented but 0 seems
to be a safe value for all frequencies whereas 3 seems to be valid
only for low frequencies (<=64MHz ?)

Change-Id: Iaa8db4af8191010789cf986b1139ff259d73e2ed
rk27xx: substitute magic constants with meaningful names for clock gating

Change-Id: I6c66c7496db3db78e5c959414464826134dbe200
rk27xx: substitute magic constants with meaningful names for peripherials reset

Change-Id: Ia411c9be65376d1c3fdf59b7e692b0590d58775e
rk27xx: substitute magic constants with meaningful names for INTC

Change-Id: Ic93114db351a9940a53d0c1df6439d82ada044e1
rk27xx: optimize irq_handler()

Change-Id: Idd3141e57b70e9b28b91748bc71208d9afffcd57
Reviewed-on: http://gerrit.rockbox.org/381
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested-by: Marcin Bukat <marcin.bukat@gmail.com>
imx233: enable underflow recovery in lcdif (needed for freq scale)

When chaging the cpu and memory frequency we need to disable the
external memory interface (EMI) for a small time. This can
underflow the dma and cause some breakage. Hopefully the SSP
controller handles this gracefully by stopping the clock and the
I2C probably handles this naturally because the clock can be
streched anyway. However the LCDIF has a special setting for this
which needs to be enable, otherwise it will send garbage to the
LCD. No other block is known to suffer from this currently but
this issue might have more unexpected consequences.

Change-Id: Ide154cad87929f2bf6cc419ac1d2ff33e30eec66
fuze+: correctly handle settings (flip and invert) accross enable

The flip and invert settings can potentially be reset to their
value accross a disable/enable cycle, so save the value of the
impacted registers and apply it after each enable. Also avoid
poking registers when the lcd is not on.

Change-Id: Ica98f166c060aade7eb205f5628b58aae692024f
fuze+: lcd code cleanup

The lcd kind is always set to st7783 in case we can't read the ID
so don't bother handling impossible cases

Change-Id: I352fd43b26068b460e69190d37c4cd4627e1db9a
imx233: correctly send the LCD_EVENT_ACTIVATION on enable

For some reason it is the responsability of the driver to send
this event so do it. This might fix some non-updating screens.

Change-Id: Ib5fdc94bf266c3497a8ac4e89d0418c0e876ff9f
rk27xx: slightly optimize commit_discard_dcache_range()

Change-Id: I13ce643d4ba26db5de9ffa083070d7f40b0e7b1f
imx233: rework frequency scaling

Move to a table based approach (scales better) and distinguish
between upward changes (increase frequency) and downward changes
(decrease frequency). This provides a better ordering of
operations and in particular it allows to avoid changing the
regulator while running at low speed since it takes a long time !
This should result in a much smoother scaling.

Change-Id: Iad7e5b61277e215f31c07877fbbad07ddde1171f
Remove HttpGet::error() function.

This function returns an internal enum value of QHttp (which is also
deprecated). It was only used for showing an error to the user / showing it in
the system trace. Since it is an enum value it doesn't have much value. Log /
show the error string instead.

Change-Id: I54b9b6026969f8108f779b02a04477f0ad9201ab
Remove Rockbox Utility Offline Mode.

Offline Mode was intended to allow performing an installation without network
access. However, to get the required files cached the same installation has to
be performed with network access, which is a rather strange prerequisite. A
better way would be a way to direct Rockbox Utility to some local "repository"
that holds the required files.

Furthermore, Offline Mode hasn't been tested since long and is likely to be
broken since the caching mechanism has been extended.

For now remove this functionality. As far as I know it's been rarely used (if
at all) anyway.

Change-Id: Ib2af4892708e0440bd0a7940c131f04182ddb39a
Remove 64bit warning by using C99 fixed width format specifier.

Change-Id: I7fecca91acb61461f6696e0bf28bdd6c1bdf6f3c