HTC Blue Angel/Sound
HaRET(50)# wasic3gpio 20 GPIOA15 S 1 ? 1601158 GPIOB14 S 1 ? 1601801 GPIO29 S 1 1602419 GPIOA15 S 0 ? 1602498
i2s, i2c and ssp
i2c is used to contact the UDA1380 and change some registers.
i2s is used on record - only.
ssp is used to send audio data to the device - playback of sounds.
VERY IMPORTANT: ssp must be set to external clock (GPIO 27 as an input, alt-fn = 1)
phone calls are presumably to do with i2c routing in the UDA1380: must do a register dump or a wi trace on the i2c data register, when a phone call is being made.
initialisation (reset) sequence:
- ASIC3 GPIOA alt function bit 15 to 1
- AISC3 CDEX EX1 to 1
- sleep for 1ms
- ASIC3 CDEX Source0 to 0 at exactly the same time as Source1 to 1
- ASIC3 CDEX CONTROL_CX to 1
the initialization sequence is complicated. at the moment, it's not been possible to get the reset sequence correct in linux in order to connect properly to the chip. there are two clocks required, according to the uad1380 data sheet: one is for the DAC, and the other is for the interpolator.
we have successfully got the DAC side working - the interpolator, however, is proving to be nasty. registers on the uda1380 e.g. speaker-mute/unmute just _will_ not budge (sticking at 0x0048) unless the interpolator clock is set up correctly. or the chip is reset correctly. neither of which have yet been worked out.
gpio and asic3gpio for audio devices
- A2: unknown. possibly related to A6 and A7. (bluetooth, phone calls). probably bluetooth mic power.
- A7: internal microphone power. 1=record 0=off
- A6: headphone microphone power. 1=record 0=off
- A8: microphone internal/headphone routing. 1=mic 0=headphone
- A9: microphone internal/headphone routing. 0=mic 1=headphone
- A10: headphone earpiece power. 1=play 0=off
- A15: CONTROL_CX - is something to do with ASIC3 clocks to the UDA1380
- B0: earphone IRQ (1=plugged in)
- B14: unknown. observed a couple of times to change when A15 and B15 are changed.
- B15: believed to be speaker/earpiece power. 1=play 0=off
- C12: headphone enable: switch on when B0 detects earpiece and D0 happy(1=on)
- D0: headphone detected. no good just having earphone IRQ: must detect it too. (1=detect)
- D1: headphone button. on the headphone, there's a button which is useful for answering calls.
- GPIO20: unknown
- GPIO22: unknown. (bluetooth, phone calls). probably bluetooth speaker on
- GPIO89: unknown. but there is some possibility it's to do with headphone power, this has to be confirmed.
presumably D0 is also a button - it looks like the entire ASIC3 D bank is buttons. presumably this is for safety for when people keep jiggling the headphone in and out and generating large amounts of interrupts...
yet to be determined: the audio routing when bluetooth audio is on. there isn't actually very much left to identify.