byt: hsw: ssp: move spinlock init to earlier stage

Moves spinlock initialization for byt and hsw platforms
to earlier stage. Otherwise the output will be undefined,
since we are using the spinlock before initializing it
in platform_init sequence.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2019-08-05 10:36:08 +02:00 committed by Tomasz Lauda
parent 9a6616a89b
commit 2ee7a24f97
4 changed files with 12 additions and 4 deletions

View File

@ -608,8 +608,6 @@ static int ssp_probe(struct dai *dai)
sizeof(*ssp)); sizeof(*ssp));
dai_set_drvdata(dai, ssp); dai_set_drvdata(dai, ssp);
spinlock_init(&dai->lock);
ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_READY; ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_READY;
ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_READY; ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_READY;

View File

@ -517,8 +517,6 @@ static int ssp_probe(struct dai *dai)
sizeof(*ssp)); sizeof(*ssp));
dai_set_drvdata(dai, ssp); dai_set_drvdata(dai, ssp);
spinlock_init(&dai->lock);
ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_READY; ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_READY;
ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_READY; ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_READY;

View File

@ -125,6 +125,12 @@ static struct dai_type_info dti[] = {
int dai_init(void) int dai_init(void)
{ {
int i;
/* initialize spin locks early to enable ref counting */
for (i = 0; i < ARRAY_SIZE(ssp); i++)
spinlock_init(&ssp[i].lock);
dai_install(dti, ARRAY_SIZE(dti)); dai_install(dti, ARRAY_SIZE(dti));
return 0; return 0;
} }

View File

@ -57,6 +57,12 @@ static struct dai_type_info dti[] = {
int dai_init(void) int dai_init(void)
{ {
int i;
/* initialize spin locks early to enable ref counting */
for (i = 0; i < ARRAY_SIZE(ssp); i++)
spinlock_init(&ssp[i].lock);
dai_install(dti, ARRAY_SIZE(dti)); dai_install(dti, ARRAY_SIZE(dti));
return 0; return 0;
} }