]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc...
authorMark Brown <broonie@linaro.org>
Tue, 3 Jun 2014 09:39:57 +0000 (10:39 +0100)
committerMark Brown <broonie@linaro.org>
Tue, 3 Jun 2014 09:39:57 +0000 (10:39 +0100)
1  2  3  4  5 
sound/soc/codecs/sgtl5000.c
sound/soc/samsung/smdk_wm8994.c

index 9626ee0417cd42485ecb59089e7f73075f39cf7e,d3ed1be5a186c50fdaab98e0cf725dce53cb4f32,f2de658d092370a87bb6c38581618569f5c0db2e,d3ed1be5a186c50fdaab98e0cf725dce53cb4f32,d3ed1be5a186c50fdaab98e0cf725dce53cb4f32..3d39f0b5b4a8afd8352edd95627e1fd690d968d5
     
     /* default value of sgtl5000 registers */
     static const struct reg_default sgtl5000_reg_defaults[] = {
++ ++   { SGTL5000_CHIP_DIG_POWER,              0x0000 },
        { SGTL5000_CHIP_CLK_CTRL,               0x0008 },
        { SGTL5000_CHIP_I2S_CTRL,               0x0010 },
        { SGTL5000_CHIP_SSS_CTRL,               0x0010 },
++ ++   { SGTL5000_CHIP_ADCDAC_CTRL,            0x020c },
        { SGTL5000_CHIP_DAC_VOL,                0x3c3c },
        { SGTL5000_CHIP_PAD_STRENGTH,           0x015f },
++ ++   { SGTL5000_CHIP_ANA_ADC_CTRL,           0x0000 },
        { SGTL5000_CHIP_ANA_HP_CTRL,            0x1818 },
        { SGTL5000_CHIP_ANA_CTRL,               0x0111 },
++ ++   { SGTL5000_CHIP_LINREG_CTRL,            0x0000 },
++ ++   { SGTL5000_CHIP_REF_CTRL,               0x0000 },
++ ++   { SGTL5000_CHIP_MIC_CTRL,               0x0000 },
++ ++   { SGTL5000_CHIP_LINE_OUT_CTRL,          0x0000 },
        { SGTL5000_CHIP_LINE_OUT_VOL,           0x0404 },
        { SGTL5000_CHIP_ANA_POWER,              0x7060 },
        { SGTL5000_CHIP_PLL_CTRL,               0x5000 },
++ ++   { SGTL5000_CHIP_CLK_TOP_CTRL,           0x0000 },
++ ++   { SGTL5000_CHIP_ANA_STATUS,             0x0000 },
++ ++   { SGTL5000_CHIP_SHORT_CTRL,             0x0000 },
++ ++   { SGTL5000_CHIP_ANA_TEST2,              0x0000 },
++ ++   { SGTL5000_DAP_CTRL,                    0x0000 },
++ ++   { SGTL5000_DAP_PEQ,                     0x0000 },
        { SGTL5000_DAP_BASS_ENHANCE,            0x0040 },
        { SGTL5000_DAP_BASS_ENHANCE_CTRL,       0x051f },
++ ++   { SGTL5000_DAP_AUDIO_EQ,                0x0000 },
        { SGTL5000_DAP_SURROUND,                0x0040 },
        { SGTL5000_DAP_EQ_BASS_BAND0,           0x002f },
        { SGTL5000_DAP_EQ_BASS_BAND1,           0x002f },
        { SGTL5000_DAP_EQ_BASS_BAND3,           0x002f },
        { SGTL5000_DAP_EQ_BASS_BAND4,           0x002f },
        { SGTL5000_DAP_MAIN_CHAN,               0x8000 },
++ ++   { SGTL5000_DAP_MIX_CHAN,                0x0000 },
        { SGTL5000_DAP_AVC_CTRL,                0x0510 },
        { SGTL5000_DAP_AVC_THRESHOLD,           0x1473 },
        { SGTL5000_DAP_AVC_ATTACK,              0x0028 },
@@@@@@ -296,7 -296,7 -311,7 -296,7 -296,7 +311,7 @@@@@@ static int dac_info_volsw(struct snd_kc
     static int dac_get_volsw(struct snd_kcontrol *kcontrol,
                         struct snd_ctl_elem_value *ucontrol)
     {
 ----   struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 ++++   struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
        int reg;
        int l;
        int r;
     static int dac_put_volsw(struct snd_kcontrol *kcontrol,
                         struct snd_ctl_elem_value *ucontrol)
     {
 ----   struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 ++++   struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
        int reg;
        int l;
        int r;
@@@@@@ -1068,71 -1068,71 -1083,11 -1068,71 -1068,71 +1083,11 @@@@@@ static int sgtl5000_suspend(struct snd_
        return 0;
     }
     
-- --/*
-- -- * restore all sgtl5000 registers,
-- -- * since a big hole between dap and regular registers,
-- -- * we will restore them respectively.
-- -- */
-- --static int sgtl5000_restore_regs(struct snd_soc_codec *codec)
-- --{
-- --   u16 *cache = codec->reg_cache;
-- --   u16 reg;
-- --
-- --   /* restore regular registers */
-- --   for (reg = 0; reg <= SGTL5000_CHIP_SHORT_CTRL; reg += 2) {
-- --
-- --           /* These regs should restore in particular order */
-- --           if (reg == SGTL5000_CHIP_ANA_POWER ||
-- --                   reg == SGTL5000_CHIP_CLK_CTRL ||
-- --                   reg == SGTL5000_CHIP_LINREG_CTRL ||
-- --                   reg == SGTL5000_CHIP_LINE_OUT_CTRL ||
-- --                   reg == SGTL5000_CHIP_REF_CTRL)
-- --                   continue;
-- --
-- --           snd_soc_write(codec, reg, cache[reg]);
-- --   }
-- --
-- --   /* restore dap registers */
-- --   for (reg = SGTL5000_DAP_REG_OFFSET; reg < SGTL5000_MAX_REG_OFFSET; reg += 2)
-- --           snd_soc_write(codec, reg, cache[reg]);
-- --
-- --   /*
-- --    * restore these regs according to the power setting sequence in
-- --    * sgtl5000_set_power_regs() and clock setting sequence in
-- --    * sgtl5000_set_clock().
-- --    *
-- --    * The order of restore is:
-- --    * 1. SGTL5000_CHIP_CLK_CTRL MCLK_FREQ bits (1:0) should be restore after
-- --    *    SGTL5000_CHIP_ANA_POWER PLL bits set
-- --    * 2. SGTL5000_CHIP_LINREG_CTRL should be set before
-- --    *    SGTL5000_CHIP_ANA_POWER LINREG_D restored
-- --    * 3. SGTL5000_CHIP_REF_CTRL controls Analog Ground Voltage,
-- --    *    prefer to resotre it after SGTL5000_CHIP_ANA_POWER restored
-- --    */
-- --   snd_soc_write(codec, SGTL5000_CHIP_LINREG_CTRL,
-- --                   cache[SGTL5000_CHIP_LINREG_CTRL]);
-- --
-- --   snd_soc_write(codec, SGTL5000_CHIP_ANA_POWER,
-- --                   cache[SGTL5000_CHIP_ANA_POWER]);
-- --
-- --   snd_soc_write(codec, SGTL5000_CHIP_CLK_CTRL,
-- --                   cache[SGTL5000_CHIP_CLK_CTRL]);
-- --
-- --   snd_soc_write(codec, SGTL5000_CHIP_REF_CTRL,
-- --                   cache[SGTL5000_CHIP_REF_CTRL]);
-- --
-- --   snd_soc_write(codec, SGTL5000_CHIP_LINE_OUT_CTRL,
-- --                   cache[SGTL5000_CHIP_LINE_OUT_CTRL]);
-- --   return 0;
-- --}
-- --
     static int sgtl5000_resume(struct snd_soc_codec *codec)
     {
        /* Bring the codec back up to standby to enable regulators */
        sgtl5000_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
     
-- --   /* Restore registers by cached in memory */
-- --   sgtl5000_restore_regs(codec);
        return 0;
     }
     #else
@@@@@@ -1322,7 -1322,7 -1277,7 -1322,7 -1322,7 +1277,7 @@@@@@ static int sgtl5000_enable_regulators(s
                        return ret;
        }
     
 - --   ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
 + ++   ret = devm_regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
                                 sgtl5000->supplies);
        if (ret)
                goto err_ldo_remove;
        ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies),
                                        sgtl5000->supplies);
        if (ret)
 - --           goto err_regulator_free;
 + ++           goto err_ldo_remove;
     
        /* wait for all power rails bring up */
        udelay(10);
     
        return 0;
     
 - --err_regulator_free:
 - --   regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 - --                           sgtl5000->supplies);
     err_ldo_remove:
        if (!external_vddd)
                ldo_regulator_remove(codec);
