Merge remote-tracking branches 'asoc/topic/da7218', 'asoc/topic/da7219' and 'asoc...
authorMark Brown <broonie@kernel.org>
Thu, 29 Sep 2016 19:44:21 +0000 (12:44 -0700)
committerMark Brown <broonie@kernel.org>
Thu, 29 Sep 2016 19:44:21 +0000 (12:44 -0700)
1  2  3  4 
sound/soc/codecs/da7218.c
sound/soc/codecs/da7219.c

Simple merge
index 1671c61c95293373ef4e3f43522ad8a28357d5ea,50ea94317cb3216d116b9351cf5387a0213b4689,32007625913d13be771bfe29ae4cc7df2c7f14a4,50ea94317cb3216d116b9351cf5387a0213b4689..1152aa5e7c394208d6e42f04a2c4d44c8b0ea906
@@@@@ -1938,14 -1937,6 -1946,37 -1937,6 +1947,37 @@@@@ static int da7219_i2c_probe(struct i2c_
                return ret;
        }
    
-       /* Software reset codec. */
++ +    regcache_cache_bypass(da7219->regmap, true);
++ +
++ +    /* Disable audio paths if still active from previous start */
++ +    regmap_read(da7219->regmap, DA7219_SYSTEM_ACTIVE, &system_active);
++ +    if (system_active) {
++ +            regmap_write(da7219->regmap, DA7219_GAIN_RAMP_CTRL,
++ +                         DA7219_GAIN_RAMP_RATE_NOMINAL);
++ +            regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_INPUT, 0x00);
++ +            regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_OUTPUT, 0x01);
++ +
++ +            for (i = 0; i < DA7219_SYS_STAT_CHECK_RETRIES; ++i) {
++ +                    regmap_read(da7219->regmap, DA7219_SYSTEM_STATUS,
++ +                                &system_status);
++ +                    if (!system_status)
++ +                            break;
++ +
++ +                    msleep(DA7219_SYS_STAT_CHECK_DELAY);
++ +            }
++ +    }
++ +
++ +    /* Soft reset codec */
 + +    regmap_write_bits(da7219->regmap, DA7219_ACCDET_CONFIG_1,
 + +                      DA7219_ACCDET_EN_MASK, 0);
 + +    regmap_write_bits(da7219->regmap, DA7219_CIF_CTRL,
-                         DA7219_CIF_REG_SOFT_RESET_MASK, 0);
++ +                      DA7219_CIF_REG_SOFT_RESET_MASK,
++ +                      DA7219_CIF_REG_SOFT_RESET_MASK);
 + +    regmap_write_bits(da7219->regmap, DA7219_SYSTEM_ACTIVE,
 + +                      DA7219_SYSTEM_ACTIVE_MASK, 0);
 + +
++ +    regcache_cache_bypass(da7219->regmap, false);
++ +
        ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_da7219,
                                     &da7219_dai, 1);
        if (ret < 0) {