rockbox/firmware/target/arm/imx233
Sebastian Leonhardt 9aafbf9ca9 STMP37xx/iMX233: reduce popping noise on power on/off (Version 1)
Version 1: this patch prolongs startup time by 2 seconds, because the
sleep happens early before other threads have started.

The patch is tested on CreativeZEN and Fuze+.

The datasheet was not very helpfull, so some experimentation was needed.
I came to the following conclusions:
* setting HP to ground:
  to prevent popping noises, the headphone output can be set to ground.
  This however must be done before any part of the audioout module is
  powered up (setting HP to ground itself will lead to a pop otherwise).
  This consequently means that HP must NOT be set to ground for powerdown
  sequence!
  Further study showed that setting HP out to ground has no audible benefit,
  controversly not setting/resetting allows for noiseless RoLo-ing.
* headphone amp class A/AB mode:
  initially the HP amp is in class A mode, and should be set to
  class AB before playing audio, as the datasheet mentions.
  If the HP output is set to ground, it must be released BEFORE
  setting class AB! Releasing from ground while in AB mode leads
  to a very loud pop!
* release HP from ground:
  as said before: never release the HP from ground if the HP amp is
  set to class AB mode. Therefore the correct order is to power up the
  headphone amp, wait some time, release HP from ground, and then
  set the amp to class AB mode.
  To prevent pop, some time is needed before releasing the HP from gnd.
  On CreativeZEN 2 sec seems to be ideal; 1 sec have no audible effect,
  1.5 sec softenes the pop to some degree.
* shutting player off
  The popping noise when shutting off is much quieter that on power up,
  so depopping measures are not absolutely necessary.
  However the power off pop can be silenced by inserting a wait time
  after the audioout block is closed and before the rest of the chip
  is powered down. The longer the better, a time of 5 sec practically
  eliminates the pop.

Note that RoLo-ing can still produce noise, because the audio device
is not properly shut down.

