+static int wsa881x_ramp_pa_gain(struct snd_soc_component *comp,
+ int min_gain, int max_gain, int udelay)
+{
+ int val;
+
+ for (val = min_gain; max_gain <= val; val--) {
+ snd_soc_component_update_bits(comp, WSA881X_SPKR_DRV_GAIN,
+ 0xF0, val << 4);
+ /*
+ * 1ms delay is needed for every step change in gain as per
+ * HW requirement.
+ */
+ usleep_range(udelay, udelay + 10);
+ wsa881x_ramp_pa_gain(comp, min_gain, max_gain, 1000);