Merge tag 'asoc-v3.13-5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
authorTakashi Iwai <tiwai@suse.de>
Thu, 21 Nov 2013 14:07:44 +0000 (15:07 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 21 Nov 2013 14:07:44 +0000 (15:07 +0100)
ASoC: Fixes for v3.13

A bunch of device specific fixes, nothing with a general impact here.

1  2 
sound/soc/codecs/wm5110.c
sound/soc/sh/rcar/scu.c

index f2d1094424b9f6f3dcce1b5eab3a7f4492ec657e,9cef204278a614c5b41ad75395a1b264c3d43435..c3c7396a618115d06171bb87314b363cc8ac9f6d
@@@ -37,6 -37,47 +37,47 @@@ struct wm5110_priv 
        struct arizona_fll fll[2];
  };
  
+ static const struct reg_default wm5110_sysclk_revd_patch[] = {
+       { 0x3093, 0x1001 },
+       { 0x30E3, 0x1301 },
+       { 0x3133, 0x1201 },
+       { 0x3183, 0x1501 },
+       { 0x31D3, 0x1401 },
+ };
+ static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w,
+                           struct snd_kcontrol *kcontrol, int event)
+ {
+       struct snd_soc_codec *codec = w->codec;
+       struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
+       struct regmap *regmap = codec->control_data;
+       const struct reg_default *patch = NULL;
+       int i, patch_size;
+       switch (arizona->rev) {
+       case 3:
+               patch = wm5110_sysclk_revd_patch;
+               patch_size = ARRAY_SIZE(wm5110_sysclk_revd_patch);
+               break;
+       default:
+               return 0;
+       }
+       switch (event) {
+       case SND_SOC_DAPM_POST_PMU:
+               if (patch)
+                       for (i = 0; i < patch_size; i++)
+                               regmap_write(regmap, patch[i].reg,
+                                            patch[i].def);
+               break;
+       default:
+               break;
+       }
+       return 0;
+ }
  static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
  static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
  static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
@@@ -101,13 -142,13 +142,13 @@@ ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_E
  ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
  ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
  
 -SND_SOC_BYTES_MASK("EQ1 Coefficeints", ARIZONA_EQ1_1, 21,
 +SND_SOC_BYTES_MASK("EQ1 Coefficients", ARIZONA_EQ1_1, 21,
                   ARIZONA_EQ1_ENA_MASK),
 -SND_SOC_BYTES_MASK("EQ2 Coefficeints", ARIZONA_EQ2_1, 21,
 +SND_SOC_BYTES_MASK("EQ2 Coefficients", ARIZONA_EQ2_1, 21,
                   ARIZONA_EQ2_ENA_MASK),
 -SND_SOC_BYTES_MASK("EQ3 Coefficeints", ARIZONA_EQ3_1, 21,
 +SND_SOC_BYTES_MASK("EQ3 Coefficients", ARIZONA_EQ3_1, 21,
                   ARIZONA_EQ3_ENA_MASK),
 -SND_SOC_BYTES_MASK("EQ4 Coefficeints", ARIZONA_EQ4_1, 21,
 +SND_SOC_BYTES_MASK("EQ4 Coefficients", ARIZONA_EQ4_1, 21,
                   ARIZONA_EQ4_ENA_MASK),
  
  SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
@@@ -400,7 -441,7 +441,7 @@@ static const struct snd_kcontrol_new wm
  
  static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = {
  SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT,
-                   0, NULL, 0),
+                   0, wm5110_sysclk_ev, SND_SOC_DAPM_POST_PMU),
  SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1,
                    ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
  SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK,
diff --combined sound/soc/sh/rcar/scu.c
index f4453e33a847653bac7fd7387f23e44e879f3c63,5e46ef2e8bb8d23ec9297771d30293bcfe21b149..fa8fa15860b9bda89dc5d3af73c85a5c4f076f15
@@@ -68,7 -68,7 +68,7 @@@ static int rsnd_scu_set_route(struct rs
                return 0;
  
        id = rsnd_mod_id(mod);
-       if (id < 0 || id > ARRAY_SIZE(routes))
+       if (id < 0 || id >= ARRAY_SIZE(routes))
                return -EIO;
  
        /*
@@@ -198,8 -198,7 +198,8 @@@ static struct rsnd_mod_ops rsnd_scu_op
  
  struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
  {
 -      BUG_ON(id < 0 || id >= rsnd_scu_nr(priv));
 +      if (WARN_ON(id < 0 || id >= rsnd_scu_nr(priv)))
 +              id = 0;
  
        return &((struct rsnd_scu *)(priv->scu) + id)->mod;
  }