diff options
author | Caesar Wang <wxt@rock-chips.com> | 2015-04-08 07:05:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-04-08 13:08:25 -0400 |
commit | c6b424fee7511407107403d3a7c50e0756ae282e (patch) | |
tree | 40710f733280a5b9793486786cd98dfc08f0297d /sound/soc/codecs/max98090.c | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
ASoC: max98090: add shutdown callback for max98090
To fix pop noise when shutdown,the pop noise during shutdown
is the pmic cutoff power of codec without any notice.
Signed-off-by: jay.xu <xjq@rock-chips.com>
Signed-off-by: zhengxing <zhengxing@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max98090.c')
-rw-r--r-- | sound/soc/codecs/max98090.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index b112b1c2c394..3e33ef2acf3c 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -2605,8 +2605,24 @@ err_enable: | |||
2605 | return ret; | 2605 | return ret; |
2606 | } | 2606 | } |
2607 | 2607 | ||
2608 | static void max98090_i2c_shutdown(struct i2c_client *i2c) | ||
2609 | { | ||
2610 | struct max98090_priv *max98090 = dev_get_drvdata(&i2c->dev); | ||
2611 | |||
2612 | /* | ||
2613 | * Enable volume smoothing, disable zero cross. This will cause | ||
2614 | * a quick 40ms ramp to mute on shutdown. | ||
2615 | */ | ||
2616 | regmap_write(max98090->regmap, | ||
2617 | M98090_REG_LEVEL_CONTROL, M98090_VSENN_MASK); | ||
2618 | regmap_write(max98090->regmap, | ||
2619 | M98090_REG_DEVICE_SHUTDOWN, 0x00); | ||
2620 | msleep(40); | ||
2621 | } | ||
2622 | |||
2608 | static int max98090_i2c_remove(struct i2c_client *client) | 2623 | static int max98090_i2c_remove(struct i2c_client *client) |
2609 | { | 2624 | { |
2625 | max98090_i2c_shutdown(client); | ||
2610 | snd_soc_unregister_codec(&client->dev); | 2626 | snd_soc_unregister_codec(&client->dev); |
2611 | return 0; | 2627 | return 0; |
2612 | } | 2628 | } |
@@ -2696,6 +2712,7 @@ static struct i2c_driver max98090_i2c_driver = { | |||
2696 | .acpi_match_table = ACPI_PTR(max98090_acpi_match), | 2712 | .acpi_match_table = ACPI_PTR(max98090_acpi_match), |
2697 | }, | 2713 | }, |
2698 | .probe = max98090_i2c_probe, | 2714 | .probe = max98090_i2c_probe, |
2715 | .shutdown = max98090_i2c_shutdown, | ||
2699 | .remove = max98090_i2c_remove, | 2716 | .remove = max98090_i2c_remove, |
2700 | .id_table = max98090_i2c_id, | 2717 | .id_table = max98090_i2c_id, |
2701 | }; | 2718 | }; |