Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3059135pxp; Mon, 14 Mar 2022 09:59:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBcjuDv1/MTNQRHP93FeHDSULRSnFvWQKrWZ5D7DKpHi9tuy7fUqNmWdfYqhuSEurEPHFK X-Received: by 2002:a17:902:b202:b0:151:4f64:e516 with SMTP id t2-20020a170902b20200b001514f64e516mr24882732plr.16.1647277193198; Mon, 14 Mar 2022 09:59:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647277193; cv=none; d=google.com; s=arc-20160816; b=lwkVoR4qloME0RjDpdc4N9anT3Pb85GjVpyjO0jIpV36aPq3efbzTXsdfD96/bl4/w Eel1gUSZZZRFjG3Rxz9vjVghdXCXOQmKEU2xYuDn/fZMSGpZRh1ZjPqdCUs8ASOFZea6 ArgisPwF5kTcQoGxjBYL128CQ+BzZXvgpV/ZTJ1v5JHKYMRWHL6iCr0zA+Wm+mSEYAqf vYX4gOMFWmh1yq9k5rv22tOGyqIvJmjaPhWxX3aIVszmh7rTUnZMRCBs8M1zufnkbqbQ OuOWVjyV3648tkcSJ/TNc3zUhvN6blqwxsPXdzar8dH6fCB+rBhvgvCtPbmUfaEylQ+0 n6nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=fkXYlJ6C6wkFx+x1ssKNLuodQj89i4Wuj3dyn8HZpf4=; b=X4B+Y446UyXIp+wmNwIWTMw0KBr40ggTAByu/oSRBVcjI1yIDunz9aTrnYzjvJkavd S4b1Iq8WDoDC1425M7WJVZl6J/TyO/6RJDS64pE/bYct+zHanVv7VM6gwaVgxyU3uMqH JmYKxR2t//anL+WQv7Z9H+cO6P1twEu1vmnSX3nVsu7SZcs+7o4VrlxqfzmJJjq8Gdv6 Bk2ElofvzkJiwb+hAIHMoGTejhScY1MNmZTUIK1PaC5L2CfwwoB99b7CMlOUSoAQY58N WHHsRz4oCEzW9x0snKI6WuvWdWRcczdJ+qrxqqx7Dko/OfYQEcYFNJodRxf1xNM7dx9A BrjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e6LfJXTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v69-20020a638948000000b00381268f37a4si5453865pgd.389.2022.03.14.09.59.39; Mon, 14 Mar 2022 09:59:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e6LfJXTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233875AbiCMM6Y (ORCPT + 99 others); Sun, 13 Mar 2022 08:58:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbiCMM6V (ORCPT ); Sun, 13 Mar 2022 08:58:21 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2A91B0A7A for ; Sun, 13 Mar 2022 05:57:11 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id v130so25755949ybe.13 for ; Sun, 13 Mar 2022 05:57:11 -0700 (PDT) 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:content-transfer-encoding; bh=fkXYlJ6C6wkFx+x1ssKNLuodQj89i4Wuj3dyn8HZpf4=; b=e6LfJXTDrJfr5e+FFTBR0v8xULBC4J7mRTDfbLN9gxn7hKKROSV7ZupjXMLbjousk1 xo3TallrpFvTBcUxLYiWQoDzUINEUjp0OnUTfRNdrVUYmyiY4gjx//bLKVUYDi31D+Pf c1qPal5zb3zJU2M1jTTSUein/9JRR1fbzyWfhW5Gqbt2uUlGJNWuMkLEqPNqg01VBjcp vUaEA7NxHf2krE4SbXeHOv3AcOMnRsdHQ9giyIm6nWRalg/MkCJpdKMuO4Z1smX5fazZ aH6qJY53kFdK7D3JZ+RuT4jMwsBmBMo/2JCUN9UsIeTkzEZLYJzxlTPQBEtEWzS+TH5u KLrg== 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:content-transfer-encoding; bh=fkXYlJ6C6wkFx+x1ssKNLuodQj89i4Wuj3dyn8HZpf4=; b=5ZWJlzgfbGuphD/MF5fJjyMgxHxc9RGqOXDNgPfAXonT+7TmADmSNy3Y6aPvD242iP 1bSZ/MOlosV3chro8AZaW1MIP1RwUaFZ+5IlGkJf1n1t/N9fhLhpoQyoJYcdTZ3IetMo ovZePabO5uunIA5iyOCgjnzZLz8eEcQ8mp/t+MgwBOHVcJQOKZBF0oDH/3XEbUabMVJ0 +ZPyU61ILy0eFuuPTb0SQRQ4Ci/79uWLfTgIjkas1pVdGKUKEZsIsg7cS9kKSx7xP0hV NcwG4lp/JNDam39XdPvIJr19q52TO1gxYaosfEgmAIfkvlFb6Yqu7GYyKzhngktl624+ OI/g== X-Gm-Message-State: AOAM533/hRnrwTlfWs0ifTJXy1HQjYYE+zusuGhfCXUrV8qu5KhFXDHG 0DgW0PYqG8IN8iTrwii9UPsynognZYKyUxgFzOM= X-Received: by 2002:a25:e697:0:b0:629:1f4a:5a3c with SMTP id d145-20020a25e697000000b006291f4a5a3cmr14243335ybh.228.1647176227256; Sun, 13 Mar 2022 05:57:07 -0700 (PDT) MIME-Version: 1.0 References: <20220126202427.3047814-1-pgwipeout@gmail.com> <3AFD1DD4-AF0A-4ECC-B4F5-E6BD6B9F1BB7@gmail.com> In-Reply-To: <3AFD1DD4-AF0A-4ECC-B4F5-E6BD6B9F1BB7@gmail.com> From: Peter Geis Date: Sun, 13 Mar 2022 08:56:55 -0400 Message-ID: Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate To: Piotr Oniszczuk Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Pierre-Hugues Husson , Archit Taneja , Sascha Hauer , Robin Murphy , "open list:ARM/Rockchip SoC..." , =?UTF-8?Q?Heiko_St=C3=BCbner?= , dri-devel@lists.freedesktop.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 13, 2022 at 6:13 AM Piotr Oniszczuk wrote: > > > > > Wiadomo=C5=9B=C4=87 napisana przez Peter Geis w d= niu 26.01.2022, o godz. 21:24: > > > > 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/dr= m/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 =3D 0x01, > > RGB444_10B =3D 0x03, > > @@ -3347,6 +3350,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_de= vice *pdev, > > ret); > > goto err_iahb; > > } > > + > > + ret =3D clk_set_rate(hdmi->cec_clk, HDMI_CEC_CLK_RATE); > > + if (ret) > > + dev_warn(hdmi->dev, "Cannot set HDMI cec clock ra= te: %d\n", ret); > > } > > > > /* Product and revision IDs */ > > -- > > 2.25.1 > > > > > > _______________________________________________ > > Linux-rockchip mailing list > > Linux-rockchip@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-rockchip > > Peter, > > On my 5.17-rc7 with applied rk356x VOP2 v8 series - this patch makes CEC = working on rk3566. > Unfortunately it breaks working ok CEC on rk3399 rockpi-4b. > > Reverting this patch brings back CEC on rk3399 - but rk3366 becomes with = non working CEC > > I'm not sure how to move forward with this.... I was worried about that, thanks for testing it. Can you send me the cec_clk rate before and after this patch? > > br