Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6177775rwr; Mon, 1 May 2023 18:16:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69lCVrWLzHn5JGmBphFsuqFdWWPvY09f8qRpg8515OtnSLYphqPbhe5/SDJN9aXzWZPisn X-Received: by 2002:a17:90b:1991:b0:24b:9255:ce16 with SMTP id mv17-20020a17090b199100b0024b9255ce16mr16450977pjb.46.1682990217768; Mon, 01 May 2023 18:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682990217; cv=none; d=google.com; s=arc-20160816; b=lu1E8pQwapmOesalrINmFnjVJe+vmPGDcSVnexFpe1R72sNH4mQULEu3CMcmQpNJH3 C2Kcg2lLotaAhihyr3W8SDsJ6vNYNdoytTpj8L21QDT0MLuf2IYFDk9L+yrckpqhjSkA ODVwW6li0FxOZ/fUpyu7UqBm8/osQ855mMsvxK28PDtCnpKAbrGDNIDmeO9uJKAyfeQN ozBnqoNeeqlVmpDMwhU5Lkr4+P5s1CtQ/HEDqX57RuvngOM4zonTb/JuWNODcksXWpXu x1GrAnXzpAZ9t98iv8ktEjqb/i35mG/4cNc5zNNFhdTODGfmvrMnULHTTgcaZy8yBJd4 orzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lFK1TzRb+WofFBaYOMfgaKdiEVNH7eD9PTVjCEw9DwY=; b=EMoeh8mQ0qI3UyUaKn9ub1crkR2iFNu+CdmRn9JABhZWbTQJ26KrOYd3/tdRg7v2+6 uX0t/kU1U9wUBTTT4w9eMEMcN5ecm+/Q+421BK2FKE8bQhhNyzi/TikvTKFbnRBpOXD9 S8vWaVjokVn1r28fGVrL/SGZeX8erJM38pAKRyxkL/b7IWVAUSF0qhjMYpsDJ1i9NWE1 GlMq2TBgaljwHa1KMu8mThmUU2r38Tq6D6696ZlTsodARud0avajiLZMXtouEsSaZmND zDfh9Y4IBTpHFSG5ZJa/uUzYIIRneHdii0qCdPwNTsUdsHk+8jcwBDesRS9EbrphU3UH rcdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sbCNxbaH; 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 i7-20020a17090332c700b001a20c983d21si33250559plr.51.2023.05.01.18.16.44; Mon, 01 May 2023 18:16:57 -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=sbCNxbaH; 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 S233409AbjEBBIg (ORCPT + 99 others); Mon, 1 May 2023 21:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232580AbjEBBIT (ORCPT ); Mon, 1 May 2023 21:08:19 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF5F73AAB for ; Mon, 1 May 2023 18:08:16 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-3311691ebd0so1416645ab.1 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=BaTB7EAl4FOgcacik0/tP2N1RhELMrZMeDtqYTP2ODspyKD/VwjkXnhFNsCgBQc71n YnoI+4P5XT+ZLbLLoTikypcxMUB6Kg/uH2wI7+NRRk5EGMOb1moeaSnuVT3mXbwKJPib O57HYkwwygokTYzuVjzorEEm+ObeyoLxG8rrYVsVOf7kpSwE0hSuk/4J3yuqlduh4s4M NOEcKMRHAQ266nIL0OTBpW5x2eDgvePN/nUCiNE5zvlw7drwTq1uIVCVxPXdF7pWN0be Q6QuabmqtdeApz8y74roDEeey098wpMEU1bfE3TtEmicfpjvHpwNOvdANJY0i5BkGxYc rOlg== X-Gm-Message-State: AC+VfDxBRr1rGMa5EeWqKyQICTk8cKsfLInNFtIS5lBssM9cfzhlZS5e 5GkBgf8a6FgqlHSPVsb02mM= 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 Cc: marex@denx.de, aford@beaconembedded.com, Adam Ford , Chen-Yu Tsai , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Inki Dae , Jagan Teki , Marek Szyprowski , Frieder Schrempf , linux-kernel@vger.kernel.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 Content-Transfer-Encoding: 8bit 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 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 --- 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