Skip to content

Commit 16faf8c

Browse files
committed
ASoC: mt8365: Fix -Werror builds
Merge series from Mark Brown <broonie@kernel.org>: Nathan reported that the newly added mt8365 drivers were causing a number of warnings which break -Werror builds, these were only visible on arm64 since the drivers did not have COMPILE_TEST enabled. Fix this and some other minor stuff I noticed while doing so.
2 parents 43fbb2c + 36fa259 commit 16faf8c

8 files changed

Lines changed: 120 additions & 153 deletions

File tree

sound/soc/mediatek/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ config SND_SOC_MT8195_MT6359
301301

302302
config SND_SOC_MT8365
303303
tristate "ASoC support for MediaTek MT8365 chip"
304-
depends on ARCH_MEDIATEK
304+
depends on ARCH_MEDIATEK || COMPILE_TEST
305305
select SND_SOC_MEDIATEK
306306
help
307307
This adds ASoC platform driver support for MediaTek MT8365 chip

sound/soc/mediatek/mt8365/mt8365-afe-clk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ int mt8365_afe_disable_afe_on(struct mtk_base_afe *afe)
295295
return 0;
296296
}
297297

298-
int mt8365_afe_hd_engen_enable(struct mtk_base_afe *afe, bool apll1)
298+
static int mt8365_afe_hd_engen_enable(struct mtk_base_afe *afe, bool apll1)
299299
{
300300
if (apll1)
301301
regmap_update_bits(afe->regmap, AFE_HD_ENGEN_ENABLE,
@@ -307,7 +307,7 @@ int mt8365_afe_hd_engen_enable(struct mtk_base_afe *afe, bool apll1)
307307
return 0;
308308
}
309309

310-
int mt8365_afe_hd_engen_disable(struct mtk_base_afe *afe, bool apll1)
310+
static int mt8365_afe_hd_engen_disable(struct mtk_base_afe *afe, bool apll1)
311311
{
312312
if (apll1)
313313
regmap_update_bits(afe->regmap, AFE_HD_ENGEN_ENABLE,

sound/soc/mediatek/mt8365/mt8365-afe-common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ static inline u32 AutoRstThLo(unsigned int fs)
421421
}
422422
}
423423

424-
bool mt8365_afe_clk_group_48k(int sample_rate);
425424
bool mt8365_afe_rate_supported(unsigned int rate, unsigned int id);
426425
bool mt8365_afe_channel_supported(unsigned int channel, unsigned int id);
427426

sound/soc/mediatek/mt8365/mt8365-afe-pcm.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ bool mt8365_afe_channel_supported(unsigned int channel, unsigned int id)
170170
return false;
171171
}
172172

