Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4587577pja; Thu, 21 Nov 2019 22:22:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxI1f1mbEwvt7bFOHXIKNNMEuBuWHBz0mYlbwT2imtsVyUjZyHDvOe882s6xgmKHqYDs9xp X-Received: by 2002:a17:906:4d58:: with SMTP id b24mr19663501ejv.277.1574403746384; Thu, 21 Nov 2019 22:22:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574403746; cv=none; d=google.com; s=arc-20160816; b=dHv1b3A6DeFiLjN0J3CmJ5vPv7uuZGTgPW7EGTfHG0oOyq/rn2j6g/4AeyeFrcv2kY ac+1OL2hG4XhtwjAvJnZz//pLa+kolIZ7mF5asgwiKWDenMdAzV35eCtQ1Nn4pwiqPHh AeThpeqxin8gN/1sZK9d0xp8/Q0c65yU1IOoYQp5wAY8l2mKxa6z+23bvHEIglJLJUfi ND2viKfc6znKozE0oFHjVRR9QeAb0zt4Q6Kjv/7Ol4/wC825fPJGrsPw/D/s1WMU+nqI ggbC1WOl5A6qbFvPN9JRvyYAb21eP5mjyxzd+e5yjA6myrL28kwzuUg0mi5yYWy/bUkR UfkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zfSTuLF5ET/huKU3eQaeUC4PmviWLZfjAJ4okshhIg8=; b=tEBcPCNFdJhE64uS/iKIlYAKPJ1wIAge5dB0dzWjKnw1mLS3sQ/tlYpVAho6UvMxGH uUQqRMv5DQhIGKMtWpaY21L8OfpFJnEtuip8RDm4Cibj7BQLjO1nM4xAD9wS6Y5rfWpd cLeHLNKjKQkfJ7N8O39r30YJzhtkZaft0X/0SekL7AgKhWySxefRPkMTMUn2hveo/odv IltJtyHH5s8egcgGjab4ltO/Jfw6yRLuhWtLxOijD35tOpqxkjgHrFk1J3QkHrFIdf73 7xKA9rKCf8Zr2DQp2Q26r9WBtbewM4R7ijlGOZpYvYwMH0S/8KANBoo6gbg7SwR1dYPW XaSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PQKXNHRM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ov27si3593028ejb.197.2019.11.21.22.22.02; Thu, 21 Nov 2019 22:22:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PQKXNHRM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728165AbfKVGTz (ORCPT + 99 others); Fri, 22 Nov 2019 01:19:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:58704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbfKVFws (ORCPT ); Fri, 22 Nov 2019 00:52:48 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CE472071F; Fri, 22 Nov 2019 05:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401967; bh=geeeVQ63UDrNG1JfFxbc//qDRyzxsQyqhEbu7hEACLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PQKXNHRMhIHkF1a9Ioi7N1d1dFy1wHjAJUCvUFKj3HYCsUJgqJWOe+jSRGPZ7X6HT AsLUAmRy0GRzEQokhnN9klEkxAHfedpbMV5BrEHTFjZ39BKUgQS3hMjcwYoUP1mTAA wL1oY8qH/p/ZcQz4gPNKhkFngZs1ZxrJYqLWWzKw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sylwester Nawrocki , Krzysztof Kozlowski , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 4.19 188/219] ASoC: samsung: i2s: Fix prescaler setting for the secondary DAI Date: Fri, 22 Nov 2019 00:48:40 -0500 Message-Id: <20191122054911.1750-181-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sylwester Nawrocki [ Upstream commit 323fb7b947b265753de34703dbbf8acc8ea3a4de ] Make sure i2s->rclk_srcrate is properly initialized also during playback through the secondary DAI. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/samsung/i2s.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index ce00fe2f6aae3..d4bde4834ce5f 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -604,6 +604,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct i2s_dai *i2s = to_info(dai); + struct i2s_dai *other = get_other_dai(i2s); int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave; u32 mod, tmp = 0; unsigned long flags; @@ -661,7 +662,8 @@ static int i2s_set_fmt(struct snd_soc_dai *dai, * CLK_I2S_RCLK_SRC clock is not exposed so we ensure any * clock configuration assigned in DT is not overwritten. */ - if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL) + if (i2s->rclk_srcrate == 0 && i2s->clk_data.clks == NULL && + other->clk_data.clks == NULL) i2s_set_sysclk(dai, SAMSUNG_I2S_RCLKSRC_0, 0, SND_SOC_CLOCK_IN); break; @@ -699,6 +701,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { struct i2s_dai *i2s = to_info(dai); + struct i2s_dai *other = get_other_dai(i2s); u32 mod, mask = 0, val = 0; struct clk *rclksrc; unsigned long flags; @@ -784,6 +787,9 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, i2s->frmclk = params_rate(params); rclksrc = i2s->clk_table[CLK_I2S_RCLK_SRC]; + if (!rclksrc || IS_ERR(rclksrc)) + rclksrc = other->clk_table[CLK_I2S_RCLK_SRC]; + if (rclksrc && !IS_ERR(rclksrc)) i2s->rclk_srcrate = clk_get_rate(rclksrc); -- 2.20.1