Commit graph

9810 commits

Author SHA1 Message Date
Amaury Pouly
63ffdc1c89 imx233: fix audioout for stmp3600 and stmp3700, add 3d effect
Although the 3D effets sound terrible, add support for it.

Change-Id: Ib24be01986a974387b592c6e291d34b196ceb884
2013-06-17 00:29:25 +02:00
Amaury Pouly
f0f6aee58c imx233: fix octop for stmp3600 and stmp3700
Change-Id: Iacfa8bb96c8b78d56e5010f313bc47b73df80720
2013-06-17 00:29:25 +02:00
Amaury Pouly
6e88d98dcf imx233: always use the timer for kernel tick
Change-Id: Ifb7f77569b351e66edb5b8f1ac2e805c2f8b394a
2013-06-17 00:29:25 +02:00
Amaury Pouly
b74a459189 imx233: fix ssp for stmp3600 and stmp3700
Using the ssp macros, we can easily handle the stmp3600 which
has a single ssp block. Take care of all the nasty differences
between targets like bus width

Change-Id: If98a091cc262e9e6834f6fb9826f7c5515bfe621
2013-06-17 00:29:25 +02:00
Amaury Pouly
86ff093267 imx233: fix emi for stmp3600 and stmp3700
Currently don't do anything on stmp3600 because emi is completely
different. On stmp3700 it is unsure how the pll lock is handled
and this will need more testing.

Change-Id: I3d11282531f54f2ecc4187c0d913e2c61f4de14d
2013-06-17 00:29:25 +02:00
Amaury Pouly
e671472c3f imx233: fix dma for stmp3600 and stmp3700, improve support
Add finer granularity to start command: now commands can be
prepared, schedule and semaphore increased independently.

Change-Id: Ib1ed1f20f4b46dc61b6dbab6ddec8b54e3d832b9
2013-06-17 00:29:25 +02:00
Amaury Pouly
bdc572b8a1 imx233: improve debug and fix for stmp3600 and stmp3700
Add pwm and usb screen, fix charging, icoll and dcp on other
stmps.

Change-Id: I3cddf987e178bc01046132adaed15cff750835c9
2013-06-17 00:29:25 +02:00
Amaury Pouly
069a0269a9 imx233: fix/improve lcdif for stmp3600 and stmp4700, fix drivers
Factorise pin setup, rewrite PIO code, add support for lcdif irq,
handle all the various differences between the stmps, drop yuv
blitting code since it already exists in the common lcd drivers.

Change-Id: Ifc40aed9b3b12f16611ce960602e46a5bc87ae53
2013-06-17 00:29:25 +02:00
Amaury Pouly
52426d0891 imx233: fix pinctrl for stmp3600 and stmp3700
Change-Id: I87281b89315890fa285cb9a63fda5c90bdc8cdbf
2013-06-17 00:29:25 +02:00
Amaury Pouly
f4fdf1ffe2 imx233: fix lradc/adc for stmp3600 and stmp3700
The lradc architecture of the stmp3600 is rather different:
only channels 6 and 7 have configurable source and we need to
take care when allocating channels so that we can actually
measure the right channel! Delegate die temperature sensing to
the power block on stmp3600.

Change-Id: I0860eb4ea98240facc3d4a19d61684eca5f630cc
2013-06-17 00:29:25 +02:00
Amaury Pouly
239219ee70 imx233: fix power for stmp3600 and stmp3700
There are many small differences between them. In particular
some regulators are not available on stmp3600. Also the vbusvalid
detect method is not available as an irq on stmp3600 and seems
broken on stmp3700. Finally die temperature is handled by the
power block on stmp3600.

