ASoC: cs42l52: Fix mask for REVID
authorAxel Lin <axel.lin@ingics.com>
Sat, 5 Apr 2014 16:04:35 +0000 (00:04 +0800)
committerMark Brown <broonie@linaro.org>
Mon, 7 Apr 2014 09:48:50 +0000 (10:48 +0100)
BIT[0:2] of register 01h is REVID, so the mask for REVID should be 0x7.
Also updates the code to use CS42L52_CHIP_REV_MASK.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/cs42l52.c
sound/soc/codecs/cs42l52.h

index f0ca6bee677159e0bb9a6af0a660bb937b815b7d..460d35547a683d226521591333ce06fe1c5de634 100644 (file)
@@ -1259,7 +1259,7 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
        }
 
        dev_info(&i2c_client->dev, "Cirrus Logic CS42L52, Revision: %02X\n",
-                       reg & 0xFF);
+                reg & CS42L52_CHIP_REV_MASK);
 
        /* Set Platform Data */
        if (cs42l52->pdata.mica_diff_cfg)
index 6fb8f00f4191a7ad890f387c40dc4711dbbfddab..ac445993e6bf98a090b6489fc2e4bd3c3d715366 100644 (file)
@@ -37,7 +37,7 @@
 #define CS42L52_CHIP_REV_A0                    0x00
 #define CS42L52_CHIP_REV_A1                    0x01
 #define CS42L52_CHIP_REV_B0                    0x02
-#define CS42L52_CHIP_REV_MASK                  0x03
+#define CS42L52_CHIP_REV_MASK                  0x07
 
 #define CS42L52_PWRCTL1                                0x02
 #define CS42L52_PWRCTL1_PDN_ALL                        0x9F