Commit graph

4043 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
5261b19bdf Still at it for 0c7b787. Might be done now.
Change-Id: Idf45731dc6554954747f6036dc6dfcd4b63981a1
2013-04-15 14:58:00 -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
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
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
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