Skip to content

Commit be1a63d

Browse files
committed
Merge existing fixes from asoc/for-5.19 into new branch
2 parents f2906aa + 0755199 commit be1a63d

File tree

9 files changed

+62
-20
lines changed

9 files changed

+62
-20
lines changed

sound/soc/codecs/cs35l36.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ static bool cs35l36_volatile_reg(struct device *dev, unsigned int reg)
444444
}
445445
}
446446

447-
static DECLARE_TLV_DB_SCALE(dig_vol_tlv, -10200, 25, 0);
447+
static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 912,
448+
TLV_DB_MINMAX_ITEM(-10200, 1200));
448449
static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);
449450

450451
static const char * const cs35l36_pcm_sftramp_text[] = {

sound/soc/codecs/cs42l51.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = {
143143
0, 0xA0, 96, adc_att_tlv),
144144
SOC_DOUBLE_R_SX_TLV("PGA Volume",
145145
CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,
146-
0, 0x1A, 30, pga_tlv),
146+
0, 0x19, 30, pga_tlv),
147147
SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0),
148148
SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
149149
SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),

sound/soc/codecs/cs42l52.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ static DECLARE_TLV_DB_SCALE(mic_tlv, 1600, 100, 0);
137137

138138
static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);
139139

140-
static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0);
140+
static DECLARE_TLV_DB_SCALE(pass_tlv, -6000, 50, 0);
141+
142+
static DECLARE_TLV_DB_SCALE(mix_tlv, -5150, 50, 0);
141143

142144
static DECLARE_TLV_DB_SCALE(beep_tlv, -56, 200, 0);
143145

@@ -351,7 +353,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
351353
CS42L52_SPKB_VOL, 0, 0x40, 0xC0, hl_tlv),
352354

353355
SOC_DOUBLE_R_SX_TLV("Bypass Volume", CS42L52_PASSTHRUA_VOL,
354-
CS42L52_PASSTHRUB_VOL, 0, 0x88, 0x90, pga_tlv),
356+
CS42L52_PASSTHRUB_VOL, 0, 0x88, 0x90, pass_tlv),
355357

356358
SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0),
357359

@@ -364,7 +366,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
364366
CS42L52_ADCB_VOL, 0, 0xA0, 0x78, ipd_tlv),
365367
SOC_DOUBLE_R_SX_TLV("ADC Mixer Volume",
366368
CS42L52_ADCA_MIXER_VOL, CS42L52_ADCB_MIXER_VOL,
367-
0, 0x19, 0x7F, ipd_tlv),
369+
0, 0x19, 0x7F, mix_tlv),
368370

369371
SOC_DOUBLE("ADC Switch", CS42L52_ADC_MISC_CTL, 0, 1, 1, 0),
370372

sound/soc/codecs/cs42l56.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,9 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = {
391391
SOC_DOUBLE("ADC Boost Switch", CS42L56_GAIN_BIAS_CTL, 3, 2, 1, 1),
392392

393393
SOC_DOUBLE_R_SX_TLV("Headphone Volume", CS42L56_HPA_VOLUME,
394-
CS42L56_HPB_VOLUME, 0, 0x84, 0x48, hl_tlv),
394+
CS42L56_HPB_VOLUME, 0, 0x44, 0x48, hl_tlv),
395395
SOC_DOUBLE_R_SX_TLV("LineOut Volume", CS42L56_LOA_VOLUME,
396-
CS42L56_LOB_VOLUME, 0, 0x84, 0x48, hl_tlv),
396+
CS42L56_LOB_VOLUME, 0, 0x44, 0x48, hl_tlv),
397397

398398
SOC_SINGLE_TLV("Bass Shelving Volume", CS42L56_TONE_CTL,
399399
0, 0x00, 1, tone_tlv),

