Signed-off-by: Danny Milosavljevic <[email protected]>
---
sound/soc/sunxi/sun4i-codec.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index bcbf4da..9866cb1 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -57,6 +57,12 @@
#define SUN4I_CODEC_DAC_ACTL_DACAENR (31)
#define SUN4I_CODEC_DAC_ACTL_DACAENL (30)
#define SUN4I_CODEC_DAC_ACTL_MIXEN (29)
+#define SUN4I_CODEC_DAC_ACTL_LINEIN_OUTPUT_VOLUME (26) /* 1 bit */
+#define SUN4I_CODEC_DAC_ACTL_FMIN_OUTPUT_VOLUME (23) /* 3 bit */
+#define SUN4I_CODEC_DAC_ACTL_LINEIN_L_SWITCH (19) /* 1 bit */
+#define SUN4I_CODEC_DAC_ACTL_LINEIN_R_SWITCH (18) /* 1 bit */
+#define SUN4I_CODEC_DAC_ACTL_FMIN_L_SWITCH (17) /* 1 bit */
+#define SUN4I_CODEC_DAC_ACTL_FMIN_R_SWITCH (16) /* 1 bit */
#define SUN4I_CODEC_DAC_ACTL_LDACLMIXS (15)
#define SUN4I_CODEC_DAC_ACTL_RDACRMIXS (14)
#define SUN4I_CODEC_DAC_ACTL_LDACRMIXS (13)
@@ -402,11 +408,37 @@ static const struct snd_kcontrol_new sun4i_codec_pa_mute =
SUN4I_CODEC_DAC_ACTL_PA_MUTE, 1, 0);
static DECLARE_TLV_DB_SCALE(sun4i_codec_pa_volume_scale, -6300, 100, 1);
+static DECLARE_TLV_DB_SCALE(sun4i_codec_linein_volume_scale, -150, 150, 0);
+static DECLARE_TLV_DB_SCALE(sun4i_codec_fmin_volume_scale, -450, 150, 0);
static const struct snd_kcontrol_new sun4i_codec_widgets[] = {
SOC_SINGLE_TLV("PA Volume", SUN4I_CODEC_DAC_ACTL,
SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,
sun4i_codec_pa_volume_scale),
+ SOC_SINGLE_TLV("Line-In Playback Volume",
+ SUN4I_CODEC_DAC_ACTL,
+ SUN4I_CODEC_DAC_ACTL_LINEIN_OUTPUT_VOLUME,
+ 1,
+ 0,
+ sun4i_codec_linein_volume_scale),
+ SOC_SINGLE_TLV("FM-In Playback Volume",
+ SUN4I_CODEC_DAC_ACTL,
+ SUN4I_CODEC_DAC_ACTL_FMIN_OUTPUT_VOLUME,
+ 3,
+ 0,
+ sun4i_codec_fmin_volume_scale),
+ SOC_DOUBLE("Line-In Playback Switch",
+ SUN4I_CODEC_DAC_ACTL,
+ SUN4I_CODEC_DAC_ACTL_LINEIN_L_SWITCH,
+ SUN4I_CODEC_DAC_ACTL_LINEIN_R_SWITCH,
+ 1,
+ 0),
+ SOC_DOUBLE("FM-In Playback Switch",
+ SUN4I_CODEC_DAC_ACTL,
+ SUN4I_CODEC_DAC_ACTL_FMIN_L_SWITCH,
+ SUN4I_CODEC_DAC_ACTL_FMIN_R_SWITCH,
+ 1,
+ 0),
};
static const struct snd_kcontrol_new sun4i_codec_left_mixer_controls[] = {
--
2.1.4
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.