From patchwork Mon Dec 10 16:17:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FA311759 for ; Mon, 10 Dec 2018 16:19:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EBBA2A713 for ; Mon, 10 Dec 2018 16:19:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 730742A86D; Mon, 10 Dec 2018 16:19:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 788902A713 for ; Mon, 10 Dec 2018 16:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbeLJQRw (ORCPT ); Mon, 10 Dec 2018 11:17:52 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54280 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727159AbeLJQRs (ORCPT ); Mon, 10 Dec 2018 11:17:48 -0500 Received: by mail-wm1-f67.google.com with SMTP id a62so4139710wmh.4 for ; Mon, 10 Dec 2018 08:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EEGBFedCv0eGIwFBpPqp7aDi2x6OUg3hp3DvnJn01c8=; b=c6YjHI+8zaC8n0EX4g1e8Vzwq0r6HCALxJ7GNsXRoSdq5wGlk8aqV/UMUWWy0ZigNu pJWOQbpwtk91QX+azruY7KvFzZr1EcdNqByLWx+kfBWeKJno2lvvLH6neki4WH2teAfc hw1FzyfEbpO0kXMjwmBiKA7sBioRz5hHYVvn4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EEGBFedCv0eGIwFBpPqp7aDi2x6OUg3hp3DvnJn01c8=; b=lHqgCniLQSogt0D64MNojCd3yPugmVEh71lsysUOUt0Au12rn47tYYzHIVZmjyim+n 9Lhfc9NUWhJxxXe17a4H3FS5Ri7Y28Lb/f3UT7hRPBUbltv5QNEk8WXSLU+ELrV9/o3s 5CPs34m8G5VIrHfLnYEq/gVJrRkjxmlIZz9rGMmpDxw00SfblntezYc/g/ojnhGsp6Mz IEVh4Avfr5CcOzm+HTexM4bjCWTvdIfM8t0kCaxritq+XmNIxuUeO9NZ0SgQbRfSn0tn lT1rNKBF/qMAkU0EFstUvOVjCGXsXl/91A10SrxR/23SD90K/9dJ8QnhhoI8lKJkRST5 66Hg== X-Gm-Message-State: AA+aEWYYzmzvj6YFaXYWAhswWMZHGZlLc+5CMYYA7mTWc5kJtYeHRLdS SdGyo2O4AuJeduLEVgVjUJyAfA== X-Google-Smtp-Source: AFSGD/UpCEzvMXG9xNu95c5VJhwbFLp1a5BdqBxOrmp/Ab/qDMfMcWI2sk3xnLZqpOL57VXj6x8Qyw== X-Received: by 2002:a1c:16ce:: with SMTP id 197mr10900332wmw.126.1544458665729; Mon, 10 Dec 2018 08:17:45 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:45 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 01/17] clk: sunxi-ng: Add check for minimal rate to NKM PLLs Date: Mon, 10 Dec 2018 21:47:13 +0530 Message-Id: <20181210161729.29720-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some NKM PLLs doesn't work well when their output clock rate is set below certain rate. So, add support for minimal rate for relevant PLLs. Signed-off-by: Jagan Teki Acked-by: Stephen Boyd --- drivers/clk/sunxi-ng/ccu_nkm.c | 5 +++++ drivers/clk/sunxi-ng/ccu_nkm.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c index 841840e35e61..096ff4f4839a 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.c +++ b/drivers/clk/sunxi-ng/ccu_nkm.c @@ -125,6 +125,11 @@ static unsigned long ccu_nkm_round_rate(struct ccu_mux_internal *mux, if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) rate *= nkm->fixed_post_div; + if (rate < nkm->min_rate) { + rate = nkm->min_rate; + return rate; + } + ccu_nkm_find_best(*parent_rate, rate, &_nkm); rate = *parent_rate * _nkm.n * _nkm.k / _nkm.m; diff --git a/drivers/clk/sunxi-ng/ccu_nkm.h b/drivers/clk/sunxi-ng/ccu_nkm.h index cc6efb70a102..ff5bd00f429f 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.h +++ b/drivers/clk/sunxi-ng/ccu_nkm.h @@ -35,6 +35,7 @@ struct ccu_nkm { struct ccu_mux_internal mux; unsigned int fixed_post_div; + unsigned int min_rate; struct ccu_common common; }; From patchwork Mon Dec 10 16:17:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8FB61759 for ; Mon, 10 Dec 2018 16:17:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 994A02AB34 for ; Mon, 10 Dec 2018 16:17:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D7DB2ABA8; Mon, 10 Dec 2018 16:17:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E9EE2AB34 for ; Mon, 10 Dec 2018 16:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727416AbeLJQRu (ORCPT ); Mon, 10 Dec 2018 11:17:50 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53161 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727410AbeLJQRu (ORCPT ); Mon, 10 Dec 2018 11:17:50 -0500 Received: by mail-wm1-f65.google.com with SMTP id r11-v6so11501517wmb.2 for ; Mon, 10 Dec 2018 08:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rlpTqVyJlpHFfIEuYuSfPKgTjg+EAGEL37BZe3O0asI=; b=kNb5POBIBg7XzJkmwn4Gn1mBl5X6SAgU4zKK8zpqOvax0/eJk56DU8LwrbzdpxrQLw lpzC2tFY28hbXcAI/itZQh7tj85b3hCcfDJNwPOrkvbE9Ov5bPqL2uZu7/lJVqWijN9W S1XOoLrcgpdO4jhAQsbhlLoHWPo9rV/4nsGcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rlpTqVyJlpHFfIEuYuSfPKgTjg+EAGEL37BZe3O0asI=; b=GB0/kOeoOF7PcGXcAdfeXFkVQeH52gqHqJYxg1j92LUlUvUlALboaaGLGifrsO4HdH IQiogZj2TpM6eAaWJ3x19iRBK9SPqYEG5NZjccAMto/pfX9hn2OI8OdUP868TpqvJmHX LHtH3loZITzYqDEFWzfsI4+LGm/0UwPgh+jtdbgl12gmRwMgtsXEd0wG/L5HUMULMf6k 8BqgkbHRdmA1dc4/tfWWkKQ0hqUaG1HT/dK5+x4vWvyscBhFA3QzgSqkn8+HugA2Lp9Q xnpC2YnTKyiAiZe6PHlSLShePAA4IaqDFaA9C3jMIgfEjKSU8M+G9Grx5J5/Y/Zn2fiR cLOA== X-Gm-Message-State: AA+aEWaLT8A/jnoPwfEJXAORoz+etyOz6ThnRWH1x/6flpLXk7oM2Gey K5t2XAhaqGeegKdXlLA05cITAg== X-Google-Smtp-Source: AFSGD/VoTlK9WvKe2US+zX0kbpr0yUt00tI+tJODq6fmyn2DLN+OprVTA8jEQYXnmnycVt8TbQJKiA== X-Received: by 2002:a1c:18c:: with SMTP id 134mr10850811wmb.88.1544458667726; Mon, 10 Dec 2018 08:17:47 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:47 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 02/17] drm/sun4i: sun6i_mipi_dsi: Add has_mod_clk quirk Date: Mon, 10 Dec 2018 21:47:14 +0530 Message-Id: <20181210161729.29720-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Mod clock is not mandatory for all Allwinner MIPI DSI controllers, it is connected as CLK_DSI_SCLK for A31 and not available in A64. So add has_mod_clk quirk and process the clk accordingly. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 39 ++++++++++++++++++-------- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 5 ++++ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index e3b34a345546..561de393ea23 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -981,6 +982,8 @@ static int sun6i_dsi_probe(struct platform_device *pdev) dsi->host.ops = &sun6i_dsi_host_ops; dsi->host.dev = dev; + dsi->variant = of_device_get_match_data(dev); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(dev, res); if (IS_ERR(base)) { @@ -1001,17 +1004,20 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return PTR_ERR(dsi->reset); } - dsi->mod_clk = devm_clk_get(dev, "mod"); - if (IS_ERR(dsi->mod_clk)) { - dev_err(dev, "Couldn't get the DSI mod clock\n"); - return PTR_ERR(dsi->mod_clk); + if (dsi->variant->has_mod_clk) { + dsi->mod_clk = devm_clk_get(dev, "mod"); + if (IS_ERR(dsi->mod_clk)) { + dev_err(dev, "Couldn't get the DSI mod clock\n"); + return PTR_ERR(dsi->mod_clk); + } } /* * In order to operate properly, that clock seems to be always * set to 297MHz. */ - clk_set_rate_exclusive(dsi->mod_clk, 297000000); + if (dsi->variant->has_mod_clk) + clk_set_rate_exclusive(dsi->mod_clk, 297000000); dphy_node = of_parse_phandle(dev->of_node, "phys", 0); ret = sun6i_dphy_probe(dsi, dphy_node); @@ -1043,7 +1049,8 @@ static int sun6i_dsi_probe(struct platform_device *pdev) pm_runtime_disable(dev); sun6i_dphy_remove(dsi); err_unprotect_clk: - clk_rate_exclusive_put(dsi->mod_clk); + if (dsi->variant->has_mod_clk) + clk_rate_exclusive_put(dsi->mod_clk); return ret; } @@ -1056,7 +1063,8 @@ static int sun6i_dsi_remove(struct platform_device *pdev) mipi_dsi_host_unregister(&dsi->host); pm_runtime_disable(dev); sun6i_dphy_remove(dsi); - clk_rate_exclusive_put(dsi->mod_clk); + if (dsi->variant->has_mod_clk) + clk_rate_exclusive_put(dsi->mod_clk); return 0; } @@ -1066,7 +1074,8 @@ static int __maybe_unused sun6i_dsi_runtime_resume(struct device *dev) struct sun6i_dsi *dsi = dev_get_drvdata(dev); reset_control_deassert(dsi->reset); - clk_prepare_enable(dsi->mod_clk); + if (dsi->variant->has_mod_clk) + clk_prepare_enable(dsi->mod_clk); /* * Enable the DSI block. @@ -1094,7 +1103,8 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev) { struct sun6i_dsi *dsi = dev_get_drvdata(dev); - clk_disable_unprepare(dsi->mod_clk); + if (dsi->variant->has_mod_clk) + clk_disable_unprepare(dsi->mod_clk); reset_control_assert(dsi->reset); return 0; @@ -1106,9 +1116,16 @@ static const struct dev_pm_ops sun6i_dsi_pm_ops = { NULL) }; +static const struct sun6i_dsi_variant sun6i_a31_dsi = { + .has_mod_clk = true, +}; + static const struct of_device_id sun6i_dsi_of_table[] = { - { .compatible = "allwinner,sun6i-a31-mipi-dsi" }, - { } + { + .compatible = "allwinner,sun6i-a31-mipi-dsi", + .data = &sun6i_a31_dsi, + }, + { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table); diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index dbbc5b3ecbda..597b62227019 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -20,6 +20,10 @@ struct sun6i_dphy { struct reset_control *reset; }; +struct sun6i_dsi_variant { + bool has_mod_clk; +}; + struct sun6i_dsi { struct drm_connector connector; struct drm_encoder encoder; @@ -35,6 +39,7 @@ struct sun6i_dsi { struct sun4i_drv *drv; struct mipi_dsi_device *device; struct drm_panel *panel; + const struct sun6i_dsi_variant *variant; }; static inline struct sun6i_dsi *host_to_sun6i_dsi(struct mipi_dsi_host *host) From patchwork Mon Dec 10 16:17:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F62718A7 for ; Mon, 10 Dec 2018 16:19:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BDD22A713 for ; Mon, 10 Dec 2018 16:19:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1032F2A952; Mon, 10 Dec 2018 16:19:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A68092AA18 for ; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbeLJQRw (ORCPT ); Mon, 10 Dec 2018 11:17:52 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53644 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbeLJQRv (ORCPT ); Mon, 10 Dec 2018 11:17:51 -0500 Received: by mail-wm1-f67.google.com with SMTP id y1so11504501wmi.3 for ; Mon, 10 Dec 2018 08:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XHVyHtVc0G3Kpp5cjsZwGbecU0Xlg/ozATiwaeVvdoQ=; b=ZE9ajIXqPxmINSacZd+H8oprtTFFyxpDCOZ2azqgIZ4MrD8FGUNTWwvslD8KG0DOpi ilI581RXk+JktjgSE0o8KGaSlCe3pwRdpL4IRr0NIdB1tNJaUns2ocfnBSC2WqQuxR4Z CDACrhmZyDVqmlA1fYMQFSnKyE5geIbCOAcQw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XHVyHtVc0G3Kpp5cjsZwGbecU0Xlg/ozATiwaeVvdoQ=; b=bwzO/pC2aOh/FlHqGfJq50gOUcw8rsjFwcxnPjxwlVXcYcrTEYCA87zQDD4CZUfcGz OotxRmJsvTK9+HVskB1jkfJ05yS0Q1KcXhM4F+XtIKygpDIve2TspQ5dJprz10bHIJwU ZCdDd3RzikOj9vbc8i53K005Jnr+1EMv1tinQ4doPbKgNoDsIt/Ox0McqpykoAZwTDJy Md0Du62Td1METW7uHCBth2EPXfgkGevYt8O/JTKYEReZkGhd/ajjx8fElCJd69KCakzY 9kPPhW1TBk9SDNI76gzpBcaxdVnZpfG34IMevNotmh0X0SyQDjHIriJ7a5gvq9hmNpWj ZS7w== X-Gm-Message-State: AA+aEWZmJNtH9lA7/7dKD7+TVW4lAk3Qjo6ojFMUEtGKGaw10LAU9dIU 9zTpz+x47+Cs/jkD1viDfwEQCg== X-Google-Smtp-Source: AFSGD/VmMHUxhKg+eCn4NcXCKmMarXP8qz9Fx0lmTKt2sUbFkE9TD3lBen1AoXZTyUnuHgUca0BB7g== X-Received: by 2002:a1c:a6d7:: with SMTP id p206mr10662383wme.143.1544458669864; Mon, 10 Dec 2018 08:17:49 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:48 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 03/17] drm/sun4i: sun6i_mipi_dsi: Add Allwinner A64 MIPI DSI support Date: Mon, 10 Dec 2018 21:47:15 +0530 Message-Id: <20181210161729.29720-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The MIPI DSI controller on Allwinner A64 is similar to Allwinner A31 without support of DSI mod clock(CLK_DSI_SCLK) So, alter has_mod_clk bool via driver data for respective SoC's compatible. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 561de393ea23..50f535ae57e9 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1120,11 +1120,18 @@ static const struct sun6i_dsi_variant sun6i_a31_dsi = { .has_mod_clk = true, }; +static const struct sun6i_dsi_variant sun50i_a64_dsi = { +}; + static const struct of_device_id sun6i_dsi_of_table[] = { { .compatible = "allwinner,sun6i-a31-mipi-dsi", .data = &sun6i_a31_dsi, }, + { + .compatible = "allwinner,sun50i-a64-mipi-dsi", + .data = &sun50i_a64_dsi, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table); From patchwork Mon Dec 10 16:17:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4A0513AF for ; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A56FC2A713 for ; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99DD32A95E; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 447E22A713 for ; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727143AbeLJQTM (ORCPT ); Mon, 10 Dec 2018 11:19:12 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53649 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728538AbeLJQRw (ORCPT ); Mon, 10 Dec 2018 11:17:52 -0500 Received: by mail-wm1-f68.google.com with SMTP id y1so11504605wmi.3 for ; Mon, 10 Dec 2018 08:17:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/FobAdk1F/zKxxqm1vIJo/CC8EUNzQ/B2arqE/fLkis=; b=O+e/8jGesF+TnCn8gM5SRD6NP0q6G5NYENXdrkyRc7q6CU8Eb4i7GTW60z95JnEKPO 3fzgHoSR4cQxYPPHQx7cgqEWpf8VhVRVlamBtQKDyQ+1D8h+RYZ3/XueJyOGoxXBOYx7 ArhaFDsmcOHfNIiTy6wxPHhItB8ClC60tXJgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/FobAdk1F/zKxxqm1vIJo/CC8EUNzQ/B2arqE/fLkis=; b=Hdz+OEUPY4V7EAj4wC/MTMxErDp8gQ5Uyx+lg/VFG6GlGdFw01Pk/l/YGySoswNv6k gBVFQmJi/XgVD2drxmYTh0pTJEaUcoox+Dik0Pi+85whK3aG1JAcZ2QILr4r2GzVxM0b 9dnKQzfjZ1Zyls4eY4xt4s3jaEhcqTAmoLq3qyy9EVqhoQVpr7prwPAYIzhGijElNFJz X76vk4yDZ7xJEYxm/wAC4pL5GKFqt7YgeMyX4R1pREjl7xO5YqS7jeTP7chtdhCcugRs RT3zabPG3q0JnU6hOy+y3WI3dp8fdnEFizfZOY/vc3+BaofkzWZRBDtkcxvlLllBMwFR +W4g== X-Gm-Message-State: AA+aEWaEOk5ysy+8t4FXm+oGkbpCg0fSgJBj1n5yFvyVPzgmtVM69cd4 LJW/T+U/1yAM1GdjQGc/y+LbZA== X-Google-Smtp-Source: AFSGD/UGSus8mIueXi7G092yzijN2KgoYa8ydFRdqDZafNWarrOeEj+ecoQ1Q8xrLccYkOaSqYz39g== X-Received: by 2002:a1c:2787:: with SMTP id n129mr11580381wmn.128.1544458671352; Mon, 10 Dec 2018 08:17:51 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:50 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 04/17] dt-bindings: sun6i-dsi: Add compatible for A64 MIPI DSI Date: Mon, 10 Dec 2018 21:47:16 +0530 Message-Id: <20181210161729.29720-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The MIPI DSI controller on Allwinner A64 is similar to Allwinner A31 without support of DSI mod clock. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt index 6a6cf5de08b0..9fa6e7a758ad 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt @@ -12,6 +12,7 @@ The DSI Encoder generates the DSI signal from the TCON's. Required properties: - compatible: value must be one of: * allwinner,sun6i-a31-mipi-dsi + * allwinner,sun50i-a64-mipi-dsi - reg: base address and size of memory-mapped region - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the DSI encoder From patchwork Mon Dec 10 16:17:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 557551759 for ; Mon, 10 Dec 2018 16:19:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44DD52A713 for ; Mon, 10 Dec 2018 16:19:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 384592A86D; Mon, 10 Dec 2018 16:19:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59F3B2A713 for ; Mon, 10 Dec 2018 16:19:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727262AbeLJQRz (ORCPT ); Mon, 10 Dec 2018 11:17:55 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34018 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728550AbeLJQRz (ORCPT ); Mon, 10 Dec 2018 11:17:55 -0500 Received: by mail-wm1-f67.google.com with SMTP id y185so6989360wmd.1 for ; Mon, 10 Dec 2018 08:17:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0G2Cm6yl0hA4By0n3opJjvWD4CEYft0z/6JnEL+u5rs=; b=iUDo70ylsxbw31KSTQNl5zLd47rgtT8gzDjZUFM2Uytf7J7H3BEaghRCvwtYg0Smek 91cLB4+6QeyZXk1lRnruo/ODwDJBb2HRJEunozV+R27S0bDcVNJurGw/myGHdHQbF7iM g+c6gYO4UxF2sNQUpTrLdQLx1vYxqOd5Rc01M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0G2Cm6yl0hA4By0n3opJjvWD4CEYft0z/6JnEL+u5rs=; b=DABPYnvhiXesvJ6X0bE8lDNJUMdnfNRusgld4G0M3CYlUxjrmNRZ2jL2QkGYdEDpyD SKsrjZsRQSc6McG5kdjWCgP6xerKSIppH7lM8pS8XrFPiOI8WtcDTbi3g9bDhpdTXH+N h6AHARq3D9Ol3dDUN5H72l7OCWvjL5I3LoypI/FW0XActpHmNpMm87SzP2qwh9z8RLgQ yQv6VLHEU2nkTLqR8X3yv69QCnzzsag7JT76dJCWC+D7FjANhUNiQUKGWsTe15jA3mWj elWm2JqIGNkVDGIhVO+LYdaOw6nG8fvetS7/u8JPfzx3Gdb+i4l+fRkPGPVKSUdx3Ir2 qFFg== X-Gm-Message-State: AA+aEWaFdtnLKnqmy3I7qqkSkiWe593aNzsVOah4pbyh138SETe3FOaY zWPHt3I5KWpXbPuDDPVAcztPMkqMYhk= X-Google-Smtp-Source: AFSGD/VgVCcVXfXR6IgQH8Ctvc2lTvygISQ8DSmGKfU4RYD/M85sJu1tV6MPzTuEmSwpAC8ZIb3/IQ== X-Received: by 2002:a1c:990c:: with SMTP id b12mr11709720wme.106.1544458673231; Mon, 10 Dec 2018 08:17:53 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:52 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 05/17] drm/sun4i: sun6i_mipi_dsi: Add DSI Generic short write 2 param transfer Date: Mon, 10 Dec 2018 21:47:17 +0530 Message-Id: <20181210161729.29720-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Short transfer write support for DCS and Generic transfer types share similar way to process command sequence in DSI block so add generic write 2 param transfer type macro so-that the panels which are requesting similar transfer type may process properly. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 50f535ae57e9..cdd44a1307b3 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -871,6 +871,7 @@ static ssize_t sun6i_dsi_transfer(struct mipi_dsi_host *host, switch (msg->type) { case MIPI_DSI_DCS_SHORT_WRITE: case MIPI_DSI_DCS_SHORT_WRITE_PARAM: + case MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM: ret = sun6i_dsi_dcs_write_short(dsi, msg); break; From patchwork Mon Dec 10 16:17:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 400BA1759 for ; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3001B2A713 for ; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 248372A86D; Mon, 10 Dec 2018 16:19:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C53E12A713 for ; Mon, 10 Dec 2018 16:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727577AbeLJQTH (ORCPT ); Mon, 10 Dec 2018 11:19:07 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34618 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728557AbeLJQR4 (ORCPT ); Mon, 10 Dec 2018 11:17:56 -0500 Received: by mail-wr1-f68.google.com with SMTP id j2so11124806wrw.1 for ; Mon, 10 Dec 2018 08:17:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1E70xeoJgFDlzIA3oUYjw8e22CRq5X3bSrjLQMHtvYQ=; b=mN9suXNqQg3s1ivOE+Oyt4ThILfe2dCniMwRaX4g401CTmR6aZfqEKhAxLoY1X/IWq cc+mzAdvuSgJUStOEfys0Wv2XXVEMBbeHqM5DCC/fL8MBY8mzA9L4B1q3bZI0upLJ2SJ BNIgEDmTCD2lkiXC1HXq13almmLQNHmLuT6J4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1E70xeoJgFDlzIA3oUYjw8e22CRq5X3bSrjLQMHtvYQ=; b=Sr8vjDhUiXs7pgUOupOrJIUiqW1biiqJsFFcX3EHA/UFYTz5hNc1FcluQqO4p3ah3l ENx0To+0zonv4/4/xLaPjR7NydSP3Xlpby8bvuYYPcw36FF679Z4JhxDLfi07Qa6JWQU oc2IlNP9h6f36B9FZZxNepSNqAMOGUgqLV+D2gi8teCa7gYZZjExcScilTjHl69bhMYf 1RG/KfNevWRMNCye6Czl/oJoNVR+EXF4Yaymrwc2an8XXzG+5bz1AIqA3MwCLmYIZm8A yMj/Z8Y0iZjinKI47JZGKv4cmAkfqySL5pruda/OSAFTrfydiLvecpNZYn5yUC+YBhJb KLdg== X-Gm-Message-State: AA+aEWYwk63GgFkl0mZDyV+kvOcpZhMibQP6ui1gica1vVjAWYIGhEQR RGvn3+RbuVnpKtxtU4sEB6EDVw== X-Google-Smtp-Source: AFSGD/V0RE8LG+FIsAjtBoW76+Ltv5cDn/pbtTDZAbRKucmXo2LBvuD0aJheiCDGz4F9Ll+4+gLGFA== X-Received: by 2002:adf:9361:: with SMTP id 88mr9946323wro.204.1544458674818; Mon, 10 Dec 2018 08:17:54 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:54 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 06/17] drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits Date: Mon, 10 Dec 2018 21:47:18 +0530 Message-Id: <20181210161729.29720-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TCON DRQ set bits for non-burst DSI mode can computed via horizontal front porch instead of front porch + sync timings. BSP code form BPI-M64-bsp is computing TCON DRQ set bits for non-burts as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) => panel->lcd_ht - panel->lcd_x - panel->lcd_hbp => (timmings->hor_front_porch + panel->lcd_hbp + panel->lcd_x) - panel->lcd_x - panel->hbp => timmings->hor_front_porch => mode->hsync_start - mode->hdisplay So, update the DRQ set bits accordingly. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index cdd44a1307b3..c9b0222ebcd4 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -367,9 +367,9 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, struct mipi_dsi_device *device = dsi->device; u32 val = 0; - if ((mode->hsync_end - mode->hdisplay) > 20) { + if ((mode->hsync_start - mode->hdisplay) > 20) { /* Maaaaaagic */ - u16 drq = (mode->hsync_end - mode->hdisplay) - 20; + u16 drq = (mode->hsync_start - mode->hdisplay) - 20; drq *= mipi_dsi_pixel_format_to_bpp(device->format); drq /= 32; From patchwork Mon Dec 10 16:17:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 925AD13AF for ; Mon, 10 Dec 2018 16:18:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81E4F29DC8 for ; Mon, 10 Dec 2018 16:18:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 759B42A058; Mon, 10 Dec 2018 16:18:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22E4529DC8 for ; Mon, 10 Dec 2018 16:18:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728551AbeLJQR6 (ORCPT ); Mon, 10 Dec 2018 11:17:58 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33652 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728561AbeLJQR6 (ORCPT ); Mon, 10 Dec 2018 11:17:58 -0500 Received: by mail-wr1-f67.google.com with SMTP id c14so11137947wrr.0 for ; Mon, 10 Dec 2018 08:17:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TxNgORGPoSCn3Oq9HEn9GoMFiwahxDYqmWRf1K3P8O8=; b=lvquzrG04DT0Y6bsbtOA+ZLoIGEvklE7XkuYHVBq0nhUBrl4xHRjAy8d0aNGFU11ux klqCRmNcoo8g0irOhc48Z5qjccbNYyTYTskDA+JQVBI+9QZNSbDjKPspgWEGimdGDFy2 slUsatULEvlKJQKiznvGc7Vbpq4fseqW3Fup4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TxNgORGPoSCn3Oq9HEn9GoMFiwahxDYqmWRf1K3P8O8=; b=LWJ7bbpS32ynU/qf5SUVywMNKBSnDw7rTj375lDHpP0P4h8UJWvlyF5fsP8nzo8QDo vPPZr6yiIjnLVn/BfBeamYTVpv7KC/eJOtPbSd7TxT7f3n5FnEK/WiYp6gCe4GbpP2BS WBVBcWV0593Lv4KRMH7Ccn5Fyb60Sz5jdfso4SDn+L3j7zOIQNeOKll4rz/5gdFRRU+M OBwBRqxP91lAb5wuBD7RHXglVz8F6KS6VAmMR4WdlF9RNhaZ1/CaSnXTmfhSV+2vMJcV /NYvK4bdjwcH7mI06PQac/HsKq/r+k2K6LPCmLeIrlxhE3ng4iSg56yuEtmbzB7wHzQ5 1m3g== X-Gm-Message-State: AA+aEWZ+KE3z425ewlS6GMqXl1OyEsIAa3SqaNXYhqNY0IXdoeLrBEbK nCrpB1hKOBd/3SK7jPzauTYo7Q== X-Google-Smtp-Source: AFSGD/WKoXN5Q1BGK+/QFKiIqyuJtSy532LcvwxbVFqOOwq141q0U/0oZ2d0GXXsJfPAZD8eAJY75Q== X-Received: by 2002:a5d:4c8a:: with SMTP id z10mr10124004wrs.75.1544458676335; Mon, 10 Dec 2018 08:17:56 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:55 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 07/17] drm/sun4i: sun6i_mipi_dsi: Refactor vertical video start delay Date: Mon, 10 Dec 2018 21:47:19 +0530 Message-Id: <20181210161729.29720-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Video start delay can be computed by subtracting total vertical timing with front porch timing and with adding 1 delay line for TCON. BSP code form BPI-M64-bsp is computing video start delay as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) - panel->lcd_y - (panel->lcd_vbp) => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y - panel->lcd_y - panel->lcd_vbp => timmings->ver_front_porch So, update the start delay computation accordingly. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index c9b0222ebcd4..cb41fea4f3ee 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -358,7 +358,17 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { - return mode->vtotal - (mode->vsync_end - mode->vdisplay) + 1; + u32 vfp = mode->vsync_start - mode->vdisplay; + u32 start_delay; + + start_delay = mode->vtotal - vfp + 1; + if (start_delay > mode->vtotal) + start_delay -= mode->vtotal; + + if (!start_delay) + start_delay = 1; + + return start_delay; } static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, From patchwork Mon Dec 10 16:17:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D31141759 for ; Mon, 10 Dec 2018 16:18:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0A4A2A03E for ; Mon, 10 Dec 2018 16:18:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4CB52A058; Mon, 10 Dec 2018 16:18:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FF1229DC8 for ; Mon, 10 Dec 2018 16:18:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727822AbeLJQS4 (ORCPT ); Mon, 10 Dec 2018 11:18:56 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46969 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728577AbeLJQR7 (ORCPT ); Mon, 10 Dec 2018 11:17:59 -0500 Received: by mail-wr1-f68.google.com with SMTP id l9so11041278wrt.13 for ; Mon, 10 Dec 2018 08:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=htHh1EHvwq+E445n98FFCiPzlmj0F1X/K1ZswWL2Ewo=; b=ZED3XNr27UkPRzb+tgfN8jqTQHr5Ws6I1Rf0utQDRSqaDDi4uqkn2Cd2F3TcHfTCmA zIvhq+voOUeGP7yvtlFI8EOgpCuKHIlQL/1yZpFlqFIOv26AVsv1AGdR9dUfodGuW/iT J1MGjR2PoCl8lJuyCQpaPDmhIbFGX/BW5meoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=htHh1EHvwq+E445n98FFCiPzlmj0F1X/K1ZswWL2Ewo=; b=pCv4ZB/CVdPuq6KZn1akxtJmpdHRWgsyGS1iQL+HBtN3bn+A0x7J53J/N+ySojQAfZ FQG+xAyFWXrb/muDv4AwrMdCHTmeeGO84quIqVLTFLrS89xuRTZaWXu0NQFT4AXivEAp RFohe97xEA5garN5Urc+//yLHlEcfaSe7JdF4Tj15+O3pirl1X0PQoR6ZLiY6ie3INzL TNRXWuCqM7doXp2g+/vwJ3878VhozL9bysOTTYV9CtiFsafbuYIc0sEdasGs1PLZkOuB tn+zBtnWH5c36p/H8InRE3wAxvQFv4Z04lxKC3YiGg/VrrSDQrlyuIth155JjDjOIXTa slRA== X-Gm-Message-State: AA+aEWY46+486ydxnqRJFaWZKcerlZWAR7/30hC58KthzlaLooracKmc giILnkRkdlkzCBLDKdRbz6P7Sg== X-Google-Smtp-Source: AFSGD/VEBKqsAcVyrh59AfZgmRINtJXwNFUQJW4oylcHw1xHvwExzJIjXON+Bb1dzmDGzo+X0yDCpw== X-Received: by 2002:a05:6000:110f:: with SMTP id z15mr10003279wrw.136.1544458677841; Mon, 10 Dec 2018 08:17:57 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:57 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 08/17] drm/sun4i: sun6i_mipi_dsi: Fix DSI hbp timing value Date: Mon, 10 Dec 2018 21:47:20 +0530 Message-Id: <20181210161729.29720-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current driver is calculating hbp maximum value by subtracting hsync_start with hdisplay which is front porch value, but the hbp refers to back porch. Back porch value is calculating by subtracting htotal with hsync_end as per drm_mode timings, and BSP code from BPI-M64-bsp is eventually following the same. BPI-M64-bsp is computing hbp as (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hbp = (hbp-hspw)*dsi_pixel_bits[format]/8 - (4+2); => (panel->lcd_hbp - timmings->hor_sync_time) => (timmings->hor_back_porch + timmings->hor_sync_time - timmings->hor_sync_time) => timmings->hor_back_porch => mode->htotal - mode->hsync_end So, update the MIPI-DSI hbp value accordingly. Tested on 2-lane, 4-lane DSI LCD panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index cb41fea4f3ee..81151d7633f9 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -482,7 +482,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, */ #define HBP_PACKET_OVERHEAD 6 hbp = max((unsigned int)HBP_PACKET_OVERHEAD, - (mode->hsync_start - mode->hdisplay) * Bpp - HBP_PACKET_OVERHEAD); + (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD); /* * The frontporch is set using a blanking packet (4 bytes + From patchwork Mon Dec 10 16:17:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 333BD1759 for ; Mon, 10 Dec 2018 16:18:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22EE229DC8 for ; Mon, 10 Dec 2018 16:18:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 146542A058; Mon, 10 Dec 2018 16:18:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B14D429DC8 for ; Mon, 10 Dec 2018 16:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728603AbeLJQSC (ORCPT ); Mon, 10 Dec 2018 11:18:02 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:34931 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728593AbeLJQSB (ORCPT ); Mon, 10 Dec 2018 11:18:01 -0500 Received: by mail-wm1-f68.google.com with SMTP id c126so11858577wmh.0 for ; Mon, 10 Dec 2018 08:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oiAA/cUEr092LynkAnVQtsmpFwj1u/ZrP8Y7/2WzfF0=; b=Fby41GOV+1hziXy0cQmlduCVcOA7fyZ3cELSFpSyPAoOMg4bvRyz4+y4SEGMpt/ahS P6pZciUC8YqcGoUEFQ5MtL/+lmadFyOH56ST2kSp+/v2WQVdtgtFaYeUgoK2+LAS+rZI 6NAxz1mjg5GSwnzbWzWJq2TwJEuQq7P67LSbE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oiAA/cUEr092LynkAnVQtsmpFwj1u/ZrP8Y7/2WzfF0=; b=MVaCOAuRObKIj/Tjna72outQEmZKEQQoSvwNVhiaXqU8PC72BEP96GmwvTUWE1QXjr FefRamQzwY5tQ2zimh1mmVk0CJVHFNZJpGrltI9WPLDjWasj5daEVw7pPmlCPDM1i34e X/oQZ9k9iwYkDx6IGst0BdhcJrWpFBPkqi7/oqLUvKELIKdVplMo+qfSF2AcxxqVg887 dqqWzR+mZRzMKZ5BxSt7IngxeU3for92IF8BAcMeUfiXI1O2A0kGaoun0hQeI9G3lqdf y23psnmi6PeequZzhMsTwZ4eLiRvRQV0QyGbImR7uaa+olSLrT62ZSXnTB5CYPCiwQ3e F1kw== X-Gm-Message-State: AA+aEWaF8F17xe+9VhdvkfplWOyerj/mOwdjJKBoQTkvQGL0nUFgRRjy FHzwoaCtxJAoZ6NIK4JaFEJd0A== X-Google-Smtp-Source: AFSGD/XfvcRdGmj8WQOq1Wc7vWq4fKFJIXF0ufvWTlz2ZYxpONPT8VIJ6rZZCNnXhKal0kD3+aipNw== X-Received: by 2002:a1c:de57:: with SMTP id v84mr10923097wmg.55.1544458679797; Mon, 10 Dec 2018 08:17:59 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:58 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 09/17] drm/sun4i: sun6i_mipi_dsi: Fix DSI hblk timing calculation Date: Mon, 10 Dec 2018 21:47:21 +0530 Message-Id: <20181210161729.29720-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP hblk is adding line with all porch timing values, or timings values from htotal without sync time. Current driver is subtracting htotal with hsa, but the hsa is bounded with packet overhead. For real hblk calculation needed by subtracting htotal with back and front porch values and BSP code BPI-M64-bsp is eventually following the same. BPI-M64-bsp is computing hbp as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hblk = (ht-hspw)*dsi_pixel_bits[format]/8-(4+4+2); => (timmings->hor_total_time - timmings->hor_sync_time) => (mode->htotal - (mode->hsync_end - mode->hsync_start)) So, update the DSI hblk timing accordingly. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 81151d7633f9..4c95b3384ed9 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -495,7 +495,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, /* * hblk seems to be the line + porches length. */ - hblk = mode->htotal * Bpp - hsa; + hblk = (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp; /* * And I'm not entirely sure what vblk is about. The driver in From patchwork Mon Dec 10 16:17:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A813813AF for ; Mon, 10 Dec 2018 16:18:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 979D029DC8 for ; Mon, 10 Dec 2018 16:18:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BF8B2A058; Mon, 10 Dec 2018 16:18:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B76529DC8 for ; Mon, 10 Dec 2018 16:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728615AbeLJQSu (ORCPT ); Mon, 10 Dec 2018 11:18:50 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54318 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728602AbeLJQSD (ORCPT ); Mon, 10 Dec 2018 11:18:03 -0500 Received: by mail-wm1-f66.google.com with SMTP id a62so4140646wmh.4 for ; Mon, 10 Dec 2018 08:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7B7/bFXR+1ggUu89xO8Gq2xSzsCKM6R16uBfSc/xhAo=; b=j64vC5c9Sc06k6W+B4eLBoq2kgCKRSayqR6+DwNYYJNjxUTlZd4q2LFlL8wdHQbIdS GN8bfAAT6V0Z6CvtFGRSbP8FBcFaEPZFXe3U3iFXpeMidy4Bs/9QNzou1htKl46xI/hd emjQS/y7d9brelH5z5Gw0ZKvG8G2md8LcP4LE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7B7/bFXR+1ggUu89xO8Gq2xSzsCKM6R16uBfSc/xhAo=; b=RqmRbsfBe8WSnv+aBmRdwmg0z71uIrRGVeQG99voMPGFWLyBRDLJwtTcg1GhXtd9MC pZVWacTeN9E4kEg7lLlkCRdAD9+TbcOSyZ3S28nWRHvgz6uE8I2yYmZhZH1EF3gSRAXv qxgHZ5zqFbTaqgufF0p68Dvp89iDxtBCGsQek9MRkoFV1zD2aUTmFSnQPlu04OOe27/S 26ETQjXQKiCPfbMmZ09MDh7VHHGwF8rBakHtBN81AXUKAn+qJ/I2FMD+81NrNUHdo+2T WhEUKN7gcZQCDXsB0M3OueEf5Ayj4qFzImFx0RWBIxX71xCtHf+ASTNzkG5PuB6p8SXc mhhw== X-Gm-Message-State: AA+aEWYaa6VXUMvGIo/EcMOiO9kbhywHcQaWS/3NrFVUiQLdwyl+eEry Cz5C3Mz/OPD2VNX4MYDovRGsSg== X-Google-Smtp-Source: AFSGD/V6DS87dkTsDhODWaxBYnTVebM8xXCu4fOadguVykyXB9nHb9tTYImyri0myo8lgB3AF4v7zw== X-Received: by 2002:a1c:d7d3:: with SMTP id o202mr11936226wmg.135.1544458681432; Mon, 10 Dec 2018 08:18:01 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:00 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 10/17] drm/sun4i: sun6i_mipi_dsi: Add DSI hblk packet overhead Date: Mon, 10 Dec 2018 21:47:22 +0530 Message-Id: <20181210161729.29720-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add 10 bytes packet overhead for hblk where blank is set using a blanking packet like (4 bytes + 4 bytes + payload + 2 bytes) This is according to BSP code from BPI-M64-bsp (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hblk = (ht-hspw)*dsi_pixel_bits[format]/8-(4+4+2); So, add 10 bytes packet overhead for DSI hblk. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 4c95b3384ed9..07eba9ec469b 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -494,8 +494,13 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, /* * hblk seems to be the line + porches length. + * The blank is set using a blanking packet (4 bytes + 4 bytes + + * payload + 2 bytes). So minimal size is 10 bytes */ - hblk = (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp; +#define HBLK_PACKET_OVERHEAD 10 + hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, + (mode->htotal - (mode->hsync_end - mode->hsync_start)) * + Bpp - HBLK_PACKET_OVERHEAD); /* * And I'm not entirely sure what vblk is about. The driver in From patchwork Mon Dec 10 16:17:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C525D13AF for ; Mon, 10 Dec 2018 16:18:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5A1C29DC8 for ; Mon, 10 Dec 2018 16:18:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9BF42A058; Mon, 10 Dec 2018 16:18:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 469BB29DC8 for ; Mon, 10 Dec 2018 16:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727168AbeLJQSt (ORCPT ); Mon, 10 Dec 2018 11:18:49 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53197 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728615AbeLJQSF (ORCPT ); Mon, 10 Dec 2018 11:18:05 -0500 Received: by mail-wm1-f66.google.com with SMTP id r11-v6so11502497wmb.2 for ; Mon, 10 Dec 2018 08:18:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iu6bo30lI7sS+xNVJvtG33E9f/2Ed96R3LMOZkklEQk=; b=V/ScvD53nQq8q8RNbZwKLQaXHDUDSHeBK8qFTPi6210g4FA5YWqL+MjTPRV9xvIPA0 T33N1XPkgDJTyx2LRFrRL1dG+IE5kTFWp64gJtU+urdyeYurxCnT6F2pzMZIwhMybXzg 0QvJWttPKfrq+mIYia5Gvpq91Newb2CgaSZsw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iu6bo30lI7sS+xNVJvtG33E9f/2Ed96R3LMOZkklEQk=; b=cMrLpeOzetuZt10f7zcgt8ZNCeFi1FuiCa91qvdAqCvUFeIUiUBDc/HjsGpTsEZOIp peHFS2BzKo50YJYKv4YFQZiv/87zzCrTRkCx3yesALQgFTqeg4kRiWPGnwJzlECQgBSf 1DkXASPGbNc/PLBy40Fdkd7njYp5L0DUOWNcNFVXHhDs1peKnSH7JYGCItMFaYE92JdS z89u+mvBg2exn2pItQv+GyqXQJcq+PXconzXp96bigka2Aexh4y+TqHx6MPkq1RuLlNy PEnRYTzbda8vlTtF4E0EJlwhcxTPnQblPKEVLNN3+sh/MbpPXgsB4hKDKW0HjL89nONR rK0Q== X-Gm-Message-State: AA+aEWbUQOeQa+i58H2Co/62F68ZP7Lzpid3P77BYa+u8cJWjPVxFnGg qAJ4gpgFGK2Yo94fJ8ujoeMk5Q== X-Google-Smtp-Source: AFSGD/X4QL8op0FfdcbGirGBh1dxiIlhCD60l+CuLwIUddllsDFHzpON/K3thRQdghvvcaUUBqcsOA== X-Received: by 2002:a1c:e3d7:: with SMTP id a206mr10879717wmh.77.1544458683263; Mon, 10 Dec 2018 08:18:03 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.18.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:02 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 11/17] drm/sun4i: sun6i_mipi_dsi: Fix DSI hfp timing value Date: Mon, 10 Dec 2018 21:47:23 +0530 Message-Id: <20181210161729.29720-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current driver is calculating hfp maximum value by subtracting htotal with hsync_end which is front back value, but the hpp refers to front porch. Front porch value is calculating by subtracting hsync_start with hdisplay as per drm_mode timings, and BSP code from BPI-M64-bsp is eventually following the same. BPI-M64-bsp is computing hfp as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hbp = (hbp-hspw)*dsi_pixel_bits[format]/8 - (4+2); dsi_hact = x * dsi_pixel_bits[format]/8; dsi_hblk = (ht-hspw)*dsi_pixel_bits[format]/8-(4+4+2); dsi_hfp = dsi_hblk - (4+dsi_hact+2) - (4+dsi_hbp+2); Example, u32 fmt = dsi_pixel_bits[format]/8; => ((ht-hspw)*fmt - 10) - (6 + x * fmt) - (6 + (hbp-hspw)*fmt - 6) => (ht - hspw - x - (hbp - hspw)) * fmt - 16 => (ht - x - hbp) * fmt - 16 => (ht - x - (timmings->hor_total_time - timmings->hor_front_porch - x) * fmt - 16 => (timmings->hor_total_time - x - timmings->hor_total_time + timmings->hor_front_porch + x) * fmt - 16 => timmings->hor_front_porch * fmt - 16 So, update the DSI hfp timing accordingly. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 07eba9ec469b..d8947be92f9d 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -490,7 +490,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, */ #define HFP_PACKET_OVERHEAD 6 hfp = max((unsigned int)HFP_PACKET_OVERHEAD, - (mode->htotal - mode->hsync_end) * Bpp - HFP_PACKET_OVERHEAD); + (mode->hsync_start - mode->hdisplay) * Bpp - + HFP_PACKET_OVERHEAD); /* * hblk seems to be the line + porches length. From patchwork Mon Dec 10 16:17:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721521 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8EEE1759 for ; Mon, 10 Dec 2018 16:18:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 946ED2A628 for ; Mon, 10 Dec 2018 16:18:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 849422A62D; Mon, 10 Dec 2018 16:18:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6856C1FFBD for ; Mon, 10 Dec 2018 16:18:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728652AbeLJQSI (ORCPT ); Mon, 10 Dec 2018 11:18:08 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36529 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728647AbeLJQSG (ORCPT ); Mon, 10 Dec 2018 11:18:06 -0500 Received: by mail-wm1-f66.google.com with SMTP id a18so11946427wmj.1 for ; Mon, 10 Dec 2018 08:18:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DaE2bcL6r+p/M15eQzTefkij1Q0qgITroLCaQhT54ts=; b=S6PS8uPD8o5uagR8UnFFV5omwXh05Mz44ipN7Z9aiXIlDLaDRYzk2Jj/QB6wdZGifY UfH6mmYsN3/xenatx9Yp6xZ6SrIX2kOaNglIrA4UwTpP6kGP3k/6TrHj05Ho1hEiBJLg KEwN29zz3nVhYewi3bpIULmuRTEgscTShjO4I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DaE2bcL6r+p/M15eQzTefkij1Q0qgITroLCaQhT54ts=; b=pwWSt6cTTIQySbJdrXGKdo1IdeVjCo188oAJmqE1oMWzjDU/Q5rMR/P/5u6rQBp43X 32wS9Bkk+pCN3R6TSWbv+dEcaF1ELWLklO/VglPacmQZMjj3HHO7zehGxHmjtKVu818Y 5FOEF02Nlxnl0VMf9+xck/PO8rAWWCVrW6MDN43VN4uex0Drcr7Hf3M4YvSTx1n8WVQE HKyFwQPm4d0NMRvSj3VysThcgU7znnE/Ck9CO6uyBkjTwWJvUQZRO+w3z3QYHkgz5f+D 4y86a+RQnwrHHzO68y/Uj84t3zY57tV7vfxckJ8kIv6WNP6m3u2qyhPPtHg5rWFpXlww XawA== X-Gm-Message-State: AA+aEWbELp1mH7TTpE8AZDfAb1OO5SmHwHHSNt2Rp9UiUT1Te2jBH6hm O32eeSx5HAxIyp2CW25SLLyzcg== X-Google-Smtp-Source: AFSGD/VZAupYbQ9LuzdN+x/pfuCVOroCGUxCmBhiF84wmW8VVo6bObaVkTtxkS+buZnlKVFmY0nK5g== X-Received: by 2002:a1c:9dcc:: with SMTP id g195mr10789931wme.153.1544458684950; Mon, 10 Dec 2018 08:18:04 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.18.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:04 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 12/17] drm/sun4i: sun6i_mipi_dsi: Set proper vblk timing calculation Date: Mon, 10 Dec 2018 21:47:24 +0530 Message-Id: <20181210161729.29720-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unlike hblk, the vblk timings should follow an equation to compute the desired value for lane 4 devices and rest of devices it would be 0. BSP code from BPI-M64-bsp is computing vblk as for 4-lane devices (from linux-sunxi drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) tmp = (ht*dsi_pixel_bits[format]/8)*vt-(4+dsi_hblk+2); dsi_vblk = (lane-tmp%lane); So, update the vblk timing calculation accordingly. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 29 +++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index d8947be92f9d..cbcef7bf7681 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -355,6 +355,27 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, SUN6I_DSI_INST_JUMP_CFG_NUM(1)); }; +static u16 sun6i_dsi_get_timings_vblk(struct sun6i_dsi *dsi, + struct drm_display_mode *mode, u16 hblk) +{ + struct mipi_dsi_device *device = dsi->device; + unsigned int Bpp = mipi_dsi_pixel_format_to_bpp(device->format) / 8; + int tmp; + + if (device->lanes != 4) + return 0; + + /* + * The vertical blank is set using a blanking packet (4 bytes + + * payload + 2 bytes). Its minimal size is therefore 6 bytes + */ +#define VBLK_PACKET_OVERHEAD 6 + tmp = (mode->htotal * Bpp) * mode->vtotal - + (hblk + VBLK_PACKET_OVERHEAD); + + return (device->lanes - tmp % device->lanes); +} + static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { @@ -503,13 +524,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp - HBLK_PACKET_OVERHEAD); - /* - * And I'm not entirely sure what vblk is about. The driver in - * Allwinner BSP is using a rather convoluted calculation - * there only for 4 lanes. However, using 0 (the !4 lanes - * case) even with a 4 lanes screen seems to work... - */ - vblk = 0; + vblk = sun6i_dsi_get_timings_vblk(dsi, mode, hblk); /* How many bytes do we need to send all payloads? */ bytes = max_t(size_t, max(max(hfp, hblk), max(hsa, hbp)), vblk); From patchwork Mon Dec 10 16:17:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7561013AF for ; Mon, 10 Dec 2018 16:18:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6497329DC8 for ; Mon, 10 Dec 2018 16:18:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 588462A03E; Mon, 10 Dec 2018 16:18:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF86B29DC8 for ; Mon, 10 Dec 2018 16:18:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728647AbeLJQSh (ORCPT ); Mon, 10 Dec 2018 11:18:37 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46981 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728596AbeLJQSI (ORCPT ); Mon, 10 Dec 2018 11:18:08 -0500 Received: by mail-wr1-f68.google.com with SMTP id l9so11041812wrt.13 for ; Mon, 10 Dec 2018 08:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=00q3XfiQq5Un+1gbOZybpEVXgQFaLUYl4K2oxVIJvfo=; b=bdtJzKSohaqs/xFQ2lRdqluAHitNCxTJ1T6qCPzDp+8cSpK9Aw/9HNW92lxNV7Vvka E4MU+osHjfuP/ALbPKdi66NNY2T/cjiBTxu/yeFbZ3cIRY3t8oSic3Ni78g7wAHTxlue pGlOkVwv0gak1VI8qe1BqgCfWDpDW3tBJLUEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=00q3XfiQq5Un+1gbOZybpEVXgQFaLUYl4K2oxVIJvfo=; b=Aw+une8yh3ksVZVd2f/kAqXdJBHqtxiaGUmx2cSVpX1wvSWbCzSa1Lp7KbcWXHFpFn zrBRP8Bk2DJw0Zap8pPGWjgvCLdP8fHj1+1CiZs9tlHKgp7zsZevauWaRICzINuZ15oh oXAbH6GIDxbhzcUSlgo0//PRtBDTY8xDzRrtlZnIR2t7IFuVleY8/Bt3vJtaxnKwS0Om Lb0voF5eB118wxTqlmLBGaYn9GphOSkEOZNOAJFxSi0Ox0KvUr6mgSXJl6st2c5saeCV VdzAg/ipQUTwEm4yPkHcDYxuQx2wQfibReGfiGc+OPXY08Ccfie6mw1lQX2hfzvTqdNk ZAIg== X-Gm-Message-State: AA+aEWYlDRmz4QnaNTow8cXiSr4YomeT6P+MDN8DJL3tdrm+kTsQ04D5 ZfSSI7fQX+MOZ0M8Tt0d2aUfKA== X-Google-Smtp-Source: AFSGD/WIIhGNAtofTDEjWfZNJq8NHZ5r84pdS+Vg4KRajzLQ+W2qdsgCoQZTkL+O2cEpDZQpEY9rfg== X-Received: by 2002:adf:a28d:: with SMTP id s13mr11073625wra.100.1544458686730; Mon, 10 Dec 2018 08:18:06 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.18.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:05 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 13/17] drm/sun4i: sun6i_mipi_dsi: Add support for VCC-DSI voltage regulator Date: Mon, 10 Dec 2018 21:47:25 +0530 Message-Id: <20181210161729.29720-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some boards have VCC-DSI pin connected to voltage regulator which may not be turned on by default. Add support for such boards by adding voltage regulator handling code to MIPI DSI driver. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 14 ++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index cbcef7bf7681..a87b65fff0e0 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1023,6 +1023,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return PTR_ERR(base); } + dsi->regulator = devm_regulator_get(dev, "vcc-dsi"); + if (IS_ERR(dsi->regulator)) { + dev_err(dev, "Couldn't get VCC-DSI supply\n"); + return PTR_ERR(dsi->regulator); + } + dsi->regs = devm_regmap_init_mmio_clk(dev, "bus", base, &sun6i_dsi_regmap_config); if (IS_ERR(dsi->regs)) { @@ -1104,6 +1110,13 @@ static int sun6i_dsi_remove(struct platform_device *pdev) static int __maybe_unused sun6i_dsi_runtime_resume(struct device *dev) { struct sun6i_dsi *dsi = dev_get_drvdata(dev); + int err; + + err = regulator_enable(dsi->regulator); + if (err) { + dev_err(dsi->dev, "failed to enable VCC-DSI supply: %d\n", err); + return err; + } reset_control_deassert(dsi->reset); if (dsi->variant->has_mod_clk) @@ -1138,6 +1151,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev) if (dsi->variant->has_mod_clk) clk_disable_unprepare(dsi->mod_clk); reset_control_assert(dsi->reset); + regulator_disable(dsi->regulator); return 0; } diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 597b62227019..0df60f84bab3 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -13,6 +13,8 @@ #include #include +#include + struct sun6i_dphy { struct clk *bus_clk; struct clk *mod_clk; @@ -32,6 +34,7 @@ struct sun6i_dsi { struct clk *bus_clk; struct clk *mod_clk; struct regmap *regs; + struct regulator *regulator; struct reset_control *reset; struct sun6i_dphy *dphy; From patchwork Mon Dec 10 16:17:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77C2913AF for ; Mon, 10 Dec 2018 16:18:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67CB02AB34 for ; Mon, 10 Dec 2018 16:18:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BB732ABA8; Mon, 10 Dec 2018 16:18:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44BAF2AB34 for ; Mon, 10 Dec 2018 16:18:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728665AbeLJQSN (ORCPT ); Mon, 10 Dec 2018 11:18:13 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55920 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728654AbeLJQSK (ORCPT ); Mon, 10 Dec 2018 11:18:10 -0500 Received: by mail-wm1-f65.google.com with SMTP id y139so11493555wmc.5 for ; Mon, 10 Dec 2018 08:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0A16quYt+swrquBMzw4Px8WMyAYxU03soI2v/Bfgb1A=; b=YF3sJk2rubhEazU2ITO1ZU+iTOrr+E5kT9wdu2ixC/aNx3jRrsdVG/2WpQLVD7SFv9 x06odRqVx9/4OBPP6uv8S0TTYoO80v57K8Ubf7WIXDiFtUq7zLE442UUdgNRoSeCDlJV YbmTAWm+nTXXDjGe30+BwZV3cxtoLv/Erft5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0A16quYt+swrquBMzw4Px8WMyAYxU03soI2v/Bfgb1A=; b=hQ6mEzD5fEsctNV1paf6BpNXb8TCWv2mblhOnDQglc2kjOpXuSgNcm5dq9x3kbsp7B hOYEyBdI2cj7Q+TPhZgcBRDAnf0u/V4D/tSKmTDDBbKmcD3zWkMBsfye7VF7GCilrQfd N7zkJRsZD6NjDRiVVybItAD4QSpeiDWHNky2hlFyQZyZpMOpHRr0LuGM4KgGc1mMkJS9 jkmWwY3XVPgJ2bYeUSUtoL3wg3NfT5L2iv7i+oByDNjSv2Bhl+b526gcBK2MdwYBtoIE W0UTxZ8Z/tAwzIZZZo8D/YzWlg13QpLjXkBsQaCCiWgWDOlTE8lJZIXl/MESDSwMQo4W c/ag== X-Gm-Message-State: AA+aEWZwfzw6qbC4nCZQ8iQ0u18KXkXq9dn/JHTPym8V+ZsQXq8aEHnT /x4WAPJmz6Jhpj1z66h0EniKUhLJaTY= X-Google-Smtp-Source: AFSGD/X4P2P8IWz19Jw4ghafGW1XCdsWJRT1xawLts5BHe68/7lQ0SenyM2uKUJlIk2b3q5hqzzE8A== X-Received: by 2002:a1c:1707:: with SMTP id 7mr11448132wmx.150.1544458688215; Mon, 10 Dec 2018 08:18:08 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.18.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:07 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 14/17] dt-bindings: sun6i-dsi: Add VCC-DSI supply property Date: Mon, 10 Dec 2018 21:47:26 +0530 Message-Id: <20181210161729.29720-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Most of the Allwinner MIPI DSI controllers are supply with VCC-DSI pin. which need to supply for some of the boards to trigger the power. So, document the supply property so-that the required board can eable it via device tree. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt index 9fa6e7a758ad..adc7cdf129dd 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt @@ -28,6 +28,9 @@ Required properties: first port should be the input endpoint, usually coming from the associated TCON. +Optional properties: + - vcc-dsi-supply: the VCC-DSI power supply of the DSI encoder + Any MIPI-DSI device attached to this should be described according to the bindings defined in ../mipi-dsi-bus.txt From patchwork Mon Dec 10 16:17:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E4DA1759 for ; Mon, 10 Dec 2018 16:18:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A1972ABA8 for ; Mon, 10 Dec 2018 16:18:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BF332ABBE; Mon, 10 Dec 2018 16:18:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2C892ABA8 for ; Mon, 10 Dec 2018 16:18:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728671AbeLJQSO (ORCPT ); Mon, 10 Dec 2018 11:18:14 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:34033 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728648AbeLJQSM (ORCPT ); Mon, 10 Dec 2018 11:18:12 -0500 Received: by mail-wm1-f65.google.com with SMTP id y185so6989846wmd.1 for ; Mon, 10 Dec 2018 08:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SS22PqBK8tWsdyn/FHAwZUavV4dNBBIV2/QUJd77h4k=; b=oMpl0ALA9vxGolpUGRPXPTFTlEuGqt8XU2UW+J1+kRVNZR+UkFW6NZi54Y1+q4yANF A5ShHj6CNV/Moj5lVh3DVAF17KqVl1oKB01MPypxImmzV+qjVOFe5y4+34Tn/DBLWaIC OYOnhYgZcZaax7fueoKLt1tiXL60i45TtsUgw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SS22PqBK8tWsdyn/FHAwZUavV4dNBBIV2/QUJd77h4k=; b=k79YTp8YFVy5TuW7g7cNWMzv8ICI2bLwFjhycisOsIOrzqNJ24qm/iFWXCSeiIg0h8 Vk5LUD/OcProIWBqqb0E/NYK0u9RZBsnlEB0XxRtOIUszGcfSc8AxUd1sXHbyXUBe4mF bVKLoqL3v9FdH97re1OQsY0OW1NXJ7EbFzCAF95KwIyxB40TqBAi5Ag56Kf+gWIhaXzO JRxaTKt8meYpshyMXE39D8V+DTOQ0MUTYSfIhANUajF0TcRxsVEXmEIJirp4kXhVxpCC IFewCib5o0DK5gb+CuG8d8Gz6ZGZ1Fz8JinX6yUMBQ7b3m7+MMG/UYpjbxr8tk/zmWh4 x87w== X-Gm-Message-State: AA+aEWbXA3BQ3g8FMLmYCF6kH+g0byLvMJW9I8H1QIQduAT59XNAaHTO ZAGzao4s8lQo/bale7OtX3OEGg== X-Google-Smtp-Source: AFSGD/UkunrLdyF1uFFqybjHZqBmchG32sEgRXZF3wFvzKBtIfF3Z3WDnTjOxaEb/dtfoyprq4epaA== X-Received: by 2002:a1c:990c:: with SMTP id b12mr11710901wme.106.1544458690275; Mon, 10 Dec 2018 08:18:10 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.18.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:09 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 15/17] clk: sunxi-ng: a64: Add minimum rate for PLL_MIPI Date: Mon, 10 Dec 2018 21:47:27 +0530 Message-Id: <20181210161729.29720-16-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Minimum PLL used for MIPI is 500MHz, as per manual, but lowering the min rate by 300MHz can result proper working nkms divider with the help of desired dclock rate from panel driver. Signed-off-by: Jagan Teki Acked-by: Stephen Boyd --- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c index 181b599dc163..b623c8150b4f 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c @@ -183,6 +183,7 @@ static struct ccu_nkm pll_mipi_clk = { .n = _SUNXI_CCU_MULT(8, 4), .k = _SUNXI_CCU_MULT_MIN(4, 2, 2), .m = _SUNXI_CCU_DIV(0, 4), + .min_rate = 300000000, /* Actual rate is 500MHz */ .common = { .reg = 0x040, .hw.init = CLK_HW_INIT("pll-mipi", "pll-video0", From patchwork Mon Dec 10 16:17:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C699213AF for ; Mon, 10 Dec 2018 16:18:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B57BF2ABA8 for ; Mon, 10 Dec 2018 16:18:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A97532ABC6; Mon, 10 Dec 2018 16:18:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DC972ABA8 for ; Mon, 10 Dec 2018 16:18:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728669AbeLJQSN (ORCPT ); Mon, 10 Dec 2018 11:18:13 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46002 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728662AbeLJQSN (ORCPT ); Mon, 10 Dec 2018 11:18:13 -0500 Received: by mail-wr1-f67.google.com with SMTP id b14so11070399wru.12 for ; Mon, 10 Dec 2018 08:18:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zSLZfhqj5LlgFfpYLOueILNrvF0k+OKE5voNHu/WFJA=; b=i9fLMhyMg+YgyHOHTvKZAa3yzDcRG1Q+CVmwCSS+wetlWyhZPoviQ01kR/cMaG/n0D IZGL21eOSqxq7ZGokDjFL49h8G1pVkrDlEBRNteA4xK/ccY3XEX5C8RJFe8I1+IV6Ioy DDl7QG6mkfm+zSMch6J4RPgbkjNMpLKbhBQ+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zSLZfhqj5LlgFfpYLOueILNrvF0k+OKE5voNHu/WFJA=; b=U+Xp2d1Cafwy5L7NHWrxvXR7joevva85SUG0uopn9bTHTeXLJXqsPJNvhV6K4wgwmF zStZR2YiB3BfEsODel/det9PY0VVzTT73OkQpfsw0Z+4Rq9iRVu1knc7Gtl+pz/URtuj E34wKxtC3AIPnr4sf3c5aMiCFd9PreoQvJ1sKlIEAogXDkKIN8MsSTvGlw0TdM18hgma WZtexRkbtVbM7BPlHkvex5zJXWKfNDBYZ2cPr4zVYJXvHoqGlkDhYj23nPwWLxj8Oa1R iksZicOJx3LZigrI/PqrJB+4fffj++NLRaOK4V0dDXBGsuflB15x+WsXsJDM1TJoPD4L Jg6g== X-Gm-Message-State: AA+aEWbHquaXv71KVltjx6++iDDl3piQoKxdkPt+lGnDgqrxjiEGJg6D UbxQ2hRvkRXv/gl1y9GRj+fK8g== X-Google-Smtp-Source: AFSGD/UG8pTrHfDIEcjUTcTwXDbLv36fj4jWRUX42zMKoNQDG4BaPOHeJx6GzE5YfiHqXFAEts88IQ== X-Received: by 2002:a5d:570c:: with SMTP id a12mr9992101wrv.161.1544458691718; Mon, 10 Dec 2018 08:18:11 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.18.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:11 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 16/17] dt-bindings: sun6i-dsi: Add A64 DPHY compatible (w/ A31 fallback) Date: Mon, 10 Dec 2018 21:47:28 +0530 Message-Id: <20181210161729.29720-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The MIPI DSI PHY HDMI controller on Allwinner A64 is similar on the one on A31. Add A64 compatible and append A31 compatible as fallback. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt index adc7cdf129dd..08f1f57abff5 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt @@ -40,6 +40,7 @@ D-PHY Required properties: - compatible: value must be one of: * allwinner,sun6i-a31-mipi-dphy + * "allwinner,sun50i-a64-mipi-dphy", "allwinner,sun6i-a31-mipi-dphy" - reg: base address and size of memory-mapped region - clocks: phandles to the clocks feeding the DSI encoder * bus: the DSI interface clock From patchwork Mon Dec 10 16:17:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10721515 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAB3F1759 for ; Mon, 10 Dec 2018 16:18:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C94082AB9E for ; Mon, 10 Dec 2018 16:18:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD1842ABA9; Mon, 10 Dec 2018 16:18:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65FDB2AB9E for ; Mon, 10 Dec 2018 16:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728697AbeLJQSX (ORCPT ); Mon, 10 Dec 2018 11:18:23 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36543 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728666AbeLJQSP (ORCPT ); Mon, 10 Dec 2018 11:18:15 -0500 Received: by mail-wm1-f65.google.com with SMTP id a18so11946976wmj.1 for ; Mon, 10 Dec 2018 08:18:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FjGhPpG8sG9uBklMCJSskhFh/huEKC/N4BLQs4vEQZ4=; b=aqPbNxfJVW0/xjfottM/ES1pxezCOVjUQ2wAkUXTBOKqfUJUIK5AJ0C3SKuV3Ajp/Q CxaRLB/C6QeFwmz5BsgCj47v0HyyD6E7HU+nuNMaTkdIxhlkI9V4znXKSXCQc+MIcpBf AzffqZ9bvrC9Z5NgxF1OZ1gu431eOchzQvR94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FjGhPpG8sG9uBklMCJSskhFh/huEKC/N4BLQs4vEQZ4=; b=cd0BxN0hhtBLkDAqo4RkhaqZQGMC3nMO17PowIs39gqkNOVVqYG9UPBK5gZhvB3/Dd gxjf8tEhFzfwdULj3r3TmBo5GON8YLWLuhXaNwUUAxsaM/CTURTEfItLqDGXR9AatvoL 887vWhxSSL7NRlh0E4QArTt87XUGIQmNglvuUwflGqpcmGHB3KzaVDeZs5GY7meyso2Y enj7sC3mW5oMT37PWCLcWvdLKC0h1iVbqQo4vtHNO7c13WWXQY/Sua4RYgSgcEcqMUW1 jRxgDY5M3I4czQp9i4RfGq+ZTNwOw9OaiUtJgJ9CbtUseZPAbsnA04FqP9vGY00KT41Y 3yLQ== X-Gm-Message-State: AA+aEWYaX8DLIAgtc0i8LjPOQ7qHCvervqlIspMf0ocA3kNVgFHHawim Di7SDhKkVStGIEebsfn28wVb1A== X-Google-Smtp-Source: AFSGD/XofnVFXaIamGKZrCl8m9R2W57jrmtIYgZOTKF+Z01pEg48PsY16QkLyN3oPdocX2J4piqR4g== X-Received: by 2002:a1c:de57:: with SMTP id v84mr10923948wmg.55.1544458693211; Mon, 10 Dec 2018 08:18:13 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.18.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:18:12 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 17/17] arm64: dts: allwinner: a64: Add DSI pipeline Date: Mon, 10 Dec 2018 21:47:29 +0530 Message-Id: <20181210161729.29720-18-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The A64 has a MIPI-DSI block which is similar to A31 without mod clock. So, add dsi node with A64 compatible, dphy node with A31 compatible and finally connect dsi to tcon0 to make proper DSI pipeline. Signed-off-by: Jagan Teki --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index dd5740bc3fc9..dd5c7ad55149 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -344,6 +344,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <1>; + + tcon0_out_dsi: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsi_in_tcon0>; + allwinner,tcon-channel = <1>; + }; }; }; }; @@ -910,6 +916,45 @@ status = "disabled"; }; + dsi: dsi@1ca0000 { + compatible = "allwinner,sun50i-a64-mipi-dsi"; + reg = <0x01ca0000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_MIPI_DSI>; + clock-names = "bus"; + resets = <&ccu RST_BUS_MIPI_DSI>; + phys = <&dphy>; + phy-names = "dphy"; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsi_in_tcon0: endpoint { + remote-endpoint = <&tcon0_out_dsi>; + }; + }; + }; + }; + + dphy: d-phy@1ca1000 { + compatible = "allwinner,sun50i-a64-mipi-dphy", + "allwinner,sun6i-a31-mipi-dphy"; + reg = <0x01ca1000 0x1000>; + clocks = <&ccu CLK_BUS_MIPI_DSI>, + <&ccu CLK_DSI_DPHY>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_MIPI_DSI>; + status = "disabled"; + #phy-cells = <0>; + }; + csi: csi@1cb0000 { compatible = "allwinner,sun50i-a64-csi"; reg = <0x01cb0000 0x1000>;