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: 10420441 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 782CB6016C for ; Wed, 23 May 2018 07:16:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6184528E76 for ; Wed, 23 May 2018 07:16:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5491728E8D; Wed, 23 May 2018 07:16:46 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B186E28E76 for ; Wed, 23 May 2018 07:16:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A77789D4D; Wed, 23 May 2018 07:16:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDAF489E5F for ; Tue, 22 May 2018 08:53:55 +0000 (UTC) Received: by mail-pl0-f65.google.com with SMTP id c41-v6so10483470plj.10 for ; Tue, 22 May 2018 01:53:55 -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=RZZoCKbdf2/O+//rTNVLlk1Z9GasNj5KlLMtDkl1J5lt2bqM0pmiKoiiycrtVVI5pM vXynPMsdvuIc/Ij//Glvbqt9xlsoygrRxDJxlF9hL0RG+0oZYKoXKs4VkOep/EPT5Lam UqCU9swUzpQQ8djuX3QzN3BTLMe4AE8LerrbpENg4DqK9o9tk0s7Ty8UK7QE2K8d+hMX 3oyO5tZxIQATcCBhztr2S1rFkiWIGbU1yte8BRyz/O9WXNZJ4DhPzmJiBKu806nAIm0Y rQln6mco2vOOL1uGi3Ijgm5Rmb+aFXei09YVrxUQLpks9dppIRykD6w8nTlAttY/sZob ZSGA== X-Gm-Message-State: ALKqPwdZY6mksP1MU+HRTroo4LUPJPKSHNTTh8sNrLzNUjhrc0IdoBHI PY8WeHPkomOnETQQULE4I1o= 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-Mailman-Approved-At: Wed, 23 May 2018 07:16:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jeffy.chen@rock-chips.com, 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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, },