path: root/firmware/drivers
AgeCommit message (Collapse)AuthorFilesLines
2020-07-24[4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.Solomon Peachy2-17/+0
Note: I left behind lcd_bitmap in features.txt, because removing it would require considerable work in the manual and the translations. Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24[3/4] Completely remove HWCODEC supportSolomon Peachy1-9/+1
'swcodec' is now always set (and recording_swcodec for recording-capable units) in feature.txt so the manual and language strings don't need to all be fixed up. Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24[2/4] get rid of HAVE_LCD_CHARCELLSSolomon Peachy3-1936/+1
HAVE_LCD_BITMAP is now redundant. lcd_bitmap is always-on in features.txt so manual and lang strings don't have to change Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
2020-07-24[1/4] Remove SH support and all archos targetsSolomon Peachy6-912/+0
This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-11ATA: Make sure "hard disk" supports power managementSolomon Peachy1-0/+5
The FC-1307 CF->SD converter that is the basis of a lot of ATA->CF devices (including several iflash iFlash models) claims to not support ATA power management commands. Rockbox unconditionally issues those commands as support is mandated by the ATA spec. This patch checks the capability bit, and if it's not supported, does not attempt to put the ATA subsystem to sleep. It is not clear if the problems lie with the SLEEP commands or the wakeup process, but who knows where else the FC1307 violates the ATA specs, and reliability is much more important than power savings. Change-Id: I8b539c579d0449a8a3cfa63cdd1387db990fe820
2020-07-11fat: Validate FS Info Sector signature when attempting to mount volumeSolomon Peachy1-0/+11
The "try to mount as superfloppy" fails with some partitioning layouts because sector 0 can have a mostly-valid FAT32 signature. However, in all dumps I've looked at, sector 0's fsinfo offset value points at a place which lacks the fsinfo signature. Resolves FS#13213, no known regressions. Change-Id: Ib323d35cca6ca54e11aca6ba77041bf33a05a277
2020-07-09Update to allow the Apple Radio Remote to function on iPod Video 5G.LiveboxAndy1-17/+59
This was broken when the major update to iap was comitted. ia-lingo7.c created and various iap related files modified. On 4G, 6G and Nano 1/2Gen iPods the remote will function even though the radio won't. Tested on 4G Greyscale, 4G Color, 4G Photo, 4G Mini 1st Gen, 4G Mini 2Gen, Nano 1G, Nano 2G, Video 5G, Video 5.5G Change-Id: Ia74e3d07d9ab5edc6da8eafa96801ede722be331
2020-07-08ATA: In picking PIO modes, word 64 is only valid if word 53 bit 1 is set.Solomon Peachy1-5/+6
Change-Id: I0a7681be7d703c1baa7f8bd7b5e31f04f20f299d
2020-06-27button: allow disabling software poweroffFranklin Wei1-1/+15
On some devices, the button driver allows a "software poweroff" by long- pressing a certain key. This behavior is inconvnient when that button needs to be held down for other purposes, such as moving the cursor in rockpaint or sgt-untangle. This patch allows selectively disabling the software poweroff (enabled by default) from both core and plugin code. Change-Id: I7580752888ae5c7c7c5eb1be5966e3d67f17d4b4
2020-05-12m66591: Fix out-of-bounds array accessSolomon Peachy1-7/+7
Loop terminator needed a preincrement rather than postincrement, and also used a proper #define instead of a magic number. Change-Id: Iafd6a0dce0304cb94e4f1d04cce46d2ca603507a
2020-04-07Consider sector size when checking cluster sizeStefan Ott1-1/+6
On file systems with 2048 bytes per cluster, the bpb_secperclus value gets multiplied by 4 when the meta data is loaded. This patch changes the sanity check to consider (and reverse) that multiplication before checking the cluster size. Signed-off-by: Stefan Ott <>
2020-04-06xDuoo X3II and X20 portMarcin Bukat1-0/+122
Provided by Roman Stolyarov Integration, Refactoring, and Upstreaming by Solomon Peachy X3II confirmed working by forum tester, X20 is nearly identical. This includes bootloader, main firmware, and the flash image patcher. Eventual Todo: * Further refactor AGPTek Rocker & xduoo hiby bootloaders * Further refactor AGPTek Rocker & xduoo hosted platform code Change-Id: I34a674051d368efcc75d1d18c725971fe46c3eee
2019-02-07transflective LCDs: fix "first buttonpress enables backlight only"Sebastian Leonhardt1-1/+9
This should be done even if the backlight is set to "always off", i.e. if the LCD is sleeping, a button press should be "eaten" and just wake up the LCD. Change-Id: I3946bdbbdc81f23eae3f47423123cefa275e0afc
2019-01-04Add HAVE_LINEOUT_DETECTION and associated logicSolomon Peachy1-14/+38
This allows targets to automatically switch audio settings when the line out is plugged/unplugged. Only hooked up on the xDuoo X3, but there are other potential users. Change-Id: Ic46a329bc955cca2e2ad0335ca16295eab24ad59
2019-01-02Add Xuelin iHIFI 770/770C/800 supportSolomon Peachy2-0/+240
Taken from the xvortex fork (Roman Stolyarov) Ported, rebased, and cleaned up by myself. Change-Id: I7b2bca2d29502f2e4544e42f3d122786dd4b7978
2018-12-25FS#7814 - Enable RTC Alarms on H300, X5, and M5Solomon Peachy1-0/+107
Original patch by Alexander Spyridakis Modified by Steve Bavin and Igor Poretsky Keymap fixes by Marianne Arnold Change-Id: I5a252d97d2b05c533e048931f7354f4261f76499
2018-12-22FS#12610 - Clip+ Ticking Noise Fixed in RadioSolomon Peachy2-7/+11
Patch taken from Igor Poretsky's tree. Original clip-radio-tick.patch modified to acts only when screen is deemed, or when recording, in order to preserve indicators functionality. Change-Id: I62afb24a0dad7ad2ecc9272c24810b37f032408d
2018-07-28Add cleaned-up xDuoo X3 supportSolomon Peachy4-9/+189
Cleaned up, rebased, and forward-ported from the xvortex fork. (original credit to Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d Signed-off-by: Solomon Peachy <>
2018-07-25Revert "Ignore truncation in lcd-scroll.c"William Wilgus1-7/+2
This reverts commit 540637ed3334364fe9d1b54cdc96a52f59afda83. Change-Id: I88e71ef47a11818a5acb407ff9c0723d3c197243
2018-07-25Ignore truncation in lcd-scroll.cWilliam Wilgus1-2/+7
Change-Id: Id1008300e58cf12ab920c1023354a74a6d32daae
2018-06-12Cleanup commentMarcin Bukat1-1/+1
Change-Id: If39a5d2f64a9453a9b9b0cf0a2e3ad36027978ff
2018-06-12Agptek Rocker: Initial commitMarcin Bukat2-1/+79
Change-Id: I26b51106c7b1c36a603fba6d521e917d79b5a95b
2018-05-25Fix Remove lcd_scroll_worker from bootloader except remote displays/charcellWilliam Wilgus1-1/+2
This patch was supposed to only remove scroll worker from devices without remote displays, the build system said otherwise Change-Id: I240db89ee6b55818dbd2567338515b53ebe09300 fixed: conditional define
2018-05-23Remove lcd_scroll_worker from bootloader except remote displays and charcellWilliam Wilgus1-1/+2
Removes unneeded scrolling fuctionality from bootloaders Change-Id: Iebe308144cc11c9139399702e3dcd1a548cb9831
2017-11-21Convert i.MX31 and AMS target to use RTC interruptMichael Sevakis1-0/+13
Instead of checking ticks, set a sticky dirty flag that indicates that the RTC needs to be read. This gives a timely update and more accurate readout without actually reading the RTC until it changes. The implementation should atomically read the flag and clear it. Setting the flag would typically happen in an RTC tick ISR. Change-Id: I6fd325f22845029a485c502c884812d3676026ea
2017-11-06nwzlinux: add support for radioAmaury Pouly1-2/+13
None of the Sony up to A15 seem to support RDS (they use either Si4702 or Si4708), thus I did not add any code to support RDS. Change-Id: I64838993b9705b36b94665f8470c7a89c772c961
2017-10-26Unify storage threads into oneMichael Sevakis2-281/+217
* Editing a bunch of drivers' thread routines in order to implement a new feature is tedious. * No matter the number of storage drivers, they share one thread. No extra threads needed for CONFIG_STORAGE_MULTI. * Each has an event callback called by the storage thread. * A default callback is provided to fake sleeping in order to trigger idle callbacks. It could also do other default processing. Changes to it will be part of driver code without editing each one. * Drivers may sleep and wake as they please as long as they give a low pulse on their storage bit to ask to go into sleep mode. Idle callback is called on its behalf and driver immediately put into sleep mode. * Drivers may indicate they are to continue receiving events in USB mode, otherwise they receve nothing until disconnect (they do receive SYS_USB_DISCONNECTED no matter what). * Rework a few things to keep the callback implementation sane and maintainable. ata.c was dreadful with all those bools; make it a state machine and easier to follow. Remove last_user_activity; it has no purpose that isn't served by keeping the disk active through last_disk_activity instead. * Even-out stack sizes partly because of a lack of a decent place to define them by driver or SoC or whatever; it doesn't seem too critical to do that anyway. Many are simply too large while at least one isn't really adequate. They may be individually overridden if necessary (figure out where). The thread uses the greatest size demanded. Newer file code is much more frugal with stack space. I barely see use crack 50% after idle callbacks (usually mid-40s). Card insert/eject doesn't demand much. * No forcing of idle callbacks. If it isn't necessary for one or more non-disk storage types, it really isn't any more necessary for disk storage. Besides, it makes the whole thing easier to implement. Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
2017-10-07sonynwz: add api and debug entries for "acoustic" and "cue/rev" modeAmaury Pouly1-2/+25
We don't really know what those are supposed to do. They seem to change the volume curve but it is not very clear what is the intended purpose. Change-Id: I65f5d18aba139844c23df092277ba17ee8518f96
2017-10-01sonynwza10/a20: enable pcm frequency selectionAmaury Pouly1-1/+20
Change-Id: I335fcdbb652253e777d0d7406545d0d44d98f4f0
2017-09-05Initial commit for the Sony NWZ linux portAmaury Pouly1-0/+385
SUPPORTED SERIES: - NWZ-E450 - NWZ-E460 - NWZ-E470 - NWZ-E580 - NWZ-A10 NOTES: - bootloader makefile convert an extra font to be installed alongside the bootloader since sysfont is way too small - the toolsicon bitmap comes from the Oxygen iconset - touchscreen driver is untested TODO: - implement audio routing driver (pcm is handled by pcm-alsa) - fix playback: it crashes on illegal instruction in DEBUG builds - find out why the browser starts at / instead of /contents - implement radio support - implement return to OF for usb handling - calibrate battery curve (NB: of can report a battery level on a 0-5 scale but probabl don't want to use that ?) - implement simulator build (we need a nice image of the player) - figure out if we can detect jack removal POTENTIAL TODOS: - try to build a usb serial gadget and gdbserver Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
2017-04-21RDS: Fix a few goofs in the unicode tableMichael Sevakis1-3/+3
Change-Id: I54c681a9eb3d5e90ee4aeedc3ec5dbd6243cb208
2017-03-12Do some housekeeping with fat.h and SECTOR_SIZEMichael Sevakis1-2/+1
Many includes of fat.h are pointless. Some includes are just for SECTOR_SIZE. Add a file 'firmware/include/fs_defines.h' for that and to define tuneable values that were scattered amongst various headers. Remove some local definitions of SECTOR_SIZE since they have to be in agreement with the rest of the fs code anyway. (We'll see what's in fact pointless in a moment ;) Change-Id: I9ba183bf58bd87f5c45eba7bd675c7e2c1c18ed5
2017-02-12Forgot to remove unused RDS buffers from the ipod remote tuner.Michael Sevakis1-6/+2
Also, use rds_reset() now to clear data on station change since the rds driver internal buffers are used. Change-Id: I043b09d661eeec21617381015347f0bcead4f7d4
2017-02-11Fix warnings and errors from fc9695eMichael Sevakis1-0/+2
* fmradio.c needs an implementation of tuner_get_rds_info() for the sim (kill all the sims). * Some macro bitflags shouldn't be seen unless HAVE_RDS_CAP is defined. Change-Id: Idd00c94ca2fc43cf32f9223aa4530d5a02fb3454
2017-02-11Improve radio RDS driver and frameworkMichael Sevakis3-238/+368
* Remove unused bits like the radio event and simplify basic radio interface. It can be more self-contained with rds.h only required by radio and tuner code. * Add post-processing to text a-la Silicon Labs AN243. The chip's error correction can only do so much; additional checks are highly recommended. Simply testing for two identical messages in a row is extremely effective and I've never seen corrupted text since doing that, even with mediocre reception. Groups segments must arrive in order, not randomly; logic change only accepts them in order, starting at 0. Time readout was made a bit better but really we'd need to use verbose mode and ensure that no errors were seen during receiving of time and more checks would be need to have a stable PI. The text is the important bit anyway. * Time out of stale text. * Text is no longer updated until a complete group has been received, as is specified in the standard. Perhaps go back to scrolling text lines in the radio screen? * Add proper character conversion to UTF-8. Only the default G0 table for the moment. The other two could be added in. * Add variants "RDS_CFG_PROCESS" and "RDS_CFG_PUSH" to allow the option for processed RDS data to be pushed to the driver and still do proper post-processing (only text conversion for now for the latter). Change-Id: I4d83f8b2e89a209a5096d15ec266477318c66925
2017-02-04Fix dangerous castsAmaury Pouly3-7/+7
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is not valid. In any case, one should use intptr_t and ptrdiff_t when casting to integers. This commit attempts to fix all instances reported by GCC. When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-01-26Move intrinsic RTC implmentation differences to driver filesMichael Sevakis11-17/+43
Some drivers set tm_wday just fine and do not need it coerced to be correct. Others set tm_yday, so don't overwrite what the driver sets; just zero it inside if it can't fill the field. Move calls to set_day_of_week() to the sorts of drivers that presumably required the hammer (FS#11814) in get_time() where the weekday isn't locked to the date. Change-Id: Idd0ded6bfc9d9f48fcc1a6074068164c42fcf24a
2017-01-25AMS: Return ascodec to interrupt-based I2C2 driverMichael Sevakis1-2/+19
1. Slightly revised and regularized internal interface. Callback is used for read and write to provide completion signal instead of having two mechanisms. 2. Lower overhead for asynchronous or alterate completion callbacks. We now only init what is required by the transfer. A couple unneeded structure members were also nixed. 3. Fixes a bug that would neglect a semaphore wait if pumping the I2C interrupts in a loop when not in thread state or interrupts are masked. 4. Corrects broken initialization order by defining KDEV_INIT, which makes kernel_init() call kernel_device_init() to initialize additional devices _after_ the kernel, threading and synchronization objects are safe to use. 5. Locking set_cpu_frequency has to be done at the highest level in system.c to ensure the boost counter and the frequency are both set in agreement. Reconcile the locking inteface between PP and AMS (the only two currently using locking there) to keep it clean. Now works fine with voltages in GIT HEAD on my Fuze v2, type 0. Previously, everything crashed and died instantly. action.c calling set_cpu_frequency from a tick was part of it. The rest may have been related to 3. and 4. Honestly, I'm not certain! Testing by Mihail Zenkov indicates it solves our problems. This will get the developer builds running again after the kernel assert code push. Change-Id: Ie245994fb3e318dd5ef48e383ce61fdd977224d4
2017-01-21Fix dumb typo in button.c.Michael Sevakis1-1/+1
Forgot to check a non-freq-scaling target. :) Change-Id: Ib19b1b6ebdb3e4ad595aca37a687f32156290a65
2017-01-21action.c must desist in calling set_cpu_frequency from a tickMichael Sevakis1-35/+71
The function is neither reentrant nor ISR callable. Instead of using a ticked-based timeout, have the button driver provide the unboost after a delay when waiting for a button. HAVE_GUI_BOOST gets immediate boost after dequeuing any message, otherwise the queue has to have at least three messages waiting for it to trigger a boost-- essentially the behavior that existed but now combined in one place. Change-Id: I1d924702840f56a1a65abe41fa92b4e753c4e75a
2017-01-17Do some debug and preparatory work for ramcache and playlistMichael Sevakis1-5/+15
The file system rework introduced incompatibility between dircache and the tagcache ramcache and playlist dircache path caching. This update makes changes to filesystem code to reintegrate all that. It also fixes a couple bugs that were found when vetting all the code. The filestream cache was being reset without regard to the stream even if it was shared in write mode (made work of .playlist_control). Better handling of unmounting gives files a better go at force-closing them without risk to disk integrity. Did some miscellaneous pedantic changes. Improved efficiency of testing a file's existence (a little) since the path parser will be shared between file code and parsing for the sake of finding dircache references, not duplicated as before. This commit doesn't reenable said items just for the sake of keeping changes separate and related. Plan for the next is to enable dircache again for the playlists (easy peasy) and reenable tagcache ramcache but *without* the dircache path caching because it's rather substantial to change in itself. The ramcache will still function without dircache. Change-Id: I7e2a9910b866251fa8333e1275f72fcfc8425d2d
2016-12-12wm8975: document audiohw settingsAmaury Pouly1-0/+2
Change-Id: I0456f85e4ebc821c23e25026fbee3d8cf7526ee7
2016-12-12wm8758: document and fix audiohw settingsAmaury Pouly1-0/+1
It looks like a copy and paste error to me, those were completely wrong. Change-Id: Id6ae025f4216ffccb1a8b8b790916d8b6c4694bd
2016-12-12wm8751: document and fix audiohw settingsAmaury Pouly1-1/+3
Document 3D depth range. Fix mismatch in recording volume: the displayed volume is completely off the chart Change-Id: I4c363f369e5d72f332391a6f96457b4e450404f9
2016-12-12wm8731: document audiohw settingsAmaury Pouly1-0/+2
Change-Id: I78ec26a00a3e14a95c591ac81d96e1b480b9138e
2016-12-12imx233: slightly rework 3D audio settingAmaury Pouly1-3/+1
The old code made the setting appear as 0dB, 1.5dB, 3dB and 4.5dB when in fact it is 0dB, 3dB, 4.5dB and 6dB. This commit clarifies the code and also fix this at the same time. This imx233 3D enhancement is complete crap anyway but now you can satisfy yourself with 6 dB of pure crap, clearly an enhancement. Change-Id: Ia3e088987c1ff0cdde228905ff70f46476a499a2
2016-09-21imx233: fix recording gainAmaury Pouly1-3/+4
For some reason, there was a mismatch between the setting (decibel) and the audiohw code (centicel). This resulted in a gain divided by 10. This may explain why some people experienced low volume with the mic on the fuze+. Change-Id: I138ac18dd93c36f43a7dfce735efc826405c598c
2016-08-29as3543: fix audio gap when switching from dac to line-in/recordingAmaury Pouly1-30/+51
Also clarity parts of the code. The old code suffered from two defects: - it was very unclear because it made changes to whole registers (using as3514_write) instead of fields (using as3514_set/clear/write_masked). Also the routing code was spread accross several functions which made it hard to follow. - it did not properly reroute audio on monitor changes. In particular, the following could happen: when switching from DAC to radio, the code would fail to clear SUM_off, resulting in a weird situation where the main mixer was off (SUM_off) but the headphone where using the main mixer as input. Incredibly this worked anyway (at least on AMSv2 and YP-R0) but resulted in strange volume gaps between DAC and radio mode. Change-Id: I7826835fdb59c21f6483b223883ca9289e85caca
2016-06-01zenxfi3: rewrite mpr121 driverAmaury Pouly1-350/+0
The new driver uses an asynchronous architecture for touch status reading. Change-Id: Ic75a8b91bc47ee16c3af873afde178cd70186376
2016-06-01fuze+: rewrite touchpad driverAmaury Pouly1-104/+0
The old driver was bad in many respect, it had some race conditions, it was using a thread to serialize transfers because of the legacy i2c interface. It also had huge latency (typically 50ms but delays up to 300ms can happen), thus some presses were missed. The new driver takes advantage of the new i2c driver to do everything asynchronously. It also does not need a thread anymore because queueing ensures proper serialization. It provides much better and reliable latency (typically ~2ms). Also fix the debug screen which was horribly broken. The new screen also displays the deadzones. Change-Id: I69b7f99b75053e6b1d3d56beb4453c004fd2076e