diff options
-rw-r--r-- | sound/soc/codecs/max98090.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index f7b0b37aa858..c58dce473e55 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -255,6 +255,7 @@ static struct reg_default max98090_reg[] = { | |||
255 | static bool max98090_volatile_register(struct device *dev, unsigned int reg) | 255 | static bool max98090_volatile_register(struct device *dev, unsigned int reg) |
256 | { | 256 | { |
257 | switch (reg) { | 257 | switch (reg) { |
258 | case M98090_REG_SOFTWARE_RESET: | ||
258 | case M98090_REG_DEVICE_STATUS: | 259 | case M98090_REG_DEVICE_STATUS: |
259 | case M98090_REG_JACK_STATUS: | 260 | case M98090_REG_JACK_STATUS: |
260 | case M98090_REG_REVISION_ID: | 261 | case M98090_REG_REVISION_ID: |
@@ -389,6 +390,7 @@ static const DECLARE_TLV_DB_SCALE(max98090_alc_tlv, -1500, 100, 0); | |||
389 | static const DECLARE_TLV_DB_SCALE(max98090_alcmakeup_tlv, 0, 100, 0); | 390 | static const DECLARE_TLV_DB_SCALE(max98090_alcmakeup_tlv, 0, 100, 0); |
390 | static const DECLARE_TLV_DB_SCALE(max98090_alccomp_tlv, -3100, 100, 0); | 391 | static const DECLARE_TLV_DB_SCALE(max98090_alccomp_tlv, -3100, 100, 0); |
391 | static const DECLARE_TLV_DB_SCALE(max98090_drcexp_tlv, -6600, 100, 0); | 392 | static const DECLARE_TLV_DB_SCALE(max98090_drcexp_tlv, -6600, 100, 0); |
393 | static const DECLARE_TLV_DB_SCALE(max98090_sdg_tlv, 50, 200, 0); | ||
392 | 394 | ||
393 | static const unsigned int max98090_mixout_tlv[] = { | 395 | static const unsigned int max98090_mixout_tlv[] = { |
394 | TLV_DB_RANGE_HEAD(2), | 396 | TLV_DB_RANGE_HEAD(2), |
@@ -665,7 +667,7 @@ static const struct snd_kcontrol_new max98090_snd_controls[] = { | |||
665 | SOC_SINGLE_EXT_TLV("Digital Sidetone Volume", | 667 | SOC_SINGLE_EXT_TLV("Digital Sidetone Volume", |
666 | M98090_REG_ADC_SIDETONE, M98090_DVST_SHIFT, | 668 | M98090_REG_ADC_SIDETONE, M98090_DVST_SHIFT, |
667 | M98090_DVST_NUM - 1, 1, max98090_get_enab_tlv, | 669 | M98090_DVST_NUM - 1, 1, max98090_get_enab_tlv, |
668 | max98090_put_enab_tlv, max98090_micboost_tlv), | 670 | max98090_put_enab_tlv, max98090_sdg_tlv), |
669 | SOC_SINGLE_TLV("Digital Coarse Volume", M98090_REG_DAI_PLAYBACK_LEVEL, | 671 | SOC_SINGLE_TLV("Digital Coarse Volume", M98090_REG_DAI_PLAYBACK_LEVEL, |
670 | M98090_DVG_SHIFT, M98090_DVG_NUM - 1, 0, | 672 | M98090_DVG_SHIFT, M98090_DVG_NUM - 1, 0, |
671 | max98090_dvg_tlv), | 673 | max98090_dvg_tlv), |
@@ -2373,6 +2375,8 @@ static int max98090_runtime_resume(struct device *dev) | |||
2373 | 2375 | ||
2374 | regcache_cache_only(max98090->regmap, false); | 2376 | regcache_cache_only(max98090->regmap, false); |
2375 | 2377 | ||
2378 | max98090_reset(max98090); | ||
2379 | |||
2376 | regcache_sync(max98090->regmap); | 2380 | regcache_sync(max98090->regmap); |
2377 | 2381 | ||
2378 | return 0; | 2382 | return 0; |
@@ -2388,9 +2392,34 @@ static int max98090_runtime_suspend(struct device *dev) | |||
2388 | } | 2392 | } |
2389 | #endif | 2393 | #endif |
2390 | 2394 | ||
2395 | #ifdef CONFIG_PM | ||
2396 | static int max98090_resume(struct device *dev) | ||
2397 | { | ||
2398 | struct max98090_priv *max98090 = dev_get_drvdata(dev); | ||
2399 | unsigned int status; | ||
2400 | |||
2401 | regcache_mark_dirty(max98090->regmap); | ||
2402 | |||
2403 | max98090_reset(max98090); | ||
2404 | |||
2405 | /* clear IRQ status */ | ||
2406 | regmap_read(max98090->regmap, M98090_REG_DEVICE_STATUS, &status); | ||
2407 | |||
2408 | regcache_sync(max98090->regmap); | ||
2409 | |||
2410 | return 0; | ||
2411 | } | ||
2412 | |||
2413 | static int max98090_suspend(struct device *dev) | ||
2414 | { | ||
2415 | return 0; | ||
2416 | } | ||
2417 | #endif | ||
2418 | |||
2391 | static const struct dev_pm_ops max98090_pm = { | 2419 | static const struct dev_pm_ops max98090_pm = { |
2392 | SET_RUNTIME_PM_OPS(max98090_runtime_suspend, | 2420 | SET_RUNTIME_PM_OPS(max98090_runtime_suspend, |
2393 | max98090_runtime_resume, NULL) | 2421 | max98090_runtime_resume, NULL) |
2422 | SET_SYSTEM_SLEEP_PM_OPS(max98090_suspend, max98090_resume) | ||
2394 | }; | 2423 | }; |
2395 | 2424 | ||
2396 | static const struct i2c_device_id max98090_i2c_id[] = { | 2425 | static const struct i2c_device_id max98090_i2c_id[] = { |