summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt721-sdca.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/rt721-sdca.c')
-rw-r--r--sound/soc/codecs/rt721-sdca.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/sound/soc/codecs/rt721-sdca.c b/sound/soc/codecs/rt721-sdca.c
index 1c9f32e405cf..a4bd29d7220b 100644
--- a/sound/soc/codecs/rt721-sdca.c
+++ b/sound/soc/codecs/rt721-sdca.c
@@ -278,6 +278,8 @@ static void rt721_sdca_jack_preset(struct rt721_sdca_priv *rt721)
RT721_ENT_FLOAT_CTL1, 0x4040);
rt_sdca_index_write(rt721->mbq_regmap, RT721_HDA_SDCA_FLOAT,
RT721_ENT_FLOAT_CTL4, 0x1201);
+ rt_sdca_index_write(rt721->mbq_regmap, RT721_BOOST_CTRL,
+ RT721_BST_4CH_TOP_GATING_CTRL1, 0x002a);
regmap_write(rt721->regmap, 0x2f58, 0x07);
}
@@ -327,7 +329,6 @@ static int rt721_sdca_set_jack_detect(struct snd_soc_component *component,
rt721_sdca_jack_init(rt721);
- pm_runtime_mark_last_busy(component->dev);
pm_runtime_put_autosuspend(component->dev);
return 0;
@@ -430,6 +431,7 @@ static int rt721_sdca_set_gain_get(struct snd_kcontrol *kcontrol,
unsigned int read_l, read_r, ctl_l = 0, ctl_r = 0;
unsigned int adc_vol_flag = 0;
const unsigned int interval_offset = 0xc0;
+ const unsigned int tendA = 0x200;
const unsigned int tendB = 0xa00;
if (strstr(ucontrol->id.name, "FU1E Capture Volume") ||
@@ -439,9 +441,16 @@ static int rt721_sdca_set_gain_get(struct snd_kcontrol *kcontrol,
regmap_read(rt721->mbq_regmap, mc->reg, &read_l);
regmap_read(rt721->mbq_regmap, mc->rreg, &read_r);
- if (mc->shift == 8) /* boost gain */
+ if (mc->shift == 8) {
+ /* boost gain */
ctl_l = read_l / tendB;
- else {
+ } else if (mc->shift == 1) {
+ /* FU33 boost gain */
+ if (read_l == 0x8000 || read_l == 0xfe00)
+ ctl_l = 0;
+ else
+ ctl_l = read_l / tendA + 1;
+ } else {
if (adc_vol_flag)
ctl_l = mc->max - (((0x1e00 - read_l) & 0xffff) / interval_offset);
else
@@ -449,9 +458,16 @@ static int rt721_sdca_set_gain_get(struct snd_kcontrol *kcontrol,
}
if (read_l != read_r) {
- if (mc->shift == 8) /* boost gain */
+ if (mc->shift == 8) {
+ /* boost gain */
ctl_r = read_r / tendB;
- else { /* ADC/DAC gain */
+ } else if (mc->shift == 1) {
+ /* FU33 boost gain */
+ if (read_r == 0x8000 || read_r == 0xfe00)
+ ctl_r = 0;
+ else
+ ctl_r = read_r / tendA + 1;
+ } else { /* ADC/DAC gain */
if (adc_vol_flag)
ctl_r = mc->max - (((0x1e00 - read_r) & 0xffff) / interval_offset);
else
@@ -1533,7 +1549,6 @@ int rt721_sdca_io_init(struct device *dev, struct sdw_slave *slave)
/* Mark Slave initialization complete */
rt721->hw_init = true;
- pm_runtime_mark_last_busy(&slave->dev);
pm_runtime_put_autosuspend(&slave->dev);
dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);