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: 89219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp283800vqo; Mon, 1 May 2023 18:17:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BlQ4PrsdrcjmPsCPGB45hwXtVcVrYIw+X4x7wC4kdbvKnMjrlAnp8RkUhXQbCW2mPYFc3 X-Received: by 2002:a17:90a:dd8f:b0:24d:f0c6:ebb2 with SMTP id l15-20020a17090add8f00b0024df0c6ebb2mr6622710pjv.7.1682990246424; Mon, 01 May 2023 18:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682990246; cv=none; d=google.com; s=arc-20160816; b=zsFGHg0m4tb4orORLEMh2lOoybPN6lphpUqLpJDNCebuP/UhWxxGHVMxl7Ytix5UJh wX5KLmiglrqLUDeyGwruyhvm3ybqDkWaTZvyXNAX7z8CM6S8AIXNVHqS4j/WXq+A9hw3 KHTz3HrCk2yU0qXALc0q2eFSQXUjeY94inHrCh4jf2AXZaAuWLUk7orK2OcDPU28Yzjz Zr+tYzCc64xWeBGbO/JP57T/XTXICk/P/k1YaBUKj1JC6MuYP11+/bLsmROopgIkfqEC Wf+y4rdWke/21oxLHBHmZe5m/DTWI0tQRT+5+wXT5TLg/FisMkhwkNNfa2EXA/vyFXSf fkxg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m65-20020a632644000000b0050309caf60esi29288152pgm.750.2023.05.01.18.17.13; Mon, 01 May 2023 18:17:26 -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 S233410AbjEBBIh (ORCPT + 99 others); Mon, 1 May 2023 21:08:37 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764743180948901861?= X-GMAIL-MSGID: =?utf-8?q?1764743180948901861?= 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