From patchwork Tue May 2 01:07:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 13228411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AED3C7EE21 for ; Tue, 2 May 2023 01:08:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9502710E0E3; Tue, 2 May 2023 01:08:18 +0000 (UTC) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by gabe.freedesktop.org (Postfix) with ESMTPS id D8A8610E2E9 for ; Tue, 2 May 2023 01:08:16 +0000 (UTC) Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-760f8ffb27fso54744939f.2 for ; Mon, 01 May 2023 18:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682989696; x=1685581696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lFK1TzRb+WofFBaYOMfgaKdiEVNH7eD9PTVjCEw9DwY=; b=sbCNxbaHm/4Ns0b0+O4D6S3b909ab9R4JIc6mVPhYCgppojoxTQL7UP4ZdTQQmUkXQ sRiuw1/O0tTB8WXfVTSY6wDQNqDNyU0vPEAtj0MUol5REjp1p3g9jvevBpH7myCb7bw1 bkCUbqR4rr7iO1M4261UGgcsLE8DfPC0fKBiH7UjDdfBnqSGyGdaUHay2LlZ+sbMOEyy ousGnAP0NOZxqdI37sY9Yf9L3EMGFkrNTwSLKZHfJ4rRMTtdzHrAvaeaqnsjIyipWL9i 3qan6Q4Px653UIgZJAZanEyY6kbRIaqm5mvqUEJP2tP7jKQg2KjkFbSR9x3sTkHSf656 5CZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682989696; x=1685581696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lFK1TzRb+WofFBaYOMfgaKdiEVNH7eD9PTVjCEw9DwY=; b=Aeql6/Hx2mKn1RC9Ft5yYqRf+y6y6mKMrEnBUqqlblSeWDXNVPd+5zmIvBGyEkTDSr 3Mncs37BJST/5Zp+lsvWAeIcZBjWeFUW5JvvIiqOPoLXQ10tYQOXlagAOqr+ZyRGuPmd 6dkb+5KbpSFWJvln3wW67Z7IjnFQR8uZO2h8IAhm6V5vQge7/pdFVu4FATI/VoXoF2JL pQW30rUfMg1mUVP2qBdNwU2MuEAf2EvHMKIvHbN9F87Vwry87mWwZnsBdwsPRdVmkb+X kGmhIAz4zBmXfx2M71e3D132QDutfZDqAHcOELquSnC9T+iviTqg2qHAXcLvIASZtw5V wWbw== X-Gm-Message-State: AC+VfDxyxolyEGyPmOLlihE2rc0Skbf0M2ggHVPqlwNqWH/rSR7KQh/4 NqHWytw8dkZwTWoxu42LL3hXmzW2Bpr56Q== X-Google-Smtp-Source: ACHHUZ6oXvc/Tm8pSKJtWxjgaQbf1O1pDYMnUGAp/ExDVDOTTgZfVeMUcAIVcCB70gmFKzggiizX+Q== X-Received: by 2002:a92:c711:0:b0:331:250a:a61b with SMTP id a17-20020a92c711000000b00331250aa61bmr248226ilp.8.1682989696008; Mon, 01 May 2023 18:08:16 -0700 (PDT) Received: from aford-B741.lan ([2601:447:d001:897f:8257:a536:d7fc:1919]) by smtp.gmail.com with ESMTPSA id f16-20020a056638329000b0040fb5d5429fsm4836329jav.131.2023.05.01.18.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 18:08:15 -0700 (PDT) From: Adam Ford To: dri-devel@lists.freedesktop.org Subject: [PATCH V3 5/7] drm: bridge: samsung-dsim: Dynamically configure DPHY timing Date: Mon, 1 May 2023 20:07:57 -0500 Message-Id: <20230502010759.17282-6-aford173@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230502010759.17282-1-aford173@gmail.com> References: <20230502010759.17282-1-aford173@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marex@denx.de, Neil Armstrong , Robert Foss , Jonas Karlman , aford@beaconembedded.com, Jernej Skrabec , Frieder Schrempf , Laurent Pinchart , Andrzej Hajda , Chen-Yu Tsai , Marek Szyprowski , Adam Ford , linux-kernel@vger.kernel.org, Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The DPHY timings are currently hard coded. Since the input clock can be variable, the phy timings 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. The phy_mipi_dphy_get_default_config function configures the DPHY timings in pico-seconds, and a small macro converts those timings into clock cycles based on the pixel clock rate. Signed-off-by: Adam Ford Tested-by: Chen-Yu Tsai Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf Tested-by: Michael Walle --- drivers/gpu/drm/bridge/samsung-dsim.c | 79 +++++++++++++++++++++++---- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 2dc02a9e37c0..99642230a54a 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -18,9 +18,7 @@ #include #include #include - #include