Change-Id: I2c68b418738f15564e445d3a1496018cef97fff7
2013-06-17 00:29:25 +02:00
Amaury Pouly
2d0d752bf8 imx233: fix clkctrl for stmp3600 and stmp3700
Change-Id: I7596e41c0d0b7fdcc18f7d328a0927c2c78dc4cb
2013-06-17 00:29:24 +02:00
Amaury Pouly
023621d401 imx233: fix icoll for stmp3600 and stmp3700
Change-Id: I97b86d67b53615eca0d870058ff5c095c3063151
2013-06-17 00:29:24 +02:00
Amaury Pouly
8ed8a79f5c imx233: various sdmmc fixes
Change-Id: I261d0bdea1e7c5bc9139b10bf42e7ce7ce6b6dd8
2013-06-17 00:29:24 +02:00
Amaury Pouly
fbee03e0f0 imx233: simplify timer code
Change-Id: I845c3f20c17ce6091ed02bc4fbfca176358d31b7
2013-06-17 00:29:24 +02:00
Amaury Pouly
f1c6c71218 imx233: improve ssp
Under some circumstance (timeout), the dma interrupt is not fired
and only the error one is. This can happen with some picky SD
cards and with the current code it causes a 1 second timeout.
This code properly catches the error interrupt to stop as soon
as possible.

Change-Id: I9c53ea272d01793f0f229571502e99eb62f1b723
2013-06-17 00:29:24 +02:00
Amaury Pouly
49ea1b3cef imx233: make linker file more regular
Change-Id: Ic3fe21be9124af71eae88a00793f914fe03ee5a2
2013-06-17 00:29:24 +02:00
Amaury Pouly
f8d2984875 imx233: enhance pwm
The current pwm interface is too low-level. Introduce a higher
level setup function which directly computes the parameters from
the required frequency.

Change-Id: Ie95c7522e9f42492fe872203f4cab46770a9649a
2013-06-17 00:29:24 +02:00
Amaury Pouly
f5ac658d16 imx233: normalise clkctrl
The clkctrl functions were becoming a mess. Normalise the names,
get rid of the xtal derived as special case and use the same
interface.

Change-Id: Ib954a8d30a6bd691914b5e0d97774ec9fc560c50
2013-06-17 00:29:24 +02:00
Amaury Pouly
84fc327aeb imx233: introduce virtual pins to simplify pin setup
A number of pins on the imx233 are standard and manually calling
functions to acquire, set function/drive/output is painful. This
will become unmanageable when we will add support for the other
stmp chips.
Introduce the concept of virtual pin which is a way to completely
describe a virtual pin (virtual because pins are muxed).

Change-Id: I01b6e040945648e58e1d1abab06529c9571c5f10
2013-06-17 00:29:24 +02:00
Amaury Pouly
8f351d6e21 imx233: enhance pinctrl irq with user pointer
Change-Id: I191704299487598a853af4df5aebbbf8a7134a34
2013-06-17 00:29:24 +02:00
Amaury Pouly
918a06a12a imx233: normalise pinctrl names
The current pinctrl functions were a mess. Normalise the functions
names to make them shorter and clearer.

Change-Id: Iac6ff84625ef2b7610268e3a5802dc0088de3167
2013-06-17 00:29:24 +02:00
Amaury Pouly
8390eb931e imx233: rewrite dma using new register headers
Change-Id: If73b84d9c9f4a152a54fb9d2dbec895e72d2e753
2013-06-16 18:21:49 +02:00
Amaury Pouly
852a82b90a imx233: rewrite timrot using new register headers
Change-Id: Ia6dc7ac7e1fdf471a518111f5593bd96bc3acfac
2013-06-16 18:21:49 +02:00
Amaury Pouly
96b1d02b05 imx233: rewrite digctl using new register headers
Change-Id: I910a09e07b9f5a82bb6cb150739fcebc942cb7c1
2013-06-16 18:21:48 +02:00
Amaury Pouly
a759242b55 imx233: rewrite ssp using new register headers
Change-Id: Ibf186b610beb07bd615c976630cdca9de2c7448e
2013-06-16 18:21:48 +02:00
Amaury Pouly
94cb72301d imx233: fix sdmmc code
The SD SWITCH command has a result and can take a long time to
finish. Ignoring the answer and waiting an arbitrary time is
unreliable at best.

