Currently the put() method for the deemphasis control returns 0 when a new value is written to the control even if the value changed, meaning events are not generated. Fix this, skip the work of updating the value when it is unchanged and then return 1 after having done so.
Unified · Split
| @@ -161,13 +161,16 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol, · 160 unmodified lines | |||
| 161 | if (deemph > 1) | 161 | if (deemph > 1) |
| 162 | return -EINVAL; | 162 | return -EINVAL; |
| 163 | 163 | ||
| 164 | if (es8328->deemph == deemph) | ||
| 165 | return 0; | ||
| 166 | |||
| 164 | ret = es8328_set_deemph(component); | 167 | ret = es8328_set_deemph(component); |
| 165 | if (ret < 0) | 168 | if (ret < 0) |
| 166 | return ret; | 169 | return ret; |
| 167 | 170 | ||
| 168 | es8328->deemph = deemph; | 171 | es8328->deemph = deemph; |
| 169 | 172 | ||
| 170 | return 0; | 173 | return 1; |
| 171 | } | 174 | } |
| 172 | 175 | ||
| 173 | 176 | ||