Skip to content

Commit 6769df9

Browse files
committed
hack: hack 98373 for feedback data validation
change max98373 to 32 bit and hack 98373 to Feedback to slots: I0->slot0, V0->slot1, I1->slot2, V1->slot3. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
1 parent 10b7674 commit 6769df9

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

drivers/base/regmap/regmap-debugfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
289289
}
290290

291291
#undef REGMAP_ALLOW_WRITE_DEBUGFS
292+
293+
#define REGMAP_ALLOW_WRITE_DEBUGFS
294+
292295
#ifdef REGMAP_ALLOW_WRITE_DEBUGFS
293296
/*
294297
* This can be dangerous especially when we have clients such as

sound/soc/codecs/max98373.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ static int max98373_set_clock(struct snd_soc_component *component,
204204
return 0;
205205
}
206206

207+
#define MAX_98373_CODEC_DAI "max98373-aif1"
208+
#define MAX_98373_DEV0_NAME "i2c-MX98373:00"
209+
#define MAX_98373_DEV1_NAME "i2c-MX98373:01"
210+
207211
static int max98373_dai_hw_params(struct snd_pcm_substream *substream,
208212
struct snd_pcm_hw_params *params,
209213
struct snd_soc_dai *dai)
@@ -213,6 +217,36 @@ static int max98373_dai_hw_params(struct snd_pcm_substream *substream,
213217
unsigned int sampling_rate = 0;
214218
unsigned int chan_sz = 0;
215219

220+
if (!strcmp(dai->component->name, MAX_98373_DEV0_NAME)) {
221+
/* voltage(1), current(0) slot configuration */
222+
regmap_write(max98373->regmap,
223+
MAX98373_R2022_PCM_TX_SRC_1,
224+
(0x0 << MAX98373_PCM_TX_CH_SRC_A_I_SHIFT |
225+
0x1) & 0xFF);
226+
regmap_update_bits(max98373->regmap,
227+
MAX98373_R2020_PCM_TX_HIZ_EN_1,
228+
0x3, 0);
229+
230+
/* speaker feedback slot configuration */
231+
regmap_write(max98373->regmap,
232+
MAX98373_R2023_PCM_TX_SRC_2,
233+
0x10);
234+
} else if (!strcmp(dai->component->name, MAX_98373_DEV1_NAME)) {
235+
/* voltage(3), current(2) slot configuration */
236+
regmap_write(max98373->regmap,
237+
MAX98373_R2022_PCM_TX_SRC_1,
238+
(0x2 << MAX98373_PCM_TX_CH_SRC_A_I_SHIFT |
239+
0x3) & 0xFF);
240+
regmap_update_bits(max98373->regmap,
241+
MAX98373_R2020_PCM_TX_HIZ_EN_1,
242+
0xc, 0);
243+
244+
/* speaker feedback slot configuration */
245+
regmap_write(max98373->regmap,
246+
MAX98373_R2023_PCM_TX_SRC_2,
247+
0x20);
248+
}
249+
216250
/* pcm mode configuration */
217251
switch (snd_pcm_format_width(params_format(params))) {
218252
case 16:

sound/soc/intel/boards/sof_maxim_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ static int max98373_hw_params(struct snd_pcm_substream *substream,
4747
for_each_rtd_codec_dais(rtd, j, codec_dai) {
4848
if (!strcmp(codec_dai->component->name, MAX_98373_DEV0_NAME)) {
4949
/* DEV0 tdm slot configuration */
50-
snd_soc_dai_set_tdm_slot(codec_dai, 0x30, 3, 8, 16);
50+
snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x1, 8, 32);
5151
}
5252
if (!strcmp(codec_dai->component->name, MAX_98373_DEV1_NAME)) {
5353
/* DEV1 tdm slot configuration */
54-
snd_soc_dai_set_tdm_slot(codec_dai, 0xC0, 3, 8, 16);
54+
snd_soc_dai_set_tdm_slot(codec_dai, 0xC, 0x2, 8, 32);
5555
}
5656
}
5757
return 0;

0 commit comments

Comments
 (0)