Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', 'asoc/topic/samsung' and 'asoc/topic/sh' into asoc-next
This commit is contained in:
Коммит
71831ef699
|
@ -14,7 +14,8 @@ Optional properties:
|
||||||
|
|
||||||
- realtek,in1-differential
|
- realtek,in1-differential
|
||||||
- realtek,in2-differential
|
- realtek,in2-differential
|
||||||
Boolean. Indicate MIC1/2 input are differential, rather than single-ended.
|
- realtek,in3-differential
|
||||||
|
Boolean. Indicate MIC1/2/3 input are differential, rather than single-ended.
|
||||||
|
|
||||||
- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.
|
- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.
|
||||||
|
|
||||||
|
@ -24,9 +25,11 @@ Pins on the device (for linking into audio routes) for RT5639/RT5640:
|
||||||
* DMIC2
|
* DMIC2
|
||||||
* MICBIAS1
|
* MICBIAS1
|
||||||
* IN1P
|
* IN1P
|
||||||
* IN1R
|
* IN1N
|
||||||
* IN2P
|
* IN2P
|
||||||
* IN2R
|
* IN2N
|
||||||
|
* IN3P
|
||||||
|
* IN3N
|
||||||
* HPOL
|
* HPOL
|
||||||
* HPOR
|
* HPOR
|
||||||
* LOUTL
|
* LOUTL
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
#define __LINUX_SND_RT5640_H
|
#define __LINUX_SND_RT5640_H
|
||||||
|
|
||||||
struct rt5640_platform_data {
|
struct rt5640_platform_data {
|
||||||
/* IN1 & IN2 can optionally be differential */
|
/* IN1 & IN2 & IN3 can optionally be differential */
|
||||||
bool in1_diff;
|
bool in1_diff;
|
||||||
bool in2_diff;
|
bool in2_diff;
|
||||||
|
bool in3_diff;
|
||||||
|
|
||||||
bool dmic_en;
|
bool dmic_en;
|
||||||
bool dmic1_data_pin; /* 0 = IN1P; 1 = GPIO3 */
|
bool dmic1_data_pin; /* 0 = IN1P; 1 = GPIO3 */
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct rt298_priv {
|
||||||
int is_hp_in;
|
int is_hp_in;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct reg_default rt298_index_def[] = {
|
static const struct reg_default rt298_index_def[] = {
|
||||||
{ 0x01, 0xa5a8 },
|
{ 0x01, 0xa5a8 },
|
||||||
{ 0x02, 0x8e95 },
|
{ 0x02, 0x8e95 },
|
||||||
{ 0x03, 0x0002 },
|
{ 0x03, 0x0002 },
|
||||||
|
@ -128,7 +128,7 @@ static bool rt298_volatile_register(struct device *dev, unsigned int reg)
|
||||||
case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0):
|
case VERB_CMD(AC_VERB_GET_EAPD_BTLENABLE, RT298_HP_OUT, 0):
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1164,7 +1164,11 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
rt298->index_cache = rt298_index_def;
|
rt298->index_cache = devm_kmemdup(&i2c->dev, rt298_index_def,
|
||||||
|
sizeof(rt298_index_def), GFP_KERNEL);
|
||||||
|
if (!rt298->index_cache)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
rt298->index_cache_size = INDEX_CACHE_SIZE;
|
rt298->index_cache_size = INDEX_CACHE_SIZE;
|
||||||
rt298->i2c = i2c;
|
rt298->i2c = i2c;
|
||||||
i2c_set_clientdata(i2c, rt298);
|
i2c_set_clientdata(i2c, rt298);
|
||||||
|
|
|
@ -405,11 +405,14 @@ static const struct snd_kcontrol_new rt5640_snd_controls[] = {
|
||||||
SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5640_DAC1_DIG_VOL,
|
SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5640_DAC1_DIG_VOL,
|
||||||
RT5640_L_VOL_SFT, RT5640_R_VOL_SFT,
|
RT5640_L_VOL_SFT, RT5640_R_VOL_SFT,
|
||||||
175, 0, dac_vol_tlv),
|
175, 0, dac_vol_tlv),
|
||||||
/* IN1/IN2 Control */
|
/* IN1/IN2/IN3 Control */
|
||||||
SOC_SINGLE_TLV("IN1 Boost", RT5640_IN1_IN2,
|
SOC_SINGLE_TLV("IN1 Boost", RT5640_IN1_IN2,
|
||||||
RT5640_BST_SFT1, 8, 0, bst_tlv),
|
RT5640_BST_SFT1, 8, 0, bst_tlv),
|
||||||
SOC_SINGLE_TLV("IN2 Boost", RT5640_IN3_IN4,
|
SOC_SINGLE_TLV("IN2 Boost", RT5640_IN3_IN4,
|
||||||
RT5640_BST_SFT2, 8, 0, bst_tlv),
|
RT5640_BST_SFT2, 8, 0, bst_tlv),
|
||||||
|
SOC_SINGLE_TLV("IN3 Boost", RT5640_IN1_IN2,
|
||||||
|
RT5640_BST_SFT2, 8, 0, bst_tlv),
|
||||||
|
|
||||||
/* INL/INR Volume Control */
|
/* INL/INR Volume Control */
|
||||||
SOC_DOUBLE_TLV("IN Capture Volume", RT5640_INL_INR_VOL,
|
SOC_DOUBLE_TLV("IN Capture Volume", RT5640_INL_INR_VOL,
|
||||||
RT5640_INL_VOL_SFT, RT5640_INR_VOL_SFT,
|
RT5640_INL_VOL_SFT, RT5640_INR_VOL_SFT,
|
||||||
|
@ -598,6 +601,8 @@ static const struct snd_kcontrol_new rt5640_rec_l_mix[] = {
|
||||||
RT5640_M_HP_L_RM_L_SFT, 1, 1),
|
RT5640_M_HP_L_RM_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("INL Switch", RT5640_REC_L2_MIXER,
|
SOC_DAPM_SINGLE("INL Switch", RT5640_REC_L2_MIXER,
|
||||||
RT5640_M_IN_L_RM_L_SFT, 1, 1),
|
RT5640_M_IN_L_RM_L_SFT, 1, 1),
|
||||||
|
SOC_DAPM_SINGLE("BST3 Switch", RT5640_REC_L2_MIXER,
|
||||||
|
RT5640_M_BST2_RM_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_L2_MIXER,
|
SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_L2_MIXER,
|
||||||
RT5640_M_BST4_RM_L_SFT, 1, 1),
|
RT5640_M_BST4_RM_L_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_L2_MIXER,
|
SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_L2_MIXER,
|
||||||
|
@ -611,6 +616,8 @@ static const struct snd_kcontrol_new rt5640_rec_r_mix[] = {
|
||||||
RT5640_M_HP_R_RM_R_SFT, 1, 1),
|
RT5640_M_HP_R_RM_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("INR Switch", RT5640_REC_R2_MIXER,
|
SOC_DAPM_SINGLE("INR Switch", RT5640_REC_R2_MIXER,
|
||||||
RT5640_M_IN_R_RM_R_SFT, 1, 1),
|
RT5640_M_IN_R_RM_R_SFT, 1, 1),
|
||||||
|
SOC_DAPM_SINGLE("BST3 Switch", RT5640_REC_R2_MIXER,
|
||||||
|
RT5640_M_BST2_RM_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_R2_MIXER,
|
SOC_DAPM_SINGLE("BST2 Switch", RT5640_REC_R2_MIXER,
|
||||||
RT5640_M_BST4_RM_R_SFT, 1, 1),
|
RT5640_M_BST4_RM_R_SFT, 1, 1),
|
||||||
SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_R2_MIXER,
|
SOC_DAPM_SINGLE("BST1 Switch", RT5640_REC_R2_MIXER,
|
||||||
|
@ -1065,6 +1072,8 @@ static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = {
|
||||||
SND_SOC_DAPM_INPUT("IN1N"),
|
SND_SOC_DAPM_INPUT("IN1N"),
|
||||||
SND_SOC_DAPM_INPUT("IN2P"),
|
SND_SOC_DAPM_INPUT("IN2P"),
|
||||||
SND_SOC_DAPM_INPUT("IN2N"),
|
SND_SOC_DAPM_INPUT("IN2N"),
|
||||||
|
SND_SOC_DAPM_INPUT("IN3P"),
|
||||||
|
SND_SOC_DAPM_INPUT("IN3N"),
|
||||||
SND_SOC_DAPM_PGA("DMIC L1", SND_SOC_NOPM, 0, 0, NULL, 0),
|
SND_SOC_DAPM_PGA("DMIC L1", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||||
SND_SOC_DAPM_PGA("DMIC R1", SND_SOC_NOPM, 0, 0, NULL, 0),
|
SND_SOC_DAPM_PGA("DMIC R1", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||||
SND_SOC_DAPM_PGA("DMIC L2", SND_SOC_NOPM, 0, 0, NULL, 0),
|
SND_SOC_DAPM_PGA("DMIC L2", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||||
|
@ -1081,6 +1090,8 @@ static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = {
|
||||||
RT5640_PWR_BST1_BIT, 0, NULL, 0),
|
RT5640_PWR_BST1_BIT, 0, NULL, 0),
|
||||||
SND_SOC_DAPM_PGA("BST2", RT5640_PWR_ANLG2,
|
SND_SOC_DAPM_PGA("BST2", RT5640_PWR_ANLG2,
|
||||||
RT5640_PWR_BST4_BIT, 0, NULL, 0),
|
RT5640_PWR_BST4_BIT, 0, NULL, 0),
|
||||||
|
SND_SOC_DAPM_PGA("BST3", RT5640_PWR_ANLG2,
|
||||||
|
RT5640_PWR_BST2_BIT, 0, NULL, 0),
|
||||||
/* Input Volume */
|
/* Input Volume */
|
||||||
SND_SOC_DAPM_PGA("INL VOL", RT5640_PWR_VOL,
|
SND_SOC_DAPM_PGA("INL VOL", RT5640_PWR_VOL,
|
||||||
RT5640_PWR_IN_L_BIT, 0, NULL, 0),
|
RT5640_PWR_IN_L_BIT, 0, NULL, 0),
|
||||||
|
@ -1310,6 +1321,7 @@ static const struct snd_soc_dapm_widget rt5639_specific_dapm_widgets[] = {
|
||||||
static const struct snd_soc_dapm_route rt5640_dapm_routes[] = {
|
static const struct snd_soc_dapm_route rt5640_dapm_routes[] = {
|
||||||
{"IN1P", NULL, "LDO2"},
|
{"IN1P", NULL, "LDO2"},
|
||||||
{"IN2P", NULL, "LDO2"},
|
{"IN2P", NULL, "LDO2"},
|
||||||
|
{"IN3P", NULL, "LDO2"},
|
||||||
|
|
||||||
{"DMIC L1", NULL, "DMIC1"},
|
{"DMIC L1", NULL, "DMIC1"},
|
||||||
{"DMIC R1", NULL, "DMIC1"},
|
{"DMIC R1", NULL, "DMIC1"},
|
||||||
|
@ -1320,18 +1332,22 @@ static const struct snd_soc_dapm_route rt5640_dapm_routes[] = {
|
||||||
{"BST1", NULL, "IN1N"},
|
{"BST1", NULL, "IN1N"},
|
||||||
{"BST2", NULL, "IN2P"},
|
{"BST2", NULL, "IN2P"},
|
||||||
{"BST2", NULL, "IN2N"},
|
{"BST2", NULL, "IN2N"},
|
||||||
|
{"BST3", NULL, "IN3P"},
|
||||||
|
{"BST3", NULL, "IN3N"},
|
||||||
|
|
||||||
{"INL VOL", NULL, "IN2P"},
|
{"INL VOL", NULL, "IN2P"},
|
||||||
{"INR VOL", NULL, "IN2N"},
|
{"INR VOL", NULL, "IN2N"},
|
||||||
|
|
||||||
{"RECMIXL", "HPOL Switch", "HPOL"},
|
{"RECMIXL", "HPOL Switch", "HPOL"},
|
||||||
{"RECMIXL", "INL Switch", "INL VOL"},
|
{"RECMIXL", "INL Switch", "INL VOL"},
|
||||||
|
{"RECMIXL", "BST3 Switch", "BST3"},
|
||||||
{"RECMIXL", "BST2 Switch", "BST2"},
|
{"RECMIXL", "BST2 Switch", "BST2"},
|
||||||
{"RECMIXL", "BST1 Switch", "BST1"},
|
{"RECMIXL", "BST1 Switch", "BST1"},
|
||||||
{"RECMIXL", "OUT MIXL Switch", "OUT MIXL"},
|
{"RECMIXL", "OUT MIXL Switch", "OUT MIXL"},
|
||||||
|
|
||||||
{"RECMIXR", "HPOR Switch", "HPOR"},
|
{"RECMIXR", "HPOR Switch", "HPOR"},
|
||||||
{"RECMIXR", "INR Switch", "INR VOL"},
|
{"RECMIXR", "INR Switch", "INR VOL"},
|
||||||
|
{"RECMIXR", "BST3 Switch", "BST3"},
|
||||||
{"RECMIXR", "BST2 Switch", "BST2"},
|
{"RECMIXR", "BST2 Switch", "BST2"},
|
||||||
{"RECMIXR", "BST1 Switch", "BST1"},
|
{"RECMIXR", "BST1 Switch", "BST1"},
|
||||||
{"RECMIXR", "OUT MIXR Switch", "OUT MIXR"},
|
{"RECMIXR", "OUT MIXR Switch", "OUT MIXR"},
|
||||||
|
@ -2260,6 +2276,10 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
|
||||||
regmap_update_bits(rt5640->regmap, RT5640_IN3_IN4,
|
regmap_update_bits(rt5640->regmap, RT5640_IN3_IN4,
|
||||||
RT5640_IN_DF2, RT5640_IN_DF2);
|
RT5640_IN_DF2, RT5640_IN_DF2);
|
||||||
|
|
||||||
|
if (rt5640->pdata.in3_diff)
|
||||||
|
regmap_update_bits(rt5640->regmap, RT5640_IN1_IN2,
|
||||||
|
RT5640_IN_DF2, RT5640_IN_DF2);
|
||||||
|
|
||||||
rt5640->hp_mute = 1;
|
rt5640->hp_mute = 1;
|
||||||
|
|
||||||
return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5640,
|
return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5640,
|
||||||
|
|
|
@ -26,16 +26,15 @@
|
||||||
#include <mach/gpio-samsung.h>
|
#include <mach/gpio-samsung.h>
|
||||||
#include "s3c24xx-i2s.h"
|
#include "s3c24xx-i2s.h"
|
||||||
|
|
||||||
static unsigned int rates[] = {
|
static const unsigned int rates[] = {
|
||||||
11025,
|
11025,
|
||||||
22050,
|
22050,
|
||||||
44100,
|
44100,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_pcm_hw_constraint_list hw_rates = {
|
static const struct snd_pcm_hw_constraint_list hw_rates = {
|
||||||
.count = ARRAY_SIZE(rates),
|
.count = ARRAY_SIZE(rates),
|
||||||
.list = rates,
|
.list = rates,
|
||||||
.mask = 0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_soc_jack hp_jack;
|
static struct snd_soc_jack hp_jack;
|
||||||
|
|
|
@ -38,16 +38,15 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
|
||||||
static int rx1950_spk_power(struct snd_soc_dapm_widget *w,
|
static int rx1950_spk_power(struct snd_soc_dapm_widget *w,
|
||||||
struct snd_kcontrol *kcontrol, int event);
|
struct snd_kcontrol *kcontrol, int event);
|
||||||
|
|
||||||
static unsigned int rates[] = {
|
static const unsigned int rates[] = {
|
||||||
16000,
|
16000,
|
||||||
44100,
|
44100,
|
||||||
48000,
|
48000,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_pcm_hw_constraint_list hw_rates = {
|
static const struct snd_pcm_hw_constraint_list hw_rates = {
|
||||||
.count = ARRAY_SIZE(rates),
|
.count = ARRAY_SIZE(rates),
|
||||||
.list = rates,
|
.list = rates,
|
||||||
.mask = 0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct snd_soc_jack hp_jack;
|
static struct snd_soc_jack hp_jack;
|
||||||
|
|
|
@ -41,7 +41,7 @@ config SND_SOC_RCAR
|
||||||
select SND_SIMPLE_CARD
|
select SND_SIMPLE_CARD
|
||||||
select REGMAP_MMIO
|
select REGMAP_MMIO
|
||||||
help
|
help
|
||||||
This option enables R-Car SUR/SCU/SSIU/SSI sound support
|
This option enables R-Car SRU/SCU/SSIU/SSI sound support
|
||||||
|
|
||||||
config SND_SOC_RSRC_CARD
|
config SND_SOC_RSRC_CARD
|
||||||
tristate "Renesas Sampling Rate Convert Sound Card"
|
tristate "Renesas Sampling Rate Convert Sound Card"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче