From patchwork Fri Feb 23 12:17:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katsuhiro Suzuki X-Patchwork-Id: 129360 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp535495lja; Fri, 23 Feb 2018 04:17:07 -0800 (PST) X-Google-Smtp-Source: AH8x224ks6yBf5xmZWsq4HTScYxg9RoVULIwuSYp3ioVb/MimDnJdRi7TTKd1ZSNSnjjlltFBX41 X-Received: by 2002:a17:902:b7c2:: with SMTP id v2-v6mr1516826plz.351.1519388227390; Fri, 23 Feb 2018 04:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519388227; cv=none; d=google.com; s=arc-20160816; b=ikC9NPrFNMKzi2eNvmyd3RzafJ7WlcXJ1i8NTUoA/sUm2RTglS6xyZ/lRLubekj0R1 xwZWYC/irc+ZAg+aHHWAWLqu8H+QQkk5hTxnr2sY2ZiccP6zRuXPNTCkrdugSzzHlq6v Nr6NkD1pLUTEwkpPMF5fay+HaaNbx4MO4JjzsZ9CD2nJAR90Z73RfJNb+9dgvxqOWzCH XNB2WDq3huOZ5/NUyNajxl21tguQw1UcwttQWLHGPHaKEAjFdFEDxNcLYmxxt7MfwJZx KGxCbXM1uvS2ncn1Mk3FHdXCT++63xPH9aADUzTpkO5+c4N+4F8b3SrGS6D4tJ62TGn2 KoHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yXwWZNa88NROvkQ4OM3ua/4Y3U5S5CS68Ds57/Uce9o=; b=E7bBi9y3nXFfIp/sGpGDM8F3+0r4ssDK3+9lQ7WJ3S7tcf7WUZRjhNiV9fI4JrXSqB U8MQwt2P/6PyD9auJMvtw1ocaDWnsYdP+AE0h4Pxc2sjxVjZ++tQXT/F2/MxBN43zvwa ARYLe8Qp6txGebst1DfiSg17q8ybVoGQtvxogL9kEwUgMWlBtpgyiUI3kq81/df2NMpT pbzYmxhoF84G6JNp3AaeloT82TXAlIV+/7vftqdwIcZLKX4LwV4bc0BKea0zO4KFvn95 UQRYyy2eaqJbqqFXsoI3DshS5JQAmMUAWWRBVmDdNhYk/xu1workOxguiQS6isc9R4aO 31OQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si1457636pgt.590.2018.02.23.04.17.07; Fri, 23 Feb 2018 04:17:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751455AbeBWMRE (ORCPT + 28 others); Fri, 23 Feb 2018 07:17:04 -0500 Received: from mx.socionext.com ([202.248.49.38]:47445 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbeBWMRD (ORCPT ); Fri, 23 Feb 2018 07:17:03 -0500 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 23 Feb 2018 21:17:02 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 2D8526006F; Fri, 23 Feb 2018 21:17:02 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Fri, 23 Feb 2018 21:17:31 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id EABE74032A; Fri, 23 Feb 2018 21:17:01 +0900 (JST) Received: from aegis.e01.socionext.com (unknown [10.213.134.210]) by yuzu.css.socionext.com (Postfix) with ESMTP id C735112042A; Fri, 23 Feb 2018 21:17:01 +0900 (JST) From: Katsuhiro Suzuki To: Mark Brown , alsa-devel@alsa-project.org Cc: Masami Hiramatsu , Jassi Brar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Katsuhiro Suzuki Subject: [PATCH] ASoC: uniphier: fix broken sound if use SRC in replay Date: Fri, 23 Feb 2018 21:17:01 +0900 Message-Id: <20180223121701.13372-1-suzuki.katsuhiro@socionext.com> X-Mailer: git-send-email 2.16.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes settings for ports with SRC. These ports need to set the fixed audio rate and clock. If not, the SRC outputs broken sound. Signed-off-by: Katsuhiro Suzuki --- sound/soc/uniphier/aio-core.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) -- 2.16.1 diff --git a/sound/soc/uniphier/aio-core.c b/sound/soc/uniphier/aio-core.c index 1e5f053d9f6b..1711361fc0c2 100644 --- a/sound/soc/uniphier/aio-core.c +++ b/sound/soc/uniphier/aio-core.c @@ -501,7 +501,7 @@ int aio_port_set_clk(struct uniphier_aio_sub *sub) OPORTMXCTR2_MSSEL_MASTER | OPORTMXCTR2_EXTLSIFSSEL_36 | OPORTMXCTR2_DACCKSEL_1_2; - } else { + } else if (sub->swm->type == PORT_TYPE_SPDIF) { if (sub->aio->pll_out >= ARRAY_SIZE(v_pll)) { dev_err(dev, "PLL(%d) is invalid\n", sub->aio->pll_out); @@ -521,6 +521,11 @@ int aio_port_set_clk(struct uniphier_aio_sub *sub) v |= OPORTMXCTR2_EXTLSIFSSEL_24; break; } + } else { + v = OPORTMXCTR2_ACLKSEL_A1 | + OPORTMXCTR2_MSSEL_MASTER | + OPORTMXCTR2_EXTLSIFSSEL_36 | + OPORTMXCTR2_DACCKSEL_1_2; } regmap_write(r, OPORTMXCTR2(sub->swm->oport.map), v); } else { @@ -550,11 +555,19 @@ int aio_port_set_param(struct uniphier_aio_sub *sub, int pass_through, const struct snd_pcm_hw_params *params) { struct regmap *r = sub->aio->chip->regmap; + unsigned int rate; u32 v; int ret; if (!pass_through) { - ret = aio_port_set_rate(sub, params_rate(params)); + if (sub->swm->type == PORT_TYPE_EVE || + sub->swm->type == PORT_TYPE_CONV) { + rate = 48000; + } else { + rate = params_rate(params); + } + + ret = aio_port_set_rate(sub, rate); if (ret) return ret;