summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/mt6358.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c
index d4c4fee6d3d9..96547ae50a5d 100644
--- a/sound/soc/codecs/mt6358.c
+++ b/sound/soc/codecs/mt6358.c
@@ -405,10 +405,9 @@ static bool is_valid_hp_pga_idx(int reg_idx)
reg_idx == DL_GAIN_N_40DB;
}
-static void headset_volume_ramp(struct mt6358_priv *priv,
- int from, int to)
+static void headset_volume_ramp(struct mt6358_priv *priv, int from, int to)
{
- int offset = 0, count = 1, reg_idx;
+ int offset = 0, count = 0, reg_idx;
if (!is_valid_hp_pga_idx(from) || !is_valid_hp_pga_idx(to))
dev_warn(priv->dev, "%s(), volume index is not valid, from %d, to %d\n",
@@ -422,7 +421,7 @@ static void headset_volume_ramp(struct mt6358_priv *priv,
else
offset = from - to;
- while (offset > 0) {
+ while (offset >= 0) {
if (to > from)
reg_idx = from + count;
else