Linux's dmesg and debugging at startup: Advanced Linux Sound Architecture Driver Version 1.0.16rc2 (Thu Jan 31 16:40:16 2008 UTC). WM9713/WM9714 SoC Audio Codec 0.21 asoc: wm9713-codec-hifi-dai <-> pxa2xx-ac97-hifi mapping ok asoc: wm9713-codec-aux-dai <-> pxa2xx-ac97-aux mapping ok AC97 READ(7c)=574d AC97 WRITE(3c)=3aff AC97 WRITE(26)=0 AC97 READ(12)=8000 AC97 WRITE(12)=0 snd_soc_dai_set_pll returned -22 snd_soc_dapm_add_routes failed: -19 AC97 READ(7c)=574d AC97 READ(7e)=4c13 ac97 0-0:wm9713-codec: detected a wm9713 codec input: wm97xx touchscreen as /class/input/input0 mmc0: new SD card at address e624 mmcblk0: mmc0:e624 SD02G 1985024KiB mmcblk0: p1 p2 mmc2: error -22 whilst initialising SDIO card AC97 READ(3c)=3aff - 0011 1010 1111 1111 - power config: TS on, 1M res string ON, Vref ON, left DAC on AC97 WRITE(3c)=3aff - 0011 1010 1111 1111 - power config: TS on, 1M res string ON, Vref ON, left DAC on AC97 WRITE(78)=c000 - 1100 0000 0000 0000 - touchpanel info: running AC97 READ(7a)=0 - 0000 0000 0000 0000 - touchpanel statuses: pen up meas type=0? auxadc =0 ac97 0-0:wm9713-codec: No IRQ specified evbug.c: Connected device: "wm97xx touchscreen", ac97 0-0:wm9713-codec: setting pen detect pull-up to 8000 Ohms AC97 READ(5a)=0 - 0000 0000 0000 0000 - gpios and battery info AC97 WRITE(74)=0 - - touchpanely stuff AC97 WRITE(76)=40 - 0000 0000 0000 0100 - enabled 'slot readback of touchpanel data' AC97 WRITE(78)=8 - 0000 0000 0000 1000 - sets internal pull-up resistor to 64k/8 = 8k Ohm (like it says but sets touchscreen off?? AC97 WRITE(50)=0 - - make gpios not sticky AC97 READ(4c)=fffe - 1111 1111 1111 1110 - gpio in/out bits (gpio0 is output, all rast are inputs) AC97 READ(4e)=ffff - 1111 1111 1111 1111 - gpio polarity AC97 READ(50)=0 - - gpio stickyness AC97 READ(52)=0 - - gpio wakeup AC97 READ(54)=0 - - gpio states AC97 READ(56)=fffe - 1111 1111 1111 1110 - gpio alt-fn select = all gpios AC97 READ(7a)=0 - - touchpanel state again ALSA device list: #0: hpipaq214 (hpipaq214) Registers in with audio etc off just after touching touchpad: r00: 6174 | r20: 0f0f | r40: 0000 | r60: b032 r02: 0888 | r22: 5c00 | r42: 0000 | r62: 3e00 r04: 8888 | r24: 0000 | r44: 0b80 | r64: 0000 r06: 0888 | r26: 000f | r46: 0000 | r66: 0000 r08: c880 | r28: 0405 | r48: 0000 | r68: 0060 r0a: e808 | r2a: 0001 | r4a: 0000 | r6a: 0000 r0c: a808 | r2c: ac44 | r4c: ffd0 | r6c: 0000 r0e: 0808 | r2e: bb80 | r4e: ffff | r6e: 0000 r10: 00da | r30: 0000 | r50: 2000 | r70: 0000 r12: 0707 | r32: ac44 | r52: a000 | r72: 0000 r14: d600 | r34: 0000 | r54: 0a80 | r74: 0004 r16: aaa0 | r36: 4523 | r56: fffa | r76: 0006 r18: aaa0 | r38: 0000 | r58: 4000 | r78: c008 r1a: aaa0 | r3a: 2000 | r5a: 0000 | r7a: 2fff r1c: 1802 | r3c: 5a0d | r5c: 0200 | r7c: 574d r1e: 0800 | r3e: 2eff | r5e: 0000 | r7e: 4c13 registers in linux: r00: 6174 r4c(298): in/out fffa - r4e(29c): polarity ffff r50(2a0): sticky 2000 r52(2a4): wake-up 2000 r54(2a8): state 28a0 - 0010 1000 1010 0000 r56(2ac): alt-func fffa r58(ab0): pullup/down 4000 r5a(ab2): misc-ctrl 0000 Of interest: r00: 6174 - As default in WM9713 docs. r02: 0888 - 0000 1000 1000 1000 SPKL not muted - volume = 001000 = 8 SPKR muted - volume = 001000 = 8 r04: 8888 HPL muted, vol=8 HPR muted, vol =8 r06: 0888 out4 not muted out3 muted ... more of same sorta thing ... and lots of path setting stuff - will need to work this out r1a: aaa0 - 1010 1010 1010 0000 r24: 0000 - jack insert detect disabled r26: 000f - 0000 0000 0000 1111 all enabled and ready - **check this** r28: 0405 - 0000 0100 0000 0101 - supported stuff - as in docs 2a: 0001 - no spdif - variable rate audio enabled 2c: ac44 - stero dac sample rate = 2e: bb80 - aux dac sample rate = default = 32: ac44 - audio adc sample rate = 3c: 5a0d = 0101 1010 0000 1101 - power control: 15 PD15 1 (OFF) Touchpanel / PenADC power down on 14 VMID1M 1 (OFF) Disables 1Meg Vmid resistor string off 13 TSHUT 1 (OFF) Disables thermal shutdown on 12 VXDAC 1 (OFF) Disables VXDAC off 11 AUXDAC 1 (OFF) Disables AUXDAC off 10 VREF 1 (OFF) Disables reference generator on 9 PLL 1 (OFF) Disables PLL off 8 ?? on 7 DACL 1 (OFF) Disables left DAC on 6 DACR 1 (OFF) Disables right DAC on 5 ADCL 1 (OFF) Disables left ADC on 4 ADCR 1 (OFF) Disables right ADC on 3 HPLX 1 (OFF) Disables left headphone mixer off 2 HPRX 1 (OFF) Disables right headphone mixer off 1 SPKX 1 (OFF) Disables speaker mixer on 0 MX 1 (OFF) Disables mono mixer off 3e: 2eff = 0010 1110 1111 1111 15 MCD 1 (OFF) Disables microphone current detect on 14 MICBIAS 1 (OFF) Disables microphone bias on 13 MONO 1 (OFF) Disables MONO output PGA off 12 OUT4 1 (OFF) Disables OUT4 output PGA on 11 OUT3 1 (OFF) Disables OUT3 output PGA off 10 HPL 1 (OFF) Disables HPL output PGA off 9 HPR 1 (OFF) Disables HPR output PGA off 8 SPKL 1 (OFF) Disables SPKL output PGA on 7 SPKR 1 (OFF) Disables SPKR output PGA off 6 LL 1 (OFF) Disables LINEL PGA off 5 LR 1 (OFF) Disables LINER PGA off 4 MOIN 1 (OFF) Disables MONOIN PGA off 3 MA 1 (OFF) Disables mic PGA MA off 2 MB 1 (OFF) Disables mic PGA MB off 1 MPA 1 (OFF) Disables mic pre-amp MPA off 0 MPB 1 (OFF) Disables mic pre-amp MPB off 44: 0b80 = 0000 1011 1000 0000 14:12 000 hifi clock divisor: f = f 11:8 1011 pcm clock divisor f = f/11 7 1 clock select = EXTERNAL! 5:3 000 pen clk divisor = f / 16 2 0 clock double A = off 1 0 clock double b = off 0 0 clk mux = clock A 46: 0000 PLL is disabled 4c: ffd0 - 1111 1111 1101 0000 - gpios in/out lin:fffa - 1111 1111 1111 1010 - linux cfg gpios 1,2,3 and 5 as output rest as input. so IRQ(GPIO2) is output 13 (virtual GPIO13) is 'input' line: IRQ out and virt13 in but other are out aswell it seems GPIO2 is IRQ in 'WM interrupts the PXA' sense, not something interrupts the WM Appears to be tied to GPIO89 on PXA (which is an input, and fires as IRQ in haret on touch) 50: 2000 - 0010 0000 0000 0000- gpio stickyness 52: a000 - 1010 0000 0000 0000 - GPIO wake-up wake up on GPIO comparator 1 and Pen-down(GPIO13) 54: 0a80 pin status: 56: 1111 1111 1111 1010 bit 2: 0 pin 45 (gpio2) is IRQ function bit 3: 1 pin 46 (gpio3) is NOT pendown function, its just a std gpio gpio 74: 0004 = 0000 0000 0000 0100 lin:010f - 0000 0001 0000 1111 9 POLL 0 Writing “1” initiates a measurement no 8 CTC 0 0=Polling mode; 1=Continuous mode (for DMA) polling 7 ADCSEL_AUX4 0 Enable COMP1/AUX4 measurement (pin32) no 6 ADCSEL_AUX3 0 Enable COMP1/AUX3 measurement (pin31) no 5 ADCSEL_AUX2 0 Enable COMP1/AUX2 measurement (pin30) no 4 ADCSEL_AUX1 0 Enable COMP1/AUX1 measurement (pin29) no 3 ADCSEL_PRESSURE 0 Enable touchpanel pressure measurement no 2 ADCSEL_Y 0 Enable touchpanel Y co-ord measurement yes 1 ADCSEL_X 0 Enable touchpanel X co-ord measurement no 0 COO 0 (OFF) Enables co-ordinate mode no 78: c008 1100 0000 0000 1000 touchscreen running 4wire touchpanel always measure pendown not inverted 200uA pressure detect current 64k/8 = 8kOhm resistor --- --- Now some weeks later Look at again, for the sound, with some haret advances. Addr merge table mapped MVA(0x068f0000)/VA(0x008f0000) to phys(0x40500000) = ac97 Trace primary codec regs while changing volume picks up: +0x0238 = reg 0x1C = Output PGA Mux Select +0x024c = reg 0x26 = Powerdown Ctrl/ Stat at MVA(0x079ac774) VA(0x019ac774) = wacedev2.dll That section of merge table is: 06800000 | 40e10000 | Small (4K) | AP=3333 MFP 06840000 | 40f50000 | Small (4K) | AP=3333 Power 06870000 | 40f50000 | Small (4K) | AP=3333 Power 06890000 | 40e00000 | Small (4K) | AP=3333 GPIO 068a0000 | 40a00000 | Small (4K) | AP=3333 Timers 068b0000 | 4a000000 | Small (4K) | AP=3333 SEMC !! 068c0000 | 40e10000 | Small (4K) | AP=3333 MFP 068f0000 | 40500000 | Small (4K) | AP=3333 AC97 Seems to generally read with GPIOs anyway: 000476: 02e241ef: debug 0208115c: e5903100(ldr) 30079620 00890000 000476: 02e2ce41: debug 02081164: e5903008(ldr) 540b00c0 00890000 000984: 099ff2b8: debug 0208115c: e5903100(ldr) 30079720 00890000 000984: 09a07da3: debug 02081164: e5903008(ldr) 540b00c0 00890000 001482: 0682e7b0: debug 0208115c: e5903100(ldr) 30079720 00890000 ... but 0208115c = pcC_quicklogic.dll 00,04,08, 100 Level 0c,10,14, 10c Dir 18,1c,20, 118 Set 24,28,2c, 124 Clear 30,34,38, 130 Rising edge 3c,40,44, 13c Falling edge 48,4c,50, 148 Edge status Playing with volumes: OUT4 sees to be half of it and SPKL the other half... hmm Disabling stereo DAC kills audio (with a click) DAC to headphone / speaker paths seem to be as named Can catch removing headphone lots o' event on trace of merge mapped IO 1c: 15:14 MONO 00 (ZH) MONO PGA input select: 00=Vmid; 01=no i/p (ZH if buffer disabled); 10=MONOMIX; 11=INV1 13:11 SPKL 000 (ZH) SPKL PGA input select: 000=Vmid; 001=no i/p (ZH if buffer disabled); 010=HPMIXL; 011=SPKMIX; 100=INV1; 101-111=unused 10:8 SPKR 000 (ZH) SPKR PGA input select: 000=Vmid; 001=no i/p (ZH if buffer disabled); 010=HPMIXR; 011=SPKMIX; 100=INV2; 101-111=unused 7:6 HPL 00 (ZH) HPL PGA input select: 00=Vmid; 01=no i/p (ZH if buffer disabled); 10=HPMIXL; 11=unused 5:4 HPR 00 (ZH) HPR PGA input select: 00=Vmid; 01=no i/p (ZH if buffer disabled); 10=HPMIXR; 11=unused 3:2 OUT3 00 (ZH) OUT3 PGA input select: 00=Vmid; 01=no i/p (ZH if buffer disabled); 10=INV1; 11=unused 1:0 OUT4 00 (ZH) OUT4 PGA input select: 00=Vmid; 01=no i/p (ZH if buffer disabled); 10=INV2; 11=unused Removing headphones: 001891: 1615a3b4: debug 079ac840: e59b3000(ldr) 00002fff 008f0238 1c Inputs to the (outputs PGAs) 001891: 1617fa27: debug 079ac898: e59b3000(ldr) 000008a1 008f0238 1c Inputs to the (outputs PGAs) 001891: 161926ce: debug 079ac774: e58b9000(str) 00000801 008f0238 1c Inputs to the (outputs PGAs) 00 00 Mono PGA = Vmid 001 001 SPKL: no i/p (ZH if buffer disabled); 000 000 SPKR: Vmid; 10 00 HPL: HPMIXL --> Vmid 10 00 HPR: HPMIXR --> Vmid 00 00 OUT3: vmid 01 01 OUT4: no i/p (ZH if buffer disabled); 001891: 161a3d11: debug 079ac840: e59b3000(ldr) 000008a1 008f0208 04 Headphone (HPL + HPR) 001891: 161b66db: debug 079ac898: e59b3000(ldr) 00000808 008f0208 04 Headphone (HPL + HPR) 001891: 161c7878: debug 079ac774: e58b9000(str) 00008888 008f0208 04 Headphone (HPL + HPR) Mute HPL+HPR 001891: 161da491: debug 079ac840: e59b3000(ldr) 00000808 008f0218 0c Audio DACS (not AUXDAC) 001891: 161ebf51: debug 079ac898: e59b3000(ldr) 00006808 008f0218 0c Audio DACS (not AUXDAC) 001891: 161fdf98: debug 079ac774: e58b9000(str) 0000e808 008f0218 0c Audio DACS (not AUXDAC) 001891: 162100a1: debug 079ac840: e59b3000(ldr) 00006808 008f027c 3e Additional power management 001891: 1632709e: debug 079ac898: e59b3000(ldr) 000028ff 008f027c 3e Additional power management 001891: 16338948: debug 079ac774: e58b9000(str) 00002eff 008f027c 3e Additional power management 001891: 171ba1a5: debug 079ac840: e59b3000(ldr) 000028ff 008f0238 1c Inputs to the (outputs PGAs) 001891: 171cce31: debug 079ac898: e59b3000(ldr) 00000801 008f0238 1c Inputs to the (outputs PGAs) 001891: 171de134: debug 079ac774: e58b9000(str) 00001802 008f0238 1c Inputs to the (outputs PGAs) 00 00 Mono: Vmid 001 011 SPKL: no i/p --> SPKMIX 000 000 SPKR: Vmid 00 00 HPL: Vmid 00 00 HPR: Vmid 00 00 OUT3: Vmid 01 10 OUT4: no i/p --> INV2 001891: 171f0b01: debug 079ac840: e59b3000(ldr) 00000801 008f023c 1e 3D Stereo 001891: 17202039: debug 079ac898: e59b3000(ldr) 00000800 008f023c 1e 3D Stereo 001891: 17214890: debug 079ac774: e58b9000(str) 00000800 008f023c 1e 3D Stereo 000 INV1: OFF 010 INV2: SPKMIX 0000 - 0 3DLC 0 3DUC 0000 3DDEPTH 001891: 17225de1: debug 079ac840: e59b3000(ldr) 00000800 008f0204 02 Speaker (SPKL + SPKR) 001891: 17238819: debug 079ac898: e59b3000(ldr) 00000088 008f0204 02 Speaker (SPKL + SPKR) 001891: 1725d3d0: debug 079ac774: e58b9000(str) 00000088 008f0204 02 Speaker (SPKL + SPKR) 001891: 1726e7e9: debug 079ac840: e59b3000(ldr) 00000088 008f020c 06 Outputs (OUT3 + OUT4) 001891: 17281131: debug 079ac898: e59b3000(ldr) 00008088 008f020c 06 Outputs (OUT3 + OUT4) 001891: 172925c0: debug 079ac774: e58b9000(str) 00000088 008f020c 06 Outputs (OUT3 + OUT4) 001891: 172a4db9: debug 079ac840: e59b3000(ldr) 00008088 008f0218 0c Audio DACS (not AUXDAC) 001891: 172b6ab9: debug 079ac898: e59b3000(ldr) 0000e808 008f0218 0c Audio DACS (not AUXDAC) 001891: 172c8770: debug 079ac774: e58b9000(str) 0000a808 008f0218 0c Audio DACS (not AUXDAC) 1 Mute headphone mixer path 1 0 Mute speaker mixer 1 Mute mono mixer 01000 left DAC input gain to all mixers 000 01000 right DAC input gain to all mixers 15 D2H 1 (mute) Mutes DAC to headphone mixer path 14 D2S 1 (mute) Mutes DAC to speaker mixer path 13 D2M 1 (mute) Mutes DAC to mono mixer path 12:8 DACLVOL 01000 (0dB) Controls left DAC input gain to all mixers 4:0 DACRVOL 01000 (0dB) Controls right DAC input gain to all mixers 001891: 172da5f1: debug 079ac840: e59b3000(ldr) 0000e808 008f0278 3c Additional power management 001891: 172ec411: debug 079ac898: e59b3000(ldr) 00005a01 008f0278 3c Additional power management 001891: 17310b30: debug 079ac774: e58b9000(str) 00005a01 008f0278 3c Additional power management 001891: 173235b1: debug 079ac840: e59b3000(ldr) 00005a01 008f027c 3e Additional power management 001891: 17334b49: debug 079ac898: e59b3000(ldr) 00002eff 008f027c 3e Additional power management 001891: 173472b0: debug 079ac774: e58b9000(str) 00002eff 008f027c 3e Additional power management In linux alsamixer: Turn on 'Mono Mixer PCM': 0c = ec0c --> cc0c Mono on: 08: c880 --> c800 DAC Inv Mux 1: 3e 3c 3c 3c 1e off: ffff 1a7e 1afe 1aff 0000 Mono: dfff 1abf 1a3f 1a3e 2000 Spkr: ffff 1a7e 1afe 1aff 4000 L HP: " " " " 6000 R HP: " " " " 8000 HPMono: " " " " a000 NC: " " " " c000 Vmid: " " " " e000 DAC Inv Mux 2: 1e off: 0000 Mono: 0400 Spkr: 0800 L HP: 0c00 R HP: 1000 HPMono: 1400 NC: 1800 Vmid: 1c00 OUT4 off->on: 06 = 8080 --> 0080 OUT3 off->on: 06 = 8080 --> 8000 Left HP Out Mux: 3e 3e 3c 1c vmid: c000 zh: c040 HP ffef fbef 1af7 c080 L spk out mux: 1c vmid: c000 zh: c800 hp: d000 spkr: d800 inv: e000 hpvmid: e800 spvmid: f000 invmid: f800 out3 mux: 1c vmid: c000 zh: c004 inv1: c008 inv1mid: c00c out4 mux: 1c vmid: c000 zh: c001 inv2: c002 inv2mid: c003 spekaer on: 02: 8080 --> 0000 right speaker out mux: Debugging stuff for "cant set DAC->SPKMIX with amixer but can with alsamixer" with alsamixer: pxa2xx_ac97_write: 000c = ae08 with amixer: pxa2xx_ac97_write: 000c = ae09 looks like: gpio95 is headphone detect gpio96 is speaker enable gpio98 is headphones enable candidates for headset enable: (so far unknown outputs) 16, 39-45, 47, 48, 94, 119, 127, 1001, 1007, 1002 gpio 1007 must be off for headset to work _properly_, on for hedaphones to work _properly_ gpio98 must be on for both