aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOder Chiou <oder_chiou@realtek.com>2015-10-01 02:47:10 -0400
committerMark Brown <broonie@kernel.org>2015-10-01 06:12:45 -0400
commite29fd55d8d23ea7afcadd15a87700583e7da5035 (patch)
tree1d5b85c9aaf6a5f63af1caa14628c04a4499caab
parentde3f8fdf7393e4259b68ae8cea806c39d602769e (diff)
ASoC: rt5645: Add the control of ClassD modulator Speaker Gain Ratio
Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/rt5645.c12
-rw-r--r--sound/soc/codecs/rt5645.h4
2 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index b0d96b6d21de..1f7045bc23a7 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -469,6 +469,14 @@ static const DECLARE_TLV_DB_RANGE(bst_tlv,
469 8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0) 469 8, 8, TLV_DB_SCALE_ITEM(5200, 0, 0)
470); 470);
471 471
472/* {-6, -4.5, -3, -1.5, 0, 0.82, 1.58, 2.28} dB */
473static const DECLARE_TLV_DB_RANGE(spk_clsd_tlv,
474 0, 4, TLV_DB_SCALE_ITEM(-600, 150, 0),
475 5, 5, TLV_DB_SCALE_ITEM(82, 0, 0),
476 6, 6, TLV_DB_SCALE_ITEM(158, 0, 0),
477 7, 7, TLV_DB_SCALE_ITEM(228, 0, 0)
478);
479
472static const struct snd_kcontrol_new rt5645_snd_controls[] = { 480static const struct snd_kcontrol_new rt5645_snd_controls[] = {
473 /* Speaker Output Volume */ 481 /* Speaker Output Volume */
474 SOC_DOUBLE("Speaker Channel Switch", RT5645_SPK_VOL, 482 SOC_DOUBLE("Speaker Channel Switch", RT5645_SPK_VOL,
@@ -476,6 +484,10 @@ static const struct snd_kcontrol_new rt5645_snd_controls[] = {
476 SOC_DOUBLE_TLV("Speaker Playback Volume", RT5645_SPK_VOL, 484 SOC_DOUBLE_TLV("Speaker Playback Volume", RT5645_SPK_VOL,
477 RT5645_L_VOL_SFT, RT5645_R_VOL_SFT, 39, 1, out_vol_tlv), 485 RT5645_L_VOL_SFT, RT5645_R_VOL_SFT, 39, 1, out_vol_tlv),
478 486
487 /* ClassD modulator Speaker Gain Ratio */
488 SOC_SINGLE_TLV("Speaker ClassD Playback Volume", RT5645_SPO_CLSD_RATIO,
489 RT5645_SPK_G_CLSD_SFT, 7, 0, spk_clsd_tlv),
490
479 /* Headphone Output Volume */ 491 /* Headphone Output Volume */
480 SOC_DOUBLE("Headphone Channel Switch", RT5645_HP_VOL, 492 SOC_DOUBLE("Headphone Channel Switch", RT5645_HP_VOL,
481 RT5645_VOL_L_SFT, RT5645_VOL_R_SFT, 1, 1), 493 RT5645_VOL_L_SFT, RT5645_VOL_R_SFT, 1, 1),
diff --git a/sound/soc/codecs/rt5645.h b/sound/soc/codecs/rt5645.h
index f45861c49ef2..d0e0ce52c287 100644
--- a/sound/soc/codecs/rt5645.h
+++ b/sound/soc/codecs/rt5645.h
@@ -668,6 +668,10 @@
668#define RT5645_M_SV_R_SPM_R (0x1 << 0) 668#define RT5645_M_SV_R_SPM_R (0x1 << 0)
669#define RT5645_M_SV_R_SPM_R_SFT 0 669#define RT5645_M_SV_R_SPM_R_SFT 0
670 670
671/* SPOMIX Ratio Control (0x4a) */
672#define RT5645_SPK_G_CLSD_MASK (0x7 << 0)
673#define RT5645_SPK_G_CLSD_SFT 0
674
671/* Mono Output Mixer Control (0x4c) */ 675/* Mono Output Mixer Control (0x4c) */
672#define RT5645_M_OV_L_MM (0x1 << 9) 676#define RT5645_M_OV_L_MM (0x1 << 9)
673#define RT5645_M_OV_L_MM_SFT 9 677#define RT5645_M_OV_L_MM_SFT 9