sound/soc/codecs/cs53l30.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,22 +348,22 @@ static const struct snd_kcontrol_new cs53l30_snd_controls[] = {
348348
SOC_ENUM("ADC2 NG Delay", adc2_ng_delay_enum),
349349

350350
SOC_SINGLE_SX_TLV("ADC1A PGA Volume",
351-
CS53L30_ADC1A_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
351+
CS53L30_ADC1A_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
352352
SOC_SINGLE_SX_TLV("ADC1B PGA Volume",
353-
CS53L30_ADC1B_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
353+
CS53L30_ADC1B_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
354354
SOC_SINGLE_SX_TLV("ADC2A PGA Volume",
355-
CS53L30_ADC2A_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
355+
CS53L30_ADC2A_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
356356
SOC_SINGLE_SX_TLV("ADC2B PGA Volume",
357-
CS53L30_ADC2B_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
357+
CS53L30_ADC2B_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
358358

359359
SOC_SINGLE_SX_TLV("ADC1A Digital Volume",
360-
CS53L30_ADC1A_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
360+
CS53L30_ADC1A_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
361361
SOC_SINGLE_SX_TLV("ADC1B Digital Volume",
362-
CS53L30_ADC1B_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
362+
CS53L30_ADC1B_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
363363
SOC_SINGLE_SX_TLV("ADC2A Digital Volume",
364-
CS53L30_ADC2A_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
364+
CS53L30_ADC2A_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
365365
SOC_SINGLE_SX_TLV("ADC2B Digital Volume",
366-
CS53L30_ADC2B_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
366+
CS53L30_ADC2B_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
367367
};
368368

369369
static const struct snd_soc_dapm_widget cs53l30_dapm_widgets[] = {

sound/soc/codecs/nau8822.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,8 @@ static int nau8822_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
740740
pll_param->pll_int, pll_param->pll_frac,
741741
pll_param->mclk_scaler, pll_param->pre_factor);
742742

743+
snd_soc_component_update_bits(component,
744+
NAU8822_REG_POWER_MANAGEMENT_1, NAU8822_PLL_EN_MASK, NAU8822_PLL_OFF);
743745
snd_soc_component_update_bits(component,
744746
NAU8822_REG_PLL_N, NAU8822_PLLMCLK_DIV2 | NAU8822_PLLN_MASK,
745747
(pll_param->pre_factor ? NAU8822_PLLMCLK_DIV2 : 0) |
@@ -757,6 +759,8 @@ static int nau8822_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
757759
pll_param->mclk_scaler << NAU8822_MCLKSEL_SFT);
758760
snd_soc_component_update_bits(component,
759761
NAU8822_REG_CLOCKING, NAU8822_CLKM_MASK, NAU8822_CLKM_PLL);
762+
snd_soc_component_update_bits(component,
763+
NAU8822_REG_POWER_MANAGEMENT_1, NAU8822_PLL_EN_MASK, NAU8822_PLL_ON);
760764

761765
return 0;
762766
}

sound/soc/codecs/nau8822.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@
9090
#define NAU8822_REFIMP_3K 0x3
9191
#define NAU8822_IOBUF_EN (0x1 << 2)
9292
#define NAU8822_ABIAS_EN (0x1 << 3)
93+
#define NAU8822_PLL_EN_MASK (0x1 << 5)
94+
#define NAU8822_PLL_ON (0x1 << 5)
95+
#define NAU8822_PLL_OFF (0x0 << 5)
9396

9497
/* NAU8822_REG_AUDIO_INTERFACE (0x4) */
9598
#define NAU8822_AIFMT_MASK (0x3 << 3)

sound/soc/intel/boards/sof_cirrus_common.c

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,29 @@ static struct snd_soc_dai_link_component cs35l41_components[] = {
5454
},
5555
};
5656

57+
/*
58+
* Mapping between ACPI instance id and speaker position.
59+
*
60+
* Four speakers:
61+
* 0: Tweeter left, 1: Woofer left
62+
* 2: Tweeter right, 3: Woofer right
63+
*/
5764
static struct snd_soc_codec_conf cs35l41_codec_conf[] = {
5865
{
5966
.dlc = COMP_CODEC_CONF(CS35L41_DEV0_NAME),
60-
.name_prefix = "WL",
67+
.name_prefix = "TL",
6168
},
6269
{
6370
.dlc = COMP_CODEC_CONF(CS35L41_DEV1_NAME),
64-
.name_prefix = "WR",
71+
.name_prefix = "WL",
6572
},
6673
{
6774
.dlc = COMP_CODEC_CONF(CS35L41_DEV2_NAME),
68-
.name_prefix = "TL",
75+
.name_prefix = "TR",
6976
},
7077
{
7178
.dlc = COMP_CODEC_CONF(CS35L41_DEV3_NAME),
72-
.name_prefix = "TR",
79+
.name_prefix = "WR",
7380
},
7481
};
7582

@@ -101,6 +108,21 @@ static int cs35l41_init(struct snd_soc_pcm_runtime *rtd)
101108
return ret;
102109
}
103110

111+
/*
112+
* Channel map:
113+
*
114+
* TL/WL: ASPRX1 on slot 0, ASPRX2 on slot 1 (default)
115+
* TR/WR: ASPRX1 on slot 1, ASPRX2 on slot 0
116+
*/
117+
static const struct {
118+
unsigned int rx[2];
119+
} cs35l41_channel_map[] = {
120+
{.rx = {0, 1}}, /* TL */
121+
{.rx = {0, 1}}, /* WL */
122+
{.rx = {1, 0}}, /* TR */
123+
{.rx = {1, 0}}, /* WR */
124+
};
125+
104126
static int cs35l41_hw_params(struct snd_pcm_substream *substream,
105127
struct snd_pcm_hw_params *params)
106128
{
@@ -134,6 +156,16 @@ static int cs35l41_hw_params(struct snd_pcm_substream *substream,
134156
ret);
135157
return ret;
136158
}
159+
160+
/* setup channel map */
161+
ret = snd_soc_dai_set_channel_map(codec_dai, 0, NULL,
162+
ARRAY_SIZE(cs35l41_channel_map[i].rx),
163+
(unsigned int *)cs35l41_channel_map[i].rx);
164+
if (ret < 0) {
165+
dev_err(codec_dai->dev, "fail to set channel map, ret %d\n",
166+
ret);
167+
return ret;
168+
}
137169
}
138170

139171
return 0;

sound/soc/qcom/lpass-platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ static int lpass_platform_cdc_dma_mmap(struct snd_pcm_substream *substream,
898898
struct snd_pcm_runtime *runtime = substream->runtime;
899899
unsigned long size, offset;
900900

901-
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
901+
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
902902
size = vma->vm_end - vma->vm_start;
903903
offset = vma->vm_pgoff << PAGE_SHIFT;
904904
return io_remap_pfn_range(vma, vma->vm_start,

0 commit comments

Comments
 (0)