From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63CD5C433F5 for ; Thu, 27 Jan 2022 09:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238645AbiA0Jdb (ORCPT ); Thu, 27 Jan 2022 04:33:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238644AbiA0JdZ (ORCPT ); Thu, 27 Jan 2022 04:33:25 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC594C061714 for ; Thu, 27 Jan 2022 01:33:24 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nD19U-0006rQ-9d; Thu, 27 Jan 2022 10:33:12 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1nD19P-0007xU-Bi; Thu, 27 Jan 2022 10:33:07 +0100 Date: Thu, 27 Jan 2022 10:33:07 +0100 From: Sascha Hauer To: Peter Geis Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Pierre-Hugues Husson , Archit Taneja , Robin Murphy , linux-rockchip@lists.infradead.org, Heiko =?iso-8859-15?Q?St=FCbner?= , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate Message-ID: <20220127093307.GJ23490@pengutronix.de> References: <20220126202427.3047814-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220126202427.3047814-1-pgwipeout@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:29:35 up 47 days, 18:15, 84 users, load average: 0.21, 0.33, 0.29 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Wed, Jan 26, 2022 at 03:24:26PM -0500, Peter Geis wrote: > 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. You removed this sentence in v2, but I just wanted to mention that clk_set_rate() won't fail when the desired clock rate can't be archieved. Instead, you will get the best rate that actually can be reached. If you want to check that you are happy with the rate you'll have to do a clk_round_rate() before setting the rate or a clk_get_rate() afterwards. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49953C433FE for ; Thu, 27 Jan 2022 09:33:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0919D10EFC6; Thu, 27 Jan 2022 09:33:23 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9821C10EF97 for ; Thu, 27 Jan 2022 09:33:21 +0000 (UTC) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nD19U-0006rQ-9d; Thu, 27 Jan 2022 10:33:12 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1nD19P-0007xU-Bi; Thu, 27 Jan 2022 10:33:07 +0100 Date: Thu, 27 Jan 2022 10:33:07 +0100 From: Sascha Hauer To: Peter Geis Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate Message-ID: <20220127093307.GJ23490@pengutronix.de> References: <20220126202427.3047814-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220126202427.3047814-1-pgwipeout@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:29:35 up 47 days, 18:15, 84 users, load average: 0.21, 0.33, 0.29 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Archit Taneja , Jonas Karlman , David Airlie , Robert Foss , dri-devel@lists.freedesktop.org, Neil Armstrong , linux-kernel@vger.kernel.org, Jernej Skrabec , linux-rockchip@lists.infradead.org, Laurent Pinchart , Andrzej Hajda , Pierre-Hugues Husson , Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Peter, On Wed, Jan 26, 2022 at 03:24:26PM -0500, Peter Geis wrote: > 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. You removed this sentence in v2, but I just wanted to mention that clk_set_rate() won't fail when the desired clock rate can't be archieved. Instead, you will get the best rate that actually can be reached. If you want to check that you are happy with the rate you'll have to do a clk_round_rate() before setting the rate or a clk_get_rate() afterwards. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8D7DC433F5 for ; Thu, 27 Jan 2022 09:52:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LF0UBl5KEPx/IbLTTORUkvs0dfgAss64aWYMDBqw+Xs=; b=0FMdb5os2ewjkB w4ZuTJ27B2kjU8azKcOItQVq8Upo7QH16ArnejI18VWJBLKXO4UQMN9F6OZA+l1pL5z1aCA40G7Y0 hjfntQl5O7fRJHNRwLg28ExBATo5MRTmVi6uTQChK+w240mMn/Xyb+NZj1+gh0Fjyykn9WOcD+Ws+ f6zy0iKY/qgLmLMbUgQc7jPTsjiRCUl5/KKayCOx+8UfS/GzgVLdyqpxL/S2UxYOU4NgFoDqWwEuH PDKQvlD7Nv5OHUzbeOdVpzwUox+t7GZ+2QuFFMzsD4hcKZa6ZR+kitJQ1nNGs70zLYvmMmFL/1Hpp 82PdqdqhAVFtejw9ehXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nD1Rk-00Ez3K-Os; Thu, 27 Jan 2022 09:52:04 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nD19f-00Euos-Dq for linux-rockchip@lists.infradead.org; Thu, 27 Jan 2022 09:33:25 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nD19U-0006rQ-9d; Thu, 27 Jan 2022 10:33:12 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1nD19P-0007xU-Bi; Thu, 27 Jan 2022 10:33:07 +0100 Date: Thu, 27 Jan 2022 10:33:07 +0100 From: Sascha Hauer To: Peter Geis Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Pierre-Hugues Husson , Archit Taneja , Robin Murphy , linux-rockchip@lists.infradead.org, Heiko =?iso-8859-15?Q?St=FCbner?= , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate Message-ID: <20220127093307.GJ23490@pengutronix.de> References: <20220126202427.3047814-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220126202427.3047814-1-pgwipeout@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:29:35 up 47 days, 18:15, 84 users, load average: 0.21, 0.33, 0.29 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220127_013323_508203_EF5FC5A8 X-CRM114-Status: GOOD ( 20.26 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Hi Peter, On Wed, Jan 26, 2022 at 03:24:26PM -0500, Peter Geis wrote: > 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. You removed this sentence in v2, but I just wanted to mention that clk_set_rate() won't fail when the desired clock rate can't be archieved. Instead, you will get the best rate that actually can be reached. If you want to check that you are happy with the rate you'll have to do a clk_round_rate() before setting the rate or a clk_get_rate() afterwards. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip