Skip to content

Commit 2338055

Browse files
author
Marcin Maka
committed
dai: hda: array size and initialization based on platform settings
Defined correct hda dai quantities for cavs plaforms. Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
1 parent 1d6643e commit 2338055

5 files changed

Lines changed: 46 additions & 68 deletions

File tree

  • src/platform
    • apollolake/include/platform
    • cannonlake/include/platform
    • icelake/include/platform
    • intel/cavs
    • suecreek/include/platform

src/platform/apollolake/include/platform/dai.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#ifndef __PLATFORM_DAI_H__
3232
#define __PLATFORM_DAI_H__
3333

34+
/* APOLLOLAKE */
35+
3436
/* SSP */
3537

3638
/*
@@ -45,6 +47,14 @@
4547
/** \brief Number of 'extended' SSP ports available */
4648
#define DAI_NUM_SSP_EXT 2
4749

50+
/* HD/A */
51+
52+
/** \brief Number of HD/A Link Outputs */
53+
#define DAI_NUM_HDA_OUT 6
54+
55+
/** \brief Number of HD/A Link Inputs */
56+
#define DAI_NUM_HDA_IN 7
57+
4858
int dai_init(void);
4959

5060
#endif

src/platform/cannonlake/include/platform/dai.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#ifndef __PLATFORM_DAI_H__
3232
#define __PLATFORM_DAI_H__
3333

34+
/* CANNONLAKE */
35+
3436
/* SSP */
3537

3638
/*
@@ -45,6 +47,14 @@
4547
/** \brief Number of 'extended' SSP ports available */
4648
#define DAI_NUM_SSP_EXT 0
4749

50+
/* HD/A */
51+
52+
/** \brief Number of HD/A Link Outputs */
53+
#define DAI_NUM_HDA_OUT 9
54+
55+
/** \brief Number of HD/A Link Inputs */
56+
#define DAI_NUM_HDA_IN 7
57+
4858
int dai_init(void);
4959

5060
#endif

src/platform/icelake/include/platform/dai.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#ifndef __PLATFORM_DAI_H__
3232
#define __PLATFORM_DAI_H__
3333

34+
/* ICELAKE */
35+
3436
/* SSP */
3537

3638
/*
@@ -45,6 +47,14 @@
4547
/** \brief Number of 'extended' SSP ports available */
4648
#define DAI_NUM_SSP_EXT 0
4749

50+
/* HD/A */
51+
52+
/** \brief Number of HD/A Link Outputs */
53+
#define DAI_NUM_HDA_OUT 9
54+
55+
/** \brief Number of HD/A Link Inputs */
56+
#define DAI_NUM_HDA_IN 7
57+
4858
int dai_init(void);
4959

5060
#endif

src/platform/intel/cavs/dai.c

Lines changed: 8 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -205,74 +205,7 @@ static struct dai dmic[2] = {
205205

206206
#endif
207207

208-
/* TODO: numbers to be defined and shared with HD/A dmas */
209-
static struct dai hda[(6 + 7)] = {
210-
{
211-
.type = SOF_DAI_INTEL_HDA,
212-
.index = 0,
213-
.ops = &hda_ops
214-
},
215-
{
216-
.type = SOF_DAI_INTEL_HDA,
217-
.index = 1,
218-
.ops = &hda_ops
219-
},
220-
{
221-
.type = SOF_DAI_INTEL_HDA,
222-
.index = 2,
223-
.ops = &hda_ops
224-
},
225-
{
226-
.type = SOF_DAI_INTEL_HDA,
227-
.index = 3,
228-
.ops = &hda_ops
229-
},
230-
{
231-
.type = SOF_DAI_INTEL_HDA,
232-
.index = 4,
233-
.ops = &hda_ops
234-
},
235-
{
236-
.type = SOF_DAI_INTEL_HDA,
237-
.index = 5,
238-
.ops = &hda_ops
239-
},
240-
{
241-
.type = SOF_DAI_INTEL_HDA,
242-
.index = 6,
243-
.ops = &hda_ops
244-
},
245-
{
246-
.type = SOF_DAI_INTEL_HDA,
247-
.index = 7,
248-
.ops = &hda_ops
249-
},
250-
{
251-
.type = SOF_DAI_INTEL_HDA,
252-
.index = 8,
253-
.ops = &hda_ops
254-
},
255-
{
256-
.type = SOF_DAI_INTEL_HDA,
257-
.index = 9,
258-
.ops = &hda_ops
259-
},
260-
{
261-
.type = SOF_DAI_INTEL_HDA,
262-
.index = 10,
263-
.ops = &hda_ops
264-
},
265-
{
266-
.type = SOF_DAI_INTEL_HDA,
267-
.index = 11,
268-
.ops = &hda_ops
269-
},
270-
{
271-
.type = SOF_DAI_INTEL_HDA,
272-
.index = 12,
273-
.ops = &hda_ops
274-
}
275-
};
208+
static struct dai hda[(DAI_NUM_HDA_OUT + DAI_NUM_HDA_IN)];
276209

277210
static struct dai_type_info dti[] = {
278211
{
@@ -298,6 +231,13 @@ int dai_init(void)
298231
{
299232
int i;
300233

234+
/* init hd/a, note that size depends on the platform caps */
235+
for (i = 0; i < ARRAY_SIZE(hda); i++) {
236+
hda[i].type = SOF_DAI_INTEL_HDA;
237+
hda[i].index = i;
238+
hda[i].ops = &hda_ops;
239+
}
240+
301241
/* init SSP ports */
302242
trace_point(TRACE_BOOT_PLATFORM_SSP);
303243
for (i = 0; i < DAI_NUM_SSP_BASE + DAI_NUM_SSP_EXT; i++)

src/platform/suecreek/include/platform/dai.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#ifndef __PLATFORM_DAI_H__
3232
#define __PLATFORM_DAI_H__
3333

34+
/* SUECREEK */
35+
3436
/* SSP */
3537

3638
/*
@@ -45,6 +47,12 @@
4547
/** \brief Number of 'extended' SSP ports available */
4648
#define DAI_NUM_SSP_EXT 0
4749

50+
/** \brief Number of HD/A Link Outputs */
51+
#define DAI_NUM_HDA_OUT 9
52+
53+
/** \brief Number of HD/A Link Inputs */
54+
#define DAI_NUM_HDA_IN 7
55+
4856
int dai_init(void);
4957

5058
#endif

0 commit comments

Comments
 (0)