]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: fsl_sai: store full version instead of major/minor
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 2 Mar 2022 08:34:25 +0000 (09:34 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 7 Mar 2022 13:13:06 +0000 (13:13 +0000)
The driver tests for the hardware revision being newer than 3.1
with (sai->verid.major >= 3 && sai->verid.minor >= 1). The result
is obviously wrong for hardware revision 4.0. Fix this by storing
the full version in a single variable and comparing to that one.
No practical change at the moment as there is no 4.0 ip version
currently.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20220302083428.3804687-5-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_sai.c
sound/soc/fsl/fsl_sai.h

index 218282c2e86f4fc7afaea25684bc21649f4b6150..c9341c25edf1443d19aab22c9e6536fe13f49cf1 100644 (file)
@@ -962,10 +962,8 @@ static int fsl_sai_check_version(struct device *dev)
 
        dev_dbg(dev, "VERID: 0x%016X\n", val);
 
-       sai->verid.major = (val & FSL_SAI_VERID_MAJOR_MASK) >>
-                          FSL_SAI_VERID_MAJOR_SHIFT;
-       sai->verid.minor = (val & FSL_SAI_VERID_MINOR_MASK) >>
-                          FSL_SAI_VERID_MINOR_SHIFT;
+       sai->verid.version = val &
+               (FSL_SAI_VERID_MAJOR_MASK | FSL_SAI_VERID_MINOR_MASK);
        sai->verid.feature = val & FSL_SAI_VERID_FEATURE_MASK;
 
        ret = regmap_read(sai->regmap, FSL_SAI_PARAM, &val);
@@ -1137,7 +1135,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
 
        /* Select MCLK direction */
        if (of_find_property(np, "fsl,sai-mclk-direction-output", NULL) &&
-           sai->verid.major >= 3 && sai->verid.minor >= 1) {
+           sai->verid.version >= 0x0301) {
                regmap_update_bits(sai->regmap, FSL_SAI_MCTL,
                                   FSL_SAI_MCTL_MCLK_EN, FSL_SAI_MCTL_MCLK_EN);
        }
index b30d6113ff08873c59af76c88ae903c0cc1364dc..7310fd02cc3c7cffe8e02d79e15b7b4bf81c6fce 100644 (file)
@@ -227,15 +227,13 @@ struct fsl_sai_soc_data {
 
 /**
  * struct fsl_sai_verid - version id data
- * @major: major version number
- * @minor: minor version number
+ * @version: version number
  * @feature: feature specification number
  *           0000000000000000b - Standard feature set
  *           0000000000000000b - Standard feature set
  */
 struct fsl_sai_verid {
-       u32 major;
-       u32 minor;
+       u32 version;
        u32 feature;
 };