]> Git Repo - linux.git/commitdiff
Merge remote-tracking branch 'asoc/fix/arizona' into asoc-linus
authorMark Brown <[email protected]>
Wed, 25 Nov 2015 17:57:46 +0000 (17:57 +0000)
committerMark Brown <[email protected]>
Wed, 25 Nov 2015 17:57:46 +0000 (17:57 +0000)
1  2 
sound/soc/codecs/arizona.c

index 9929efc6b9aaa4257a155e844b7feb2f91ea80f9,586789597ecdff8fc3fbccd38583b61b9195c332..b3ea24d64c5009cf4cc77e1877c894e3f21f4ee7
@@@ -147,8 -147,6 +147,8 @@@ static int arizona_spk_ev(struct snd_so
                                                   0x4f5, 0x0da);
                }
                break;
 +      default:
 +              break;
        }
  
        return 0;
@@@ -316,7 -314,6 +316,7 @@@ const char *arizona_mixer_texts[ARIZONA
        "Tone Generator 2",
        "Haptics",
        "AEC",
 +      "AEC2",
        "Mic Mute Mixer",
        "Noise Generator",
        "IN1L",
@@@ -424,7 -421,6 +424,7 @@@ int arizona_mixer_values[ARIZONA_NUM_MI
        0x05,
        0x06,  /* Haptics */
        0x08,  /* AEC */
 +      0x09,  /* AEC2 */
        0x0c,  /* Noise mixer */
        0x0d,  /* Comfort noise */
        0x10,  /* IN1L */
@@@ -529,32 -525,6 +529,32 @@@ EXPORT_SYMBOL_GPL(arizona_mixer_values)
  const DECLARE_TLV_DB_SCALE(arizona_mixer_tlv, -3200, 100, 0);
  EXPORT_SYMBOL_GPL(arizona_mixer_tlv);
  
 +const char * const arizona_sample_rate_text[ARIZONA_SAMPLE_RATE_ENUM_SIZE] = {
 +      "12kHz", "24kHz", "48kHz", "96kHz", "192kHz",
 +      "11.025kHz", "22.05kHz", "44.1kHz", "88.2kHz", "176.4kHz",
 +      "4kHz", "8kHz", "16kHz", "32kHz",
 +};
 +EXPORT_SYMBOL_GPL(arizona_sample_rate_text);
 +
 +const unsigned int arizona_sample_rate_val[ARIZONA_SAMPLE_RATE_ENUM_SIZE] = {
 +      0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
 +      0x10, 0x11, 0x12, 0x13,
 +};
 +EXPORT_SYMBOL_GPL(arizona_sample_rate_val);
 +
 +const char *arizona_sample_rate_val_to_name(unsigned int rate_val)
 +{
 +      int i;
 +
 +      for (i = 0; i < ARRAY_SIZE(arizona_sample_rate_val); ++i) {
 +              if (arizona_sample_rate_val[i] == rate_val)
 +                      return arizona_sample_rate_text[i];
 +      }
 +
 +      return "Illegal";
 +}
 +EXPORT_SYMBOL_GPL(arizona_sample_rate_val_to_name);
 +
  const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE] = {
        "SYNCCLK rate", "8kHz", "16kHz", "ASYNCCLK rate",
  };
@@@ -719,15 -689,6 +719,15 @@@ static void arizona_in_set_vu(struct sn
                                    ARIZONA_IN_VU, val);
  }
  
 +bool arizona_input_analog(struct snd_soc_codec *codec, int shift)
 +{
 +      unsigned int reg = ARIZONA_IN1L_CONTROL + ((shift / 2) * 8);
 +      unsigned int val = snd_soc_read(codec, reg);
 +
 +      return !(val & ARIZONA_IN1_MODE_MASK);
 +}
 +EXPORT_SYMBOL_GPL(arizona_input_analog);
 +
  int arizona_in_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
                  int event)
  {
                reg = snd_soc_read(codec, ARIZONA_INPUT_ENABLES);
                if (reg == 0)
                        arizona_in_set_vu(codec, 0);
 +              break;
 +      default:
 +              break;
        }
  
        return 0;
@@@ -848,8 -806,6 +848,8 @@@ int arizona_out_ev(struct snd_soc_dapm_
                        break;
                }
                break;
 +      default:
 +              break;
        }
  
        return 0;
@@@ -1023,24 -979,18 +1023,18 @@@ void arizona_init_dvfs(struct arizona_p
  }
  EXPORT_SYMBOL_GPL(arizona_init_dvfs);
  
- static unsigned int arizona_sysclk_48k_rates[] = {
+ static unsigned int arizona_opclk_ref_48k_rates[] = {
        6144000,
        12288000,
        24576000,
        49152000,
-       73728000,
-       98304000,
-       147456000,
  };
  
- static unsigned int arizona_sysclk_44k1_rates[] = {
+ static unsigned int arizona_opclk_ref_44k1_rates[] = {
        5644800,
        11289600,
        22579200,
        45158400,
-       67737600,
-       90316800,
-       135475200,
  };
  
  static int arizona_set_opclk(struct snd_soc_codec *codec, unsigned int clk,
        }
  
        if (refclk % 8000)
-               rates = arizona_sysclk_44k1_rates;
+               rates = arizona_opclk_ref_44k1_rates;
        else
-               rates = arizona_sysclk_48k_rates;
+               rates = arizona_opclk_ref_48k_rates;
  
-       for (ref = 0; ref < ARRAY_SIZE(arizona_sysclk_48k_rates) &&
+       for (ref = 0; ref < ARRAY_SIZE(arizona_opclk_ref_48k_rates) &&
                     rates[ref] <= refclk; ref++) {
                div = 1;
                while (rates[ref] / div >= freq && div < 32) {
@@@ -1912,11 -1862,6 +1906,11 @@@ static int arizona_calc_fratio(struct a
                if (fll->arizona->rev < 3 || sync)
                        return init_ratio;
                break;
 +      case WM8998:
 +      case WM1814:
 +              if (sync)
 +                      return init_ratio;
 +              break;
        default:
                return init_ratio;
        }
This page took 0.145654 seconds and 4 git commands to generate.