Tool/software:
Hi all,
I'm reaching out to the TI audio experts for some guidance on the integration of the TAS5802 on an AM6254 design.
Our system contains one single TAS5802, on bus I2C-0, with the I2C address set to 0x54. The codec is driven from MCASP2, which is configured as a master, with an external 24.576MHz clock fed throu EXT_AUDIO_REFCLK0 input of the AM6254.
So far I was able to configure the clocks, with some help from TI and I can see the MCASP2 driving 48kHz audio on LRCLK and BCLK with a scope. For more info see this thread
So I configured the device tree as follow to bring up the TAS5802:
/* NOTE: ball names, refer to AM6254ALW */ &main_pmx0 { board_pins_codec_control: pp1-pins-codec-control { pinctrl-single,pins = < AM62X_IOPAD(0xf40b4, PIN_OUTPUT, 7) /* [Speaker_Audio_PDN] (K24) GPMC0_CSn3.GPIO0_44 */ AM62X_IOPAD(0xf40b0, PIN_INPUT, 7) /* [Speaker_Audio_FAULT] (K22) GPMC0_CSn2.GPIO0_43 */ >; }; }; &main_i2c0 { /* On-board audio amp: TAS5802 */ tas5802: tasdevice@54 { compatible = "ti,tas5802"; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&board_pins_codec_control>; reg = <0x54>; // ADR had 4.7k to VDD #sound-dai-cells = <0>; interrupt-parent = <&main_gpio0>; interrupts = <43 IRQ_TYPE_EDGE_FALLING>; reset-gpios = <&main_gpio0 44 GPIO_ACTIVE_HIGH>; }; }; &mcasp2 { status = "okay"; #sound-dai-cells = <0>; /* CLOCKS: * BOARD_AUDIO_EXT_REFCLK0 <192 12> --> AHCLKR IN <192 9> * BOARD_AUDIO_EXT_REFCLK0 <192 18> --> AHCLKX IN <192 15> * from TI E2E: ???? <192 30> --> ???? <192 27> * REFCLK runs at 24,576 MHz */ assigned-clocks = <&k3_clks 192 9>, <&k3_clks 192 15>, <&k3_clks 192 27>; assigned-clock-parents = <&k3_clks 192 12>, <&k3_clks 192 18>, <&k3_clks 192 30>; assigned-clock-rates = <24576000>, <24576000>, <0>; pinctrl-names = "default"; pinctrl-0 = <&pp1_pins_mcasp2>; op-mode = <0>; /* MCASP_IIS_MODE */ tdm-slots = <2>; serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >; tx-num-evt = <0>; rx-num-evt = <0>; }; / { board_speakers: sound { compatible = "simple-audio-card"; simple-audio-card,name = "Internal-Speaker"; simple-audio-card,widgets = "Speaker", "Internal Speaker"; simple-audio-card,routing = "Internal Speaker", "OUT"; simple-audio-card,bitclock-master = <&mcasp2>; simple-audio-card,frame-master = <&mcasp2>; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-inversion; simple-audio-card,cpu { sound-dai = <&mcasp2>; system-clock-frequency = <24576000>; }; simple-audio-card,codec { sound-dai = <&tas5802>; }; }; };
In addition I used the tool shipped with the tasdevice out-of-tree driver, opened tas5802-1amp-reg.json, saved it as tas5802-1amp-reg.bin and placed it in /usr/lib/firmware on the target system.
With this setup I am running into some issues that I need help figuring out.
During boot the following messages are printed (only tasdevice entries shown):
[ 5.102786] tasdevice-codec 3-0054: Primary-device = 0x54
[ 5.112888] tasdevice-codec 3-0054: tasdevice_i2c_probe: GPIO 305 request error
[ 5.627002] tasdevice-codec 3-0054: tasdev: regbin_ready start
[ 5.633031] tasdevice-codec 3-0054: nconfig = 4
[ 5.641577] tasdevice-codec 3-0054: img_sz = 884 total_config_sz = 592 offset = 292
[ 5.649742] tasdevice-codec 3-0054: select_cfg_blk: profile_conf_id = 0
[ 5.656463] tasdevice-codec 3-0054: select_cfg_blk: conf 0, block type:PRE_POWER_UP device idx = 0x00
[ 5.677230] tasdevice-codec 3-0054: init id = 0!
[ 5.684789] tasdevice-codec 3-0054: Firmware init complete
When I run aplay or speaker-test I see the following output on the console:
[ 45.300126] tasdevice-codec 3-0054: tasdevice_hw_params: Playback
[ 45.306717] tasdevice-codec 3-0054: tasdevice_hw_params: BCLK rate = 1536000 Channel = 2Sample rate = 48000 slot width = 16
[ 45.347272] tasdevice-codec 3-0054: powercontrol_routine:1310: enter
[ 45.353665] tasdevice-codec 3-0054: select_cfg_blk: profile_conf_id = 0
[ 45.360287] tasdevice-codec 3-0054: select_cfg_blk: conf 0, block type:PRE_POWER_UP device idx = 0x00
[ 45.378850] tasdevice-codec 3-0054: powercontrol_routine:1319: leave
Pin 12 (nPDN) is high, and LRCLK and BCLK have 48kHz and 1.536MHz frequencies, respectively. I have no sound through the speakers, but I am not convinced yet that this is a hardware problem.
I tried removing the interrupt specifier and the reset gpio (hogging the pin high). None of these produced effect.
What steps can I take to understand what is missing on this setup?
Thanks!
António