Change-Id: Ib20e1d613b346433d2a711c442e303ededc26e78
2025-11-12 16:07:23 -05:00
..
creative-zen zen/zenxfi: fix incorrect dotclk polarity 2025-08-31 20:50:22 -04:00
creative-zenxfi2 Remove BATTERY_TYPES 2025-03-11 02:26:38 -04:00
creative-zenxfi3 Remove BATTERY_TYPES 2025-03-11 02:26:38 -04:00
pins imx233: add stmp3600 and stmp3700 pin descriptions 2013-06-18 16:21:38 +02:00
regs imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
sansa-fuzeplus Remove BATTERY_TYPES 2025-03-11 02:26:38 -04:00
sony-nwz nwze370: fix bootloader regression I caused 2025-10-21 23:33:36 +02:00
adc-imx233.c imx233: cosmetics 2016-05-28 17:07:42 +02:00
adc-target.h Fix sim red 2013-11-19 22:12:42 +00:00
app.lds arm: Fix PortalPlayer linker scripts with binutils 2.21+ 2020-07-05 03:34:30 +00:00
ata-imx233.c imx233: Fix up compilation problems with the IMX233 ATA driver 2025-01-07 20:29:35 -05:00
ata-target.h Unify storage threads into one 2017-10-26 14:35:41 -04:00
audio-imx233.c imx233: remove weak attribute on some functions 2017-02-04 17:16:32 +01:00
audio-imx233.h imx233: remove weak attribute on some functions 2017-02-04 17:16:32 +01:00
audioin-imx233.c imx233: Hardware codec supports up to 192KHz. Make it so! 2020-10-02 09:50:38 -04:00
audioin-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
audioout-imx233.c STMP37xx/iMX233: reduce popping noise on power on/off (Version 1) 2025-11-12 16:07:23 -05:00
audioout-imx233.h imx233: slightly rework 3D audio setting 2016-12-12 12:15:24 +01:00
boot.lds imx233: Fix bootloader link regression caused by cd9906 2020-07-05 04:17:17 +00:00
button-imx233.c imx233: remove weak attribute on some functions 2017-02-04 17:16:32 +01:00
button-imx233.h imx233: remove weak attribute on some functions 2017-02-04 17:16:32 +01:00
button-lradc-imx233.c imx233: make button-lradc drive able to handle VDDIO derived values 2014-02-10 23:14:25 +01:00
button-lradc-imx233.h imx233: make button-lradc drive able to handle VDDIO derived values 2014-02-10 23:14:25 +01:00
clkctrl-imx233.c imx233: Fix clkctrl for STMP3600 variants (creativezenv) 2025-01-08 08:04:25 -05:00
clkctrl-imx233.h imx233: make clkctrl code aware of hbus fractional divider 2024-10-27 10:46:28 -04:00
clock-target.h Sansa Fuze+: initial commit (bootloader only, LCD basically working) 2011-05-01 13:02:46 +00:00
crt0.S Add boot data support to rockbox. 2017-10-29 17:50:59 +01:00
dcp-imx233.c Add missing kernel.h includes (hopefully all of them). 2014-01-05 20:32:09 +01:00
dcp-imx233.h Fix copyright headers 2012-12-29 01:40:35 +01:00
debug-imx233.c [Fix Yellow] imx233_debug fix yellow 2024-06-05 20:03:02 -04:00
dma-imx233.c imx233: workaround hardware dma bug 2017-01-15 18:41:27 +01:00
dma-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
dualboot-imx233.c IMX233: make use of register define for bootdata 2025-10-02 13:06:11 +02:00
dualboot-imx233.h imx233: add capability to boot OF or updater instead of Rockbox 2016-12-12 12:03:08 +01:00
emi-imx233.c imx233: Make bootloader compile, fix up remanining warnings 2025-01-08 09:14:20 -05:00
emi-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
fmradio-imx233.c imx233: rewrite i2c driver 2016-06-01 22:55:37 +02:00
fmradio-imx233.h imx233: factor fmradio i2c and tuner power code 2013-11-19 20:39:10 +00:00
gpmi-imx233.c imx233: add gpmi stubs 2012-05-19 16:10:52 +02:00
gpmi-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
i2c-imx233.c imx233: rewrite i2c driver 2016-06-01 22:55:37 +02:00
i2c-imx233.h imx233: rewrite i2c driver 2016-06-01 22:55:37 +02:00
icoll-imx233.c imx233: add more icoll statistics 2016-12-12 13:20:10 +01:00
icoll-imx233.h imx233: add more icoll statistics 2016-12-12 13:20:10 +01:00
kernel-imx233.c imx233: simplify timrot API 2016-05-28 17:18:32 +02:00
kernel-imx233.h imx233: fix touchscreen driver 2017-05-16 12:14:43 +10:00
lcdif-imx233.c imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
lcdif-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
led-imx233.c imx233: add small framework for LED 2017-01-16 20:08:13 +01:00
led-imx233.h imx233: add small framework for LED 2017-01-16 20:08:13 +01:00
lradc-imx233.c imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
lradc-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
nand-imx233.c storage: 64-bit sector offsets 2024-08-12 14:23:44 -04:00
ocotp-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
partitions-imx233.c Hopefully fix the remaining red from 15e52374 2024-08-12 15:20:13 -04:00
partitions-imx233.h Hopefully fix the remaining red from 15e52374 2024-08-12 15:20:13 -04:00
pcm-imx233.c Fix yellow from e532714d1f 2021-07-25 15:22:33 +01:00
pinctrl-imx233.c imx233: fix pinctrl for stmp3600 and stmp3700 2013-06-17 00:29:25 +02:00
pinctrl-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
power-imx233.c fix typo in imx233_power_get_info() 2025-10-08 11:01:49 +02:00
power-imx233.h imx233: don't print stmp3780 debug info on stmp3700 2017-07-31 01:04:24 +02:00
powermgmt-imx233.c imx233: fix red 2016-05-28 16:50:07 +01:00
powermgmt-imx233.h imx233: speedup charging trickle phase 2016-05-28 16:21:03 +01:00
pwm-imx233.c imx233: add small framework for LED 2017-01-16 20:08:13 +01:00
pwm-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
rtc-imx233.c imx233: implement alarm wake up 2013-07-02 00:45:00 +02:00
rtc-imx233.h imx233: rtc: generalize PERSISTENT0 fix 2020-07-28 22:37:26 +00:00
sdmmc-imx233.c Hopefully fix the remaining red from 15e52374 2024-08-12 15:20:13 -04:00
sdmmc-imx233.h Fix red, forgotten file 2016-05-29 20:21:26 +01:00
ssp-imx233.c imx233: Make bootloader compile, fix up remanining warnings 2025-01-08 09:14:20 -05:00
ssp-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
system-imx233.c Imx233 Disable Autoslow only at maximum cpu frequency 2017-11-12 14:28:03 +01:00
system-target.h arm: split ARM cache maintenance functions to separate header 2025-04-21 12:39:47 -04:00
timer-imx233.c imx233: simplify timrot API 2016-05-28 17:18:32 +02:00
timrot-imx233.c imx233: simplify timrot API 2016-05-28 17:18:32 +02:00
timrot-imx233.h imx233: simplify timrot API 2016-05-28 17:18:32 +02:00
touchscreen-imx233.c Remove Samsung YP-Z5 port 2021-08-14 14:13:54 +01:00
touchscreen-imx233.h Fix copyright headers 2012-12-29 01:40:35 +01:00
uartdbg-imx233.c imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
uartdbg-imx233.h imx233: generate register headers using headergen_v2 and update code for it 2016-05-28 16:49:22 +02:00
usb-imx233.c imx233: fix usb_detect() to be consistent with vbus detection 2013-10-21 01:23:14 +02:00