Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp510002rwr; Thu, 4 May 2023 06:19:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wR9s5E7oys9FGj4WtMweOxDeD0cMKCyVtMFdXn8FglfnjUHyYIMIeL6QExdvyO4MceGZy X-Received: by 2002:a17:90a:db97:b0:24e:1215:c280 with SMTP id h23-20020a17090adb9700b0024e1215c280mr1979311pjv.45.1683206341430; Thu, 04 May 2023 06:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683206341; cv=none; d=google.com; s=arc-20160816; b=AI4a5rELQZD5xNQ2V9WTXewKl0SurOlXvKRke99z+QP/iv0ZCdAnID9mA1GgWLLBPz vPDUEw9YsWh2mWpYFXzwTEk1RgZinek8FoJZF0sQT5UYWDSUl04ooUQr5rUkjJAQfYBX dpzKYRvOqWjzNb/rz4grB4hUCoFrma56psksAp3sQAtKPwIWH/7bsH0Y7eiexRTf1s7j t+GE3CY1BWb10G5BxmGk7FWXCxMMmGw0EsbDu6g9oLQ2YbjjpKnJY1iogeMNMKBLCqKa mZQvPES6sc1mkvCHd+A2WpVnbrW/HN41HkcrywSDCMx0uLOYdej0u0Gv+nNEJp3DKdQj UFlg== 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 :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=qWGSg6d1nhW2VOQBIw4YIvEy4bV7o1yT12cZc0wNGSw=; b=Pv4Se4xXyZKj/0cAs0bdIdohH5NvR1j2W391AXwN1ASrjrBi5fUNyCDpcU5FSk+bQr 8dVQozafdwSIpH1SNRiN2Msa+TVzvFxqxU1Ypac8ZvfUc3qheo9WXOIBRcK/tB98C6P9 +jg9rAvf4YVsispf7DHhHztQElnhSSamulFcHXwiU9K0aeQ9Xkd7aSZbjLuPBwoVkXrQ ddIJQIeC9Yv2kEWuA3R3gOc261vLsLLLsPXVZovl4FiP/iiTdwZHkty+VbzLOvpiIawD iSlRjC5qgHj2kNmlOdNDK1hCyLgyfoQZdMeT9HuTxE3LpEYxgE1q6dOsg73gLAwNH5UM vTnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=n6udjuC7; dkim=pass header.i=@tq-group.com header.s=key1 header.b=pYrRRUo7; 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=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s85-20020a632c58000000b00519a8f54d2bsi35952175pgs.667.2023.05.04.06.18.49; Thu, 04 May 2023 06:19:01 -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=@tq-group.com header.s=key1 header.b=n6udjuC7; dkim=pass header.i=@tq-group.com header.s=key1 header.b=pYrRRUo7; 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=NONE dis=NONE) header.from=tq-group.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbjEDNSS (ORCPT + 99 others); Thu, 4 May 2023 09:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231124AbjEDNSP (ORCPT ); Thu, 4 May 2023 09:18:15 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E8976B7 for ; Thu, 4 May 2023 06:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1683206289; x=1714742289; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qWGSg6d1nhW2VOQBIw4YIvEy4bV7o1yT12cZc0wNGSw=; b=n6udjuC7bKntM+Uuhn/VXz8jqajSQkPvalbJGKyEFAvCkOty221bYcnf y9gj5TWNfNczDJEx3xIYYy2RIGfTh6AUrL5nCdNMSO8jNxjVyLEAGJCHz gwCSc0uYQq1tqHdVkIW9I7gYv7fdnFmmeYAQO4LUMvAoPx3o82l4S65E9 BVVnXDKIe/+E5TqbUfPdVQgmI/6rnn6uICg6g2B/VHdIUcA/Ap7xAZhqE UkESa+SDTlz5iy48epSgx+HrfTQBAVo5t6+lrYmu8MoeKvU2DdhFA3D4V GoFv1nW9/STFRYbne9jNiMQXLKQYqz+JpAVMnOtpR8LNV7n+Y9gP6PLyS g==; X-IronPort-AV: E=Sophos;i="5.99,249,1677538800"; d="scan'208";a="30722926" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 04 May 2023 15:18:07 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Thu, 04 May 2023 15:18:07 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Thu, 04 May 2023 15:18:07 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1683206287; x=1714742287; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qWGSg6d1nhW2VOQBIw4YIvEy4bV7o1yT12cZc0wNGSw=; b=pYrRRUo7K3oo5ylmXUGvA0xcMVhThxeQfKdUBtEEfT7FWDNWM7eSawar D0o1YNNaNiu3xTmsLzGOCu+3/leMpZulGEhQWA2pawngn5hM+qmjLix8J JTQw9QWgNVzpi2bwB4Va9CXV/IKJ454kOvY8tJ/ap0jJJ090UtcvZ+Uk6 da8W7Zu1Hg3CBPciEuWnxPE9Y4NPCmidyUyIjVrAcGvVTPb9VvruJE3lG vBsOvqYZoV+jbRrONHn9rnk0+5FoeWg7wWGqnGDVvZ9QpLmVy9k32y0MO HBgOW+jWSo1vOPX1e0oW9pcY4b3pDDfRsuRphOMXT0nfOYxI+bh2ghau8 g==; X-IronPort-AV: E=Sophos;i="5.99,249,1677538800"; d="scan'208";a="30722925" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 04 May 2023 15:18:07 +0200 Received: from steina-w.localnet (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id A0123280056; Thu, 4 May 2023 15:18:06 +0200 (CEST) From: Alexander Stein To: Adam Ford Cc: dri-devel@lists.freedesktop.org, marex@denx.de, Neil Armstrong , Robert Foss , Jonas Karlman , aford@beaconembedded.com, Jernej Skrabec , linux-kernel@vger.kernel.org, Laurent Pinchart , Andrzej Hajda , Chen-Yu Tsai , Marek Szyprowski , Jagan Teki Subject: Re: [PATCH V3 3/7] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically Date: Thu, 04 May 2023 15:18:07 +0200 Message-ID: <1856543.CQOukoFCf9@steina-w> Organization: TQ-Systems GmbH In-Reply-To: References: <20230502010759.17282-1-aford173@gmail.com> <1759996.VLH7GnMWUR@steina-w> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Am Donnerstag, 4. Mai 2023, 14:57:01 CEST schrieb Adam Ford: > On Thu, May 4, 2023 at 7:40=E2=80=AFAM Alexander Stein >=20 > wrote: > > Hi Adam, > >=20 > > Am Donnerstag, 4. Mai 2023, 14:00:08 CEST schrieb Adam Ford: > > > On Thu, May 4, 2023 at 4:21=E2=80=AFAM Alexander Stein > > >=20 > > > wrote: > > > > Am Dienstag, 2. Mai 2023, 03:07:55 CEST schrieb Adam Ford: > > > > > Make the pll-clock-frequency optional. If it's present, use it > > > > > to maintain backwards compatibility with existing hardware. If it > > > > > is absent, read clock rate of "sclk_mipi" to determine the rate. > > > > >=20 > > > > > Signed-off-by: Adam Ford > > > > > Tested-by: Chen-Yu Tsai > > > > > --- > > > > >=20 > > > > > drivers/gpu/drm/bridge/samsung-dsim.c | 12 ++++++++++-- > > > > > 1 file changed, 10 insertions(+), 2 deletions(-) > > > > >=20 > > > > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c > > > > > b/drivers/gpu/drm/bridge/samsung-dsim.c index > > > > > bf4b33d2de76..2dc02a9e37c0 > > > > > 100644 > > > > > --- a/drivers/gpu/drm/bridge/samsung-dsim.c > > > > > +++ b/drivers/gpu/drm/bridge/samsung-dsim.c > > > > > @@ -1726,12 +1726,20 @@ static int samsung_dsim_parse_dt(struct > > > > > samsung_dsim *dsi) { > > > > >=20 > > > > > struct device *dev =3D dsi->dev; > > > > > struct device_node *node =3D dev->of_node; > > > > >=20 > > > > > + struct clk *pll_clk; > > > > >=20 > > > > > int ret; > > > > > =20 > > > > > ret =3D samsung_dsim_of_read_u32(node, > > > > > "samsung,pll-clock-frequency", > > > > > =20 > > > > > &dsi->pll_clk_rate); > > > > >=20 > > > > > - if (ret < 0) > > > > > - return ret; > > > > > + > > > > > + /* If it doesn't exist, read it from the clock instead of > > > > > failing > > > > > */ > > > > > + if (ret < 0) { > > > > > + pll_clk =3D devm_clk_get(dev, "sclk_mipi"); > > > > > + if (!IS_ERR(pll_clk)) > > > > > + dsi->pll_clk_rate =3D clk_get_rate(pll_clk); > > > > > + else > > > > > + return PTR_ERR(pll_clk); > > > > > + } > > > >=20 > > > > Now that 'samsung,pll-clock-frequency' is optional the error in > > > > samsung_dsim_of_read_u32() should be changed. Otherwise you will get > > > >=20 > > > > > /soc@0/bus@32c00000/dsi@32e10000: failed to get 'samsung,pll-cloc= k- > > > >=20 > > > > frequency' property > > >=20 > > > I'll change the message from err to info with a message that reads "no > > > samsung,pll-clock-frequency, using pixel clock" > > >=20 > > > Does that work? > >=20 > > Having just a info is totally fine with me. Thanks. > > Although your suggested message somehow implies (to me) using pixel clo= ck > > is just a fallback. I'm a bit concerned some might think > > "samsung,pll-clock- frequency" should be provided in DT. But this might > > just be me. >=20 > Oops, I got the PLL and burst burst clock confused. I think both > burst-clock and pll clock messages should get updates. >=20 > The pll clock should say something like "samsung,pll-clock-frequency > not defined, using sclk_mipi" >=20 > The imx8m n/m/p have the sclk_mipi defined in the device tree, and > this patch allows them to not have > to manually set the pll clock since it can be read. This allows to > people to change the frequency of the PLL in > in one place and let the driver read it instead of having to set the > value in two places for the same clock. That's why I would like to make it sound less error-like. How about "Using sclk_mipi for pll clock frequency"? > For the burst clock, I'd like to propose > "samsung,burst-clock-frequency not defined, using pixel clock" Similar to above how about "Using pixel clock for burst clock frequency"? > Does that work for you? But I'm okay with both ways. Up to you. Thanks and best regards, Alexander > > frequency > >=20 > >=20 > > Best regards, > > Alexander > >=20 > > > adam > > >=20 > > > > Best regards, > > > > Alexander > > > >=20 > > > > > ret =3D samsung_dsim_of_read_u32(node, "samsung,burst-clock- > > > >=20 > > > > frequency", > > > >=20 > > > > > &dsi->burst_clk_rate); > > > >=20 > > > > -- > > > > TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefe= ld, Germany > > > > Amtsgericht M=C3=BCnchen, HRB 105018 > > > > Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, St= efan Schneider > > > > http://www.tq-group.com/ > >=20 > > -- > > TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, = Germany > > Amtsgericht M=C3=BCnchen, HRB 105018 > > Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan= Schneider > > http://www.tq-group.com/ =2D-=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider http://www.tq-group.com/