Change-Id: I1bfbb193952b96598f8bb056bac88220d4edf1fc
2013-06-16 18:21:48 +02:00
Amaury Pouly
2d12ef6c73 imx233: rewrite rtc using new registers
Change-Id: I30794dac2175d5717ea8e05e911abec65a214c44
2013-06-16 18:21:48 +02:00
Amaury Pouly
3e8c2dc46d imx233: rewrite pwm using new registers
Change-Id: Ie222f0b25f4b8af9ccf21aecd82a7f4eba40aa3c
2013-06-16 18:21:48 +02:00
Amaury Pouly
7c5b65b9d2 imx233: rewrite power using new registers
Change-Id: Ifbee91161220419f4d1750672b5c4ae3537cefca
2013-06-16 18:21:43 +02:00
Amaury Pouly
b73fda3a05 imx233: rewrite pinctrl using new registers
Change-Id: I907a0b599ef65061360c215580f96f59b78b615b
2013-06-16 16:58:01 +02:00
Amaury Pouly
6f0eaf4827 imx233: rewrite ocotp using new register headers
Change-Id: I3c622119a1e296ec6b3f35f27e81b5118ab7f6cc
2013-06-16 16:58:00 +02:00
Amaury Pouly
d815cf3c79 imx233: rewrite lradc using new register headers
Change-Id: I06e4467c0ffe33145e6192528b074a23a8df67cc
2013-06-16 16:57:54 +02:00
Amaury Pouly
8517cf8bed imx233: rewrite lcdif using the new register headers
Change-Id: I94329a65a7c6a4127fa05b77b9a7a291f8a50013
2013-06-16 16:32:03 +02:00
Amaury Pouly
0fa014a6fe imx233: rewrite i2c using new register headers
Change-Id: Ieffb389fb74404e86d8ba51ee8c48bab6b299763
2013-06-16 15:58:36 +02:00
Amaury Pouly
3d62000fcb imx233: rewrite gpmi using new register headers
Change-Id: I8284836a79ac7e6d59da040df63f6fcf43857191
2013-06-16 15:52:03 +02:00
Amaury Pouly
444a8b1da0 imx233: rewrite audioin using new register headers
Change-Id: I7d71d16361a29030d0eb6de5c518168947516d39
2013-06-16 15:47:55 +02:00
Amaury Pouly
df9e6c3147 imx233: rewrite audioout using new register headers
Change-Id: I20dddec437187c0974ac16027548dbe3dd097c59
2013-06-16 15:45:32 +02:00
Amaury Pouly
e6a931301f imx233: rewrite emi using new register headers
Change-Id: Ie893162aac38ea3aaf73b4e84e54be714a5fc33f
2013-06-16 15:30:46 +02:00
Amaury Pouly
2a01b3766f imx233: rewrite clkctrl using new register headers
Change-Id: I6c79e99ed4ab20e00c3110d870e144a6c8596769
2013-06-16 15:28:04 +02:00
Amaury Pouly
f545908c16 imx233: rewrite icoll to use new register headers
Change-Id: I0bf30849d18a8493627025b383ce75ce524777ab
2013-06-16 14:46:58 +02:00
Amaury Pouly
81224c62bb imx233: add subtarget and package type to configure files
Change-Id: I234dab0e861d38abf866803bfcd729c63a8ee3ed
2013-06-16 14:39:58 +02:00
Amaury Pouly
dda1d5ca48 imx233: add register selector file
Register set selection is based on the value of the
IMX233_SUBTARGET value. The reg-select.h file (used by the
generated headers), does the selection based on this value as
follows:
- 3600 <= . < 3700: stmp3600 register set
- 3700 <= . < 3780: stmp3700 register set
- 3780 <= .: imx233 register set
Note that this selector relies on the name of the socs in the
register description to be respectively stmp3600, stmp3700 and
imx233.

Change-Id: I793b18e6c4f3fea85aa74f4c6be3affb0622c14e
2013-06-15 22:27:34 +02:00
Amaury Pouly
017667c2dc imx233: generate register headers for stmp3600, stmp3700 and imx233
Change-Id: Ia87086f4f4f4ecbb844ffd869407b14ea2509934
2013-06-15 22:27:34 +02:00
Michael Sevakis
5857c44017 Refactor audio thread to run both recording and playback.
Eliminates the pcmrec thread and keeps playback and recording engine
operation mutually-exclusive.

audio_thread.c contains the audio thread which branches to the
correct engine depending upon the request. It also handles the main
audio initialization.

Moves pcm_init into main.c just before dsp_init because I don't want
that one in audio_init in the new file.

(Also makes revision df6e1bc pointless ;)

