summaryrefslogtreecommitdiffstats
path: root/firmware/drivers
AgeCommit message (Collapse)AuthorFilesLines
8 dayslcd_putsxyofs 16 bit lcd_mono_bitmap_part [AS]William Wilgus1-9/+8
'Bugfix' mono_bitmap_part reads ahead in the buffer, if the height is <= char bit pixels other memory gets read found with [Address Sanitizer] also g#3332 since this is clearly a problem across the code instead place the check for height < 8 in the lcd_mono_bitmap_part function Change-Id: I917cbbd568fd5474b76a98c8919467e2538e0f0c
13 daysNuke the never-functional iriver ifp-7xx portSolomon Peachy1-484/+0
It never worked, and hasn't compiled in something like a decade, Given the HW capabilities (limited onboard flash, no expandability) there's really no point in trying to fix/complete it. Change-Id: I7d175089840396f8891645bd10010d730dd5bfdc
13 daysNuke all TCC77x targets: iAudio 7, Sansa C100, M200(v1-3), Logik DAXSolomon Peachy2-91/+0
They were never finished, never saw any release ever, and haven't compiled for the better part of a decade. Given their HW capabilities [1], they are not worth trying to fix. [1] 1-2MB RAM, ~256MB onboard flash, no expandability Change-Id: I7b2a5806d687114c22156bb0458d4a10a9734190
2021-04-23ata: Rework power management behavior a bitSolomon Peachy1-42/+65
After continued reports of corruption using iFlash adapters, I went digging for more clues, and this combination of changes seemed to solve data corruption with the iFlash adapters on the ipod video: 1) Instead of SLEEP, use STANDBY_IMMEDIATE when we detect drive as an SSD or CFA-compliant device. The latter is technically higher power than the former, but what this means in practice is unclear. 2) Don't check ATA powermanagement flag prior to issuing powermgmt commands. This reverts the previous "workaround" for the FC1307A -- and PM is a mandatory part of the ATA spec for any CFA device. 3) Prior to issuing SLEEP/STANDBY_IMMEDIATE, issue FLUSH CACHE. The ATA spec says this is redundant for the latter, but says nothing about the former. Either way it is always safe to call first. 4) Delete all other FC1307A_WORKAROUND code related to powermgmt flags. Change-Id: I492d06664c097d9bbd5cccfb9f5b516da165b1ee
2021-04-21FiiO M3K/X1000: add USB supportAidan MacDonald1-2/+11
This only required a minor patch to the usb-designware driver due to DMA requiring physical addresses -- on the X1000, these differ from virtual addresses so we have to do the usual conversion. Both the mass storage and HID drivers work, but there are a few issues so this can't be considered 100% stable yet. - Mass storage might not be detected properly on insertion, and USB has to be replugged before it shows up - HID driver may occasionally panic or hang the machine Change-Id: Ia3ce7591d5928ec7cbca7953abfef01bdbd873ef
2021-04-21Minor enhancements to axp173 driverAidan MacDonald1-24/+81
- Added register names to reduce usage of magic numbers - Added function to control max charging current, needed for USB - Corrected comment about axp173, since FiiO M3K has an axp192 Change-Id: I6604ce8d44e5a2ee84061cf042d17ccc4734ac57
2021-04-18Move usb-designware out of ARM target treeAidan MacDonald1-0/+1381
Change-Id: Ic981737976655596ea622b7b4d15a2d841bd993d
2021-04-17 16 bit lcd_mono_bitmapWilliam Wilgus1-1/+8
'Bugfix' mono_bitmap_part reads ahead in the buffer, if the height is <= char bit pixels other memory gets read Change-Id: I6e0d7a9017e1f9c371ffbd56af149ac20cb82341
2021-04-17erosq: Tweak volume scale to be approximately correctDana Conrad1-5/+5
Tested on eros q, everything measured from line out, open circuit. - volume steps were approximately double the dB they were labelled as, so "-2 dB" would result in a change of about -4 dB from maximum (0, +6.2dBV) - maximum volume defining the line out volume only changed every 10 values, and then was not close to correct- "-10 dB" resulted in -2.5 dB from maximum This gets the volume dB approximately correct, and maximum volume correctly sets the line out volume. I was unable to get odd values in the max volume to work, so set the step size to 2 instead of one. For "consumer level" (-10dBV), set to -16. For "Pro level" (+4dBu -> ~1.8dBV), set to -4. Change-Id: I898b85d768153579a893b23551019af88f865d21
2021-04-14hosted: Don't open alsa control device directlySolomon Peachy4-73/+25
It was just being used as a proxy "yeah, we called hw_init()" so just use a flag for that directly. affects rocker, erosq, xduoo x3ii/x20, and fiiom3klinux Change-Id: I14bd9f8d91f1d6cc8de0982a7426e2a103c6bfce
2021-04-10misc: Only include rbpaths.h and string-extra.h in places that need itSolomon Peachy1-3/+0
(Don't include rbpaths.h in settings.h, or string-extra.h in rbpaths.h) Build-tested on rocker, erosq, mini2g, nano2g, xduoox3, clipzip, dx50, and uisim Change-Id: If32e9c9910f5c8247a655cb64522b84d6d7ccbb5
2021-04-09erosq: When mucking with the clickwheel, ensure we keep the screen awake!Solomon Peachy1-1/+1
Change-Id: I49d39f301f4b44c2477a657e2af964b97d73cf6b
2021-04-08erosq: Switch to 32-bit PCM output, and do volume scaling in driverSolomon Peachy1-8/+11
Should improve audio output quality, especially at lower volumes. Change-Id: I31c38f05fe4b554b092511f0fe7aaad9f346f6c5
2021-04-08ErosQ: fix panic on startup caused by ad55da5fSolomon Peachy1-2/+3
It turns out #include "settings.h" pulls in rbpaths.h which ends up remapping open() to the path-mangling rockbox open(). By defining RB_FILESYSTEM_OS we prevent the remap. My mistake for not testing this before committing! Change-Id: I2978eb7b413693c4cb887b7ac7b2457780db7d25
2021-04-08ErosQ: Set Line Level Output volumeDana Conrad1-4/+10
With a full-scale 440Hz tone, the line out voltage measured approx. 5.8Vpp at the 0 setting. WAY too hot! (9 dBV, in fact) For 0.894Vpp (-10 dBV - consumer devices), -18 appears to be about right for line level signals, but for "pro" equipment a different level may be desired. Therefore, the user to cap the line out level by re-using the global volume limit setting. Change-Id: I0d1d6482ea95537e9a2d00884eaee2713771c614
2021-03-28New port: FiiO M3K on bare metalAidan MacDonald3-0/+797
Change-Id: I7517e7d5459e129dcfc9465c6fbd708619888fbe
2021-03-27Use STORAGE_NEEDS_BOUNCE_BUFFER instead of STORAGE_NEEDS_ALIGNSolomon Peachy1-3/+3
Enable its use in the jz47xx MIPS targets. (accidently committed g#3249 before making these changes) Change-Id: I1791946f632901f0c7a94b04b009671aa0d71717
2021-03-27Have FAT filesystem respect storage buffer alignment on readsAidan MacDonald1-2/+36
This is just a minor cleanup of Solomon Peachy's code, and using per-filesystem buffers instead of a single static buffer. Tested and working on the FiiO M3K. Change-Id: I3c19e8cc24e2f8aa07668c9d1c6d63364815050a
2021-03-24Revert "lcd framebuffer - Bugfix ensure proper alignment"William Wilgus5-10/+12
This reverts commit ffee661ab70e9622a05c9c2f24ecf474dad8f042. Reason for revert: <INSERT REASONING HERE> iAudio M5 `IRAM' overflowed by 48 bytes Change-Id: Id808a72c6eacabc562d53eac8acd36b45f678a97
2021-03-24lcd framebuffer - Bugfix ensure proper alignmentWilliam Wilgus5-12/+10
-- apparenty 0x4 aligned doesn't work properly requires 0x8 alignment at least for the h10 20gb but enabled for all arm processors assign the default framebuffer to the default_vp as well Change-Id: I0b76c30f2ddb5d6d2f7c6a132e4081aee58da17b
2021-03-23Add asynchronous I2C bus APIAidan MacDonald1-0/+398
The driver core is based off of the i.MX233 I2C implementation and should work on any platform. Change-Id: I3b9c15e12a689ef02a51c285be08d29d35e323dc
2021-03-22Add new audiohw capability: POWER_MODE_CAPAidan MacDonald1-0/+4
This allows the user to make use of the DAC's power-saving abilities. The two modes are "high performance" and "battery saver". This feature is supported by the AK4376 DAC in the upcoming FiiO M3K port. The setting is only a manual toggle right now, but in the future it could be hooked up to the battery level (via another setting) so it can be toggled automatically when the battery gets too low. Change-Id: I482af6e2f969fcbdeb3411bd3ff91f866b12d027
2021-03-12ATA: Increase delay to power-off when device doesn't support ATA SLEEPSolomon Peachy1-4/+42
The storage subsystem aggressively issues SLEEPNOW events when idle and power off happened a fixed 2s later. This turns out to not be enough time for FC1307A (eg iFlash) adapters to flush outstanding writes. So, when we detect a lack of PM support, increase the poweroff delay to 5 seconds to compensate for not being able to issue the ATA SLEEP command. Hopefully this is enough time. If not, we will have to re-disable PM entirely when we detect these popular adapters. Thankfully that is now just an #ifdef away. Change-Id: I4112b9acb965973d81f70483bd9d595461c7301c
2021-03-11ATA: When device doesn't support powermgmt, only gate ata sleep command.Solomon Peachy1-47/+37
The FC1307A ATA->SD chipset (used by the common iFlash adapters) doesn't support mandatory ATA power management commands, leading to massive data corruption if they were issued. A workaround was identified (54629073ae) that basically disabled all of rockbox's power management code for these adapters, which extends well beyond the specific ATA commands issued. This patch moves the gating test to the issuance of the actual SLEEP, so that the rest of rockbox's PM code can function as intended. This allows the device to get powered down when idle, yielding potentially significant improvements in battery life. Change-Id: Ia13e2405243fe5efe6f68c3a549ab4933567790b
2021-03-10xduoo_x3ii: Improvements in the meymappings!Solomon Peachy1-2/+7
* PREV/NEXT now swapped so they do what is expected in most contexts * List and setting context retains prior behavior * Enable the ADC that reads the headset remote and map the keys. * As ADC-based remote "events" arrive as press/release pairs, delay the button release. Change-Id: I22d4eac3bfe1573b50eca795cf377bdafdeb5336
2021-03-04ata: Make ata_disk_is_active() only special-case powermgmt-less devices.Solomon Peachy1-11/+12
SSDs that respect powermgmt commands should be treated the same, as the powermgmt commands are an important part of ensuring it's safe to shut down. And greatly expand the comment explaining things. Change-Id: Ia52b99fca802f495422b5ee097390a72dbc28f61
2021-03-04Always indicate inactive ata disk if device is solid state or doesn't ↵Christian Soffke1-0/+13
support power management Commit 5462907 made sure that SLEEP commands weren't issued on devices that don't support ATA power management commands (e.g. certain CF->SD converters including several iFlash models). Since Rockbox waits for the disk to become inactive in shutdown_hw(), which won't happen in this case, the OS would previously stall during the shutdown process until a timeout was reached. Change-Id: I03bb05f6f6401bb8f0da5d0b76bd3f07681fdc06
2021-02-27Rename symbols of FiiO M3K Linux-based portAidan MacDonald1-1/+1
Mainly a straight replacement of FIIO_M3K -> FIIO_M3K_LINUX. Change-Id: Id07c84f8150991d1b6851540c2c3f8f67e3f12c2
2020-12-08lcd: Wrap anonymous union initializer in bracesFranklin Wei1-1/+3
GCC 4.9.4 is apparently smart enough to compile this, but 4.4.4 is not. Change-Id: I186f969cbad4c701936ab738f585efea07421d2e
2020-11-04pp5020: use ipod firmware timings for ATA PIO.Torne Wuff1-1/+1
Some mSATA adapters seem to have trouble working with Rockbox using our normal PIO timings; the timing value we use is probably out of spec and is different to the OF. Switch to using the OF's timings according to which PIO mode we select. This may not completely resolve problems with these adapters but allows Rockbox to boot and play audio. Change-Id: If73210700eb4af01864b373709ee1d15c775fb11
2020-11-03ATA: Check to see if the ATA device is solid-state (WIP)Solomon Peachy1-0/+13
Not all devices advertise this flag, unfortunately. Change-Id: I6d666febdfcba7598e4d29df7d05c0a288e15158
2020-10-31Rocker: Fix a boneheaded bug introduced in dd82f13fa1Solomon Peachy1-1/+1
Change-Id: Ia743cba6ccd50b38b052f26cce23ac9fe7aac31b
2020-10-31nwz/alsa: various improvementsAmaury Pouly5-10/+9
Also audiohw driver to specific device name, rewrite alsa controls code to cache more data, thus making the code easier and use less stack. Avoid using short/long in pcm alsa code since it's the wrong size on 64-bit (simulator for example) Change-Id: Ibc1ec44396e37b6cbdedbcf37300878638e5d2d3
2020-10-31lcd_framebuffer bugfixes, sanity checksWilliam Wilgus5-14/+45
several issues I saw that could pontentially cause problems scroll engine doesn't take text height into account when checking bounds NBELEMS was one whole row too large hopefully I got them right this time Change-Id: If303da8320429c3964fc675351cb088d46303745
2020-10-31pcm: Get rid of pcm_play_pause() and associated APIsSolomon Peachy1-1/+1
Nothing in the core has used it for some time. It's exported to the plugin API but the last plugins to use it were switched to the mixer API back in 2011. This allows us to get rid of pcm_play_dma_pause() from all audio drivers Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
2020-10-26FIX RED framebuffer viewport rewriteWilliam Wilgus1-5/+5
Change-Id: I4cb8f580e15440d06f8d5fabb2fbf5147c67b49c
2020-10-26FIX RED/YELLOW framebuffer viewport rewriteWilliam Wilgus1-1/+1
Change-Id: Icfd3b00b646c593991f73550d8a316a80e5930a1
2020-10-26Whitespace cleanup on fb_viewport RewriteWilliam Wilgus9-200/+200
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus11-649/+906
I'm currently running up against the limitations of the lcd_draw functions I want these functions to be able to be used on any size buffer not just buffers with a stride matching the underlying device [DONE] allow the framebuffer to be decoupled from the device framebuffer [DONE need examples] allow for some simple blit like transformations [DONE] remove the device framebuffer from the plugin api [DONE}ditto remote framebuffer [DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr while remote lcds may compile (and work in the sim) its not been tested on targets [FIXED] backdrops need work to be screen agnostic [FIXED] screen statusbar is not being combined into the main viewport correctly yet [FIXED] screen elements are displayed incorrectly after switch to void* [FIXED] core didn't restore proper viewport on splash etc. [NEEDS TESTING] remote lcd garbled data [FIXED] osd lib garbled screen on bmp_part [FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport [FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer [FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw) [UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear scrolling viewports no longer trigger wps refresh also fixed a bug where guisyncyesno was displaying and then disappearing [ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes (LCD_ and LCD_REMOTE_) LCD_STRIDE(w, h) same as STRIDE_MAIN LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH) test_viewports.c has an example of usage [FIXED!!] 2bit targets don't respect non-native strides [FIXED] Few define snags Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-10-26rocker: Disable mute-on-pause, due to a platform kernel bug.Solomon Peachy1-0/+4
In short, the display fading back in after a pause resuming interferes with the audio codec, causing BadThings(tm) that cannot be recovered from This really is just avoiding a known trigger; there's no guarantee this condition won't occur under random circumstances during normal use, and there's no good way to work around this from within rockbox. I suspect the underlying problem is that both the display control and codec control share an i2c bus, but the kernel drivers implementing them isn't using proper linux bus access/locking. Change-Id: Id4f56f9cb269ed74aac2f041146b3630cef09030
2020-10-25hosted: Document HW capabilities of audio driversSolomon Peachy2-0/+68
One surprise: X3ii is capable of 384KHz playback Change-Id: I0cc88637c81a21d54979e82b2941fe14de933d4d
2020-10-23ClipPlus BOOTLOADER DONT FIT!William Wilgus1-0/+67
REMOVED FROM ALL NATIVE BOOTLOADERS: finish removing the text scrolling pare down printf to a minimal subset (%c %s %l %d %u and %x(%p)) remove diacritic and rtl language support GOAL 134000 START 135305 CURRENT 133700 SUCCESS! (ASSUMING IT WORKS -- UNESTED) Change-Id: Ic3f6ac1dc260578f581ee53458b3e5bb47d313ec
2020-10-22fiio: Another bugfix in the mute code.Solomon Peachy1-0/+2
Change-Id: I165f4871fa79fb5759d2f0833c543edd5f1ce779
2020-10-22fiio: add in a missing audiohw_mute() call.Solomon Peachy1-0/+1
Change-Id: I837dcb81b8814573fe947d6c7cfa10ff651689d0
2020-10-20xduoox20: Start unmuted, as the least-worst optionSolomon Peachy1-0/+6
Change-Id: Ie85d9df0f861315dfc9d767218d86115420aa9d7
2020-10-16hosted: Make sure we don't call mixer/etc controls when we're not readySolomon Peachy4-24/+40
(Might fix the rocker crash-on-shutdown bug) Change-Id: Id375fc5053adef18d7ec812bdba36ee002e706ef
2020-10-15update the hibi patcher script to handle initial m3k stuffSolomon Peachy1-4/+5
Change-Id: I63ed8443952888da3dafb23ff6e7daf9c7aca574
2020-10-15fiiom3k: Temporarily disable filter rolloff programmingSolomon Peachy1-4/+8
(Hardware control isn't wired into ALSA properly) Change-Id: Iac537d2d90a6119b8c002cd38a558a4ebb3321eb
2020-10-13Fix more red.Solomon Peachy1-1/+1
Change-Id: Id1a45b420f8eb70a25010b058822b78f80db33d8
2020-10-13fix more yellowSolomon Peachy1-0/+1
Change-Id: I74bad58707d05ea167169d4315c05eb0cd1c8b7b