Skip to content

Commit 6088b7b

Browse files
authored
Merge pull request #140 from xiulipan/daiindex
dai index alignment
2 parents c65d733 + e68b10f commit 6088b7b

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/audio/dai.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static struct comp_dev *dai_new(struct sof_ipc_comp *comp)
195195

196196
comp_set_drvdata(dev, dd);
197197

198-
dd->dai = dai_get(dai->type, dai->index);
198+
dd->dai = dai_get(dai->type, dai->dai_index);
199199
if (dd->dai == NULL) {
200200
trace_dai_error("eDg");
201201
goto error;

src/audio/pipeline_static.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
{.comp = scomp, .no_irq = hno_irq, \
9090
.dmac_config = hconfig}
9191
#define SPIPE_DAI(scomp, ddai_type, ddai_idx, ddmac, dchan, dconfig) \
92-
{.comp = scomp, .type = ddai_type, .index = ddai_idx, \
92+
{.comp = scomp, .type = ddai_type, .dai_index = ddai_idx, \
9393
.dmac_config = dconfig}
9494
#define SPIPE_VOL(scomp, vmin, vmax) \
9595
{.comp = scomp, .min_value = vmin, .max_value = vmax}

src/drivers/apl-ssp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,8 @@ static inline int ssp_set_config(struct dai *dai,
619619
/* TODO: move this into M/N driver */
620620
mn_reg_write(0x0, mdivc);
621621
mn_reg_write(0x80 + config->ssp.mclk_id * 0x4, mdivr);
622-
mn_reg_write(0x100 + config->id * 0x8 + 0x0, i2s_m);
623-
mn_reg_write(0x100 + config->id * 0x8 + 0x4, i2s_n);
622+
mn_reg_write(0x100 + config->dai_index * 0x8 + 0x0, i2s_m);
623+
mn_reg_write(0x100 + config->dai_index * 0x8 + 0x4, i2s_n);
624624

625625
ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_PREPARE;
626626
ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_PREPARE;

src/include/uapi/ipc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ struct sof_ipc_dai_dmic_params {
340340
struct sof_ipc_dai_config {
341341
struct sof_ipc_hdr hdr;
342342
enum sof_ipc_dai_type type;
343-
uint32_t id; /* physical number if more than 1 of this type */
343+
uint32_t dai_index; /* index of this type dai */
344344

345345
/* physical protocol and clocking */
346346
uint16_t format; /* SOF_DAI_FMT_ */
@@ -665,7 +665,7 @@ struct sof_ipc_comp_dai {
665665
struct sof_ipc_comp comp;
666666
struct sof_ipc_comp_config config;
667667
enum sof_ipc_stream_direction direction;
668-
uint32_t index;
668+
uint32_t dai_index; /* index of this type dai */
669669
enum sof_ipc_dai_type type;
670670
uint32_t dmac_config; /* DMA engine specific */
671671
} __attribute__((packed));

src/ipc/handler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ static int ipc_dai_config(uint32_t header)
489489
trace_ipc("DsF");
490490

491491
/* get DAI */
492-
dai = dai_get(config->type, config->id);
492+
dai = dai_get(config->type, config->dai_index);
493493
if (dai == NULL) {
494494
trace_ipc_error("eDi");
495495
trace_error_value(config->type);
496-
trace_error_value(config->id);
496+
trace_error_value(config->dai_index);
497497
return -ENODEV;
498498
}
499499

0 commit comments

Comments
 (0)