Change-Id: Ifc1db24404e6d8dd9ac42d9f4dfbc207aa9a26e1
2013-05-31 03:20:35 -04:00
Michael Sevakis
5a1e697e2a PP Sansa: Use better I2S divider settings for 48kHz.
The previous ones produced some crackling.

Change-Id: I70de901172aba156f58d4b1088d0038b2ed53d49
2013-05-30 03:34:10 -04:00
Andrew Ryabinin
00b8563654 df1704: Add filter roll-off selection.
Change-Id: I732ebd3446858b497105cf03fc81e934a749a57b
2013-05-24 11:32:20 +04:00
Andrew Ryabinin
0519f7e5ab Add DAC's oversampling filter roll-off selection to sound settings.
Change-Id: I1258ba50dd9308f49d97965562f3a423c9bfb785
2013-05-24 11:18:16 +04:00
Boris Gjenero
f6e179bd8e Remove data_abort_handler from ARM crt0 files.
This causes data_abort_handler from lib/unwarminder/safe_read.S to be
used instead. It allows unwarminder to avoid data aborts when
displaying the backtrace. A data_abort_handler remains in system-arm.c,
but it is not used because it is declared as a weak symbol.

Change-Id: I832066ed514347fe697e219872e90fbdd937f477
Reviewed-on: http://gerrit.rockbox.org/475
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested-by: Boris Gjenero <boris.gjenero@gmail.com>
2013-05-24 02:02:04 +02:00
Michael Sevakis
9b65f8e658 Fix 6e211ab errors and warnings.
If target has HW tone controls but no HW prescaler (non-implemented or
non-existent), audiohw_set_prescaler() should, for now, do nothing.

Change-Id: If1b1a36970dca82fda1c350fbaa4d6ce068a6d32
2013-05-23 14:58:57 -04:00
Michael Sevakis
6e211ab3ac Remove dsp_callback because DSP is now library code, not app code.
Yep, nope, not necessary anymore. Just call functions directly.

Change-Id: I21dc35f8d674c2a9c8379b7cebd5613c1f05b5eb
2013-05-23 14:25:37 -04:00
Michael Sevakis
b7e0e1a0a3 buflib: Remove compulsory IRQ disable during buffer move.
It can cause excessively long interrupt outages if moving a larger
buffer and disrupt audio where DMA is not at a higher interrupt priority
such as FIQ.

Some targets, like Gigabeat S, have very low audio interrupt latency
requirements and will even channel swap if they are missed. Pictureflow
will make the issue very obvious. Even then, moves could take
milliseconds or more depending on the buffer size which is far too long
for any target.

Change-Id: I8e7817213e901da67c36b7eb25d7cb1c1e3ba802
Reviewed-on: http://gerrit.rockbox.org/472
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-05-23 18:25:29 +02:00
Michael Sevakis
7738660eff USB: Detect charging-only mode upon cable insert, not host detect.
Letting go of the button before the host is detected allows storage mode
to be entered even though a button was down when plugging. Sometimes the
host would try several times and the button would have to be held down
for several seconds to avoid a storage connection.

The adjustment wasn't made when switching to setup request host
detection.

Change-Id: Iab3bced5bfb1478d4d9a7baab2a2a1144afaf437
2013-05-22 02:28:31 -04:00
Boris Gjenero
01d0de9fc4 FS#12854 - ipod-time-sync sets wrong day
Change-Id: I8ac7561119e51774b9aee377e7373a7e830a5780
2013-05-17 21:12:56 +02:00
Michael Sevakis
91b850ec42 Get rid of usb_drv_attach() from USB code.
'Twas an idiosyncrasy of detecting a host upon bus reset, which is
obsolete.

Change-Id: I0adb25e1805022544f52cd0cb766819a367dbde4
2013-05-14 22:13:38 -04:00
Michael Sevakis
8d21fc9229 usb-drv-arc: Kill trailing whitespace
Change-Id: I682a8b68fa8148e5db2e06e4f261b1ea01d140ad
2013-05-14 22:05:51 -04:00
Michael Sevakis
af4c55bd11 Set the right variable type for ucallback :)
Change-Id: I19eace9452d9d0b2a6c7770549930c83ece05c80
2013-05-11 21:20:49 -04:00
Michael Sevakis
0a7d941fb9 i.MX31: Remove long udelay from DVFS interrupt handler
Split the ISR into two parts and alllow quick return from first half.

