1
0
Fork 0
forked from len0rd/rockbox
foxbox/firmware/export
Lorenzo Miori 6879dec6ec yp-r0: improve the charging code
Some people reported strange charging times and
strange battery life.
Charging by OF: 25 hours; RB: 18 hours
It has been found that there are at least two issues here:

1) the way of getting battery charging status wasn't
really accurate. This attempts to fix that issue.
This patch also simplifies some code (opening a
device is no more needed, for example).

To technically explain, battery charging implies first a constant
current mode (where the voltage increases) and then a constant
voltage mode (where, obviously, the voltage reads more or less
the same). The old way the End Of Charge was detected was based solely
on the voltage, while now it is based on chip's EOC interrupt,
which should be more accurate.

2) OF explicitly sets a constant current 350 mA, while we usually had
55 mA (by as3543 default).
This wasn't discovered before since there is a caching problem
("an accurate guess") in the Samsung power mgmt Linux module,
thus its debugging dumper wasn't really working, reporting a 55 mA current.
Strangely this option should have been set by the bootloader
but apparently it does not.

Some testing is still needed, but I confirm that with this patch
I could run a benchmark for 25 hours (vs. 18 hours), by charging
within Rockbox of course.

Change-Id: I3bd921e86b9018d1cc3c720d15cc46896e8490b3
2015-01-29 20:28:07 +01:00
..
config yp-r0: improve the charging code 2015-01-29 20:28:07 +01:00
adc.h adc-target.h: cleanup 2012-01-08 00:39:29 +00:00
aic3x.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
ak4537.h Radio and radio recording for Samsung YH-920. 2014-06-18 18:06:17 +00:00
akcodec.h 3 new ports: Samsung YH-820, YH-920, and YH-925. Mostly functional. Audio working on 820 & 925 (untested on the 920). No battery readings. No recording. No plugins. Keymap needs work. 2009-05-25 21:10:45 +00:00
as3514.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
as3525.h Move usb-s3c6400 register comments to usb-s3c6400.h 2011-12-13 04:21:06 +00:00
as3525v2.h GHWCFG* are not as3525v2 specific 2012-01-01 19:21:49 +00:00
ascodec.h remove now unused prototype 2012-01-08 01:44:08 +00:00
at91sam9260.h Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h 2009-06-29 14:30:12 +00:00
ata-defines.h Bulk convert all DOS line endings to UNIX. 2011-11-06 22:44:25 +00:00
ata-driver.h Add STORAGE_INIT_ATTR to some target-specific ATA functions. 2011-12-09 02:07:24 +00:00
ata.h Cleanup MV/MD macros a little. 2013-08-17 12:18:22 -04:00
ata_idle_notify.h events: Rework event subsystem (add_event, send_event) to be more versatile. 2014-03-14 23:36:30 +01:00
ata_mmc.h Merge tCardInfo struct (MMC) and tSDCardInfo struct (SD) 2009-07-01 10:07:22 +00:00
audio.h Implement time-based resume and playback start. 2014-03-10 04:12:30 +01:00
audiohw.h Introduce HiFi E.T. MA8/MA8C ports. 2013-11-05 09:59:45 +04:00
audiohw_settings.h Add DAC's oversampling filter roll-off selection to sound settings. 2013-05-24 11:18:16 +04:00
backlight-sw-fading.h Get rid of the last "backlight thread fading" remnant, and of the calculation of the delay. It actually wasn't more than those 3 cases before anyway. 2009-03-11 21:10:17 +00:00
backlight.h Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
bidi.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
bitswap.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
bootchart.h bootchart.h doesn't need _ansi.h, especially not in a relative path 2010-07-25 15:28:24 +00:00
button.h touch devices: Disable touch on softlock. 2013-09-05 20:02:07 +02:00
config.h Get rid of USE_ROCKBOX_USB 2015-01-08 16:07:12 +01:00
config_caps.h Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
cpu.h Rockchip rk27xx port initial commit. This is still work in progress. 2011-05-30 21:10:37 +00:00
cs42l55.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
cscodec.h New port: iPod Classic (also known as iPod 6G/6.5G/7G) 2011-01-02 23:16:27 +00:00
dac3550a.h Straighten out the mad twisted state of sound.c and related areas. 2013-04-15 12:02:05 -04:00
debug.h Hosted: Merge debugf() implementations. Cleanup debug.h. 2012-01-21 18:39:19 +01:00
df1704.h ma9: Slightly change df1704 driver API. 2013-11-05 09:59:45 +04:00
disk.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
dm320.h Sandisk Sansa Connect port (FS #12363) 2011-11-16 14:08:01 +00:00
ds2411.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
dsp-util.h Add rbcodecplatform.h and rbcodecconfig.h. 2012-05-03 14:49:35 +02:00
dummy_codec.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
eeprom_24cxx.h Various files: make function implementations consistent with their declaration in the header file or static if 2009-01-31 23:51:11 +00:00
eeprom_settings.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
enc_base.h Update software recording engine to latest codec interface. 2013-06-30 00:40:27 +02:00
events.h events: Rework event subsystem (add_event, send_event) to be more versatile. 2014-03-14 23:36:30 +01:00
fat.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
fmradio.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
fmradio_3wire.h Radio and radio recording for Samsung YH-920. 2014-06-18 18:06:17 +00:00
fmradio_i2c.h mark some functions as init functions (discarded after init() has run) 2010-05-27 12:00:29 +00:00
font.h fonts: Fix regression(s) caused by c23ce62. 2014-01-26 14:01:48 +01:00
gdb_api.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
general.h Simplify mpegplayer a bit and use array-based lists rather than linked lists for stream management. Move a couple useful functions to handle pointer arrays from kernel.c into general.c; mpeglayer now makes use of them. 2010-05-17 12:34:05 +00:00
generic_i2c.h Apply FS #11423 - Use udelay in AMS driver for FM radio I2C 2010-06-21 21:41:07 +00:00
hangul.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
hd66789r.h Commit fs#9404 (iAudio 7 updates by vitja). Also fixes play/pause behaviour on D2. 2008-09-16 08:09:44 +00:00
hosted_codec.h Introducing Targets iBasso DX50 & iBasso DX90 2014-09-18 18:19:01 +02:00
hostfs.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
hwcompat.h Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently). 2010-06-21 16:53:00 +00:00
i2c-coldfire.h Fix more tabs 2010-01-03 10:27:43 +00:00
i2c-pp.h Move private #defines from i2c-pp.h to i2c-pp.c 2009-05-21 14:31:47 +00:00
i2c-rk27xx.h Rockchip rk27xx port initial commit. This is still work in progress. 2011-05-30 21:10:37 +00:00
i2c-s5l8700.h S5L8700: implement i2c driver (used for communicating with the RTC and the codec in the meizus) 2009-06-27 20:11:11 +00:00
i2c-s5l8702.h New port: iPod Classic (also known as iPod 6G/6.5G/7G) 2011-01-02 23:16:27 +00:00
i2c.h imx233/fuze+: replace software i2c by hardware i2c, make some code more correct, reduce code size of lcd init sequences 2011-07-03 15:18:41 +00:00
i2s.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
iap.h Updated IAP commands. 2013-11-10 18:41:24 +01:00
ifp_usb_serial.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
imx31l.h Clean up multiple definitions of RAM size. Remove -DMEM (make) and MEM (code), use the already defined MEMORYSIZE instead. 2011-02-02 17:43:32 +00:00
imx233-codec.h fuze+: fix volume bottom limit 2013-09-18 23:09:44 +02:00
imx233.h imx233: fix soc header for stmp3600 and stmp3700 2013-06-18 15:33:07 +02:00
ipod_remote_tuner.h iap: pass length and data pointer to iap_handlepkt functions, this prepares for iap large packet support. 2011-05-02 21:55:13 +00:00
isp1362.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
isp1583.h creative zvm isp1583 defines: move to isp1583.h 2011-12-31 18:44:32 +00:00
jz4740-codec.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
jz4740.h jz4740: a few minor fixes 2013-03-11 08:33:18 +01:00
jz_mxu.h Ingenic Jz4740: 2008-12-31 01:57:07 +00:00
lcd-charcell.h Fix Player red and icons on mono displays. 2014-01-07 23:39:37 +01:00
lcd-remote.h put_line/scrolling: Make the scroll engine inform custom scrollers about start/stop of scrolling. 2014-01-12 01:34:06 +01:00
lcd.h lcd-24bit: Introduce a 24-bit mid-level LCD driver 2014-06-21 00:15:53 +02:00
led.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
load_code.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
logdiskf.h logdiskf.h - fix wrong cpp conditionals 2012-10-22 22:36:11 +02:00
logf.h Print `last logf lines on panic(). 2014-01-11 11:37:18 +01:00
ltv350qv.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
lv24020lp.h Signal strength meter for FM radio - FS#8151 by Przemysław Hołubowski 2010-11-11 21:13:29 +00:00
m5636.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
m66591.h Correct svn:keywords and svn:eol-style on a few more files. 2009-07-12 09:43:44 +00:00
mas35xx.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
mascodec.h FS#12378 : Removal of Archos HWCODEC unused code and data. Several large hardware-specific functions are kept for reference or future use. 2011-11-22 19:59:31 +00:00
mc13783.h i.MX31: Fix a couple oopses from r31528 2012-01-03 06:13:59 +00:00
mcf5249.h Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h 2009-06-29 14:30:12 +00:00
mcf5250.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
mi4-loader.h Move load_firmware() to separate file 2013-06-27 13:50:11 +02:00
mips-archdefs.h Onda VX747: 2009-02-16 22:49:58 +00:00
mips.h Onda VX747: 2009-02-16 22:49:58 +00:00
mipsregs.h Onda VX747: 2009-02-16 22:49:58 +00:00
mmc.h Cleanup MV/MD macros a little. 2013-08-17 12:18:22 -04:00
mp3_playback.h Use buflib for the allocation of voice PCM resources. 2012-05-02 17:22:28 -04:00
mpr121.h Add the MPR121 (touchbutton chip) driver 2012-05-19 16:10:52 +02:00
mv.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
nand.h Cleanup MV/MD macros a little. 2013-08-17 12:18:22 -04:00
nand_id.h Correct svn:keywords and svn:eol-style on a few more files. 2009-07-12 09:43:44 +00:00
ohci.h Add data structures 2009-07-12 15:29:22 +00:00
panic.h panicf doesn't return so why not tell GCC and $AVE : 2014-08-25 13:55:16 -04:00
pathfuncs.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
pca9555.h Introduce HiFi E.T MA9 port. 2013-05-06 14:09:24 +04:00
pcf5060x.h D2: Use a common function for reading ADC values from the PMU 2009-10-08 15:47:43 +00:00
pcf5063x.h Initial support for runtime detection of the PMU used in newer D2+ models (PCF50635). The backlight and battery monitoring should work, but the RTC and touchscreen are not yet implemented. 2009-10-10 17:35:02 +00:00
pcf50605.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
pcf50606.h D2: Use a common function for reading ADC values from the PMU 2009-10-08 15:47:43 +00:00
pcf50635.h Initial support for runtime detection of the PMU used in newer D2+ models (PCF50635). The backlight and battery monitoring should work, but the RTC and touchscreen are not yet implemented. 2009-10-10 17:35:02 +00:00
pcm-internal.h Greatly reduce volume-change zipper artifacts with SW volume. 2014-03-08 08:04:41 +01:00
pcm.h Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
pcm1792.h Introduce HiFi E.T. MA8/MA8C ports. 2013-11-05 09:59:45 +04:00
pcm_mixer.h Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
pcm_sampr.h Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
pcm_sw_volume.h Provide high resolution volume and prescaler to hosted targets. 2013-04-27 06:59:27 +02:00
pl081.h Sansa AMS: Use DMA for SD transfers (read and write) 2008-11-25 13:38:32 +00:00
pl180.h AMS Sansa: Add voltage defines to pl180.h. No functional changes. 2009-10-19 05:34:17 +00:00
pnx0101.h Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h 2009-06-29 14:30:12 +00:00
power.h Rework powermgmt to enable code re-use on appliation and sims. 2012-01-03 23:44:38 +00:00
powermgmt.h Add set_sleeptimer_duration function in minutes 2012-10-06 11:59:13 +02:00
pp5002.h Revise the PCM callback system after adding multichannel audio. 2012-03-03 07:23:38 +01:00
pp5020.h Bootloader USB mode for PP502x. Enable only on GoGear SA9200 for the time being. Add HAVE_BOOTLOADER_USB_MODE to config if BOOTLOADER is defined to enable it. Clean up some kernel stuff a little to support it. Mess up a bunch of other stuff (hopefully not too badly). 2011-01-15 08:19:30 +00:00
pp5024.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
pp6100.h sansaview: fix lcd code 2014-05-11 19:56:43 +02:00
profile.h Commit FS#9170 by Dave Hooper. Adds support for profiling on ARM, and fixes various issues with compiling profile builds. Also, note that profile_reader.pl syntax has changed. 2008-07-28 22:43:41 +00:00
qt1106.h set svn properties 2008-09-17 18:50:34 +00:00
r61509.h Onda VX7x7: fix error when compiling with USB_BOOT defined 2009-07-29 12:57:42 +00:00
ramdisk.h Cleanup MV/MD macros a little. 2013-08-17 12:18:22 -04:00
rbpaths.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
rda5802.h Signal strength meter for FM radio - FS#8151 by Przemysław Hołubowski 2010-11-11 21:13:29 +00:00
rds.h rds: add basic RDS clock-time support 2012-02-18 11:02:13 +01:00
rk27xx.h Revert "rk27xx: implement usb driver" 2013-08-11 19:21:24 +02:00
rk27xx_codec.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
rkw-loader.h rename rkw.h header file 2012-03-04 00:36:02 +01:00
rolo.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
rtc.h rtc_enable_alarm() needs no return value 2010-05-22 00:28:26 +00:00
s1a0903x01.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
s3c2440.h s5l870x : use mmu-arm.S 2010-04-13 15:59:49 +00:00
s5l8700.h s5l870x: use usb-s3c6400 defines 2011-12-13 05:25:57 +00:00
s5l8702.h iPod Classic: update timer API using 32-bit timers. 2014-11-16 14:18:32 +01:00
screendump.h Really fix yellow: Rename BMP_LINESIZE and BMP_BPP to get rid of the macro name collision 2010-10-25 12:52:02 +00:00
scroll_engine.h put_line/scrolling: Make the scroll engine inform custom scrollers about start/stop of scrolling. 2014-01-12 01:34:06 +01:00
sd.h storage: fix MD vs MV confusion 2013-12-06 01:55:21 +01:00
sdmmc.h imx233: merge sd and mmc drivers, fix dma issues 2012-08-18 18:24:42 +02:00
serial.h Commit FS#8624 by Linus Nielsen, Ryan Press, Craig Elliott, and Kenderes Tamas. Adds preliminary support for numerous accessories that use the ipod serial port on the dock connector. See IpodAccessories for a list of tested devices. 2008-12-25 01:46:16 +00:00
sh7034.h Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h 2009-06-29 14:30:12 +00:00
si4700.h RDS: Use a define that doesn't imply any particular hardware dependency. 2011-12-29 14:55:49 +00:00
sound.h Add DAC's oversampling filter roll-off selection to sound settings. 2013-05-24 11:18:16 +04:00
spdif.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
spi.h Clean spi.h and spi-target.h 2012-01-07 22:04:12 +00:00
stfm1000.h zenxfi3&stfm1000: implement fmradio i2c and debug screen 2012-05-19 18:04:25 +02:00
storage.h Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
structec.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
sw_i2c.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00
synaptics-mep.h SA9200: Adjust touchpad sensitivities so that actual contact with the player is needed to cause button presses and hopefully those settings will work nicely. Add a parameter read function to the MEP driver for debugging and RE purposes; enable compilation of it if you want to use it. Make a note in power-sa9200.c about button inits. 2011-01-11 23:48:29 +00:00
synaptics-rmi.h rmi/fuze+: add product info in the debug screen 2013-12-08 11:12:39 +01:00
system.h Add IS_ALIGNED(x, a) macro helper 2014-11-29 20:59:18 +03:00
tcc77x.h Define CACHEALIGN_BITS for missing ARM CPUs for later use. 2010-11-19 07:17:20 +00:00
tcc780x.h Define CACHEALIGN_BITS for missing ARM CPUs for later use. 2010-11-19 07:17:20 +00:00
tea5760.h Signal strength meter for FM radio - FS#8151 by Przemysław Hołubowski 2010-11-11 21:13:29 +00:00
tea5767.h Signal strength meter for FM radio - FS#8151 by Przemysław Hołubowski 2010-11-11 21:13:29 +00:00
timer.h Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently). 2010-06-21 16:53:00 +00:00
tlv320.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
touchpad.h touch devices: Disable touch on softlock. 2013-09-05 20:02:07 +02:00
touchscreen.h fix red 2013-09-05 20:35:51 +02:00
tsc200x.h Touchscreen support for newer Cowon D2+ hardware revisions (using TSC200x touchscreen controller). 2009-10-15 20:13:29 +00:00
tsc2100.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
tuner.h Add stub STFM1000 tuner driver 2012-05-19 16:10:52 +02:00
uda1341.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
uda1380.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
udacodec.h Create an udacodec interface (similar to ascodec and wmcoded) and adapt/implement it for the iriver h1xx/h3xx and the meizus. 2009-06-28 17:43:04 +00:00
usb-s3c6400x.h GHWCFG* are not as3525v2 specific 2012-01-01 19:21:49 +00:00
usb-tcc.h Fix more tabs 2010-01-03 10:27:43 +00:00
usb.h usb: make usb_release_exclusive_storage private 2015-01-08 16:45:41 +01:00
usb_ch9.h Fix more tabs 2010-01-03 10:27:43 +00:00
usb_core.h usb: move usb charging function prototype from usb_core.h to usb.h 2015-01-08 16:44:55 +01:00
usb_drv.h Get rid of usb_drv_attach() from USB code. 2013-05-14 22:13:38 -04:00
wm8731.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
wm8751.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
wm8758.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
wm8975.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
wm8978.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
wm8985.h Do some cleanup, adjustment and a couple fixes to recent sound changes. 2013-04-22 20:38:17 -04:00
wmcodec.h Updated our source code header to explicitly mention that we are GPL v2 or 2008-06-28 18:10:04 +00:00