Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2492952rwr; Sat, 6 May 2023 12:08:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vf/3abXYybZdycBdFCSebsbmI273svyu4axqF5H6dr/JlEPXcQeQVjXPIz2YaXRxmiiw7 X-Received: by 2002:a05:6a20:9143:b0:f0:2ba6:8406 with SMTP id x3-20020a056a20914300b000f02ba68406mr7313278pzc.26.1683400132742; Sat, 06 May 2023 12:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683400132; cv=none; d=google.com; s=arc-20160816; b=mSzDLR3OstTsvYuwWj05x4+up1U833VanGspWGpc8c/NHgRmKQIj95WGEmGkge9AJz /tHaS/XS8Bn+27fh/oXrskQtxTtEvtKgLLQKdKH0yR+/x2bml7ptG2jgPYQXWS3xTI86 lSnW2rs31nEZ0rHgtfd5ITnAmdIw003jJ9eOMaE6b6NER3am8RHk+6OJhSSJHQlVCW9v PyO2OsaT/GYUv4dJywpVkjtQK1sab5Vc3SoqKRO3/1/SSMStFjnC/kLua1pvlp6MiB7y CVgDsrKAVyyyKgS4F7YtK7My8ipBbPip6+NvKMYpwr6AHSjIatElcWl44AvgdMLl3AYT SPRQ== 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=t/WwOrZJ5JRzyY6p6wiuOMAhVag97atAR6Wjafb+S2A=; b=NVVpurLT7NvHqYeR0d9kpmcEHUN2xDZbjYgnvAJtrnoxDZJHKCldn3xUvivOgMortV BCSnvf9M+SfYEHUldiRZ6lRSjC4Rgn/TD4NcQYkZgkyPsHb8olvgase2vZYWRfm7uqrg VZr+rTY6FuR67uoVU3aH2KXEL68KJYdeKLXRAE2OsE099jiz3s+uwzoX5KZG+iqlUwZs 9v+R9bx7eb653uSnkLX1qH2kQyYMY0rFNUHIoFTCODwg9ARSYCYiLLSwkZ0tHlZMwKRK kVMtN0X6XIjitGHmZ0qcjnB2jltSVENAGOm9fkjkWdFSxg74x38jHXwudMbGU/zA05hE uHOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Ed0WNNwC; 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 k64-20020a628443000000b0064387bc87cesi5020695pfd.22.2023.05.06.12.08.40; Sat, 06 May 2023 12:08:52 -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=Ed0WNNwC; 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 S229601AbjEFS2A (ORCPT + 99 others); Sat, 6 May 2023 14:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjEFS16 (ORCPT ); Sat, 6 May 2023 14:27:58 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F09D540C3 for ; Sat, 6 May 2023 11:27:57 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-52c6504974dso2678253a12.2 for ; Sat, 06 May 2023 11:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683397677; x=1685989677; 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=t/WwOrZJ5JRzyY6p6wiuOMAhVag97atAR6Wjafb+S2A=; b=Ed0WNNwC5JVc/UevED/FuEHi+jsrMHibsAXB7n0Hv6KblssEN8GuVTTkx3Jbl8zlne ifBfne1EIZ0L2ZEaowjD216ZVUWg8L4ItBmrxzS6sEbA31bCOzRvOMKRXshU3SiUU57N UJKp8EOaPvg4hrgAnrbeRf4yMMdbPlqTyghbQwrx/7GK62MefqKXuuaSs91fwA32Yjeq v4182toBBPBGXBJ+A+fes6LALCH2gP8JpwJdZ0I5CtVI8/Kr11V7B3BVeyn9jlW/Qpwt Tpk++Jr5DlDwk4y+EjpiKpd7BIALwuIsTUDP5MOSe8T+Qurrmr8Tfy08BZ1lCsBoYyoJ 0MFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683397677; x=1685989677; 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=t/WwOrZJ5JRzyY6p6wiuOMAhVag97atAR6Wjafb+S2A=; b=DLpCHzJpJkETVuwQdYJzWmRI5Vi5ad1yLrrrTODSWDOAbQs7w3kmohQ9aaoFNAkUPY cMGyoweLTN23Iuoa7dkCzQzWX99XvoiF33A5PLnFBHieLuXcgwlqV3BAA8/OBGlhXBmW fGI3sJKuj7F72QRMOpC9otkck3hFPP5QAzjH/sJgYb2xVrmL0LcTpaGkHYMl1x2Scp9c uV+399VxZ9HuzUUR869npdSs+DN/RmKUcN3VEZEllLUChzcFP4JwZmjfAxOrVDDujYCx n5B1HgNYHs8xkFESFo8+craX3o5ldUiT846nHXDPyyMYtGNnmdoNTAA1ohEzmHX09KK+ 15jQ== X-Gm-Message-State: AC+VfDxmAEFWQz4FyQEYg5Rt4Uz9ZIDPIypUhyPi88Lfh8Lxhu2KDXNf ETjifjz6xANJ76xf0d205fc6dGC4A1J1yvRf/qY= X-Received: by 2002:a17:90a:9307:b0:24d:ef6a:dd0a with SMTP id p7-20020a17090a930700b0024def6add0amr5444552pjo.5.1683397677239; Sat, 06 May 2023 11:27:57 -0700 (PDT) MIME-Version: 1.0 References: <20230506010933.170939-1-aford173@gmail.com> <20230506010933.170939-4-aford173@gmail.com> In-Reply-To: <20230506010933.170939-4-aford173@gmail.com> From: Adam Ford Date: Sat, 6 May 2023 13:27:45 -0500 Message-ID: Subject: Re: [PATCH V4 3/6] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically To: dri-devel@lists.freedesktop.org Cc: aford@beaconembedded.com, Chen-Yu Tsai , Frieder Schrempf , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Inki Dae , Jagan Teki , Marek Szyprowski , linux-kernel@vger.kernel.org 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 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 Fri, May 5, 2023 at 8:09=E2=80=AFPM Adam Ford wrote= : > > 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 > Tested-by: Frieder Schrempf > Reviewed-by: Frieder Schrempf Sorry for the noise. I forgot to merge in the suggested updates for the messages so they don't look like errors. A V5 is coming once I merge and test the changes. adam > --- > 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/brid= ge/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_d= sim *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); > + } > > ret =3D samsung_dsim_of_read_u32(node, "samsung,burst-clock-frequ= ency", > &dsi->burst_clk_rate); > -- > 2.39.2 >