Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp406297rwr; Thu, 4 May 2023 05:03:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4f8XN/mD6fgfLB1oo324gVLTnhbgIH6yzcj0bFD12ZE0xxoUjr3XLDFUCYdeSDpVHD6x0D X-Received: by 2002:a05:6870:c819:b0:184:222:6652 with SMTP id ee25-20020a056870c81900b0018402226652mr922898oab.39.1683201780033; Thu, 04 May 2023 05:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683201780; cv=none; d=google.com; s=arc-20160816; b=S2p3klGyzPX+0q5ddHcNX2nESl/qCt6/xk1jsX5c7stIfYk/weq6cHn8jL++ucg9G9 UES7K4ChRsTrB7SV3VpG+jQx/fZ9tp69+EGrV5vrXX8rk3tK3by8M0eB4i4YDHmtEZB7 yi2teoXcnVyYkdBs/11tMbx6DBPt5Ty2UddBve+FOberL8rWxuAqRv0gDKmtEtGiL0ws eGUK4j/Vb7/q/Xrr9tvU3qOE7e0EUy5tSGlPXZCEZXsIEJcsMRmaQTihfr9UjhmoMtsS SNqJH6ney1cX9wjXj1415NWoAZpy+KwXNf5/MuzlTqfgplwdExAVWpfCdx12rPkI7p/c wNGQ== 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=qyXif4sCtHvoN5uI5jyPj3Z5NBr5S8ivL+oLwWNb3rg=; b=xxJdfiL+aB7K34bDyRFl3nOoWkAIfM+nc4GQObGRDERKazJSvsHzOeO8m3Li5RHhY3 6PaFDTsXmyH1JWRsBPhlFRp4coG2IWsFMKYdAzTOrLxWYBvp0X+vsMNeQ2xpESd4YhYs cFfImFvR+S3B6bE0CuFy8xm30NW+ul9GhiiPj/s1MD8uB8GcrnMJgxxXggn+keiykq9Q f5UuVocjiUQ7Y5LPadSLSSJd2EQZdR8YK4aaQLQnAsguCrbwcdvwkYUdCIuFArL62apm ssS9lm/8KdtlT6wbW8Lyz+sH3pNlpJUMsaVRWi7hmRo8ba5KfyzrtRJ6aaq7H7jdHuQl da4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=f5GVgLtQ; 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 en18-20020a056870079200b0017697191928si1055888oab.12.2023.05.04.05.02.45; Thu, 04 May 2023 05:03:00 -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=20221208 header.b=f5GVgLtQ; 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 S229620AbjEDMAd (ORCPT + 99 others); Thu, 4 May 2023 08:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbjEDMAb (ORCPT ); Thu, 4 May 2023 08:00:31 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 425CB6188 for ; Thu, 4 May 2023 05:00:21 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-643990c5319so19355b3a.2 for ; Thu, 04 May 2023 05:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683201621; x=1685793621; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qyXif4sCtHvoN5uI5jyPj3Z5NBr5S8ivL+oLwWNb3rg=; b=f5GVgLtQqOiovcWwoZPI+yiTb7UcRkGusHC/AMfo1LJYOXrnLlIrhjZ6oEjU9QxJmt DwsdrOdUGf6ddzyxiBZItfwQokSfb+CEmrJ+3J3rB+8TH4gB58ddqnPZqVqdfBdNuh/M hbrBB89EuGX4Ffv7Y4BBViMl44W298gSC7c4LCxEime69AVP16mtiDk/UbsQzDpKbM5g J4VBTwV00WxmQog5AvZdlq5OeoDrka2AhiJ2kt54yMycTG4RlHQOI+LWjuGo7ksISWbP gSltMvNmuGnUI91ZsxH5izfGiwR1xFhxtnYoAiT5GUkMKupcjLVXbSCyha1bsKqBCmwW hUbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683201621; x=1685793621; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qyXif4sCtHvoN5uI5jyPj3Z5NBr5S8ivL+oLwWNb3rg=; b=KlyV/i5dORLqCXgSnLCcaKYAM/vZgVlolA2tIT6hEbTBLNUiptJYiNp34RYaT+7ZIj Id7wB4S3euDzPer5VtECqJ31KqLdTje8X3saOzLUP0h4YFeYEIbBoi6bno89cYHxUHMw Sc6ac7+MIylZ744ojxtVsbW87mSHpZsOtyXHBAuqas5C7yqPeDs/RGwxffM4HjJxbZbF 0S+BB123NtAiDM44+QR5p/UaM6aABGU7MSRiXFKOcA4fP1i0AdOsInF0tGBTAz3ZG3fr SBXpG76opfPZvjtYJoQORKD7N00XDh8Z4ShTwM8H4C8R+rqwrV3+GkeiGzFAMXxC/VVt hJSA== X-Gm-Message-State: AC+VfDxy4YguCLeamkDvXie4fga3/ftfC4fFN0+eykertexudguwtidZ dcTV/NyuLfvodw/CoiumvHdz/5WwKnN5VF7WHYIYrJlq X-Received: by 2002:a17:902:70cb:b0:1a6:4016:8974 with SMTP id l11-20020a17090270cb00b001a640168974mr2971499plt.31.1683201620554; Thu, 04 May 2023 05:00:20 -0700 (PDT) MIME-Version: 1.0 References: <20230502010759.17282-1-aford173@gmail.com> <20230502010759.17282-4-aford173@gmail.com> <7519081.EvYhyI6sBW@steina-w> In-Reply-To: <7519081.EvYhyI6sBW@steina-w> From: Adam Ford Date: Thu, 4 May 2023 07:00:08 -0500 Message-ID: Subject: Re: [PATCH V3 3/7] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically To: Alexander Stein 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 On Thu, May 4, 2023 at 4:21=E2=80=AFAM Alexander Stein 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. > > > > Signed-off-by: Adam Ford > > Tested-by: Chen-Yu Tsai > > --- > > drivers/gpu/drm/bridge/samsung-dsim.c | 12 ++++++++++-- > > 1 file changed, 10 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c > > b/drivers/gpu/drm/bridge/samsung-dsim.c index bf4b33d2de76..2dc02a9e37c= 0 > > 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) { > > struct device *dev =3D dsi->dev; > > struct device_node *node =3D dev->of_node; > > + struct clk *pll_clk; > > int ret; > > > > ret =3D samsung_dsim_of_read_u32(node, "samsung,pll-clock-frequen= cy", > > &dsi->pll_clk_rate); > > - 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); > > + } > > > > Now that 'samsung,pll-clock-frequency' is optional the error in > samsung_dsim_of_read_u32() should be changed. Otherwise you will get > > /soc@0/bus@32c00000/dsi@32e10000: failed to get 'samsung,pll-clock- > frequency' property I'll change the message from err to info with a message that reads "no samsung,pll-clock-frequency, using pixel clock" Does that work? adam > > Best regards, > Alexander > > > ret =3D samsung_dsim_of_read_u32(node, "samsung,burst-clock- > frequency", > > &dsi->burst_clk_rate); > > > -- > TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Ge= rmany > Amtsgericht M=C3=BCnchen, HRB 105018 > Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan S= chneider > http://www.tq-group.com/ > >