This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TAS2770: Cannot set the power register to activate the TAS2770 amplifier

Part Number: TAS2770

Dear Support,

We have finished evaluating the TAS2770 amplifier with the EVM board, and are currently in the process of integrating it in the design of our audio module. We are facing two issues

1) Creating devicetree for it

The i2c section for the tas 2770 amplifier is like this:

&i2c0 {
        status = "okay";
        clock-frequency = <400000>;

        tas2770: tas2770@41 {
                #address-cells = <1>;
                #sound-dai-cells = <0>;
                #size-cells = <0>;
                compatible = "ti,tas2770";
                reg = <0x41>;
                ti,asi-format = <0>;
                ti,imon-slot-no = <0>;
                ti,vmon-slot-no = <2>;
        };
};

In this case the linux kernel panics with "no pinctrl hande" error:

[    1.760000] bus: 'i2c': really_probe: probing driver tas2770 with device 0-0041                                                 
[    1.761000] tas2770 0-0041: no pinctrl handle                                                                                   
[    1.763000] 8<--- cut here ---                                                                                                  
[    1.764000] Unable to handle kernel NULL pointer dereference at virtual address 00000044                                        
[    1.765000] pgd = (ptrval)                                                                                                      
[    1.766000] [00000044] *pgd=00000000                                                                                            
[    1.767000] Internal error: Oops: 5 [#1] PREEMPT SMP THUMB2                                                                     
[    1.767000] Modules linked in:                                                                                                  
[    1.767000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc5 #1                                                              
[    1.767000] Hardware name: Allwinner sun8i Family                                                                               
[    1.767000] PC is at snd_soc_component_write+0x0/0x20                                                                           
[    1.767000] LR is at tas2770_i2c_probe+0xd7/0x190                                                                               
[    1.767000] pc : [<8048c050>]    lr : [<804de08f>]    psr: 00000033                                                             
[    1.767000] sp : 8e82dde8  ip : 8e048c00  fp : 00000000                                                                         
[    1.767000] r10: 80ed8524  r9 : 00000000  r8 : 00000000                                                                         
[    1.767000] r7 : 8e035820  r6 : 8e035800  r5 : 8e149bc0  r4 : 00000000                                                          
[    1.767000] r3 : f03e5b2d  r2 : 00000001  r1 : 00000001  r0 : 00000000                                                          
[    1.767000] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA Thumb  Segment none                                                 
[    1.767000] Control: 50c5387d  Table: 4000406a  DAC: 00000051                                                                   
[    1.767000] Process swapper/0 (pid: 1, stack limit = 0x(ptrval))                                                                
[    1.767000] Stack: (0x8e82dde8 to 0x8e82e000)                                                                                   
[    1.767000] dde0:                   00000000 8e035820 804ddfb9 80e7720c 8e035800 804017b1                                       
[    1.767000] de00: 80ed8520 00000000 8e035820 00000000 80e7720c 8036933d 8e031940 00000000                                       
[    1.767000] de20: 8e035820 80e7720c 80c375e4 80e03e88 00000000 000000d9 00000007 803695f5                                       
[    1.767000] de40: 80c375e4 8043c2f5 80e3df2c 8e035820 00000000 80e7720c 80e03e88 00000000

Do we miss some entry in the devictree? We are using the tas2770 driver fromkernel 5.5-rc5. There is a thread in the forums pointing to another driver that TI provides-which one chall be th eprevferred one to use? Could you provide some tips how to compile it and configure the devicetree for it?

2) Manually controlling the TAS2770 via i2c

In order to continue the SW development until 1) is solved, we have created some scripts to initialize and control the TAS2770 amplifier using the t2c-tools from userspace. This works well, with one exception: we cannot power up the amplifier at the end.

We do a reset, and then the register 0x02 comes up with a value of 0xE. If we try to set bits 0 and 1 to 0 (amplifier active), the operation results always in 0x2 (SW shutdown). Whaever we do attempt, the value does not change. We are using the EVM board connected to our audio module via the I2C lines. These are the commands we do try:

setting page 0:

i2cset -y 0 0x41 0x0 0x0

 

Setting the power register

i2cset -y 0 0x41 0x02 0x0 b

Checking the set value:

i2cget -y 0 0x41 0x02                                             
0x02

Do you have any idea what is going wrong here? Shall I disconnect the USB cable from the EVM board when the jumper is set to use the external i2c?

Thank you very much in advance,

Alex

  • Hi Alex,

    Perhaps the device is being shutdown due to protection. Have you read back Registers 0x24, 0x25 and 0x26 from page 0 to check if there is any protection being triggered?

    Best regards,
    -Ivan Salazar
    Applications Engineer - Low Power Audio & Actuators

  • Hi Ivan,

    Thanks for the hint, I will check these registers tomorrow morning. In the meantime, I have seen that I can set this register only when there is a signal on the i2s bus. It there any way of keeping the amplifier "always ready" without the need to initialize it every time  when I start playing audio?

    Cheers,

    Alex

  • Hi Ivan,

    These are the values I get reading wit i2cget:

    # i2cget -y 0 0x41 0x24
    0x04
    # i2cget -y 0 0x41 0x25
    0x00
    # i2cget -y 0 0x41 0x26
    0xdb

    The 0x24 reports TDM error, which happens as soon as you stop the playback, and there is no I2S signal going out. This I can understand.

    However, the contents of 0x26 is surprising me a bit, especially bit 6 (Interrupt due to DMA Request to DSP lost flag ) Where it is coming from? Could these be masked?

    Cheers,

    Alex

  • Alex,

    bit 6 from reg 0x26 might be related as well to the missing clocks. Internal DSP uses SBCLK clock signal to derive internal clocks.

    You should disable the device before removing the clocks, and enabling it back again after the clocks are present.
    Is this functionality with missing clocks when playback stops the normal use-case?

    Can you try the following:

    • When I2S signals are gone, and then back again, read the flags to clear TDM error flag. Does this take the device back to normal operation?
    • Additionally, try by writing register 0x02 bits 1-0 to 0x00

    Best regards,
    -Ivan Salazar
    Applications Engineer - Low Power Audio & Actuators