Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4808938rwe; Mon, 17 Apr 2023 19:55:56 -0700 (PDT) X-Google-Smtp-Source: AKy350Z6Rl0URKVrmcno/gm8jk+ekZ5XCoNB1utXelzMjw61nG99IQV/QSdM8HQLfdVnvFGixMe7 X-Received: by 2002:a05:6a00:1818:b0:63b:89ba:fca1 with SMTP id y24-20020a056a00181800b0063b89bafca1mr9620404pfa.10.1681786555960; Mon, 17 Apr 2023 19:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681786555; cv=none; d=google.com; s=arc-20160816; b=Zt92OFU0u5qyhAUnyokfAxF94RordZCPLLPpnC2/A1ZWBK+mFIOsH0G10EfqtxD4fi OjUJvYWcIdn/ACiYOHHzoBmWJk0AT5S1+xVbkIjUoecIO1g/T2MeSP8GZbBzKbX6RRDf z+1Zr/PNVC790vMs9Ypxhq9+vr25jROsdLH+ATCe39wxdxX4a/YHL965G9TReCqNi2If i9lofN7oboNB0MXYLz6e55XaklCe/5QHyOmX3uELs0rnn8+pOaGKH2N+xTQPjnrsPDqX i4HKxw1Qc3BfLkpRlr388P86TuJn5uyaaagAhXS0xNdkl/RJALZ1M/DPUDSi818/Xzat XWjQ== 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=OmIO4AdDKQdy+8t5oD0ActH/+eFcz+x5x3nOJUUqhCQ=; b=efi48S/LX/JFC9y1dIVi3F/Q0lvVtjC3tgWQ3Cc7ysb7DULTIeU72ayxAoVO233FGd InSq7ThQ3dY3SQYUz8LTJH9aDYCdA5xyFHVGd4NXUfUGr1LpXp6xeQdTy2KLUta6odi+ BLbTSD3XnLcbRC5oZNwSD6WyDh9iMn8MmHMS+1LHgtxaEbhEd2PoPluE5NRSMsAfWulL T0rHlIBnhpBtziq1yDLFTnp5qK6WHuEXCYcVJzi2w5oXTD/GXmBwATku9A2AcT6aaCz3 vox4iPEzBgw+F0TW3esrnxi7qeNIPJH1tWysEV9O6APFauaBLIop8I90XQOa+k4ZsPXd AsFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ZYk8e0xn; 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 bm18-20020a656e92000000b0051902cb0b5fsi13879304pgb.177.2023.04.17.19.55.44; Mon, 17 Apr 2023 19:55:55 -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=ZYk8e0xn; 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 S229830AbjDRCna (ORCPT + 99 others); Mon, 17 Apr 2023 22:43:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjDRCn2 (ORCPT ); Mon, 17 Apr 2023 22:43:28 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF53422D; Mon, 17 Apr 2023 19:43:27 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-63b51fd2972so1366412b3a.3; Mon, 17 Apr 2023 19:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681785806; x=1684377806; 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=OmIO4AdDKQdy+8t5oD0ActH/+eFcz+x5x3nOJUUqhCQ=; b=ZYk8e0xnFpSbdWGBL12gfnkN8bm66ghxLYzKfJSzINawVMKpggmz1STUYKM922oyOt Eaq2nakbFzVsulDAExekVrQChKfXHBw/lKK83+dnrqNUyApP3KvSTCXu2jy/s8j6wtzO wogs34JGO0c8R8X51ZRT/zyd9MUDd+7tEJhHSGl9sdHuFN+Al+Q+psLL05mQcBOO16eJ 8Q+9mYJLw1AIz3/PC+iPn7m3JgSm49iFCG+AbJKgmAUaPc5GbBpeej/a7OCW2f5HWFK7 wnbkYY6ca1IRlVhgZI+fVaeuqxInU2LmuXDpXdK0ev/nwPJM6+qxILSmHH0VlhVGx7z8 HDEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681785807; x=1684377807; 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=OmIO4AdDKQdy+8t5oD0ActH/+eFcz+x5x3nOJUUqhCQ=; b=Y567FG2f9h+ULqxLB5v96dRrrvp0EUpTlsQRuEI0i3c5OEGgGTNgmrOzgaD9zJdhrg FRmgb8zL+mk33seWOIdIejpx11qha8KpTOM7MauDiEWzif/HcqPkUDwZe8jS1UQmGX9P eJquShuU6DlktUrewnwC+uSByhLBrEEYbCYKGLjrzOY185ZM5TtJpdiZAL7IdsSaQrcL W7sJP8rfqWEbdSPgRrxR/L51Rj94u722HX+cVUC+ZyRR6SP6mGTv8zH/XUy2pBoLL190 51C7ar1s5z4WWNln3EK6MZIgJYzVzhQxLE+xqxxlfI8ko615EqEl0A6QGpkymhDaYKzx d1uw== X-Gm-Message-State: AAQBX9dJ2DBv9BdkS9uKS2SXk4m9LMMwayDW4gGdlkSKcsmDCVkZ0iOB dDEZcYQkVVnQJl4T2GSgjOBtPPrWzJBmgE7QoEo= X-Received: by 2002:a05:6a00:228b:b0:63b:641d:76d8 with SMTP id f11-20020a056a00228b00b0063b641d76d8mr6976290pfe.2.1681785806554; Mon, 17 Apr 2023 19:43:26 -0700 (PDT) MIME-Version: 1.0 References: <20230415104104.5537-1-aford173@gmail.com> <20230415104104.5537-4-aford173@gmail.com> <8db7ad8da4805d7eb4471051676d179e193ee399.camel@pengutronix.de> In-Reply-To: From: Adam Ford Date: Mon, 17 Apr 2023 21:43:15 -0500 Message-ID: Subject: Re: [PATCH 4/6] drm: bridge: samsung-dsim: Dynamically configure DPHY timing To: Lucas Stach Cc: dri-devel@lists.freedesktop.org, Krzysztof Kozlowski , aford@beaconembedded.com, Frieder Schrempf , Laurent Pinchart , Andrzej Hajda , Fabio Estevam , m.szyprowski@samsung.com, marex@denx.de, Robert Foss , David Airlie , Jernej Skrabec , Jagan Teki , NXP Linux Team , devicetree@vger.kernel.org, Daniel Vetter , Jonas Karlman , Sascha Hauer , Inki Dae , Rob Herring , linux-arm-kernel@lists.infradead.org, Neil Armstrong , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Shawn Guo 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 Mon, Apr 17, 2023 at 6:53=E2=80=AFAM Adam Ford wrot= e: > > On Mon, Apr 17, 2023 at 3:38=E2=80=AFAM Lucas Stach wrote: > > > > Hi Adam, > > > > Am Samstag, dem 15.04.2023 um 05:41 -0500 schrieb Adam Ford: > > > NXP uses a lookup table to determine the various values for > > > the PHY Timing based on the clock rate in their downstream > > > kernel. Since the input clock can be variable, the phy > > > settings need to be variable too. Add an additional variable > > > to the driver data to enable this feature to prevent breaking > > > boards that don't support it. > > > > > > > I haven't checked if this generates values close to the ones in this > > table, but I guess it should be worth a try to use > > phy_mipi_dphy_get_default_config() instead. > > I didn't know that was a thing. I like that idea much better than the > table. I just pulled what NXP had and tweaked it to fit the mainline. > I'll give it a try in the next few days, when I have some more time. I tried phy_mipi_dphy_get_default_config() and the function return different values than what NXP's table returns, and the screen doesn't sync properly. I will try to figure out the mathematical calculation to generate the values for this DSIM instead of using a lookup table. adam > > adam > > > > Regards, > > Lucas > > > > > Signed-off-by: Adam Ford > > > --- > > > drivers/gpu/drm/bridge/samsung-dsim.c | 85 +++++++-- > > > drivers/gpu/drm/bridge/samsung-dsim.h | 254 ++++++++++++++++++++++++= ++ > > > include/drm/bridge/samsung-dsim.h | 1 + > > > 3 files changed, 326 insertions(+), 14 deletions(-) > > > create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.h > > > > > >