Introduces a uevent() API to have a callback happen in a specified
number of microseconds. Right now only one event is supported.

Change-Id: Ib1666165be2f6082e5275d64961f083cab104f9f
2013-05-11 21:09:01 -04:00
Marcin Bukat
440872bb42 rk27xx: Use DMA for lcd_update_rect()
This speeds up partial updates quite a bit but what is more
important it opens up a way to efficiently implement
lcd_blit_yuv() using hw colorspace conversion.

Tested on rk27generic, hm60x v1 and v2 and on ma9.

Benchmark for hm60x v1 (by mortalis):
HEAD patched
1/1 141fps 138fps
1/4 315fps 395fps

Change-Id: I4cc115786c3139000fc14c49a7290e289cfd6c42
2013-05-11 12:55:23 +02:00
Marcin Bukat
ca8154741f rk27xx: Slightly refactor lcd_set_gram_area()
Change-Id: I1040164220dd87b19b58be560eb5b628857bc284
2013-05-11 12:30:38 +02:00
Marcin Bukat
3f4824b94f rk27xx: Decide lcd databus width at compile time
Change-Id: I013da0f3f862e733c5245a48dceb08219f43bf2d
2013-05-11 12:16:39 +02:00
Michael Sevakis
b210a3a8cb Fix FS#12860 - iPod 5g line out silent
Conversion from centibels to register values was left out of
audiohw_set_lineout_volume().

Credit goes to Dave Marsh for providing the fix.

Just another little oversight from sound/audiohw rework.

Change-Id: I7f8b1c5fb575ac95b5d595c2f4824fbb5ebbd3c8
2013-05-09 15:37:56 -04:00
Andrew Ryabinin
d04bd89bbd hm60x: Implement lcd_enable() for v2 display.
Change-Id: I5ed0cba03711b3ba6db58405fe805d92aece974e
2013-05-09 16:08:17 +04:00
Andrew Ryabinin
83554cce8d hm60x: Implement lcd_update_rect for v2 display.
Change-Id: I9d6b14bcbd26cfd760516f1ef3bf421698507806
2013-05-08 18:30:32 +04:00
Andrew Ryabinin
fa4e1baa83 Introduce HiFi E.T MA9 port.
Change-Id: I79aadc958fd5222f26f91ed127f8c6fb2c465dc2
2013-05-06 14:09:24 +04:00
Michael Sevakis
fd00d3cf48 Fix FS#12859 - Bass/Treble not doing anything in new builds
Just one more SNAFU after redoing sound.c. Software bass/treble controls
in the DSP expect .1 dB gain increments but the gains were being set as
1 dB increments because that's what the AUDIOHW_SETTING specifies. Just
x10 the gains given to audiohw_set_bass/treble.

Change-Id: Id5296f93908ec0036a5605d3a60a2cb5eec91bb5
2013-05-04 22:46:18 -04:00
Michael Sevakis
08199cd6cb Provide high resolution volume and prescaler to hosted targets.
HAVE_SW_VOLUME_CONTROL is required and at this time only affects the
SDL targets using pcm-sdl.c.

Enables balance control in SDL targets, unless mono volume is in use.

Compiles software volume control as unbuffered when
PCM_SW_VOLUME_UNBUFFERED is defined. This avoids the overhead and
extra latency introduced by the double buffer when it is not needed.
Use this config when the target's PCM driver is buffered and sufficient
latency exists to perform safely the volume scaling.

Simulated targets that are double-buffered when made as native targets
remain so in the sim in order to run the same code.

Change-Id: Ifa77d2d3ae7376c65afecdfc785a084478cb5ffb
Reviewed-on: http://gerrit.rockbox.org/457
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-27 06:59:27 +02:00
Michael Sevakis
95e23defb0 Make fixepoint.c as a shared library (libfixedpoint.a).
Change-Id: Icc10d6e85f890c432f191233a4d64e09f00be43d
Reviewed-on: http://gerrit.rockbox.org/456
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-26 00:11:04 +02:00
Michael Sevakis
8829e909b4 Bass/Treble caps should exist implicitly with HAVE_SW_TONE_CONTROLS.
If AUDIOHW_CAPS is defined without explicit BASS_CAP/TREBLE_CAP while
HAVE_SW_TONE_CONTROLS is defined, AUDIOHW_HAVE_BASS/TREBLE should be
defined or otherwise the tone controls won't show up. TREBLE/BASS were
being defined if AUDIOHW_CAPS was NOT defined, but the same rule should
apply if the codec needs to specify other caps but doesn't use hardware
tone controls.

