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.

TAS2559: tas2559 "nConfiguration" setting

Part Number: TAS2559

Hi

My customer is optimizing and debugging the tas2559's software.

They inquired about the reference code of TAS2559.

It seems to be the configuration value set in the firmware. Can you know the meaning of "nConfiguration"?

All source codes are attached.

Please Check it.

Thank you.

Best Regards

From Anthony

tas2559.txt
���ϸ� : tas2559-core.c
���� �ҽ� �κ�

int tas2559_set_program(struct tas2559_priv *pTAS2559,
                                unsigned int nProgram, int nConfig)
{
           struct TProgram *pProgram;
           struct TConfiguration *pConfiguration;
           unsigned int nConfiguration = 0;
           unsigned int nSampleRate = 0;
           bool bFound = false;
           int nResult = 0;

           if ((!pTAS2559->mpFirmware->mpPrograms) ||
               (!pTAS2559->mpFirmware->mpConfigurations)) {
                     dev_err(pTAS2559->dev, "Firmware not loaded\n");
                     nResult = 0;
                     goto end;
           }

           if (nProgram >= pTAS2559->mpFirmware->mnPrograms) {
                     dev_err(pTAS2559->dev, "TAS2559: Program %d doesn't exist\n",
                                nProgram);
                     nResult = 0;
                     goto end;
           }

           if (nConfig < 0) {
                     nSampleRate = pTAS2559->mnCurrentSampleRate;

                     while (!bFound && (nConfiguration < pTAS2559->mpFirmware->mnConfigurations)) {
                                if (pTAS2559->mpFirmware->mpConfigurations[nConfiguration].mnProgram == nProgram) {
                                          if (nSampleRate == 0) {
                                                     bFound = true;
                                                     dev_info(pTAS2559->dev, "find default configuration %d\n", nConfiguration);
                                          } else if (nSampleRate == pTAS2559->mpFirmware->mpConfigurations[nConfiguration].mnSamplingRate) {
                                                     bFound = true;
                                                     dev_info(pTAS2559->dev, "find matching configuration %d\n", nConfiguration);
                                          } else {
                                                     nConfiguration++;
                                          }
                                } else {
                                          nConfiguration++;
                                }
                     }

                     if (!bFound) {
                                dev_err(pTAS2559->dev,
                                          "Program %d, no valid configuration found for sample rate %d, ignore\n",
                                          nProgram, nSampleRate);
                                nResult = 0;
                                goto end;
                     }
           } else {
                     if (pTAS2559->mpFirmware->mpConfigurations[nConfig].mnProgram != nProgram) {
                                dev_err(pTAS2559->dev, "%s, configuration program doesn't match\n", __func__);
                                nResult = 0;
                                goto end;
                     }

                     nConfiguration = nConfig;
           }

           pProgram = &(pTAS2559->mpFirmware->mpPrograms[nProgram]);

           if (pTAS2559->mbPowerUp) {
                     dev_info(pTAS2559->dev,
                                "device powered up, power down to load program %d (%s)\n",
                                nProgram, pProgram->mpName);

                     if (hrtimer_active(&pTAS2559->mtimer))
                                hrtimer_cancel(&pTAS2559->mtimer);

                     if (pProgram->mnAppMode == TAS2559_APP_TUNINGMODE)
                                pTAS2559->enableIRQ(pTAS2559, DevBoth, false);

                     nResult = tas2559_DevShutdown(pTAS2559, DevBoth);

                     if (nResult < 0)
                                goto end;
           }

           pTAS2559->hw_reset(pTAS2559);
           nResult = pTAS2559->write(pTAS2559, DevBoth, TAS2559_SW_RESET_REG, 0x01);
           if (nResult < 0)
                     goto end;

           msleep(1);
           nResult = tas2559_load_default(pTAS2559);
           if (nResult < 0)
                     goto end;

           dev_info(pTAS2559->dev, "load program %d (%s)\n", nProgram, pProgram->mpName);
           nResult = tas2559_load_data(pTAS2559, &(pProgram->mData), TAS2559_BLOCK_PGM_DEV_A);
           if (nResult < 0)
                     goto end;

           nResult = tas2559_load_data(pTAS2559, &(pProgram->mData), TAS2559_BLOCK_PGM_DEV_B);
           if (nResult < 0)
                     goto end;

           pTAS2559->mnCurrentProgram = nProgram;
           pTAS2559->mnDevGain = 15;
           pTAS2559->mnDevCurrentGain = 15;

           nResult = tas2559_load_coefficient(pTAS2559, -1, nConfiguration, false);
           if (nResult < 0)
                     goto end;

           tas2559_update_edge(pTAS2559, DevBoth);

           if (pTAS2559->mbPowerUp) {
                     dev_info(pTAS2559->dev, "%s, load VBoost before power on %d\n", __func__, pTAS2559->mnVBoostState);
                     nResult = tas2559_set_VBoost(pTAS2559, pTAS2559->mnVBoostState, false);
                     if (nResult < 0)
                                goto end;

                     pTAS2559->clearIRQ(pTAS2559);
                     pConfiguration = &(pTAS2559->mpFirmware->mpConfigurations[pTAS2559->mnCurrentConfiguration]);
                     nResult = tas2559_DevStartup(pTAS2559, pConfiguration->mnDevices);
                     if (nResult < 0)
                                goto end;

                     if (pProgram->mnAppMode == TAS2559_APP_TUNINGMODE) {
                                nResult = tas2559_checkPLL(pTAS2559);
                                if (nResult < 0) {
                                          nResult = tas2559_DevShutdown(pTAS2559, pConfiguration->mnDevices);
                                          pTAS2559->mbPowerUp = false;
                                          goto end;
                                }
                     }

                     if (pConfiguration->mnDevices & DevB) {
                                nResult = tas2559_load_data(pTAS2559, &(pConfiguration->mData),
                                                                TAS2559_BLOCK_PST_POWERUP_DEV_B);
                                if (nResult < 0)
                                          goto end;
                     }

                     nResult = tas2559_DevMute(pTAS2559, pConfiguration->mnDevices, false);
                     if (nResult < 0)
                                goto end;

                     if (pProgram->mnAppMode == TAS2559_APP_TUNINGMODE) {
                                pTAS2559->enableIRQ(pTAS2559, pConfiguration->mnDevices, true);

                                if (!hrtimer_active(&pTAS2559->mtimer)) {
                                          pTAS2559->mnDieTvReadCounter = 0;
                                          hrtimer_start(&pTAS2559->mtimer,
                                                           ns_to_ktime((u64)LOW_TEMPERATURE_CHECK_PERIOD * NSEC_PER_MSEC), HRTIMER_MODE_REL);
                                }
                     }
           }

end:

           if (nResult < 0) {
                     if (pTAS2559->mnErrCode & (ERROR_DEVA_I2C_COMM | ERROR_DEVB_I2C_COMM | ERROR_PRAM_CRCCHK | ERROR_YRAM_CRCCHK))
                                failsafe(pTAS2559);
           }

           return nResult;
}

  • Hi, Anthony,

    Our team will take a look at this thread and will answer as soon as possible.

    Best regards,
    Luis Fernando Rodríguez S.

  • Hello Luis


    Thanks for your answer.

    Sorry, but my customers don't have much time on the development schedule.

    I'm sorry, but I would like a quick response.

    Thank you.

    Best Regards.

    From Anthony.

  • Anthony,

    We have already asked our software support team about it. I'll provide their answer as soon as possible.

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

  • Anthony,

    Here our comments regarding nConfiguration:

    The firmware binary can have ‘m’ programs and ‘n’ configurations. A program can have multiple configuration that only changes the tuning coefficients while not changing the underlying program. A program might need to change if for instance if we change from Tuning mode to ROM mode, the program would change, that in turn can have multiple configurations.

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

  • Hi Ivan

    Thank you for your answer. 

    Then, when we change the value of nConfiguration, what function of TAS2559 is changed?

    Also, my customer's inquiry asks if the value of the digital filter changes as the nConfiguration value changes.

    In conclusion, my customer wants to know how nConfiguration affects IC operation, and if necessary, wants to control such as changing to the desired setting.

    Please Check it.

    Thank you.

    Best Regards.

    From Anthony.

  • Anthony,

    As described in the previous reply:
    A program can have multiple configuration that only changes the tuning coefficients while not changing the underlying program

    To answer your questions:

    1. what changes is tuning coefficients: EQ, DRC, etc
    2. if digital filter means EQ, then these are changes by nConfiguration
    3. nConfiguration can change only tuning settings

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

  • Hi Ivan

    Thank you for answer.

    Is there any data related to the entire register map configure details(including nconfigure and etc.)?

    If you have such material, can you share it?

    Unfortunately, I can't check the entire register map configure material, including tuning coefficients, in the Datasheet or any other application note.

    My customer is developing various models using TAS2559,

    so they want to know exactly all TAS2559's register map configuration.

    I hope for your help.

    Thank you.

    Best Regards.

    From Anthony.

  • Hi Anthony,

    The tuning coefficients (the DSP program) is unreachable once it is written during initialization. In addition we cannot provide the description of these values.
    The data sheet already shows all the "visible" registers, so the rest of the configuration for internal processing cannot be described the same way.

    Perhaps one option is to use the "combined_configuration_0_..." cfg file to get the register values, at least during device initialization.

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