173-
bool mt8365_afe_clk_group_44k(int sample_rate)
173+
static bool mt8365_afe_clk_group_44k(int sample_rate)
174174
{
175175
if (sample_rate == 11025 ||
176176
sample_rate == 22050 ||
@@ -182,7 +182,7 @@ bool mt8365_afe_clk_group_44k(int sample_rate)
182182
return false;
183183
}
184184

185-
bool mt8365_afe_clk_group_48k(int sample_rate)
185+
static bool mt8365_afe_clk_group_48k(int sample_rate)
186186
{
187187
return (!mt8365_afe_clk_group_44k(sample_rate));
188188
}
@@ -496,8 +496,8 @@ static int mt8365_afe_configure_cm(struct mtk_base_afe *afe,
496496
return 0;
497497
}
498498

499-
int mt8365_afe_fe_startup(struct snd_pcm_substream *substream,
500-
struct snd_soc_dai *dai)
499+
static int mt8365_afe_fe_startup(struct snd_pcm_substream *substream,
500+
struct snd_soc_dai *dai)
501501
{
502502
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
503503
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
@@ -651,7 +651,6 @@ static int mt8365_afe_fe_hw_free(struct snd_pcm_substream *substream,
651651
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
652652
struct mt8365_afe_private *afe_priv = afe->platform_priv;
653653
int dai_id = snd_soc_rtd_to_cpu(rtd, 0)->id;
654-
struct mtk_base_afe_memif *memif = &afe->memif[dai_id];
655654
struct mt8365_fe_dai_data *fe_data = &afe_priv->fe_data[dai_id];
656655
int ret = 0;
657656

@@ -714,8 +713,8 @@ static int mt8365_afe_fe_prepare(struct snd_pcm_substream *substream,
714713
return 0;
715714
}
716715

717-
int mt8365_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd,
718-
struct snd_soc_dai *dai)
716+
static int mt8365_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd,
717+
struct snd_soc_dai *dai)
719718
{
720719
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
721720
struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);

sound/soc/mediatek/mt8365/mt8365-dai-dmic.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -108,36 +108,6 @@ static void mt8365_dai_disable_dmic(struct mtk_base_afe *afe,
108108
regmap_update_bits(afe->regmap, reg, mask, 0);
109109
}
110110

111-
static const struct reg_sequence mt8365_dmic_iir_coeff[] = {
112-
{ AFE_DMIC0_IIR_COEF_02_01, 0x00000000 },
113-
{ AFE_DMIC0_IIR_COEF_04_03, 0x00003FB8 },
114-
{ AFE_DMIC0_IIR_COEF_06_05, 0x3FB80000 },
115-
{ AFE_DMIC0_IIR_COEF_08_07, 0x3FB80000 },
116-
{ AFE_DMIC0_IIR_COEF_10_09, 0x0000C048 },
117-
{ AFE_DMIC1_IIR_COEF_02_01, 0x00000000 },
118-
{ AFE_DMIC1_IIR_COEF_04_03, 0x00003FB8 },
119-
{ AFE_DMIC1_IIR_COEF_06_05, 0x3FB80000 },
120-
{ AFE_DMIC1_IIR_COEF_08_07, 0x3FB80000 },
121-
{ AFE_DMIC1_IIR_COEF_10_09, 0x0000C048 },
122-
{ AFE_DMIC2_IIR_COEF_02_01, 0x00000000 },
123-
{ AFE_DMIC2_IIR_COEF_04_03, 0x00003FB8 },
124-
{ AFE_DMIC2_IIR_COEF_06_05, 0x3FB80000 },
125-
{ AFE_DMIC2_IIR_COEF_08_07, 0x3FB80000 },
126-
{ AFE_DMIC2_IIR_COEF_10_09, 0x0000C048 },
127-
{ AFE_DMIC3_IIR_COEF_02_01, 0x00000000 },
128-
{ AFE_DMIC3_IIR_COEF_04_03, 0x00003FB8 },
129-
{ AFE_DMIC3_IIR_COEF_06_05, 0x3FB80000 },
130-
{ AFE_DMIC3_IIR_COEF_08_07, 0x3FB80000 },
131-
{ AFE_DMIC3_IIR_COEF_10_09, 0x0000C048 },
132-
};
133-
134-
static int mt8365_dai_load_dmic_iir_coeff_table(struct mtk_base_afe *afe)
135-
{
136-
return regmap_multi_reg_write(afe->regmap,
137-
mt8365_dmic_iir_coeff,
138-
ARRAY_SIZE(mt8365_dmic_iir_coeff));
139-
}
140-
141111
static int mt8365_dai_configure_dmic(struct mtk_base_afe *afe,
142112
struct snd_pcm_substream *substream,
143113
struct snd_soc_dai *dai)

sound/soc/mediatek/mt8365/mt8365-dai-i2s.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,15 @@ static int mt8365_afe_set_2nd_i2s_asrc(struct mtk_base_afe *afe,
385385
/* disable IIR coeff SRAM access */
386386
regmap_update_bits(afe->regmap, AFE_ASRC_2CH_CON0,
387387
COEFF_SRAM_CTRL,
388-
(unsigned long)~COEFF_SRAM_CTRL);
388+
~COEFF_SRAM_CTRL);
389389
regmap_update_bits(afe->regmap, AFE_ASRC_2CH_CON2,
390390
CLR_IIR_HISTORY | IIR_EN | IIR_STAGE_MASK,
391391
CLR_IIR_HISTORY | IIR_EN |
392392
FIELD_PREP(IIR_STAGE_MASK, iir_stage));
393393
} else {
394394
/* disable IIR */
395395
regmap_update_bits(afe->regmap, AFE_ASRC_2CH_CON2,
396-
IIR_EN, (unsigned long)~IIR_EN);
396+
IIR_EN, ~IIR_EN);
397397
}
398398

399399
/* CON3 setting (RX OFS) */
@@ -456,7 +456,7 @@ static int mt8365_afe_set_2nd_i2s_asrc_enable(struct mtk_base_afe *afe,
456456
ASM_ON, ASM_ON);
457457
else
458458
regmap_update_bits(afe->regmap, AFE_ASRC_2CH_CON0,
459-
ASM_ON, (unsigned long)~ASM_ON);
459+
ASM_ON, ~ASM_ON);
460460
return 0;
461461
}
462462

sound/soc/mediatek/mt8365/mt8365-mt6357.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,8 @@ static int mt8365_mt6357_dev_probe(struct mtk_soc_card_data *soc_card_data, bool
290290
struct mtk_platform_card_data *card_data = soc_card_data->card_data;
291291
struct snd_soc_card *card = card_data->card;
292292
struct device *dev = card->dev;
293-
struct device_node *platform_node;
294293
struct mt8365_mt6357_priv *mach_priv;
295-
int i, ret;
294+
int ret;
296295

297296
card->dev = dev;
298297
ret = parse_dai_link_info(card);

0 commit comments

Comments
 (0)