(I'm surprised noone noticed some settings gone missing :-)

Change-Id: I85b5c467bab07bb62362a0dc2d582267ac2d8ec9
2013-04-25 16:37:12 -04:00
andypotter
ecaa401660 Add Serial Port 1 support for iPod Photo/Color/4G/Mini2G
Based on FS#9920 by Ryan Press with changes to selection logic so
that it works on my iPod Photo. Should also work on iPod Color/4G
and Mini2G. Moved all target specific code from
firmware/drivers/serial.c into new file
firmware/target/arm/pp/uart-pp.c in the same manner as other
target specific uart code.
Update to fix build error on ipodmini2g by adding defines in config file.
Removed unwanted whitespace
Tested on iPod Photo.

Change-Id: Ia5539563966198e06372d70b5adf2ef78882f863
Reviewed-on: http://gerrit.rockbox.org/455
Reviewed-by: andypotter <liveboxandy@gmail.com>
Tested-by: andypotter <liveboxandy@gmail.com>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-04-25 21:02:09 +02:00
Michael Sevakis
21b62bd893 Make pcm_sw_volume.c a bit less verbose by merging volume code.
pcm_set_master_volume had two implementations, one for a prescaler
and one without one but the differences can be made minimal enough
to combine them.

Change-Id: I889e60b50b9f046c093853cb1685058796fe9067
2013-04-23 21:33:55 -04:00
Michael Sevakis
4f2c0c1ed2 Oops. Revert a pointless change.
Change-Id: I082411145a411ca7d41b359dea419ef8190d70ce
2013-04-22 20:55:47 -04:00
Michael Sevakis
e61e9c61d0 Do some cleanup, adjustment and a couple fixes to recent sound changes.
* SOUND_x enum can be generated by audiohw_settings.h along with settings
entries and sound_val2phys.

* VOLUME_MIN and VOLUME_MAX are no longer necessary within sound.c. If
you need them, they are for target-defined purposes.

* Fix up SDL volume implementation in sdl.c. Move sim volume calculation
code to pcm-sdl.c.

* Min trigger tresholds were based upon VOLUME_MIN for some reason.
These setting have nothing to do with playback volume. Since it is no
longer present, set these at -89dB which is the minimum peak meter
sensitivity setting.

* Fix an oversight in wm8758.c. I forgot to add the dB->register
conversion to audiohw_set_volume.

Change-Id: Ie1df33f1793eee75e6793f16bc7bddd16edb7f75
2013-04-22 20:38:17 -04:00
Michael Sevakis
540e5d103f Forget about fixedpoint.c in any HWCODEC bin.
It bloats to much just for one simple use. Just use a simple function
for shifting sound setting decimal places.

Change-Id: I1a7d37cce6ada3c6e6600dc0d301f354ffeff231
2013-04-15 16:11:28 -04:00
Michael Sevakis
333f4f52be Fix final error from 0c7b787 in Player sim.
Change-Id: Ifeebed8f594fc56acbbd2439fb8186566cc04de8
2013-04-15 15:19:39 -04:00
Michael Sevakis
5261b19bdf Still at it for 0c7b787. Might be done now.
Change-Id: Idf45731dc6554954747f6036dc6dfcd4b63981a1
2013-04-15 14:58:00 -04:00
Michael Sevakis
9e71fd16a5 Keep fixing 0c7b787 stuff
Change-Id: I0678d3307fbcad32156f9f4e0f8b90eed5a20d92
2013-04-15 14:00:48 -04:00
Michael Sevakis
bbd991ad63 Fix some more errors and warnings from 0c7b787.
Change-Id: Ib67d0ab344e36964cadbcc982dc2afe35733770b
2013-04-15 13:24:29 -04:00
Michael Sevakis
0971f57634 Hopefully knock out most of the red and yellow from 0c7b787.
Change-Id: Ib8dd0d011b11ee3eded3025308f19ddb5d151b59
2013-04-15 12:39:04 -04:00
Michael Sevakis
0c7b787398 Straighten out the mad twisted state of sound.c and related areas.
This is going right in since it's long overdue. If anything is goofed,
drop me a line or just tweak it yourself if you know what's wrong. :-)

Make HW/SW codec interface more uniform when emulating HW functionality
on SWCODEC for functions such as "audiohw_set_pitch". The firmware-to-
DSP plumbing is in firmware/drivers/audiohw-swcodec.c. "sound_XXX"
APIs are all in sound.c with none in DSP code any longer.

Reduce number of settings definitions needed by each codec by providing
defaults for common ones like balance, channels and SW tone controls.

Remove need for separate SIM code and tables and add virtual codec header
for hosted targets.

Change-Id: I3f23702bca054fc9bda40f49824ce681bb7f777b
2013-04-15 12:02:05 -04:00
Marcin Bukat
fd6ab02912 rk27xx: do not attenuate signal twice in analog bypass mode
Change-Id: I108091adaa05e53ccb8bbe3d60ca35e2191a39fd
2013-04-12 21:43:17 +02:00
Marcin Bukat
490db740a1 rk27xx: avoid one multiply in udelay() as pointed by kugel
Change-Id: Ie33a393b0d4c4b45975ca53ced91dd9f03369db1
2013-04-12 10:08:45 +02:00
Marcin Bukat
3c802a95ed rk27xx: make udelay() more accurate
Change-Id: Ic448c4e5ec52af6aaeebccee4feea49954394677
2013-04-12 09:27:41 +02:00
Andrew Ryabinin
6be8097651 hm60x/hm801: Fix balance by enabling sw volume control.
Change-Id: I8760b58d5b801409f35370d812d72f8d578d2889
2013-04-12 10:11:54 +04:00
Michael Sevakis
2dd1f37a10 Fix f5a5b94 errors. Employ SW volume for select targets on SIM.
Onda VX747 sim was missing a limits #define; #include limits.h in
pcm_sw_volume.h.

Simply use the software volume control for the SIM volume control
rather than the SDL volume control when the target would have it
natively.

Change-Id: I8e924a2ff1b410f602452d2ea9b691efb82c931e
2013-04-11 19:00:23 -04:00
Michael Sevakis
f5a5b94686 Implement universal in-PCM-driver software volume control.
Implements double-buffered volume, balance and prescaling control in
the main PCM driver when HAVE_SW_VOLUME_CONTROL is defined ensuring
that all PCM is volume controlled and level changes are low in latency.

Supports -73 to +6 dB using a 15-bit factor so that no large-integer
math is needed.

Low-level hardware drivers do not have to implement it themselves but
parameters can be changed (currently defined in pcm-internal.h) to work
best with a particular SoC or to provide different volume ranges.

Volume and prescale calls should be made in the codec driver. It should
appear as a normal hardware interface. PCM volume calls expect .1 dB
units.

Change-Id: Idf6316a64ef4fb8abcede10707e1e6c6d01d57db
Reviewed-on: http://gerrit.rockbox.org/423
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-04-11 22:55:16 +02:00
Marcin Bukat
a9049a79d7 fix yellow
Change-Id: Ide0df2c3719d6100c6dc61515bf7acf6ac11231b
2013-04-11 11:42:12 +02:00
Amaury Pouly
a924df8d6d rk27xx: implement radio support
Change-Id: I59d3905e9b2a3df8aa235e424c7a6e0eff6d73e9
Reviewed-on: http://gerrit.rockbox.org/427
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-04-11 11:18:23 +02:00
Michael Sevakis
f49e750531 Move fixedpoint.h to be accessible in /firmware.
Will need it soon enough.

Combine the contents of all the various fixedpoint.h files.
Not moving fixedpoint.c for now since I'm not sure where it
should be and it causes some dependency issues.

Change-Id: Ideacbca2ca78f9158c2b114b113c274f68e908d5
2013-04-10 13:28:35 -04:00
Marcin Bukat
e6c0bd0350 rk27xx: fix i2c driver
Change-Id: I205cc92f452c1990c64da7e91b2baf00b920c922
2013-04-09 09:31:40 +02:00
Andrew Ryabinin
f84602aa68 Fix identations.
Change-Id: I98acabd5c8ab024d553726cfabe5654242a18b3b
2013-04-04 15:47:24 +04:00
Marcin Bukat
670af6344e rk27xx: Correct comment about i2c divider calculation
Change-Id: I75605d5bd6f8a3d1f44b63a9f4467ebcdd15267a
2013-04-04 13:06:46 +02:00
Frank Gevaerts
f8d36b5baa Increase MAXUSERFONTS to 12.
In the modern everything-can-be-skinned world, themes are beginning
to hit the limit of 8 fonts (which includes sysfont). Increasing this
to 12 will allow some headroom, at the cost of a bit more RAM usage
(about 20 bytes per extra possible font, so about 80 bytes total here)

Change-Id: Iddf4374b7ccf92b400614a7309bf3d2147ba98ab
2013-04-01 17:30:38 +02:00
Thomas Martitz
9f242e7be4 android: Rewrite PCM playback without OnPlaybackPositionUpdateListener.
The old way actually mis-used the API (I misunderstood the docs) because
it specified the marker position as a "low buffer watermark" but instead of a
future playback head position.

The replacement is a simple thread that writes the data regardless of the
filling level of the buffer (write() will just block) and polls the playback
state periodically.

Change-Id: If29237cee4ce78dc42f5a8320878bab0cafe78f7
Reviewed-on: http://gerrit.rockbox.org/422
Tested-by: Dominik Riebeling <Dominik.Riebeling@gmail.com>
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-04-01 11:26:12 +02:00
Andrew Ryabinin
ddf55200dc rk27xx: Add E & F gpio ports to debug info.
Change-Id: Idafd6fe37864625f7052045a32bb374798edfe1a
2013-03-25 16:35:04 +04:00
Andrew Ryabinin
b0eb3c7eb2 hm60x: Add lcd type information to debug info.
Change-Id: I09d30f9db6ac40cc92c22c637d560e4a3dcd50de
2013-03-25 16:32:58 +04:00
Bertrik Sikken
575d00e3b7 Remove redundant assigment of variable to itself
Change-Id: Ibecd8c869280a55a0716e631f44ab556f7dbd8b5
2013-03-24 16:24:40 +01:00
Bertrik Sikken
9b8f11d94a Fix LV24020 tuner chip volume level definition (found by cppcheck)
Change-Id: I328cfbd7c9fc6295db2e62f6174f8f4405e281a8
2013-03-24 16:03:31 +01:00
Marcin Bukat
027c035a4e jz4740: a few minor fixes
This was spotted while playing with qemu-jz:
1) rockbox reads TECR and TESR which are described as write-only
   registers. Datasheet doesn't mention what happens if they are
   readed. Apparently this doesn't have fatal side effects.
   It comes down to two defines from jz4740.h
   __tcu_stop_counter(n) and __tcu_start_counter(n) which use
   read-modify-write sequence.

2) rockbox accesses out of bound offset 0xd4 in DMA memspace.
   It comes from dis_irq() in system-jz4740.c. NUM_DMA is 6 but
   DMA channels are 0-5 so (irq <= IRQ_DMA_0 + NUM_DMA)) bound
   check is wrong.

This are *NOT* tested on device.

Change-Id: I29dff6a4f828030877b7d50fbcc98866478b9e3d
Reviewed-on: http://gerrit.rockbox.org/338
Reviewed-by: Bertrik Sikken <bertrik@sikken.nl>
Tested-by: Purling Nayuki <cyq.yzfl@gmail.com>
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2013-03-11 08:33:18 +01:00
Lorenzo Miori
2f9e3cae2c Samsung YP-R0 LCD improvements
This patch adds to YP-R0 (and other future targets using Linux
framebuffer) the ability to use LCD_ENABLE to save some CPU cycles
while display is powered off.
This patch also changes the way to toggle LCD power: now using
a proper ioctl call, slightly more efficient.

Change-Id: I544de77f5abd4ac1c13d3fe3a6e40a30f7c0bece
Reviewed-on: http://gerrit.rockbox.org/410
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2013-03-06 23:23:52 +01:00