Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5545623pxb; Wed, 26 Jan 2022 14:40:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwI2BABAvxn1ZCEQgfwKx53KeF34/54SichV5QB4luy9/ST9pKwI48Q5L6tVvJPBqkZGxae X-Received: by 2002:a17:906:b116:: with SMTP id u22mr676033ejy.427.1643236801610; Wed, 26 Jan 2022 14:40:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236801; cv=none; d=google.com; s=arc-20160816; b=ccTeLBc/wv747v+z7kRtyF2HU3ksW67S5wvtWbGsEexXMJS0Tw7+A+KqE7348ZETZ3 XikFymaoFTcsMQuJI03aSQ0N67msNKgrWfqjZs1jm+r6STXlx02q/X75Za6ThWK+Gxza w80U1IyRlFhf7MafitTRQ5C8PcMnUAiEw6OoOVnlfZkRD143v+8gsQFPx1+JXEXEYvzR dv/kZD+j7AY+XI3FjZddb1aFPC3Zgyvl5CHgJzeyxAnzdXCqA90mX3HKhhVM1eLdXLNq 8sa9os3niaRCQnNp5Ew7EqH/WE27drTuKKO6pOioYPEhI6Yohn5iCvx5aqe/SyU+TiMf pzNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jx0fEdivrdIheYkmyUPfrhwIwpeLJHBEwq8uDdSjGFg=; b=XK3VcBJiWxDM9tlkJPrPlZJBB0AJopzQ6Mu5Sh4zoh1sZyGljW04k3L0CnZxf6XhZO fXU9ICupImm2Bc5lWyTod1uL2QtbsMffsPF9RqbUJ8TeDS3N61qNU8ViP05+JMruzd0d o4egBrY9zSFkJzdOUlY1mYxzvqMkeL2QeRrPPLs786TRqoKrdl/HovN0VGPdsOA4WaRn bxX5r8uEPT3ClLlpIJ8MBF305me8PKm1fYPS0NSDd4Vdfef1lfxy0kG3o/MWW3LmzqsL LnJPNBtSIkbid3GGMAUWak05BRJl1CgRRS+3TNTztOq59Ot2xRRfyPxI7ibLb61PF1GK Vpdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nmmplP3D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si334713edd.402.2022.01.26.14.39.35; Wed, 26 Jan 2022 14:40:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nmmplP3D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbiAZUYv (ORCPT + 99 others); Wed, 26 Jan 2022 15:24:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbiAZUYu (ORCPT ); Wed, 26 Jan 2022 15:24:50 -0500 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CDEEC06161C for ; Wed, 26 Jan 2022 12:24:50 -0800 (PST) Received: by mail-qt1-x82b.google.com with SMTP id j12so443772qtr.2 for ; Wed, 26 Jan 2022 12:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jx0fEdivrdIheYkmyUPfrhwIwpeLJHBEwq8uDdSjGFg=; b=nmmplP3DBvZ0FwYQd0TzFsbhI5oKxxSkpNdZtEXTpy6RAUjjL1zKnr075WtAw3Mf7j /R2PePkGFB+qf0lOPWUFU5ZRK/DOlsQmvZKJRa2YjM2tjoL6ZUmUN7e0Xk0Cl4jub/1K 5dpsUF0FaBmHxtkNEaCMO6c2BcaQ/bhWTMKDRr/aXwzS1y7o6ctNg7n6y0VyGIimhqaS 336VUgUXwWjxDWvVlT1vCHurjqIAjzbRdio4W8HrRA72txkvsZCjnFOSD5HIdwHWdfyK VhdlJJufslYZGSXlyU22yI/tDnE6FP/ueYbrGB0wAsiLhTCkT3XUNQWMDR0fme37CW0Z +m5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jx0fEdivrdIheYkmyUPfrhwIwpeLJHBEwq8uDdSjGFg=; b=5NmhT4hJgPtQczDf3NU6Zwv27DV7otySjxJTZncuISEQ00WHcrlwwXQh2NQSCWwNTc VotT/bsc5bnsIXN9OJdSESmdzDkm4UIzbKus9jmI9UAXRTMbwigt080cPJJTjWMwtS8V MWA7VGBlFahC8h/ahGkGH0ZjmdyhkoYnr4kxau8YaM5kSSmHWbZRNegbP+x0xLhbYS6m 1Kei4nRlQQfMk+zNG0WQmyH6t5q3VRkKJM780zeyQOchZnB2S/Phu+rBcml4oMf8XWiO rydH3a4eH9gdHCdof4/dZDlzDVV5J45fHW6rW/uuF0bQGFgJyNa63c7J8tujQrtzn+Fz M9CQ== X-Gm-Message-State: AOAM532fyQnPPDu0eia+cYk38gdrTxtCsPZByzsnP4XaAscEXdtI0u9d VkmpagW8zqahJmhGwg3Fs9DDVvIPI0HM+g== X-Received: by 2002:ac8:74cc:: with SMTP id j12mr355803qtr.374.1643228689310; Wed, 26 Jan 2022 12:24:49 -0800 (PST) Received: from master-x64.sparksnet (c-98-233-193-225.hsd1.md.comcast.net. [98.233.193.225]) by smtp.gmail.com with ESMTPSA id a21sm155311qta.65.2022.01.26.12.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 12:24:49 -0800 (PST) From: Peter Geis To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Pierre-Hugues Husson , Archit Taneja Cc: Peter Geis , Sascha Hauer , Robin Murphy , linux-rockchip@lists.infradead.org, =?UTF-8?q?Heiko=20St=C3=BCbner?= , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate Date: Wed, 26 Jan 2022 15:24:26 -0500 Message-Id: <20220126202427.3047814-1-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The hdmi-cec clock must be 32khz in order for cec to work correctly. Ensure after enabling the clock we set it in order for the hardware to work as expected. Warn on failure, in case this is a static clock that is slighty off. Fixes hdmi-cec support on Rockchip devices. Fixes: ebe32c3e282a ("drm/bridge: synopsys/dw-hdmi: Enable cec clock") Signed-off-by: Peter Geis --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 54d8fdad395f..1a96da60e357 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -48,6 +48,9 @@ #define HDMI14_MAX_TMDSCLK 340000000 +/* HDMI CEC needs a clock rate of 32khz */ +#define HDMI_CEC_CLK_RATE 32768 + enum hdmi_datamap { RGB444_8B = 0x01, RGB444_10B = 0x03, @@ -3347,6 +3350,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, ret); goto err_iahb; } + + ret = clk_set_rate(hdmi->cec_clk, HDMI_CEC_CLK_RATE); + if (ret) + dev_warn(hdmi->dev, "Cannot set HDMI cec clock rate: %d\n", ret); } /* Product and revision IDs */ -- 2.25.1