@@@@@@ -1406,6 -1409,8 -1361,6 -1409,8 -1409,8 +1361,6 @@@@@@ static int sgtl5000_probe(struct snd_so
     err:
        regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
                                                sgtl5000->supplies);
 - --   regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 - --                           sgtl5000->supplies);
        ldo_regulator_remove(codec);
     
        return ret;
@@@@@@ -1419,6 -1424,8 -1374,6 -1424,8 -1424,8 +1374,6 @@@@@@ static int sgtl5000_remove(struct snd_s
     
        regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
                                                sgtl5000->supplies);
 - --   regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
 - --                           sgtl5000->supplies);
        ldo_regulator_remove(codec);
     
        return 0;
index fc25cc00f0f2661fa6efd7b318cd1f522c6abb5c,5b544dcf18b4696bd2b0fd2f7a8b375ddc42244a,682eb4f7ba0c61257ade6e96691ceafcb4d023a5,682eb4f7ba0c61257ade6e96691ceafcb4d023a5,682eb4f7ba0c61257ade6e96691ceafcb4d023a5..3d6272a8cad25949321bb96b87f8abe9be07d96c
@@@@@@ -57,7 -57,7 -57,7 -57,7 -57,7 +57,7 @@@@@@ static int smdk_hw_params(struct snd_pc
        int ret;
     
        /* AIF1CLK should be >=3MHz for optimal performance */
- ---   if (params_format(params) == SNDRV_PCM_FORMAT_S24_LE)
+ +++   if (params_width(params) == 24)
                pll_out = params_rate(params) * 384;
        else if (params_rate(params) == 8000 || params_rate(params) == 11025)
                pll_out = params_rate(params) * 512;
@@@@@@ -89,6 -89,18 -89,18 -89,18 -89,18 +89,6 @@@@@@ static int smdk_wm8994_init_paiftx(stru
        struct snd_soc_codec *codec = rtd->codec;
        struct snd_soc_dapm_context *dapm = &codec->dapm;
     
 ----   /* HeadPhone */
 ----   snd_soc_dapm_enable_pin(dapm, "HPOUT1R");
 ----   snd_soc_dapm_enable_pin(dapm, "HPOUT1L");
 ----
 ----   /* MicIn */
 ----   snd_soc_dapm_enable_pin(dapm, "IN1LN");
 ----   snd_soc_dapm_enable_pin(dapm, "IN1RN");
 ----
 ----   /* LineIn */
 ----   snd_soc_dapm_enable_pin(dapm, "IN2LN");
 ----   snd_soc_dapm_enable_pin(dapm, "IN2RN");
 ----
        /* Other pins NC */
        snd_soc_dapm_nc_pin(dapm, "HPOUT2P");
        snd_soc_dapm_nc_pin(dapm, "HPOUT2N");