diff options
author | Peter Li | 2017-03-24 20:57:22 -0500 |
---|---|---|
committer | Peter Li | 2017-03-24 20:57:22 -0500 |
commit | c03e2b44b6e504d590f338eaa6e8edf8ace0e82f (patch) | |
tree | 16897abff31bbfb127abff675bbf8383f2476f08 | |
parent | c567bcf2514943383c208c94dc1253a5a6e77a3e (diff) | |
download | tas2557-stereo-driver-c03e2b44b6e504d590f338eaa6e8edf8ace0e82f.tar.gz tas2557-stereo-driver-c03e2b44b6e504d590f338eaa6e8edf8ace0e82f.tar.xz tas2557-stereo-driver-c03e2b44b6e504d590f338eaa6e8edf8ace0e82f.zip |
keep channel setup until set to default
-rwxr-xr-x | tas2557-core.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/tas2557-core.c b/tas2557-core.c index 58c9323..194f50e 100755 --- a/tas2557-core.c +++ b/tas2557-core.c | |||
@@ -196,6 +196,12 @@ int tas2557_SA_DevChnSetup(struct tas2557_priv *pTAS2557, unsigned int mode) | |||
196 | goto end; | 196 | goto end; |
197 | } | 197 | } |
198 | 198 | ||
199 | if (pTAS2557->mbLoadConfigurationPrePowerUp) { | ||
200 | dev_dbg(pTAS2557->dev, "%s, setup channel after coeff update\n", __func__); | ||
201 | pTAS2557->mnChannelState = mode; | ||
202 | goto end; | ||
203 | } | ||
204 | |||
199 | switch (mode) { | 205 | switch (mode) { |
200 | case TAS2557_DM_AD_BD: | 206 | case TAS2557_DM_AD_BD: |
201 | pDevABuf = pTAS2557->mnDevAChlData; | 207 | pDevABuf = pTAS2557->mnDevAChlData; |
@@ -234,6 +240,7 @@ int tas2557_SA_DevChnSetup(struct tas2557_priv *pTAS2557, unsigned int mode) | |||
234 | goto end; | 240 | goto end; |
235 | pTAS2557->mnChannelState = mode; | 241 | pTAS2557->mnChannelState = mode; |
236 | } | 242 | } |
243 | |||
237 | end: | 244 | end: |
238 | 245 | ||
239 | return nResult; | 246 | return nResult; |
@@ -561,23 +568,32 @@ prog_coefficient: | |||
561 | TAS2557_BLOCK_CFG_COEFF_DEV_A); | 568 | TAS2557_BLOCK_CFG_COEFF_DEV_A); |
562 | if (nResult < 0) | 569 | if (nResult < 0) |
563 | goto end; | 570 | goto end; |
564 | pTAS2557->mnChannelState = TAS2557_DM_AD_BD; | 571 | if (pTAS2557->mnChannelState == TAS2557_DM_AD_BD) { |
565 | nResult = pTAS2557->bulk_read(pTAS2557, | 572 | nResult = pTAS2557->bulk_read(pTAS2557, |
566 | channel_left, TAS2557_SA_PG2P1_CHL_CTRL_REG, pTAS2557->mnDevAChlData, 16); | 573 | channel_left, TAS2557_SA_PG2P1_CHL_CTRL_REG, pTAS2557->mnDevAChlData, 16); |
567 | if (nResult < 0) | 574 | if (nResult < 0) |
568 | goto end; | 575 | goto end; |
576 | } | ||
569 | } | 577 | } |
570 | if (pNewConfiguration->mnDevices & channel_right) { | 578 | if (pNewConfiguration->mnDevices & channel_right) { |
571 | nResult = tas2557_load_data(pTAS2557, &(pNewConfiguration->mData), | 579 | nResult = tas2557_load_data(pTAS2557, &(pNewConfiguration->mData), |
572 | TAS2557_BLOCK_CFG_COEFF_DEV_B); | 580 | TAS2557_BLOCK_CFG_COEFF_DEV_B); |
573 | if (nResult < 0) | 581 | if (nResult < 0) |
574 | goto end; | 582 | goto end; |
575 | pTAS2557->mnChannelState = TAS2557_DM_AD_BD; | 583 | if (pTAS2557->mnChannelState == TAS2557_DM_AD_BD) { |
576 | nResult = pTAS2557->bulk_read(pTAS2557, | 584 | nResult = pTAS2557->bulk_read(pTAS2557, |
577 | channel_right, TAS2557_SA_PG2P1_CHL_CTRL_REG, pTAS2557->mnDevBChlData, 16); | 585 | channel_right, TAS2557_SA_PG2P1_CHL_CTRL_REG, pTAS2557->mnDevBChlData, 16); |
586 | if (nResult < 0) | ||
587 | goto end; | ||
588 | } | ||
589 | } | ||
590 | |||
591 | if (pTAS2557->mnChannelState != TAS2557_DM_AD_BD) { | ||
592 | nResult = tas2557_SA_DevChnSetup(pTAS2557, pTAS2557->mnChannelState); | ||
578 | if (nResult < 0) | 593 | if (nResult < 0) |
579 | goto end; | 594 | goto end; |
580 | } | 595 | } |
596 | |||
581 | if (pTAS2557->mpCalFirmware->mnCalibrations) { | 597 | if (pTAS2557->mpCalFirmware->mnCalibrations) { |
582 | pCalibration = &(pTAS2557->mpCalFirmware->mpCalibrations[pTAS2557->mnCurrentCalibration]); | 598 | pCalibration = &(pTAS2557->mpCalFirmware->mpCalibrations[pTAS2557->mnCurrentCalibration]); |
583 | dev_dbg(pTAS2557->dev, "load calibration\n"); | 599 | dev_dbg(pTAS2557->dev, "load calibration\n"); |