46 lines
1.8 KiB
Diff
46 lines
1.8 KiB
Diff
--- a/sound/soc/sunxi/sun4i-codec.c
|
|
+++ b/sound/soc/sunxi/sun4i-codec.c
|
|
@@ -89,6 +89,8 @@
|
|
#define SUN4I_CODEC_ADC_ACTL_VMICEN (27)
|
|
#define SUN4I_CODEC_ADC_ACTL_VADCG (20)
|
|
#define SUN4I_CODEC_ADC_ACTL_ADCIS (17)
|
|
+//miopa: Line-in PreAmp Gain
|
|
+#define SUN4I_CODEC_ADC_ACTL_LNPREG (13)
|
|
#define SUN4I_CODEC_ADC_ACTL_PA_EN (4)
|
|
#define SUN4I_CODEC_ADC_ACTL_DDE (3)
|
|
#define SUN4I_CODEC_ADC_DEBUG (0x2c)
|
|
@@ -190,6 +192,10 @@ static int sun4i_codec_prepare_capture(s
|
|
BIT(SUN4I_CODEC_ADC_FIFOC_FIFO_FLUSH),
|
|
BIT(SUN4I_CODEC_ADC_FIFOC_FIFO_FLUSH));
|
|
|
|
+ /* miopa - set ADC input selector to stereo line-in */
|
|
+ regmap_update_bits(scodec->regmap, SUN4I_CODEC_ADC_ACTL,
|
|
+ 7 << SUN4I_CODEC_ADC_ACTL_ADCIS,
|
|
+ 0 << SUN4I_CODEC_ADC_ACTL_ADCIS);
|
|
|
|
/* Set RX FIFO trigger level */
|
|
regmap_update_bits(scodec->regmap, SUN4I_CODEC_ADC_FIFOC,
|
|
@@ -508,11 +514,21 @@ static const struct snd_kcontrol_new sun
|
|
SUN4I_CODEC_DAC_ACTL_PA_MUTE, 1, 0);
|
|
|
|
static DECLARE_TLV_DB_SCALE(sun4i_codec_pa_volume_scale, -6300, 100, 1);
|
|
+//miopa
|
|
+static DECLARE_TLV_DB_SCALE(sun4i_codec_linein_gain, -1200, 300, 0);
|
|
+static DECLARE_TLV_DB_SCALE(sun4i_codec_adc_gain, -450, 150, 0);
|
|
|
|
static const struct snd_kcontrol_new sun4i_codec_widgets[] = {
|
|
- SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL,
|
|
+ SOC_SINGLE_TLV("Power Amplifier Playback Volume", SUN4I_CODEC_DAC_ACTL,
|
|
SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,
|
|
sun4i_codec_pa_volume_scale),
|
|
+ //miopa
|
|
+ SOC_SINGLE_TLV("Line Capture Volume", SUN4I_CODEC_ADC_ACTL,
|
|
+ SUN4I_CODEC_ADC_ACTL_LNPREG, 0x07, 0,
|
|
+ sun4i_codec_linein_gain),
|
|
+ SOC_SINGLE_TLV("Capture Volume", SUN4I_CODEC_ADC_ACTL,
|
|
+ SUN4I_CODEC_ADC_ACTL_VADCG, 0x07, 0,
|
|
+ sun4i_codec_adc_gain),
|
|
};
|
|
|
|
static const struct snd_kcontrol_new sun4i_codec_left_mixer_controls[] = {
|