This fixes the radioart crash that was the result of buffering.c working
on a freed buffer at the same time as buflib (radioart uses buffering.c for the
images). With this change the buffer is owned by buflib exclusively so this
cannot happen.
As a result, audio_get_buffer() doesn't exist anymore. Callers should call
core_alloc_maximum() directly. This buffer needs to be protected as usual
against movement if necessary (previously it was not protected at all which
cased the radioart crash), To get most of it they can adjust the willingness of
the talk engine to give its buffer away (at the expense of disabling voice
interface) with the new talk_buffer_set_policy() function.
Change-Id: I52123012208d04967876a304451d634e2bef3a33
The port uses the imx233 soc, it's a STMP3650 based Samsung player
Change-Id: I50b6d7e77fd292fab5ed26de87853cd5aaf9eaa4
Reviewed-on: http://gerrit.rockbox.org/490
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
This reverts commit 462adf2a0f.
Leaving the card in TRAN results in a huge power consumption because some cards
and internal bridges do not automatically enter power saving mode in TRAN state.
Change-Id: If79efe8cf99b24174889b3a5ebbcb51b07085f58
The ZEN/ZEN-XFi seem to be very picky about the lcd. And they do not like
standby mode so I'm going to drop it, the OF doesn't use it anyway. I still
don't know what this "power" pin is about, obviously it's not real power but
the OF toggle it. Let's hope the lcd will finally become more stable with
fix: the driver now does full power on/off on enable/disable.
Change-Id: I1c465ee4f2462bc3d9507e5f575f0a181af60214
Tested on iPod Mini 1G.
Change-Id: I67ac9b7ed84c34533107136d0aa72e5ce3bcc5bc
Reviewed-on: http://gerrit.rockbox.org/668
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Choices are limited for those: i2c is either generic software or imx233
hardware and power is either none or with a gpio. So factor ever possible
combination in a single common file and use fmradio-target.h to supply the
required parameters. This will remove a bunch of duplicate code.
Change-Id: If12faeb2e371631cd39cc18a4c1d859812007934
The old code allowed each target to specify its adc targets but this proved
useless since the target rely directly on imx233/lradc for input method and
generic adc is mostly used for battery and debug. Remove all target specific
files and provide a generic implemenation. The targets can still specify a
battery temperature channel in powermgmt-target.h
Change-Id: I68cf2e3e46379d174ac6d774ffb237bb15a19ae3
Although there is no difference in the cost of a full or partial update,
it is preferable that the semantic of lcd_update_rect() be correct.
Change-Id: I8a168388b98e0dbd7237729b7fd8a62fa1885be1
Originally written and uploaded by Lalufu (Ralf Ertzinger) in Feb 2012.
They have been condensed into a single patch and some further additions
by Andy Potter.
Currently includes Authentication V2 support from iPod to Accessory,
RF/BlueTooth transmitter support, selecting a playlist and selecting a
track from the current playlist. Does not support uploading Album Art
or podcasts. Has been tested on the following iPods,
4th Gen Grayscale, 4th Gen Color/Photo, Mini 2nd Gen, Nano 1st Gen and
Video 5.5Gen.
Change-Id: Ie8fc098361844132f0228ecbe3c48da948726f5e
Co-Authored by: Andy Potter <liveboxandy@gmail.com>
Reviewed-on: http://gerrit.rockbox.org/533
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
HiFi E.T. MA8 is almost the same as MA9 except
another DAC(pcm1792 in ma8, df1704 in ma9).
MA8 has ILI9342 lcd, MA8C has ILI9342C lcd.
Change-Id: If2ac04f5a3382590b2a392c46286559f54b2ed6a
The only difference between this target and HiFi E.T. MA9
is display driver (ILI9342 in MA9 and ILI9342c in MA9C)
Change-Id: Icc3d2490f850902a653175360f12283f3708bbb7
button_read_device() could be called before pca9555_read_thread
intializes pca9555_in_ports variable, and return incorrect value.
Change-Id: I960bff72fe230c9d0256b20e92d0a75e67266038
The previous code disabled the irq when there were fired. This seems
unreliable for some mysterious reason. Instead simply disable them
before enabling the irq.
Change-Id: I7ee1aa25dbc41c7dd53aa7c7744aa5e4d70ff2d8
Reviewed-on: http://gerrit.rockbox.org/640
Reviewed-by: benjamin brown <foolshperson@gmail.com>
Tested-by: benjamin brown <foolshperson@gmail.com>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
The code was broken in two ways:
- it called storage_read_sectors with a wrong drive number
- calling storage_read_sectors too early at boot time will fail because
we are in the init function, so the drive is not yet registered.
To fix this, use a user provided read callback instead of storage read
functions.
Change-Id: I5ab79d48391fae619d5f8ae09c3d499fc43854c8
The setting is currently unused but it provides some documentation and basic
support for a more comprehensive implementation of read-only support.
Change-Id: I353c33ef765ef6e6c09d59e943da6654a311ad84
The exact combination on which recording is needed is too complicated, so
just always cancel the unused warning, the compiler will optimise it away.
Change-Id: I0946586e4b01769c98babc4616f893c38f44c05f
The new code can select among several types of window (user, system, ...).
Furthermore, the type of partitions to use is selectable in config file.
Currently, two types are support: Freescale style MBR and Creative MBLK
Change-Id: I969d60a3d08f2c9448fb4b9c440051b7801b94cd
When bootloader is too intelligent, like on Creative devices, it might leave
some unexpected IRQs sources on, this is problematic when those sources share
the same IRQ line.
Change-Id: Ie9333918eb1048b1f2de4ea738cddf556aa75ee2
The STMP3700 has unreliable vbusvalid irq so we need to use
vdd5gtvddio. Therefore, using the vbusvalid bit produces
inconsistent results between events and detect. Fix that
by making power handle all the usb detect stuff.
Change-Id: Ic521b2f6677602e184fe46352c5359f4b4ba8d56
These functions are mostly used by the radio drivers and any blocking
call could potentially block the entire UI, which is pretty bad.
Since any request is expected to finish within a few us, having a 10ms
timeout doesn't seem unreasonable.
Change-Id: I03b19729511547e5bbdeb3476d020e5d87d0d7e1
On targets like stmp3700, resetting the dma channel on "soft" timeout
drives the whole block crazy unless it goes through complete reset.
Change-Id: I830b252279989bf9f9cd9c138240a6ea9b003527
The driver can now handle HOLD in several ways, including using a GPIO.
Also add a debug routine to read the raw value of the adc.
Change-Id: Ide2cb1ac58e759b4bc464e606b432f2c150ee36f
Many imx233 targets boot in a very low performance mode, typically cpu and
dram at 24MHz. This results in very slow boots and very unstable USB
bootloader mode. Since cpu frequency scaling is disabled in bootloader in
rockbox, always make the frequency scaling code available and boost at boot
time.
Change-Id: Ie96623c00f7c4cd9a377b84dcb14b772558cfa4d
This one is a bit strange: our codebase just don't use it if there is both
SD and MMC, so this missing function got unnoticed so far.
Change-Id: Ifea4bb5140477b7637d033737594259cc44fb10e
The i2c core has some bugs: it locks up when the slave doesn't NAK and
prevent the dma channel from being resetted. Specifically handle this
situation by setting CLR_GOT_A_NAK (workaround) and then reset dma and i2c
block.
Change-Id: I0e09d38d4301a0ad42dfad785cc934b43f2c4485
Target that have a touchpad/touchscreen should disable it while
being locked (In order to avoid LCD to drain battery power due to
"key locked" constant reporting messages. If they a have a keylock
button this was already handled at driver level. If not (e.g. fuze+),
they will have to implement a switch at driver level that action.c
can operate on softlock.
This patch does the following for any target having a touchpad
or a touchscreen and no HAS_BUTTON_HOLD (ie any softlock target)
1) it implements the code to call button_enable_touch(bool en) in
action.c.
2) button_enable_touch is implemented in button.c and call
either touchpad_enable or touchscreen_enable
3) those two function are implemented respectively in touchscreen.c
and a new touchpad.c file. They provide a generic way to silents touch's
device and call a function at driver level where target specific code
can be implemented if possible/needed (for power saving for instance).
Those function name are touchpad_enable_device and touchscreen_enable_device
4) we implement an empty function at driver level of targets that need it
to have them still being able to compiled.
Change-Id: I9ead78a25bd33466a8533f5b9f259b395cb5ce49
Reviewed-on: http://gerrit.rockbox.org/569
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Drop most of the cases: only keep 64 MHz and 133 MHz. Pick values
from the manual which seem to match real life values.
Change-Id: I912752fbe372f9f44207db6853d0ff92fd619bed
Now that the drive strength problem has been fixed, we can safely
drive sd cards at 48MHz in HS mode to get the best possible
transfer speed at 3.3V.
Change-Id: I0291589c399fb4880deba97895ff578451a32f99
Instead of going back and forth between TRAN and STBY modes,
stay in TRAN mode all the time, this avoid two commands on each
read/write and a potential delay to wait for the card.
Change-Id: Iafd456ab9a581d870331b622eeb48dcc254eda7f
This allows tells the card the number of blocks that will be
transfered. This is usually faster than continuous read/write.
It is mandatory for MMC and on SD cards, support is probed.
Change-Id: Ide3f97c26c2b714390884c69e05b00c2caa552f8
The old max dma transfer size was set to 2^15 because allowing
values up to 2^16 would result in overflow of the transfer count
in many places. This was a problem with the old register headers
because the macros didn't make sure the result is contained in
the bitmask of the field. The new macro do so 2^16 will actually
end up being 0 which means 2^16 for the hardware. This is kind of
hacky but it works and I prefer that this stays a power of two
because setting it to 2^16-1 would be extremely weird.
Change-Id: I9ce5661c477a79ab52efd5c573948e2353117804
- take advantage of the new rmi power function implemented to:
1) lower usual power_mode to low_power as it seems to be enough and might save
some battery
2) implement a system that lower that state to very_low_power
after 1 minute of inactivity.
3) implement touchdev_enable(bool) that can be use later to disable the
touchpad when needed
4) improve the debug screen report of the current power state and
changing the power state using volume keys
Change-Id: I0b372696d4b2bef5360c778d0500870fd9badee1
Reviewed-on: http://gerrit.rockbox.org/525
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal
with function parameters. IF_MD/IF_MV are enough.
Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0
if not.
Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
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
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
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
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
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
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
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>
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
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
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
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
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
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
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
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
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
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
Add finer granularity to start command: now commands can be
prepared, schedule and semaphore increased independently.
Change-Id: Ib1ed1f20f4b46dc61b6dbab6ddec8b54e3d832b9
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
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
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
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
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
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
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
The current pinctrl functions were a mess. Normalise the functions
names to make them shorter and clearer.
Change-Id: Iac6ff84625ef2b7610268e3a5802dc0088de3167
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