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.

tlv320aic31xx-codec 1-0018: Failed to restore cache: -121

Other Parts Discussed in Thread: TLV320AIC3100, TLV320AIC3106, TLV320DAC3100

TLV320aic3100 codec driver probe is failing : Due the maximum registers limit(1536=12*128).

[ 2.615815] davinci_evm sound.12: tlv320aic31xx-hifi <-> 4803c000.mcasp mapping ok

we are getting this error:  which leads to codec driver is not loading.

[ 2.626516] tlv320aic31xx-codec 1-0018: Failed to restore cache: -121 //-121 error code refers to REMOTE IO ERROR

Code for this error log: in tlv320aic31xx.c: in this function 

//----------------------------------------------------------------------------------

static int aic31xx_power_on(struct snd_soc_codec *codec)
{
struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
int ret = 0;

ret = regulator_bulk_enable(ARRAY_SIZE(aic31xx->supplies),
aic31xx->supplies);
if (ret)
return ret;

if (gpio_is_valid(aic31xx->pdata.gpio_reset)) {
gpio_set_value(aic31xx->pdata.gpio_reset, 1);
udelay(100);
}
regcache_cache_only(aic31xx->regmap, false);
ret = regcache_sync(aic31xx->regmap);
if (ret != 0) {
dev_err(codec->dev,
"Failed to restore cache: %d\n", ret);
regcache_cache_only(aic31xx->regmap, true);
regulator_bulk_disable(ARRAY_SIZE(aic31xx->supplies),
aic31xx->supplies);
return ret;
}
return 0;
}

//-------------------------------------------------------------------------------------

regards,

Viswanath K 

  • This error is due to RBTREE -- Regcache to write values to Device registers.
    But my Doubt is this error is not occurred with Sitara EVM Starter kit with TLV320AIC3106(tlv320aic3x.c).

    We modified that driver to TLV320AIC3100(tlv320aic31xx.c)  


    Regards,
    Viswanath K

  • I will ask the SW team to look at this.

  • Hi Viswanath K,

    I am using TI am335x EVM with TLV320AIC3106 and do not have such error when insert the driver.
    Using SDK7.

    BR,
    Georgi

  • Hi Georgi,

    This error is occuring with TLV320AIC3100(similar to TLV320DAC3100 which we are using) and not with TLV320AIC3106 in EVM SK.

    we took the as reference codec-driver, there is difference in the driver.

    regards,

    Viswanath K 

  • Hi,

    can you, please, trace the regcache_sync() function to see when it returns the error.

    Thanks,
    Georgi

  • Hi Georgi,

    Thank you for reply, regmap_sync we are getting -121: REMOTE IO ERROR -- we traced it --- it is going to I2C driver.
    in the driver for the NAK it is giving remote io error.

    We are debugging i2c-0 (which we are using for Audio-codec) --- like voltage,clock on IO's
    ##1: we are getting 3.3v as voltage but unable to test I2C clock -- as device is not responding -- unable to run any application to test the clock of the device. as that -121 -remote IO error.

    we tried "cat /dev/i2c-0" we arer getting same error. and
    we thought may be device address is wrong -- "i2cdetect -r 0" with this command we got 0x18 is the address.

    this error we are getting, when Suspend or resume the in the codec-driver(tlv320aic31xx.c) -- through by setting bias level -- it is throwing this error.

    regards,

    Viswanath K
  • One more Doubt in (am335x--evmsk.dts)DTS file : But I2C-0 is for Audio Codec -- but we given in I2C-1 is that issue..???
    We changed like this because: The Codec Driver is registering to I2C, before I2C-0 up. so that we given in I2C-1.

    Here our doubt is : How the Kernel understand -- ?? which device connected to which I2C-BUS..??

    If we given in I2C like any issue -- please correct me, if i am doing wrong..!

    &I2C0
    {
    pinctrl-names = "default";
    pinctrl-0 = <&i2c0_pins>;

    status = "okay";
    clock-frequency = <400000>;


    };
    &i2c1 {
    pinctrl-names = "default";
    pinctrl-0 = <&i2c1_pins>;

    status = "okay";
    clock-frequency = <400000>;

    tps: tps@2d {
    reg = <0x2d>;
    };

    tlv320aic3106: tlv320aic3106@1b {
    compatible = "ti,tlv320aic3106";
    reg = <0x1b>;
    status = "okay";

    /* Regulators */
    AVDD-supply = <&vaux2_reg>;
    IOVDD-supply = <&vaux2_reg>;
    DRVDD-supply = <&vaux2_reg>;
    DVDD-supply = <&vbat>;
    };
    };

    regards,

    Viswanath K
  • Hi Viswanath K,

    can you, please, specify what is the number of I2C module on am335x processor, your codec is connected to (I2C0 or I2C1 pins)?

    If it is i2c0, edit your dts file, referring to am335x-evm.dts from SDK (on EVM tlv320aic3106 is connected to i2c1!).

    BR,
    Georgi

  • Concerning "How the Kernel understand which device connected to which I2C-BUS..??"
    please refer here:

    www.kernel.org/.../instantiating-devices

  • Hi Georgi,

    This issue is resolved. The codec structure should place in the i2c-0, node only -- this one is solved.
    -- BUT NO SOUND FROM CODEC --

    this is the Log when we given :
    CMD: # aplay /usr/share/sound/alsa/Front_Center.wav

    [ 227.277403] davinci_mcasp_set_sysclk:
    [ 227.298161] davinci_mcasp_hw_params:
    [ 227.301965] mcasp_i2s_hw_param:slots:2
    [ 227.314739] davinci_mcasp_start:
    [ 227.318174] mcasp_start_tx:
    [ 227.321133] mcasp_start_tx:tdm_slots:2, op_mode:0,num_serializer:4,txnumevt:32,rxnumevt:32
    [ 227.329815] mcasp_start_tx:wait for XDATA to be cleared
    [ 227.335302] mcasp_start_tx:enable transmit underrun IRQ

    here the the command interface going to hang state -- and NO SOUND.
    unless we terminate the instance -- mcasp_stop_tx event is not generating -- my doubt is :"is that interrupt is related to mcasp or DMA interrupt is not generating to transmit and the streams is not reaching to end and then command interface- instance is not getting the status and which is leads to hang , until we terminate.

    Please help me here in this issue.

    regards,

    Viswanath K
  • Can you, please, open a new thread for this issue?

    Thanks,
    Georgi
  • Sure we will Post as NEW