use si4700_read() instead of si4700_read_reg() to make it clear we are
not interested in the register itself but in the cache update. Also, a
tiny bit more efficient as we save a function call and don't request a
return value we don't use anyhow.
Change-Id: Ibbb66fd9e5ea748ba11ac3c2a0570f5219b72637
As detailed in the <Low Power Mode> section of the AK4376A
datasheet, the amp should be powered down before switching
power modes (or to a sample rate <= 12 KHz).
Change-Id: I3ab0a21c78a3ad2bb418b64c916f7dbe2a843efa
Define proper symbolic constants for power mode. Also allow
targets to define the default power mode setting.
Change-Id: Ia07cf854dce47d0a6aa88e067471f1ff9fbc45fb
Remove the battery power ADC since it's not used right now,
and seems to fluctuate too rapidly to be of much use.
Change-Id: If115e4e3ce14d4c18ce899f5a889f7f99ab66489
This caused LCD problems on the ErosQ, where the screen would
go white until being put through a sleep/wake cycle. The exact
reason for this isn't obvious, but the problem didn't exist
prior to the AXP driver rewrite.
The two dependent changes,
42999913ba - x1000: Increase USB current limit to 500 mA at all times
90dd2f84a9 - x1000: Correctly limit USB charging current
ended up bringing the USB charging situation back to where it
was prior to the rewrite, so the cleanest option is to revert
the whole lot.
This reverts commit 42999913ba.
This reverts commit 90dd2f84a9.
This reverts commit 2d89143962.
Change-Id: I1cff2bfdd1b189df14bcf8cce42db725caa470d7
I noticed a few mistakes in the old driver code and it was in
need of an overhaul anyway... I decided to scale things back,
simplify the code and remove most of the debug menus, netting
a nice code size savings.
One new feature is an advanced debug menu which is accessible
by recompiling the code with AXP_EXTRA_DEBUG. It adds quite a
bit of code size and isn't useful other than for development
so it must be manually enabled by editing the source.
Change-Id: I30e17c1194c14823decd726a574ed14451d4cb2d
Rewrite the loop to update the framebuffer by rows rather
than by columns. This should (a) be more efficient on the
majority of targets using horizontal stride framebuffers,
(b) skimp a bit on code size and (c) avoid AddressSanitizer
errors caused by reading past the end of the source buffer.
Change-Id: I238d191d63bfdecd25336fd8879a63d9d6ab7087
This handles the case where the host sends a new setup packet
in the middle of an ongoing control transfer.
Change-Id: I1d2e02467e9b813c9827cc0699cb87a500515e31
The FT6x06 driver used for the Shanling Q1's touchscreen
has been extended to report more than one touch point. It
can also return the gesture detected by the controller,
but this doesn't seem to report anything useful on the Q1.
Multi-touch is only useful in 3x3 grid mode since the Rockbox
button API cannot report more than one touch point.
The FiiO M3K uses the same driver so it's been updated to the
multi-touch API, but functionality is unchanged.
Change-Id: I4de42f44808d6eb902e3da212d8f936b7a5042c7
Touch devices have physical buttons too, and these should be
subject to repeat acceleration. That feature was disabled for
the sake of better touch event responsiveness (apparently).
So, re-enable the acceleration feature & add a special case
to exempt BUTTON_TOUCHSCREEN from acceleration.
Change-Id: I9e097e27457fbd6b824f098e8b325ff35c59dde4
Based on a patch by Amaury Pouly which was based on a patch from Ryan
Hitchman.
I mainly moved the code for polling into the tuner driver so it can be
reused by other targets. I added the CONFIG parameter for the polling
frequency (in ticks) to save energy. Also, I did some minor cleanups.
Change-Id: I95a62e7e1e42c62dbf47ecb27a3b312a42be62aa
Ive seen no ill effects having this disabled on target so
limit it to the sim to stop Address Sanitizer from dumping
on the extra byte read. the bad data is never used AFAICT
since the loop ends
Change-Id: I8cb54e9d1f8fe28747867d861a015edb3dbfa5ff
According to a forum user, there's an audible click when changing
the volume between -32 and -32.5 dB with some headphones. Fix this
by not (ab)using the DAC digital mixer for volume control.
The mixer only provides an extra -6 dB of hardware volume range,
so the only side effect is that software volume will now kick in
at -32 dB instead of -38 dB.
Change-Id: If24d9bc0058eff3c1a29aefb155a2e378522623c
IMHO the current name is somewhat misleading:
- usb_drv_send() is blocking and we have usb_drv_send_nonblocking()
for the non-blocking case. This inconsistent naming can only
promote confusion. (And what would we call a blocking receive?)
- Other hardware abstraction APIs in Rockbox are usually blocking:
storage, LCD, backlight, audio... in other words, blocking is the
default expected behavior, with non-blocking calls being a rarity.
Change-Id: I05b41088d09eab582697674f4f06fdca0c8950af
'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
second try places the check above the negative y offset
this was causing glitches on the Q1 and likely other TS targets
since a negative y was added to height it made it < CHAR_BIT setting
stride = 0 even though the bitmap was >= CHAR_BIT high
Change-Id: I13bb8ab472c2ae61302a6de5d9e2c78243354460
An oversight on my part meant that setting channel balance to
100% L or 100% R would mute both channels - this logic will
prevent that.
Change-Id: I912c2745784fbbbd7a773e1234179801f2ca4680
A small negative offset seems to silence all
play/pause clicking on the PCM5102A.
Also adding PCM soft muting, and muting the headphone amp
when the headphones are detected as removed. This has been
tested to not cause any unintended side effects on the
line out.
Also confirmed the numerical dB values are (approx.) correct.
Change-Id: I689d68887c86add9cc5e0ccb0c7de01aaa69b4d9
What works:
- LCD: 16-bit RGB565
- all buttons, including scrollwheel
- SD Card
- Battery level and charging/not charging status
- USB
- audio
- sample rate switching
- HP / LO detect, with "safe" fixed LO volume -
LO volume will only be put to user-defined max volume
if headphones are not present.
- rtc
- Plugins build, tried a couple and they seem OK
- Bootloader, installable to nand via usbboot
What doesn't work:
- Dual Boot
- power on/off has intermittent, low volume audio click
(sometimes it's completely silent, sometimes there's
a click)
- Audio uses 16-bit volume scaling, so clicking/popping
is pretty bad at lower volumes - need 32 bit volume
scaling, 24 bit I2S data
- USB HID keys not yet defined
- no jztool support
Unknowns:
- Stereo Switch pins: Direction select, AC_DC
(probably not even hooked up)
- What is the actual purpose of the Stereo Swtich?
- How does the bluetooth module connect?
"Someday" stuff:
- get LCD working at higher bit depth
- Bluetooth
Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
I'm not happy with the proliferation of filter-roll-off options
but I don't have a less ugly solution.
Change-Id: I740fca006fa0c3443a467acfea55b6574d48346b
- Audio playback works
- Touchscreen and buttons work
- Bootloader works and is capable of dual boot
- Plugins are working
- Cabbiev2 theme has been ported
- Stable for general usage
Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps.
There's a few minor known issues:
- Bootloader must be installed manually using 'usbboot' as there is
no support in jztool yet.
- Keymaps may be lacking, need further testing and feedback.
- Some plugins may not be fully adapted to the screen size and could
benefit from further tweaking.
- LCD shows abnormal effects under some circumstances: for example,
after viewing a mostly black screen an afterimage appears briefly
when going back to a brightly-lit screen. Sudden power-off without
proper shutdown of the backlight causes a "dissolving" effect.
- CW2015 battery reporting driver is buggy, and disabled for now.
Battery reporting is currently voltage-based using the AXP192.
Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
Atmel AT88SC6416C CryptoMemory is almost I2C compatible. The device
is connected to bitbanged I2C bus shared with compliant I2C devices.
Change-Id: Iec54702db1bdfb93c01291eef18ec60391c63b16
This eliminates the dependence on a special struct since we were only
using the modtime anyway. But it no longer fits any known standard APIs
so I have converted it to our own extension instead. This can still be
adapted to existing hosted APIs if the need arises.
Change-Id: Ic8800698ddfd3a1a48b7cf921c0d0f865302d034
This emulates the traditional utime function from UNIX clones to allow
for manual updates of the modification timestamp on files and directories.
This should only prove useful for non-native targets as those usually
have a libc version of utime.
Change-Id: Iea8a1d328e78b92c400d3354ee80689c7cf53af8
Import non-free firmware image from linux-firmware package.
Firmware loading works but is disabled at compile time because just
loading firmware without configuring device results in higher power
consumption without any benefit to end user.
Change-Id: I8fd252c49385ede1ea4e0f9b1e29adeb331ab8ae
This moves the time conversion function to timefuncs since it has
uses on ports that don't use the FAT driver. This function has no
dependency on the FAT driver as it is so this should not cause any
issues. To reflect this separation the function was renamed to
dostime_mktime since it is really for DOS timestamps. The places
where it was used have also been updated.
Change-Id: Id98b1448d5c6fcda286846e1d2c736db682bfb52
Allows for the i2c boilerplate to be shared between the M3K and
Shanling Q1 ports. M3K-specific quirks remain in button-fiiom3k.
Change-Id: I8879b603cefc16416bb200f1c484ca916d935c6a
The old name was a bit misleading. AXP173 is sort of the lowest common
denominator of a series of related chips. The M3K uses an AXP192 which
has a few extra features vs. the AXP173.
New voltage regulator stuff was added for the sake of the Shanling Q1
native port (that player also uses an AXP192).
Change-Id: Id0c162c23094bb03d13fae2d6c332e3047968d6e
Some audiohw API calls are shared between playback and recording,
eg. frequency settings. Implementing these in the DAC driver won't
work for the M3K, as it uses a separate codec for microphone input.
Change-Id: Ieb0a267f8a81b9e2bbf0bbca951c5778f8dcd203
Motivation: turns out the DMA in the M3K's MSC controller is buggy,
and can't handle unaligned addresses properly despite the HW docs
claiming otherwise.
Extending the FAT driver bounce buffering code is the easiest way
to work around the problem (but probably not the most efficient).
Change-Id: I1b59b0eb4bbc881d317ff10c64ecadb1f9041236
'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
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
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
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
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
- 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