From e68b10ffd6e358aa57b97691f403ced69530ee5c Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Mon, 23 Jul 2018 16:49:51 +0800 Subject: [PATCH] ipc: make dai index name unified dai_get function only need type and index, make index filed unified to dai_index to avoid misleading in sof_ipc_dai_config and sof_ipc_dai_config. Signed-off-by: Pan Xiuli --- src/audio/dai.c | 2 +- src/audio/pipeline_static.c | 2 +- src/drivers/apl-ssp.c | 4 ++-- src/include/uapi/ipc.h | 4 ++-- src/ipc/handler.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index afe7ed82be7d..bfe21416576a 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -191,7 +191,7 @@ static struct comp_dev *dai_new(struct sof_ipc_comp *comp) comp_set_drvdata(dev, dd); - dd->dai = dai_get(dai->type, dai->index); + dd->dai = dai_get(dai->type, dai->dai_index); if (dd->dai == NULL) { trace_dai_error("eDg"); goto error; diff --git a/src/audio/pipeline_static.c b/src/audio/pipeline_static.c index f13a4c5c68c2..5af542061dd8 100644 --- a/src/audio/pipeline_static.c +++ b/src/audio/pipeline_static.c @@ -89,7 +89,7 @@ {.comp = scomp, .no_irq = hno_irq, \ .dmac_config = hconfig} #define SPIPE_DAI(scomp, ddai_type, ddai_idx, ddmac, dchan, dconfig) \ - {.comp = scomp, .type = ddai_type, .index = ddai_idx, \ + {.comp = scomp, .type = ddai_type, .dai_index = ddai_idx, \ .dmac_config = dconfig} #define SPIPE_VOL(scomp, vmin, vmax) \ {.comp = scomp, .min_value = vmin, .max_value = vmax} diff --git a/src/drivers/apl-ssp.c b/src/drivers/apl-ssp.c index fd5905c2a9fe..923dc3279c06 100644 --- a/src/drivers/apl-ssp.c +++ b/src/drivers/apl-ssp.c @@ -619,8 +619,8 @@ static inline int ssp_set_config(struct dai *dai, /* TODO: move this into M/N driver */ mn_reg_write(0x0, mdivc); mn_reg_write(0x80 + config->ssp.mclk_id * 0x4, mdivr); - mn_reg_write(0x100 + config->id * 0x8 + 0x0, i2s_m); - mn_reg_write(0x100 + config->id * 0x8 + 0x4, i2s_n); + mn_reg_write(0x100 + config->dai_index * 0x8 + 0x0, i2s_m); + mn_reg_write(0x100 + config->dai_index * 0x8 + 0x4, i2s_n); ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_PREPARE; ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_PREPARE; diff --git a/src/include/uapi/ipc.h b/src/include/uapi/ipc.h index a5f46490a94a..6cf993e191b1 100644 --- a/src/include/uapi/ipc.h +++ b/src/include/uapi/ipc.h @@ -340,7 +340,7 @@ struct sof_ipc_dai_dmic_params { struct sof_ipc_dai_config { struct sof_ipc_hdr hdr; enum sof_ipc_dai_type type; - uint32_t id; /* physical number if more than 1 of this type */ + uint32_t dai_index; /* index of this type dai */ /* physical protocol and clocking */ uint16_t format; /* SOF_DAI_FMT_ */ @@ -665,7 +665,7 @@ struct sof_ipc_comp_dai { struct sof_ipc_comp comp; struct sof_ipc_comp_config config; enum sof_ipc_stream_direction direction; - uint32_t index; + uint32_t dai_index; /* index of this type dai */ enum sof_ipc_dai_type type; uint32_t dmac_config; /* DMA engine specific */ } __attribute__((packed)); diff --git a/src/ipc/handler.c b/src/ipc/handler.c index 6f32ab3092ba..9e0401dfdeb1 100644 --- a/src/ipc/handler.c +++ b/src/ipc/handler.c @@ -489,11 +489,11 @@ static int ipc_dai_config(uint32_t header) trace_ipc("DsF"); /* get DAI */ - dai = dai_get(config->type, config->id); + dai = dai_get(config->type, config->dai_index); if (dai == NULL) { trace_ipc_error("eDi"); trace_error_value(config->type); - trace_error_value(config->id); + trace_error_value(config->dai_index); return -ENODEV; }