From patchwork Mon Dec 15 02:11:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yakir Yang X-Patchwork-Id: 5499081 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4DA1BEEA8 for ; Tue, 16 Dec 2014 01:08:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 244CF209C9 for ; Tue, 16 Dec 2014 01:08:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 23FE6209C7 for ; Tue, 16 Dec 2014 01:08:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7B126E649; Mon, 15 Dec 2014 17:08:35 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.99.132]) by gabe.freedesktop.org (Postfix) with ESMTP id A18106E12F for ; Sun, 14 Dec 2014 18:20:04 -0800 (PST) Received: from ykk?rock-chips.com (unknown [192.168.167.153]) by regular1.263xmail.com (Postfix) with SMTP id F2CAF7B99; Mon, 15 Dec 2014 10:12:09 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id DC44B24760; Mon, 15 Dec 2014 10:12:01 +0800 (CST) X-RL-SENDER: ykk@rock-chips.com X-SENDER-IP: 104.167.231.7 X-LOGIN-NAME: ykk@rock-chips.com X-UNIQUE-TAG: <65b79f4a1650223acd81a9183a899539> X-ATTACHMENT-NUM: 0 X-SENDER: ykk@rock-chips.com X-DNS-TYPE: 0 Received: from unknown (unknown [104.167.231.7]) by smtp.263.net (Postfix) whith SMTP id 6366UK5639; Mon, 15 Dec 2014 10:12:04 +0800 (CST) From: Yakir Yang To: Yakir Yang Subject: [PATCH 2/6] drm: bridge/bridge: add support for rk3288 hdmi-audio Date: Mon, 15 Dec 2014 10:11:30 +0800 Message-Id: <1418609494-15820-3-git-send-email-ykk@rock-chips.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1418609494-15820-1-git-send-email-ykk@rock-chips.com> References: <1418609494-15820-1-git-send-email-ykk@rock-chips.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 15 Dec 2014 17:08:29 -0800 Cc: Fabio Estevam , Oder Chiou , Brian Austin , Zubair.Kakakhel@imgtec.com, Greg Kroah-Hartman , Xu Jianqun , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Max Filippov , Bard Liao , Russell King , =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Dylan Reid , Sonny Rao , Heiko Stuebner X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In rk3288 dw-hdmi, AUD_CTS3 register's BIT(4) is CTS_manual. If "CTS_manual" set to 0b, AUD_CTS3 contains “audCTS[19:0]” generated by the Cycle time counter according to specified timing. If “CTS_manual” bit equals 1b, AUD_CTS3 should be configured with the “audCTS[7:0]” value that should be outputted by the Audio Packetizer. Signed-off-by: Yakir Yang --- drivers/gpu/drm/bridge/dw_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c index 9ba96de..0c19276 100644 --- a/drivers/gpu/drm/bridge/dw_hdmi.c +++ b/drivers/gpu/drm/bridge/dw_hdmi.c @@ -191,8 +191,10 @@ static void hdmi_set_clock_regenerator_n(struct dw_hdmi *hdmi, static void hdmi_regenerate_cts(struct dw_hdmi *hdmi, unsigned int cts) { + int val = (hdmi->dev_type == RK3288_HDMI) ? 0x10 : 0x00; + /* Must be set/cleared first */ - hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3); + hdmi_modb(hdmi, val, HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3); hdmi_writeb(hdmi, cts & 0xff, HDMI_AUD_CTS1); hdmi_writeb(hdmi, (cts >> 8) & 0xff, HDMI_AUD_CTS2);