summaryrefslogtreecommitdiffstats
path: root/firmware/drivers
AgeCommit message (Collapse)AuthorFilesLines
2020-10-01fix more red.Solomon Peachy1-7/+0
Change-Id: If5fee31d633e5f75272ba85f5293ad01b1ce573a
2020-10-01Fix warnings and errors introduced in b030bf5Solomon Peachy1-0/+7
Change-Id: I23966b6a79c0d2cbab2e01c649c1b991f460d8ad
2020-10-01xduoox3ii/x20: Proper lineout detection and volume mangling.Solomon Peachy1-12/+56
hotplugging hp and lineout works, without blowing out eardrums. Change-Id: I2df5c7a618bb2d1d77d416548d45dff9cfc619db
2020-10-01fix some of the red introduced in e43726dSolomon Peachy1-1/+1
Change-Id: Id1abb0dd11f8a8e79a80fc54e58a5a22706a03ad
2020-10-01hosted pcm-alsa improvementsSolomon Peachy2-31/+77
* xduoo x3ii/x20: Better line out support * less granular volume settings (too many steps before) * Better handling of swiching sample rates * Log actual sample rate in debug menu Most credit goes to Roman Stolyarov Additional integration [re]work by myself Change-Id: I63af3740678cf2ed3170f61534e1029c81826bb6
2020-09-18Headphone / lineout pause/resume #FS13237William Wilgus1-0/+2
Allow Lineout to behave like headphone port in regards to plug/unplug pause/resume Change-Id: I9cb2c9c40e0bdf3bf7e1e272164acd343f6b3850
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 <stefan@ott.net>
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 vsoftster@gmail.com) Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
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