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 117A4C433FE for ; Fri, 28 Jan 2022 19:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350761AbiA1TDQ (ORCPT ); Fri, 28 Jan 2022 14:03:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbiA1TDP (ORCPT ); Fri, 28 Jan 2022 14:03:15 -0500 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAEE7C061714 for ; Fri, 28 Jan 2022 11:03:14 -0800 (PST) Received: by mail-yb1-xb30.google.com with SMTP id c6so21326720ybk.3 for ; Fri, 28 Jan 2022 11:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3hlBZRfJeaaEMgpDJfGF4VXTiNMRL5u5A8XWDhcHgIU=; b=RB+iJtZRYF0dkmWtZQjZrE5l2GCNTyyleglmYgfhw2DfTccUOrvGv9t6I6Yk7N3fd1 i90XCiFg/0xlIqHxlY0zFOXcxPwjk7qLfB9xsvV/FxdncdXC32oYUY+M/uVFIzbbRkHS sGAHLY2u0DS9/gwV0Bw8Llaky5XDQPsalA9CkpoF7O7nCYaGNpqK/b3tj5Zq48+wjJoe QMaTbI9e0mRXYA0VjJ2MYyLeZM271Ly4gVi94O4Z7JeGjWaG7KtuFAcrocfly191vqsq BP+/8tBvp4hnN0JJUQazPDSUO82daB1GopBf7zqzTLm5faaI3mAwSJt3f4JT1K0I7IBP yiIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3hlBZRfJeaaEMgpDJfGF4VXTiNMRL5u5A8XWDhcHgIU=; b=f2WEkQqv2BmWr6/SG3EviHDclUnkZewqHlu8qAYpJY+aqfCvQ3Y0aWceqWBmnzIeW+ 9EdspyYngqqBwVmEZjBpsENBplNxAcRQrUDjNppePYRNc8BG00t4D862n1wT4oWa8kN6 P6oIlTxXojrnHT7VqO6EoNxWxhxAkaKPHTXumO5xaBMSR4Fp21kyrDJUvzMwsWIS5D+c dTmwsqgD5h5sQkh9x1c+OVFAeHi3dAXZC6Ipa+Cdez9T4Bdqs5g8K5PtpQ8rqeD+8JTr sG2vONz8TgREpN0QIjHyglljCNY/ZepJV3c+qGmO1uHG22WtRRGTInFl+ijRj6oy/jeC tKdg== X-Gm-Message-State: AOAM531TAXpfA4rWxWHGjyTbUJggXh6VkjRiJEmAYA4VW6lwJ22NVXqT fnevsbs8bHGurCW6ku24VsRQkEzNs3z1d0SvGqVPpYr+XWA= X-Google-Smtp-Source: ABdhPJzzfPPKuV+kEV5XP50RjBgFVl8NGNQtLCUEqsEPQE6Z940iaylmOzR016fVVotXJrtEZoq5NTeoaKbhpkUa57Y= X-Received: by 2002:a05:6902:704:: with SMTP id k4mr14250783ybt.355.1643396593140; Fri, 28 Jan 2022 11:03:13 -0800 (PST) MIME-Version: 1.0 References: <20220126202427.3047814-1-pgwipeout@gmail.com> <20220127093307.GJ23490@pengutronix.de> In-Reply-To: <20220127093307.GJ23490@pengutronix.de> From: Peter Geis Date: Fri, 28 Jan 2022 14:03:02 -0500 Message-ID: Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate To: Sascha Hauer Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Pierre-Hugues Husson , Archit Taneja , Robin Murphy , "open list:ARM/Rockchip SoC..." , =?UTF-8?Q?Heiko_St=C3=BCbner?= , dri-devel@lists.freedesktop.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 4:33 AM Sascha Hauer wrote: > > 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. Thanks, the behavior in v2 is actually what I'm looking for. I dug into clk_set_rate while checking into its interaction with clk_prepare and I came to this conclusion. > > 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 1A28CC433F5 for ; Fri, 28 Jan 2022 19:03:24 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/IgTnJRkwG1Qap10anwaPwAloGPg0O7Ydzme8g1pAQE=; b=Mb07i8PSk/NYP6 y/zfIRSdzKK+s4OLMgKKimn/nMgbn18b2iinr9kZK01bsPUyplZgUxPR28vyUZ0ca71gsVwVWutwG P3UnWRec2bJO0IJZfnKiojSgm7OzmybwodQYcYqKcQ3699h67CvjUuRxI3kAS4oQXFUCFMTMa94LF qcUu7sl94piFlKY4CpmGDzWJcfi4WwXmsAArE2mVp8kHfuZpzTSdgX+KGNXGi5HqxN9/JRbDs+sBh F+lwq3JWRPg1MJZGvQePHHITQxranQqXHiG/FJuKA4ZEM4xCcN49ZXUfW4kh5WUAAUqrq9DcUTSt0 MixtsK6RcKcZdIDX385g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDWWk-003Nu8-8M; Fri, 28 Jan 2022 19:03:18 +0000 Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDWWg-003NtV-L7 for linux-rockchip@lists.infradead.org; Fri, 28 Jan 2022 19:03:16 +0000 Received: by mail-yb1-xb2d.google.com with SMTP id g14so21228808ybs.8 for ; Fri, 28 Jan 2022 11:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3hlBZRfJeaaEMgpDJfGF4VXTiNMRL5u5A8XWDhcHgIU=; b=RB+iJtZRYF0dkmWtZQjZrE5l2GCNTyyleglmYgfhw2DfTccUOrvGv9t6I6Yk7N3fd1 i90XCiFg/0xlIqHxlY0zFOXcxPwjk7qLfB9xsvV/FxdncdXC32oYUY+M/uVFIzbbRkHS sGAHLY2u0DS9/gwV0Bw8Llaky5XDQPsalA9CkpoF7O7nCYaGNpqK/b3tj5Zq48+wjJoe QMaTbI9e0mRXYA0VjJ2MYyLeZM271Ly4gVi94O4Z7JeGjWaG7KtuFAcrocfly191vqsq BP+/8tBvp4hnN0JJUQazPDSUO82daB1GopBf7zqzTLm5faaI3mAwSJt3f4JT1K0I7IBP yiIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3hlBZRfJeaaEMgpDJfGF4VXTiNMRL5u5A8XWDhcHgIU=; b=M/ffpBiR7JF5gILWizAR7zBGJ/Avz1jnG8DH+5qlIEP82wEB+CTxLQAVtNCZ0iVhB7 3gp/qR7y7hHhvZ5CLpbT4nnhsWY3EPND5x3t3RcQE/4dLxLPkaiDDwcUGeroiXwISvE0 67niGQFW2WLuUS0dmXnxc+bYhsSndsPXUi5iB8FzXK3sNelWkqteMbRZsSvJW48X1Hzu HpG3O97llMPWgmv95hBygZyeGu+b2oX1vxTvi4MBDsy3eaUkwDNVLjEprhDJYovwj5K4 asqKnw+WuwL9hZQ/lhkg8Y0v+hA08Dd7WkCDGAzIBDJYTD4vLh/H/RBSCp4gQG3RTDpr vYCQ== X-Gm-Message-State: AOAM530XtlKFTutoVvJaFcxMsQGFEYj8tiIYPG2lj4pSay5iSqIAcfKy mbp20FUm04C54eUtWmEEWbbxM6hkbxNHntdhmug= X-Google-Smtp-Source: ABdhPJzzfPPKuV+kEV5XP50RjBgFVl8NGNQtLCUEqsEPQE6Z940iaylmOzR016fVVotXJrtEZoq5NTeoaKbhpkUa57Y= X-Received: by 2002:a05:6902:704:: with SMTP id k4mr14250783ybt.355.1643396593140; Fri, 28 Jan 2022 11:03:13 -0800 (PST) MIME-Version: 1.0 References: <20220126202427.3047814-1-pgwipeout@gmail.com> <20220127093307.GJ23490@pengutronix.de> In-Reply-To: <20220127093307.GJ23490@pengutronix.de> From: Peter Geis Date: Fri, 28 Jan 2022 14:03:02 -0500 Message-ID: Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate To: Sascha Hauer Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Pierre-Hugues Husson , Archit Taneja , Robin Murphy , "open list:ARM/Rockchip SoC..." , =?UTF-8?Q?Heiko_St=C3=BCbner?= , dri-devel@lists.freedesktop.org, Linux Kernel Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_110314_715463_E4011E32 X-CRM114-Status: GOOD ( 19.88 ) 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 On Thu, Jan 27, 2022 at 4:33 AM Sascha Hauer wrote: > > 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. Thanks, the behavior in v2 is actually what I'm looking for. I dug into clk_set_rate while checking into its interaction with clk_prepare and I came to this conclusion. > > 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 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 02AD0C433F5 for ; Fri, 28 Jan 2022 19:03:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D581510E1E8; Fri, 28 Jan 2022 19:03:15 +0000 (UTC) Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 349DD10E1E8 for ; Fri, 28 Jan 2022 19:03:14 +0000 (UTC) Received: by mail-yb1-xb29.google.com with SMTP id m6so21241732ybc.9 for ; Fri, 28 Jan 2022 11:03:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3hlBZRfJeaaEMgpDJfGF4VXTiNMRL5u5A8XWDhcHgIU=; b=RB+iJtZRYF0dkmWtZQjZrE5l2GCNTyyleglmYgfhw2DfTccUOrvGv9t6I6Yk7N3fd1 i90XCiFg/0xlIqHxlY0zFOXcxPwjk7qLfB9xsvV/FxdncdXC32oYUY+M/uVFIzbbRkHS sGAHLY2u0DS9/gwV0Bw8Llaky5XDQPsalA9CkpoF7O7nCYaGNpqK/b3tj5Zq48+wjJoe QMaTbI9e0mRXYA0VjJ2MYyLeZM271Ly4gVi94O4Z7JeGjWaG7KtuFAcrocfly191vqsq BP+/8tBvp4hnN0JJUQazPDSUO82daB1GopBf7zqzTLm5faaI3mAwSJt3f4JT1K0I7IBP yiIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3hlBZRfJeaaEMgpDJfGF4VXTiNMRL5u5A8XWDhcHgIU=; b=RFQdKEvGFXiSrSBmvuH/MxqbqkuhwcrLSOMEPIppKMwjLtmvSXZACI8ael7KX9qj+Z fu8OyP6tf3/6KN62ADYyUeE89srnK9ssH4IitngTz5HXXvTRMtxiwveUGMavZWQyK18T jmu7KMXjMl3/y4jsjKw0ppPxGiy/tDgey/Jmi/h7iu4/Mlk99bCakUhuNO3IJwkfLThK 2sGrVfc8GxDdM4T4NmsgVkFpZAkWH5UMX32/vJz1jGfs2Hr/yZEQl1otiXvdJSksUM+e M+oF2Bo/tArYG2LLvytzWR9ZGLJr9AcvCOdnxpyIzlyVjl0rcEOBP37etnokLfuP4Pkx uUkA== X-Gm-Message-State: AOAM531mJZ9q/LtJ+Gn+uz7jDXvOS0fWix7rnkqX8XiunWl+7umSdaw3 KOeQ7gh74wDQZQ6F1J+QuesSS2RO5wDmZvtkMgU= X-Google-Smtp-Source: ABdhPJzzfPPKuV+kEV5XP50RjBgFVl8NGNQtLCUEqsEPQE6Z940iaylmOzR016fVVotXJrtEZoq5NTeoaKbhpkUa57Y= X-Received: by 2002:a05:6902:704:: with SMTP id k4mr14250783ybt.355.1643396593140; Fri, 28 Jan 2022 11:03:13 -0800 (PST) MIME-Version: 1.0 References: <20220126202427.3047814-1-pgwipeout@gmail.com> <20220127093307.GJ23490@pengutronix.de> In-Reply-To: <20220127093307.GJ23490@pengutronix.de> From: Peter Geis Date: Fri, 28 Jan 2022 14:03:02 -0500 Message-ID: Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate To: Sascha Hauer Content-Type: text/plain; charset="UTF-8" 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 Mailing List , Jernej Skrabec , "open list:ARM/Rockchip SoC..." , Laurent Pinchart , Andrzej Hajda , Pierre-Hugues Husson , Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jan 27, 2022 at 4:33 AM Sascha Hauer wrote: > > 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. Thanks, the behavior in v2 is actually what I'm looking for. I dug into clk_set_rate while checking into its interaction with clk_prepare and I came to this conclusion. > > 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 |