Skip to content

Commit 065807d

Browse files
committed
Merge tag 'asoc-fix-v5.16-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.16 This is a relatively large set of driver specific changes so it may make sense to hold off to v5.17, though picking some over might be good. It's a combination of new device IDs and fixes for various driver specific things which are all small and of the usual "really bad if you're running into them" level, especially the Tegra ones.
2 parents f7ac570 + ee907af commit 065807d

8 files changed

Lines changed: 46 additions & 36 deletions

File tree

sound/soc/codecs/rt5682.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
929929
unsigned int val, count;
930930

931931
if (jack_insert) {
932+
snd_soc_dapm_mutex_lock(dapm);
933+
932934
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
933935
RT5682_PWR_VREF2 | RT5682_PWR_MB,
934936
RT5682_PWR_VREF2 | RT5682_PWR_MB);
@@ -979,6 +981,8 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
979981
snd_soc_component_update_bits(component, RT5682_MICBIAS_2,
980982
RT5682_PWR_CLK25M_MASK | RT5682_PWR_CLK1M_MASK,
981983
RT5682_PWR_CLK25M_PU | RT5682_PWR_CLK1M_PU);
984+
985+
snd_soc_dapm_mutex_unlock(dapm);
982986
} else {
983987
rt5682_enable_push_button_irq(component, false);
984988
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,

sound/soc/codecs/tas2770.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ static int tas2770_set_samplerate(struct tas2770_priv *tas2770, int samplerate)
291291
ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_44_1KHZ |
292292
TAS2770_TDM_CFG_REG0_31_88_2_96KHZ;
293293
break;
294-
case 19200:
294+
case 192000:
295295
ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_48KHZ |
296296
TAS2770_TDM_CFG_REG0_31_176_4_192KHZ;
297297
break;
298-
case 17640:
298+
case 176400:
299299
ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_44_1KHZ |
300300
TAS2770_TDM_CFG_REG0_31_176_4_192KHZ;
301301
break;

sound/soc/meson/aiu-encoder-i2s.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#define AIU_RST_SOFT_I2S_FAST BIT(0)
1919

2020
#define AIU_I2S_DAC_CFG_MSB_FIRST BIT(2)
21-
#define AIU_I2S_MISC_HOLD_EN BIT(2)
2221
#define AIU_CLK_CTRL_I2S_DIV_EN BIT(0)
2322
#define AIU_CLK_CTRL_I2S_DIV GENMASK(3, 2)
2423
#define AIU_CLK_CTRL_AOCLK_INVERT BIT(6)
@@ -36,37 +35,6 @@ static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component,
3635
enable ? AIU_CLK_CTRL_I2S_DIV_EN : 0);
3736
}
3837

39-
static void aiu_encoder_i2s_hold(struct snd_soc_component *component,
40-
bool enable)
41-
{
42-
snd_soc_component_update_bits(component, AIU_I2S_MISC,
43-
AIU_I2S_MISC_HOLD_EN,
44-
enable ? AIU_I2S_MISC_HOLD_EN : 0);
45-
}
46-
47-
static int aiu_encoder_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
48-
struct snd_soc_dai *dai)
49-
{
50-
struct snd_soc_component *component = dai->component;
51-
52-
switch (cmd) {
53-
case SNDRV_PCM_TRIGGER_START:
54-
case SNDRV_PCM_TRIGGER_RESUME:
55-
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
56-
aiu_encoder_i2s_hold(component, false);
57-
return 0;
58-
59-
case SNDRV_PCM_TRIGGER_STOP:
60-
case SNDRV_PCM_TRIGGER_SUSPEND:
61-
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
62-
aiu_encoder_i2s_hold(component, true);
63-
return 0;
64-
65-
default:
66-
return -EINVAL;
67-
}
68-
}
69-
7038
static int aiu_encoder_i2s_setup_desc(struct snd_soc_component *component,
7139
struct snd_pcm_hw_params *params)
7240
{
@@ -353,7 +321,6 @@ static void aiu_encoder_i2s_shutdown(struct snd_pcm_substream *substream,
353321
}
354322

355323
const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
356-
.trigger = aiu_encoder_i2s_trigger,
357324
.hw_params = aiu_encoder_i2s_hw_params,
358325
.hw_free = aiu_encoder_i2s_hw_free,
359326
.set_fmt = aiu_encoder_i2s_set_fmt,

sound/soc/meson/aiu-fifo-i2s.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#define AIU_MEM_I2S_CONTROL_MODE_16BIT BIT(6)
2121
#define AIU_MEM_I2S_BUF_CNTL_INIT BIT(0)
2222
#define AIU_RST_SOFT_I2S_FAST BIT(0)
23+
#define AIU_I2S_MISC_HOLD_EN BIT(2)
24+
#define AIU_I2S_MISC_FORCE_LEFT_RIGHT BIT(4)
2325

2426
#define AIU_FIFO_I2S_BLOCK 256
2527

@@ -90,6 +92,10 @@ static int aiu_fifo_i2s_hw_params(struct snd_pcm_substream *substream,
9092
unsigned int val;
9193
int ret;
9294

95+
snd_soc_component_update_bits(component, AIU_I2S_MISC,
96+
AIU_I2S_MISC_HOLD_EN,
97+
AIU_I2S_MISC_HOLD_EN);
98+
9399
ret = aiu_fifo_hw_params(substream, params, dai);
94100
if (ret)
95101
return ret;
@@ -117,6 +123,19 @@ static int aiu_fifo_i2s_hw_params(struct snd_pcm_substream *substream,
117123
snd_soc_component_update_bits(component, AIU_MEM_I2S_MASKS,
118124
AIU_MEM_I2S_MASKS_IRQ_BLOCK, val);
119125

126+
/*
127+
* Most (all?) supported SoCs have this bit set by default. The vendor
128+
* driver however sets it manually (depending on the version either
129+
* while un-setting AIU_I2S_MISC_HOLD_EN or right before that). Follow
130+
* the same approach for consistency with the vendor driver.
131+
*/
132+
snd_soc_component_update_bits(component, AIU_I2S_MISC,
133+
AIU_I2S_MISC_FORCE_LEFT_RIGHT,
134+
AIU_I2S_MISC_FORCE_LEFT_RIGHT);
135+
136+
snd_soc_component_update_bits(component, AIU_I2S_MISC,
137+
AIU_I2S_MISC_HOLD_EN, 0);
138+
120139
return 0;
121140
}
122141

sound/soc/meson/aiu-fifo.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <linux/bitfield.h>
77
#include <linux/clk.h>
8+
#include <linux/dma-mapping.h>
89
#include <sound/pcm_params.h>
910
#include <sound/soc.h>
1011
#include <sound/soc-dai.h>
@@ -179,6 +180,11 @@ int aiu_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd,
179180
struct snd_card *card = rtd->card->snd_card;
180181
struct aiu_fifo *fifo = dai->playback_dma_data;
181182
size_t size = fifo->pcm->buffer_bytes_max;
183+
int ret;
184+
185+
ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
186+
if (ret)
187+
return ret;
182188

183189
snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV,
184190
card->dev, size, size);

sound/soc/sof/intel/pci-tgl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ static const struct pci_device_id sof_pci_ids[] = {
112112
.driver_data = (unsigned long)&adls_desc},
113113
{ PCI_DEVICE(0x8086, 0x51c8), /* ADL-P */
114114
.driver_data = (unsigned long)&adl_desc},
115+
{ PCI_DEVICE(0x8086, 0x51cd), /* ADL-P */
116+
.driver_data = (unsigned long)&adl_desc},
115117
{ PCI_DEVICE(0x8086, 0x51cc), /* ADL-M */
116118
.driver_data = (unsigned long)&adl_desc},
119+
{ PCI_DEVICE(0x8086, 0x54c8), /* ADL-N */
120+
.driver_data = (unsigned long)&adl_desc},
117121
{ 0, }
118122
};
119123
MODULE_DEVICE_TABLE(pci, sof_pci_ids);

sound/soc/tegra/tegra_asoc_machine.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,24 @@ static const struct snd_kcontrol_new tegra_machine_controls[] = {
116116
SOC_DAPM_PIN_SWITCH("Headset Mic"),
117117
SOC_DAPM_PIN_SWITCH("Internal Mic 1"),
118118
SOC_DAPM_PIN_SWITCH("Internal Mic 2"),
119+
SOC_DAPM_PIN_SWITCH("Headphones"),
120+
SOC_DAPM_PIN_SWITCH("Mic Jack"),
119121
};
120122

121123
int tegra_asoc_machine_init(struct snd_soc_pcm_runtime *rtd)
122124
{
123125
struct snd_soc_card *card = rtd->card;
124126
struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
127+
const char *jack_name;
125128
int err;
126129

127130
if (machine->gpiod_hp_det && machine->asoc->add_hp_jack) {
128-
err = snd_soc_card_jack_new(card, "Headphones Jack",
131+
if (machine->asoc->hp_jack_name)
132+
jack_name = machine->asoc->hp_jack_name;
133+
else
134+
jack_name = "Headphones Jack";
135+
136+
err = snd_soc_card_jack_new(card, jack_name,
129137
SND_JACK_HEADPHONE,
130138
&tegra_machine_hp_jack,
131139
tegra_machine_hp_jack_pins,
@@ -658,6 +666,7 @@ static struct snd_soc_card snd_soc_tegra_max98090 = {
658666
static const struct tegra_asoc_data tegra_max98090_data = {
659667
.mclk_rate = tegra_machine_mclk_rate_12mhz,
660668
.card = &snd_soc_tegra_max98090,
669+
.hp_jack_name = "Headphones",
661670
.add_common_dapm_widgets = true,
662671
.add_common_controls = true,
663672
.add_common_snd_ops = true,

sound/soc/tegra/tegra_asoc_machine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ struct snd_soc_pcm_runtime;
1414
struct tegra_asoc_data {
1515
unsigned int (*mclk_rate)(unsigned int srate);
1616
const char *codec_dev_name;
17+
const char *hp_jack_name;
1718
struct snd_soc_card *card;
1819
unsigned int mclk_id;
1920
bool hp_jack_gpio_active_low;

0 commit comments

Comments
 (0)