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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0980BC2BBD5 for ; Fri, 18 Dec 2020 12:25:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF3C72395C for ; Fri, 18 Dec 2020 12:25:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF3C72395C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zHbxvjofzbLei0hClg/5MV/48UyHww4ByORzbyYe5pU=; b=WsdNhjO1k6/hve9ujycNosPAj jK9EsIBA4sz+6bzSsh94unk3C4ImtFDae4S4ktb2R2xBYeU7KZ4lvoUWLaJRoJfFASGhLM2kuR6fh ThWCkZXZU+IyxeY+efICtW/B6mj/Mm8UWBLiRbYOsQb6QZYvJCSWEbeb5sj6kgo/WPDVGuq+ueBIo 33tMwosyhA2qWMpONDQzzowRYn4yLEGrVpN2DHIb+61sp1bXy2oGbdlUhJB+GeAZ/QMR6kgjRB7gC zwz7+9sdjMrrGjUtn2oba7PxeLiCyBmb/Ivv2biYp/p7PsnuKHNwZXa6GQTlvyHPsbEk9FA82LbNF pknEAxAIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqEnU-0001c2-2r; Fri, 18 Dec 2020 12:23:48 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqEnR-0001b6-7s; Fri, 18 Dec 2020 12:23:46 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id EE83D58042B; Fri, 18 Dec 2020 07:23:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 18 Dec 2020 07:23:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=HZ2lvYrWK8D7QHvnJNCIdRlHUCr +09IGqR+IruZm1Jc=; b=o8vQmAYgw3Z5QK9DpTYDmUe2/7lcgk8rqifz5T1YaMu GlP+LkEHNRvYCm8B20b/F671N+Q09HV8A8K6+vO6jwOU1o9GC77p7IWIRflZ6NB4 7xoqtDoJa6QPU6azvtH1LbA+ulJE40jP1JEQCSJ/lXNBVUb76cd2BDYdxASX2E9k YVrG7OxBcFOpkZTHxAKVvASevxE4SRptwH9Lp3m2RYecHqSNF2l3k48RhqspeMLh qPngyAwlANijQj8L7c9UR5VY3t0go7Y60mcc4wjlD6ZnJKke5TkemkVW94pLTAig GB8gjQyZg6ReFz0/hUvh1jDAGL30l+YqqGDw6+FR+Tg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HZ2lvY rWK8D7QHvnJNCIdRlHUCr+09IGqR+IruZm1Jc=; b=QdFCxWH1tPU1r9zhA/CTWV e4N0IyNB4TeFqfCvoz6cRLy5ZAAf0naI2oj92jMRta75+UHq3MnVrH+qGcsvR2Yg LQ0bfbHLudlm7Bvb8NTuo3zRk/KsfBdSNo5PBVCDz42HkFOSmENYw68WjpZxqIE7 wMtPlnfJsQwEZd1uluRtNzWXEzvdQKo0o4KIJZfGoWT+EpWzF44DT2jg6mAu6Npk neQpgt3CGAurDtOAgQ8kNfQTxG7iMZXCKX8s/oA+cJb6dvUEynboEhS7GokJnLku aKveEmXo971ZeeDt54PvQHPu3b9xaCqRmhCJuRVZ19vbOIbS2grSFsH1yUmt7EdQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeliedgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepveevfeffudeviedtgeethffhteeuffetfeffvdehvedvheetteehvdelfffg jedvnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepledtrdekledrieekrd ejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehm rgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 090CA24005D; Fri, 18 Dec 2020 07:23:35 -0500 (EST) Date: Fri, 18 Dec 2020 13:23:34 +0100 From: Maxime Ripard To: Dave Stevenson Subject: Re: [PATCH 08/15] drm/vc4: hdmi: Introduce a CEC clock Message-ID: <20201218122334.tvdeslyyuus4hp4y@gilmour> References: <20201210134648.272857-1-maxime@cerno.tech> <20201210134648.272857-9-maxime@cerno.tech> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201218_072345_344152_AFA9D120 X-CRM114-Status: GOOD ( 24.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Cooper , David Airlie , Marc Zyngier , Maarten Lankhorst , LKML , DRI Development , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Thomas Zimmermann , Hans Verkuil , Daniel Vetter , Thomas Gleixner , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Linux Media Mailing List Content-Type: multipart/mixed; boundary="===============8805899583543210211==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8805899583543210211== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="daa325rvus7mm5rb" Content-Disposition: inline --daa325rvus7mm5rb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Dave, On Fri, Dec 18, 2020 at 11:37:50AM +0000, Dave Stevenson wrote: > Hi Maxime >=20 > On Thu, 10 Dec 2020 at 13:47, Maxime Ripard wrote: > > > > While the BCM2835 had the CEC clock derived from the HSM clock, the > > BCM2711 has a dedicated parent clock for it. > > > > Let's introduce a separate clock for it so that we can handle both > > cases. > > > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/vc4/vc4_hdmi.c | 9 ++++++++- > > drivers/gpu/drm/vc4/vc4_hdmi.h | 1 + > > 2 files changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_h= dmi.c > > index b93ee3e26e2b..0debd22bc992 100644 > > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > > @@ -145,7 +145,7 @@ static void vc4_hdmi_cec_update_clk_div(struct vc4_= hdmi *vc4_hdmi) > > * Set the clock divider: the hsm_clock rate and this divider > > * setting will give a 40 kHz CEC clock. > > */ > > - clk_cnt =3D clk_get_rate(vc4_hdmi->hsm_clock) / CEC_CLOCK_FREQ; > > + clk_cnt =3D clk_get_rate(vc4_hdmi->cec_clock) / CEC_CLOCK_FREQ; > > value |=3D clk_cnt << VC4_HDMI_CEC_DIV_CLK_CNT_SHIFT; > > HDMI_WRITE(HDMI_CEC_CNTRL_1, value); > > } > > @@ -1740,6 +1740,7 @@ static int vc4_hdmi_init_resources(struct vc4_hdm= i *vc4_hdmi) > > return PTR_ERR(vc4_hdmi->hsm_clock); > > } > > vc4_hdmi->audio_clock =3D vc4_hdmi->hsm_clock; > > + vc4_hdmi->cec_clock =3D vc4_hdmi->hsm_clock; > > > > return 0; > > } > > @@ -1833,6 +1834,12 @@ static int vc5_hdmi_init_resources(struct vc4_hd= mi *vc4_hdmi) > > return PTR_ERR(vc4_hdmi->audio_clock); > > } > > > > + vc4_hdmi->cec_clock =3D devm_clk_get(dev, "cec"); > > + if (IS_ERR(vc4_hdmi->cec_clock)) { > > + DRM_ERROR("Failed to get CEC clock\n"); > > + return PTR_ERR(vc4_hdmi->cec_clock); > > + } >=20 > Aren't we adding to the DT binding here and breaking backwards compatibil= ity? > Admittedly CEC didn't work before (and was masked out) for vc5, but do > we need to worry about those with existing DT files that currently > work happily? The DT compatibility is not a worry here: I made sure the CEC clock and range were part of the binding since it's been introduced: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?= id=3D2e3725b05b785e73482a194b99bff3d5a1c85140 So we were not using it so far, but it was in the DT all along Maxime --daa325rvus7mm5rb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX9yfRgAKCRDj7w1vZxhR xdw8AQDSePfxRuumqbi3ziN0f2aHgCzU27a3QqLpmmDtvy9yjwD8DDNWRGgWo+YB Sm5jVlyvzrNZGCh1S4auc/kwypDjNA4= =wsp5 -----END PGP SIGNATURE----- --daa325rvus7mm5rb-- --===============8805899583543210211== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============8805899583543210211==--