From patchwork Tue May 22 08:53:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: huang lin X-Patchwork-Id: 10417645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25F5B60224 for ; Tue, 22 May 2018 08:54:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1518D28B72 for ; Tue, 22 May 2018 08:54:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09D0828B79; Tue, 22 May 2018 08:54:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B168328B72 for ; Tue, 22 May 2018 08:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=W/CG2LAosuQRCa00GfOneSEEGYKN4ETlKB35HfaUPao=; b=kC+hWyfPu8Y/zMpn8m/A5veqpc ETkDN5y5P1xdjMVdu4MiD/obuRErwf+7RXgJo9lNjDLtacAao3G6uml18M//SdnKUY+LUN5REtV5G 8WsR9tT6VvPxEhaMLS64a7L1sZDq9lAuWNaWnLdnuwkf66gC1xKVRF3/6hKn2vgoY4kcIPL56mfu0 gjSHDQrUa0JR/fmdaKG6KT0FcadQyC6FMuNI2XuAud+zKwm6vn/XtsUz0l4BA/L2Dylo2FN9X3iyW ltVOngKYvvtyuDwcRsicXf8Jx77rcRwsxGqXKoidZbtN9Ij/NNwdgI3UORyg2LA04byckTWj7Ae/E 9RJvD+BQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fL33m-0006vt-8a; Tue, 22 May 2018 08:54:22 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fL33c-0006qi-VY; Tue, 22 May 2018 08:54:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zu2dYFIp9/1VbiTWzklgKe9ujTv0BV4Rz6x3SSgQEu0=; b=DrMA/HDBkR/eilmYp/g4cFrl4 1H/BRSJC9E56ZtgHaDWUWJh0gJa6OyUI9uhznMBFgTsY4lQ0N8R4e//WlXxUK9ia+k8SPgjNreE9y 2cCjJzkV9oVjPxFG4In94EP1Iuugy7ysUfwWaI8gYx4ViADIj4qwdeBrvH7101BPFDUKZUOPgraNO 7tngwCEIEcMXS8w+9mLNlGXlvAbOJ2+cmVXym3QIuXu2j+72e0YuVmf8n7j7keoKCWufuYfxmQy6U 9JpAjPt2JG+9cY1TLbzW0sqLOTH06+aYmT0xWMkoFv1wwWKkrJo7nTIbHQISAnJMN5nUnxJi0D3b1 DS8MhNFEA==; Received: from mail-pl0-f67.google.com ([209.85.160.67]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fL33Z-0003da-Kz; Tue, 22 May 2018 08:54:10 +0000 Received: by mail-pl0-f67.google.com with SMTP id az12-v6so10490155plb.8; Tue, 22 May 2018 01:53:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zu2dYFIp9/1VbiTWzklgKe9ujTv0BV4Rz6x3SSgQEu0=; b=aXMfT2i7oZcx4pZ7AimPEMq1Puak+XTNr1O5nfMizC+hhJnOxAO+HBI/JFZM3RBL+o 2j2HFLZPF0fpYX5f4yoLVHk5kLuxdEKTNgZX+x2LhpZ3+k+ZPu1EB1d5DKll/vxZMWFC p36BabtWmR7v/0nX8BlXJ1+Gsy67rdfZtW8F8w6+lgYPFtk+Sd+yUDgXe6BVC6uh9Usu F3Nk3L//3F64vyxnEBhXSg7uXPYMfNeFA3NpGzTL23YIx4W2ZNNJ0Qx01vwi/pp/Zylp Dp0lr87D0P2e63SQJ4wDrwKCDtwEGXUMfZsZp9INyF9nODWqZh27+DPwBSTAKpKyqQja koDw== X-Gm-Message-State: ALKqPwduJ2htMRs0+jWhRUYlyYWgY0pDz/YbGc9WhRgl8zB5YHbxUeDW dNkSvELKH7SdfEk7KJXJw3o= X-Google-Smtp-Source: AB8JxZpLL/Ao+O7KVOSqi1G+1D7dEO6cYJNCBVcESs1AF6rAVnzckG3lkoh/pS9ICCzw+8KaVwNi1g== X-Received: by 2002:a17:902:b681:: with SMTP id c1-v6mr23754235pls.286.1526979235288; Tue, 22 May 2018 01:53:55 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id q19-v6sm12054105pgv.78.2018.05.22.01.53.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 01:53:54 -0700 (PDT) From: Lin Huang To: seanpaul@chromium.org, airlied@linux.ie, zyw@rock-chips.com, dgreid@chromium.org, broonie@kernel.org Subject: [PATCH 2/2] ASoC: rockchip: cdn-dp sound output use spdif Date: Tue, 22 May 2018 16:53:42 +0800 Message-Id: <1526979222-32478-2-git-send-email-hl@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526979222-32478-1-git-send-email-hl@rock-chips.com> References: <1526979222-32478-1-git-send-email-hl@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180522_045409_695890_63AC5544 X-CRM114-Status: GOOD ( 16.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jeffy.chen@rock-chips.com, heiko@sntech.de, briannorris@chromium.org, dianders@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, daniel.vetter@intel.com, linux-arm-kernel@lists.infradead.org, Lin Huang MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP some monitors care about the parity bit in the sub-frame of I2S, but the cdn-dp always set this bit to "1", so these monitors do not have sound output if use i2s, use spdif can fix this issue. Signed-off-by: Chris Zhong Signed-off-by: Lin Huang --- sound/soc/rockchip/rk3399_gru_sound.c | 46 +---------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c index 9a10181..f184168 100644 --- a/sound/soc/rockchip/rk3399_gru_sound.c +++ b/sound/soc/rockchip/rk3399_gru_sound.c @@ -220,45 +220,6 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) return 0; } -static int rockchip_sound_cdndp_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - struct snd_soc_dai *codec_dai = rtd->codec_dai; - int mclk, ret; - - /* in bypass mode, the mclk has to be one of the frequencies below */ - switch (params_rate(params)) { - case 8000: - case 16000: - case 24000: - case 32000: - case 48000: - case 64000: - case 96000: - mclk = 12288000; - break; - case 11025: - case 22050: - case 44100: - case 88200: - mclk = 11289600; - break; - default: - return -EINVAL; - } - - ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk, - SND_SOC_CLOCK_OUT); - if (ret < 0) { - dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret); - return ret; - } - - return 0; -} - static int rockchip_sound_dmic_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { @@ -293,10 +254,6 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = { .hw_params = rockchip_sound_da7219_hw_params, }; -static const struct snd_soc_ops rockchip_sound_cdndp_ops = { - .hw_params = rockchip_sound_cdndp_hw_params, -}; - static const struct snd_soc_ops rockchip_sound_dmic_ops = { .hw_params = rockchip_sound_dmic_hw_params, }; @@ -323,8 +280,7 @@ static const struct snd_soc_dai_link rockchip_dais[] = { [DAILINK_CDNDP] = { .name = "DP", .stream_name = "DP PCM", - .codec_dai_name = "i2s-hifi", - .ops = &rockchip_sound_cdndp_ops, + .codec_dai_name = "spdif-hifi", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, },