add support for multiple pll source for same sample rate
authorPeter Li <a0220410@ti.com>
Mon, 10 Jul 2017 22:53:19 +0000 (06:53 +0800)
committerPeter Li <a0220410@ti.com>
Mon, 10 Jul 2017 22:53:19 +0000 (06:53 +0800)
tas2557-core.c
tas2557.h

index a32c66db2d2e824ac12bde33f669bf2224873c54..7e9bab7aa81706a68e2c09696cb021946fcae14b 100755 (executable)
@@ -43,6 +43,7 @@
 
 #define        PPC_DRIVER_CRCCHK                       0x00000200
 #define        PPC_DRIVER_CONFDEV                      0x00000300
+#define        PPC_DRIVER_MTPLLSRC                     0x00000400
 #define        PPC_DRIVER_CFGDEV_NONCRC        0x00000101
 
 #define TAS2557_CAL_NAME    "/data/tas2557_cal.bin"
@@ -839,6 +840,14 @@ static int fw_parse_configuration_data(struct tas2557_priv *pTAS2557,
                pConfiguration->mnSamplingRate = fw_convert_number(pData);
                pData += 4;
 
+               if (pFirmware->mnDriverVersion >= PPC_DRIVER_MTPLLSRC) {
+                       pConfiguration->mnPLLSrc = pData[0];
+                       pData++;
+
+                       pConfiguration->mnPLLSrcRate = fw_convert_number(pData);
+                       pData += 4;
+               }
+
                n = fw_parse_data(pTAS2557, pFirmware, &(pConfiguration->mData), pData);
                pData += n;
        }
index 14837f98bdd6832e37f0c143a8c960140e7aa95b..d109454bf99a13d2e5f751176b72eab4f20785ac 100755 (executable)
--- a/tas2557.h
+++ b/tas2557.h
 #define TAS2557_GPIO10_PIN_REG                 TAS2557_REG(0, 1, 70)
 #define TAS2557_GPI_PIN_REG                            TAS2557_REG(0, 1, 77)   /*B0_P1_R0x4d */
 #define TAS2557_GPIO_HIZ_CTRL1_REG             TAS2557_REG(0, 1, 79)
-#define TAS2557_GPIO_HIZ_CTRL2_REG             TAS2557_REG(0, 1, 80)
+#define TAS2557_GPIO_HIZ_CTRL2_REG             TAS2557_REG(0, 1, 80)   /*B0_P1_R0x50 */
 #define TAS2557_GPIO_HIZ_CTRL3_REG             TAS2557_REG(0, 1, 81)
 #define TAS2557_GPIO_HIZ_CTRL4_REG             TAS2557_REG(0, 1, 82)
 #define TAS2557_GPIO_HIZ_CTRL5_REG             TAS2557_REG(0, 1, 83)
 
 #define TAS2557_SA_PG1P0_CHL_CTRL_REG  TAS2557_REG(0, 58, 120) /* B0_P0x3a_R0x78 */
 
-#define TAS2557_TEST_MODE_REG                  TAS2557_REG(0, 253, 13)
-#define TAS2557_BROADCAST_REG                  TAS2557_REG(0, 253, 54)
+#define TAS2557_TEST_MODE_REG                  TAS2557_REG(0, 253, 13) /* B0_P0xfd_R0x0d */
+#define TAS2557_BROADCAST_REG                  TAS2557_REG(0, 253, 54) /* B0_P0xfd_R0x36 */
 #define TAS2557_CRYPTIC_REG                    TAS2557_REG(0, 253, 71)
 #define TAS2557_PG2P1_CALI_R0_REG              TAS2557_REG(0x8c, 0x2f, 0x40)
 #define TAS2557_PG1P0_CALI_R0_REG              TAS2557_REG(0x8c, 0x2f, 0x28)
@@ -357,6 +357,8 @@ struct TConfiguration {
        unsigned int mnProgram;
        unsigned int mnPLL;
        unsigned int mnSamplingRate;
+       unsigned char mnPLLSrc;
+       unsigned int mnPLLSrcRate;
        struct TData mData;
 };