Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp262320pxx; Wed, 28 Oct 2020 04:25:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwte+6CUg3TD5zD7pK2U6vTy7gihz7R8VzI64zuPHfHjZrHZ/4XX2rwKQPayHzWUu3yVsOr X-Received: by 2002:a17:906:34c3:: with SMTP id h3mr7016460ejb.132.1603884316110; Wed, 28 Oct 2020 04:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884316; cv=none; d=google.com; s=arc-20160816; b=FytHHSofIIv7LD+WLRlW2ORBAJW13dVzpotFEwbPFZ+lLpD/F6/rzFy1UgjdmWbxWM qqFyap6iH9a1qBR+m+GhYKFi6R0YHTLxLgPS9GD+dQDHwvbe+Q22+elBG78k2flldlA5 jHvWpMSkT7WvKcSbVLdi7bAZeJY2ql/G7h7HO2laxnbZXj8NV2CvzKGOWi354JGfDsza cshVdZGaHZ2qpyQUeCiICe/I/qLYj5SRS1mqXYc2NSfMMfhC8geDGMWk7EUw3dYDkNMh KkWDIfV5iLytSH5M/j0XUckEBH+aFM4tz4fmp4MpMA/5AKxOrH8Dqab5/wBj/HzRT6QU 605w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g0l4T7sYvirGlwi0wZlxUdT4/OB5YEkrPT2eQ+MvFxQ=; b=iNB9rlsDh9Kc5p6rOj5/whRZ5YUGVL63sDqwBrqAFA5tlFSgbgU6UY8fq0JXUHDYWy 6zZhqIMZAUG+HVQb1yS/g7tjeK7DbEEbPqbfHkVO0rnehG2tY23HEUfRBamwOhVfJjCA CEdv/yl/R0VUkl9U6+7g4ZCIWcUXUbNDdGjOPs/i9rVR2a16e5NTns+VMqi6fkDd89am oG/Aayb0aniBCIZySIuO8DYbebpdAPy1IbJf/WiQGJrgptLb3b4PnzMFsFosJZSY8IiQ VaptD/dY9i1NRoZAvK77pYfMKWdhG5/ldARYwKe1n8sAJ9KyqDQ15Q2y3AcFitolz42X Azhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aGOgbd2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk22si2709939edb.258.2020.10.28.04.24.54; Wed, 28 Oct 2020 04:25:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aGOgbd2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1789832AbgJ0PDK (ORCPT + 99 others); Tue, 27 Oct 2020 11:03:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:33580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788023AbgJ0PAV (ORCPT ); Tue, 27 Oct 2020 11:00:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3565720714; Tue, 27 Oct 2020 15:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810820; bh=1WrJIwMGMhxOJA3JGXDpPGq1547qOfA/6vWBxXExNK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aGOgbd2Yw376QHuczHf9UJ2E/w3h/hxGGQxGAOdbZPH+7XRRddkNHAP891OBnoli+ X4cjmRzbYLKOmvstI+/g4btbUpRwb6IlVJcJNP25XJgZwbtvAxhm1psNCWQZFNJ9cC LPTy2Z1R2WEf+cXG1NQONC+mlCxNTA+eO+qpYIAk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.8 273/633] ASoC: fsl_sai: Instantiate snd_soc_dai_driver Date: Tue, 27 Oct 2020 14:50:16 +0100 Message-Id: <20201027135535.473649373@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shengjiu Wang [ Upstream commit 22a16145af824f91014d07f8664114859900b9e6 ] Instantiate snd_soc_dai_driver for independent symmetric control. Otherwise the symmetric setting may be overwritten by other instance. Fixes: 08fdf65e37d5 ("ASoC: fsl_sai: Add asynchronous mode support") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1600424760-32071-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_sai.c | 19 +++++++++++-------- sound/soc/fsl/fsl_sai.h | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 7031869a023a1..211e29a73a41a 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -694,7 +694,7 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) return 0; } -static struct snd_soc_dai_driver fsl_sai_dai = { +static struct snd_soc_dai_driver fsl_sai_dai_template = { .probe = fsl_sai_dai_probe, .playback = { .stream_name = "CPU-Playback", @@ -966,12 +966,15 @@ static int fsl_sai_probe(struct platform_device *pdev) return ret; } + memcpy(&sai->cpu_dai_drv, &fsl_sai_dai_template, + sizeof(fsl_sai_dai_template)); + /* Sync Tx with Rx as default by following old DT binding */ sai->synchronous[RX] = true; sai->synchronous[TX] = false; - fsl_sai_dai.symmetric_rates = 1; - fsl_sai_dai.symmetric_channels = 1; - fsl_sai_dai.symmetric_samplebits = 1; + sai->cpu_dai_drv.symmetric_rates = 1; + sai->cpu_dai_drv.symmetric_channels = 1; + sai->cpu_dai_drv.symmetric_samplebits = 1; if (of_find_property(np, "fsl,sai-synchronous-rx", NULL) && of_find_property(np, "fsl,sai-asynchronous", NULL)) { @@ -988,9 +991,9 @@ static int fsl_sai_probe(struct platform_device *pdev) /* Discard all settings for asynchronous mode */ sai->synchronous[RX] = false; sai->synchronous[TX] = false; - fsl_sai_dai.symmetric_rates = 0; - fsl_sai_dai.symmetric_channels = 0; - fsl_sai_dai.symmetric_samplebits = 0; + sai->cpu_dai_drv.symmetric_rates = 0; + sai->cpu_dai_drv.symmetric_channels = 0; + sai->cpu_dai_drv.symmetric_samplebits = 0; } if (of_find_property(np, "fsl,sai-mclk-direction-output", NULL) && @@ -1019,7 +1022,7 @@ static int fsl_sai_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component, - &fsl_sai_dai, 1); + &sai->cpu_dai_drv, 1); if (ret) goto err_pm_disable; diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index 6aba7d28f5f34..677ecfc1ec68f 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -180,6 +180,7 @@ struct fsl_sai { unsigned int bclk_ratio; const struct fsl_sai_soc_data *soc_data; + struct snd_soc_dai_driver cpu_dai_drv; struct snd_dmaengine_dai_dma_data dma_params_rx; struct snd_dmaengine_dai_dma_data dma_params_tx; }; -- 2.25.1