From patchwork Sun Apr 23 12:12:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 13221292 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 6D18DC77B76 for ; Sun, 23 Apr 2023 12:13:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AC6210E38F; Sun, 23 Apr 2023 12:13:08 +0000 (UTC) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by gabe.freedesktop.org (Postfix) with ESMTPS id C546810E3B9 for ; Sun, 23 Apr 2023 12:13:00 +0000 (UTC) Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-329627dabfbso35779015ab.0 for ; Sun, 23 Apr 2023 05:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682251979; x=1684843979; 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=O6CFEB27xnVdVzEI62Flt6e1TPcC5Y7Hj3J4O8a2oNs=; b=HPz5zGuQZjGTlD9yDmRFg5osb0SdqVkhFRdAZeSXK3qdl6WHUVTmDNlROtS8eNFTQs EIcytRZzFR3srIcZQvhU7qdDC1fybmSrsjcIu6V0wXQE+YHfSQ8FuhKFdfxc+7bB+SLw QvG5oYV+oR10Sg3bObZFSw1eLZV+cHTUZfWaUGMmWGPJCY/dUzaZUrCgY/bMdyy4uDdq dkgI5WeG9TzCv1Xfi8hO7mUvKqpD/OB/5ucQ60/lcDZt8eXYultn1MRTl39ZaGupVV87 B3bM/sXNp2wV9QhzRvdSsDjvZaGwy0Gs5PY/jQXXj6ZN7L/heWci4OFbJ1AAQ4Iv6mYh vIcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682251979; x=1684843979; 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=O6CFEB27xnVdVzEI62Flt6e1TPcC5Y7Hj3J4O8a2oNs=; b=SkjXqh9RlCTauHxgRq5n2tkmuWvnD655tEGRKIKPFEh+x+xWdpIXc8GLPycNjyr0zN tvVWWoYtdzummOrrAEUsbSoaj0wmIfyDmf3GjoI1fEsX48u0LkD9vNVfeiJ8ptaRUHRY u0UINmVLrN37bD3OCfOyt7N3/jaMWXyveQfCP3i1lMvFZ6BjWxkEddCw7dSbOyw1c1Xb ZOHdIyRLfl8CiKouv7M592rm4HNqVH1Y450UESvU4ujBSvzZ9XeM5p0L/XIh7ssoiWc4 QU4axXHYuN1QURBw/Vvh+2BZ5slxdG4CZ0ddL6zwXJPTlOIk5GvzsdlUKHclX6+aephZ yjxw== X-Gm-Message-State: AAQBX9dF87brJi+SMzJ4THL1SO2jx5vB158WiZpzTAn/aWGrSEtfh8Dw osfL5LpEC0HOKxy4hrhw3EaQ1idw9RQ= X-Google-Smtp-Source: AKy350aV7Y3qxojQ8ut07O12d1kdEL+nfMyl42N9PB2EuYGoAfF2NGj/nUuy9peWZ/5OXSCH30XvqQ== X-Received: by 2002:a05:6e02:34a0:b0:326:5b1b:3cc5 with SMTP id bp32-20020a056e0234a000b003265b1b3cc5mr3119124ilb.15.1682251978999; Sun, 23 Apr 2023 05:12:58 -0700 (PDT) Received: from aford-B741.lan ([2601:447:d001:897f:b473:5d7c:4c2:75d7]) by smtp.gmail.com with ESMTPSA id u11-20020a02230b000000b00411a1373aa5sm1612155jau.155.2023.04.23.05.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Apr 2023 05:12:58 -0700 (PDT) From: Adam Ford To: dri-devel@lists.freedesktop.org Subject: [PATCH V2 4/6] drm: bridge: samsung-dsim: Dynamically configure DPHY timing Date: Sun, 23 Apr 2023 07:12:30 -0500 Message-Id: <20230423121232.1345909-5-aford173@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230423121232.1345909-1-aford173@gmail.com> References: <20230423121232.1345909-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: Marek Vasut , Neil Armstrong , Robert Foss , Jonas Karlman , Laurent Pinchart , aford@beaconembedded.com, Jernej Skrabec , linux-kernel@vger.kernel.org, Jagan Teki , Andrzej Hajda , m.szyprowski@samsung.com, dario.binacchi@amarulasolutions.com, Adam Ford 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 --- 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 5b6e7825b92f..f165483d5044 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