From patchwork Fri Oct 26 14:43: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: 10657485 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 4072114BD for ; Fri, 26 Oct 2018 14:45:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BEF92B226 for ; Fri, 26 Oct 2018 14:45:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F3DE2C1CF; Fri, 26 Oct 2018 14:45:32 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C75A2B226 for ; Fri, 26 Oct 2018 14:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MD/ihmZMgUu3Fi5cj17SS4I0Ee8KyphGjW1lghfbW6c=; b=owCHu3HgEfmMqr JGkQufz89byIbt6DqdtGfDkJZbRf+Jdo5SEXA7cz9GNCBi0KhSfyFA0M3O/9HT4Uhs2CleOlHD9Ef 83qXRBtjLd5KGGvoMU9d+4Uv45XA8F1r/BUfS7r7ZzHG0Vd6Ts8vBhipj2tm1bbvV02vXSef16jcq MBbrg7yZMbd/5yt1ggoPebN60mERpx9ovkE7tQEafQ9Zt8RaqwKOWLhksdXGD2NlhyNW7TAUBRHMo rR3LbSoDTXp+may22SQkrhbomLaCrvA/FhMJnxihIUFs75cqa1tuilaq41pv0sIzg+XlUCwKde/w7 5iQHfW7gBgpxuC1VK2gg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3MO-0001Ke-HW; Fri, 26 Oct 2018 14:45:12 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Lg-0000oL-W9 for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:44:38 +0000 Received: by mail-pl1-x641.google.com with SMTP id 30-v6so611851plb.10 for ; Fri, 26 Oct 2018 07:44:18 -0700 (PDT) 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=D7lpI0032ckljqWxd5MKeqF8bO9v9lcI3LVfhs/Q60g=; b=Z/54ZxHSCcZEI10NsF/NUqaNHrhdZ7pQLL/DAAQN0ge47Tmdp9F4pe9l2N08LJhE6p XwgGqBY7/WXh4fFqAquiSszal8LDiQHZAG+c20B9lZjgMDNyuEHq5GRWSExMursGffXD 3AB4nsv3DxMVq7o7n0z1tONzEME6kO66+G9lQ= 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=D7lpI0032ckljqWxd5MKeqF8bO9v9lcI3LVfhs/Q60g=; b=EWH0rM4s3SLk4p3Q8uGSXQScbRnqDcSpTDZObglIeQukWXCpf83+JB0PBNrfhVns2M RZWYMY++U1LGJvLtt7iKoKVYGSraslqbM2uR2Q4de6sEGwnzRAmAR71fa/bXxJ95T6Ir yHJvqB5GPSjeJkGn/AVOqErZA6lZ5RB7ZeDgtw/UBpGrj2zHCUES4eW6aatvO+aHnJcY dWvgITdRexX9mYN6izdUDaCRQ7MoQeSxOIHiCjBqBEN1p1eixF7R6a42FyQdOwLoANhd XuaGm/yCXUY/tyFn4zqiUXOwM26AHBWslNSE2NZ7zI6HSYRmeWz8SP0igX2A9GdobW4H 9NaQ== X-Gm-Message-State: AGRZ1gLrFwBezVunrFt1qxeEP/4L5Mrpe7pGBzlGUNxrKCcUvAEbjhgh u0YhTa5c9mkZUAALpt/3KREI7g== X-Google-Smtp-Source: AJdET5dJ5LJZm4D61hO5lp28Zm+zdXyFPxQUFWzENOd9cvfV3l6atMx85qUxmJwtg7YSMX6gt8mKjQ== X-Received: by 2002:a17:902:f01:: with SMTP id 1-v6mr3831894ply.8.1540565058294; Fri, 26 Oct 2018 07:44:18 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:17 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 01/25] clk: sunxi-ng: a64: Fix gate bit of DSI DPHY Date: Fri, 26 Oct 2018 20:13:20 +0530 Message-Id: <20181026144344.27778-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074429_085625_908E2805 X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP DSI DPHY gate bit on MIPI DSI clock register is bit 15 not bit 30. Signed-off-by: Jagan Teki Acked-by: Stephen Boyd Tested-by: Jagan Teki --- Changes for v3: - collect Stephen Ack - add tested credit Changes for v2: - none drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c index f7d297368eb2..019d67bf97c4 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c @@ -581,7 +581,7 @@ static const char * const dsi_dphy_parents[] = { "pll-video0", "pll-periph0" }; static const u8 dsi_dphy_table[] = { 0, 2, }; static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(dsi_dphy_clk, "dsi-dphy", dsi_dphy_parents, dsi_dphy_table, - 0x168, 0, 4, 8, 2, BIT(31), CLK_SET_RATE_PARENT); + 0x168, 0, 4, 8, 2, BIT(15), CLK_SET_RATE_PARENT); static SUNXI_CCU_M_WITH_GATE(gpu_clk, "gpu", "pll-gpu", 0x1a0, 0, 3, BIT(31), CLK_SET_RATE_PARENT); From patchwork Fri Oct 26 14:43: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: 10657493 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 A81B014BD for ; Fri, 26 Oct 2018 14:46:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A7D22B226 for ; Fri, 26 Oct 2018 14:46:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D8FC2C1BE; Fri, 26 Oct 2018 14:46:05 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF5682B226 for ; Fri, 26 Oct 2018 14:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tBJqYj1vAsKEN9SmtYCmf5hsl415LpdR95FuPe2Ywt4=; b=BKUHf5eoHz4eF4 0S1xmiQSIa4gzrkO7mQUYbnXik2H6TR6ZbNmk2NJVrGzj+J3EwckZd3KXjkNMeXfZbthRu++5Uney 0nHakUVY8mLbQlRccVE0+rZIKNSYXurOgpOJ/q+eDChpMqg9DDhs9L5Qz83C5T4GXJz6SDSjaUKv4 ePSUub8eaauAZ+kexSo0fVqpY05ttRimUOQWDg7Ux0AAVc/JAlmwDBO413fjv6Kl5UVfShBZJfn3e C+pO1+qkZLMvLBI4XapSmW1hE99Ab+eXeXYio0U1yqr/3yk8/OtK3G42IrFAVCFGqTGa1hPVdsRIZ s8IaNtPkteHmObQb7yFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3N9-0002jY-Hb; Fri, 26 Oct 2018 14:45:59 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Lm-0000p9-JX for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:44:43 +0000 Received: by mail-pg1-x544.google.com with SMTP id i4-v6so635300pgq.9 for ; Fri, 26 Oct 2018 07:44:24 -0700 (PDT) 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=ZqT7S7ccSlN0Z4oiBOZYnQBnDGQDeTm2f/tIRaoUEO4=; b=IwQkeVkXMNjUbqG8HwSVKIlFeG2UDJLGlpb32wDzc5jnDs0TKyi8UfQ8Otm3LgsIyn YhgeEihQGExInby1uQLx0bNRQbdAc18wdR1WUphI5NzDUErZJL62BKY36F1lQ9OobsBJ c539CFIjvY1RMhiGduAsTT6tjYoNdJJB4F29I= 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=ZqT7S7ccSlN0Z4oiBOZYnQBnDGQDeTm2f/tIRaoUEO4=; b=FdQYCEQZjdjnC8EF1RbFNTbKBb4MYvYD/kOuGGCO2xVzVEoZNJI/xXOkkoIDMQ/lKH 6a4M2Vhj/Axj11YAhtNtGsL5hu8XBywNPBtWb1nWgx4n4lKQJf8HbHhB/7BZVHxX/Dpv nWMkb0QQXVkkAmDnBt6gYftWXGUwhwszAZAZrRqaUzGPICTa4nNzOVv4nrMKrefBR+za wwnbmL2zWXQjn4r3gL+RQHZ+P/kF/wqV6kV4ApDT9Ll+mLUmRrgvc6rC1+FSIdpjehY5 /6sRzkiNNmFTLmbktfWZidxhLcRlsLIW0WqrnXzVw7+7KH0GKSLb2msqeiQCiDx5bSvb ip5w== X-Gm-Message-State: AGRZ1gIm+3sfyUIQOT1yc6J7ipgFYHO3846oX5zhseg2Q2bvJwgRnKGv C3XVef2CLjTVKUMbPD/A8kagMA== X-Google-Smtp-Source: AJdET5dwXUrFOyiMpZ7HyN1IfRqpZo8uWMppQAsUlS9mUf0ioXHLoBiT2n/c/xkE2UhLRT+xsEUqxg== X-Received: by 2002:a63:b218:: with SMTP id x24mr3606180pge.223.1540565063890; Fri, 26 Oct 2018 07:44:23 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:23 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 02/25] clk: sunxi-ng: Add check for minimal rate to NKM PLLs Date: Fri, 26 Oct 2018 20:13:21 +0530 Message-Id: <20181026144344.27778-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074434_694510_AEF542C9 X-CRM114-Status: GOOD ( 15.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Tested-by: Jagan Teki --- Changes for v3: - collect Stephen Ack - add tested credit Changes for v2: - none drivers/clk/sunxi-ng/ccu_nkm.c | 7 +++++++ drivers/clk/sunxi-ng/ccu_nkm.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c index 841840e35e61..d17539dc88dd 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.c +++ b/drivers/clk/sunxi-ng/ccu_nkm.c @@ -125,6 +125,13 @@ 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; + if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) + rate /= nkm->fixed_post_div; + 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 Fri Oct 26 14:43: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: 10657517 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 F24E314BD for ; Fri, 26 Oct 2018 14:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9AD12AB4E for ; Fri, 26 Oct 2018 14:46:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD5192B1D8; Fri, 26 Oct 2018 14:46: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 230062AB4E for ; Fri, 26 Oct 2018 14:46:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OE8Jt5Lltr8LfqILTk3YvMDCZqq9lyhc7EGHxgA0S5k=; b=JZBOuzPw5WnBrH RVRqw1D0YuguXYJU6ayCRM4e9bEWKFHTifbccq2W1q4CVKzkbLzIZXQzBP1maz//ZyXaoW/tFkYx1 0TvuIwI58LbUlGqauq77MKydSK+yp/QYh8ZnGfT2yyQV6s8p/aY2c1oRX8wCdWnW89I7lGGMlEzvF Ku/y36k5K05BNCw49nGmvJc19PZUDnL2GoPAJSugFB2ICdhN/iDsCTGfm4CCzH86c17j98somi1P4 yQ03ITakdtH9mSbnILNQAxObwIlhkogSCT7BrHIrRjbBon426Rk3r7H/PlkQZH0wRtDQ85OeO2ntg ihOIpRo9Rtii+NFejO9w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Nk-00030f-Uh; Fri, 26 Oct 2018 14:46:37 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Ls-0000qo-DG for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:44:52 +0000 Received: by mail-pf1-x442.google.com with SMTP id l17-v6so677807pff.2 for ; Fri, 26 Oct 2018 07:44:30 -0700 (PDT) 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=LCfUU8SpHfEmAPHXqEtW+VtRBKPuExRqicCDj8q29y4=; b=nGIIzA9sUH3xhRTgytGk06e1T3qPtjrDwlKet6b3HqKEojx405qjqESehx1x4TqgHP G9gA3JalkS1tteEFAerR3AtMoRInyOlLRy1cPYF/iQINgLIYVRBOd/fYsUdt9yEqUFAY YgrxT1V8RmNHl8eu4ioOgMJz7EiMkyWdkFXJM= 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=LCfUU8SpHfEmAPHXqEtW+VtRBKPuExRqicCDj8q29y4=; b=R4TP/7X+9KjNhQt3mn1YbwPJ+DptQONehevfihggrtqx3jmjYlZej1O6vDO1eRCIb2 B7gp8M7YwIghtUEw9FXpzP2pdslkBZNai5qAkFk57uGLLxQShe0In3WuIlS2oeEF4oB/ BXS02A7jnObJBcqJyOX5a5sf9ZjqX0IrSkbFiNi5RSrb6IwH7o66ajr73SGXoNljtdRj qhIBBPkEcdSGI2s8NDPJvgVijPBroWZdxaMaZ6700dtGWB+Jl6PKbcZ0v0syyJ1crXT2 hCOhKb77csCYfiMpsq8K0reRCrSp+RbEGCaLHf3irHh1460jbald8os6Bt7OKSAeE5pq Rpvw== X-Gm-Message-State: AGRZ1gKmuxo5iRgs/hEvBqz1G5TmepKvTd0VaDXEy0LDrBMb2dbG6elP NGp9eGPWbzA1xd4rwpPwKL/vow== X-Google-Smtp-Source: AJdET5dCkTKMuBJG5eIyIgbSBBwJuaDl+Rpv9ClSqBLosTZXn8tzu1DRJ9schG34dsVFgG3vek45Iw== X-Received: by 2002:a63:ce56:: with SMTP id r22-v6mr3698001pgi.217.1540565069444; Fri, 26 Oct 2018 07:44:29 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:28 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 03/25] clk: sunxi-ng: Add check for maximum rate to NKM PLLs Date: Fri, 26 Oct 2018 20:13:22 +0530 Message-Id: <20181026144344.27778-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074440_486997_7B84E187 X-CRM114-Status: GOOD ( 15.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some NKM PLLs, frequency can be set above PLL working range. Add a constraint for maximum supported rate. This way, drivers can specify which is maximum allowed rate for PLL. Signed-off-by: Jagan Teki Acked-by: Stephen Boyd Tested-by: Jagan Teki --- Changes for v3: - collect Stephen Ack - add tested credit Changes for v2: - none drivers/clk/sunxi-ng/ccu_nkm.c | 7 +++++++ drivers/clk/sunxi-ng/ccu_nkm.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nkm.c index d17539dc88dd..574fd2cd2a79 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.c +++ b/drivers/clk/sunxi-ng/ccu_nkm.c @@ -132,6 +132,13 @@ static unsigned long ccu_nkm_round_rate(struct ccu_mux_internal *mux, return rate; } + if (nkm->max_rate && rate > nkm->max_rate) { + rate = nkm->max_rate; + if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) + rate /= nkm->fixed_post_div; + 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 ff5bd00f429f..c82590481188 100644 --- a/drivers/clk/sunxi-ng/ccu_nkm.h +++ b/drivers/clk/sunxi-ng/ccu_nkm.h @@ -36,6 +36,7 @@ struct ccu_nkm { unsigned int fixed_post_div; unsigned int min_rate; + unsigned int max_rate; struct ccu_common common; }; From patchwork Fri Oct 26 14:43: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: 10657523 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 B267714BD for ; Fri, 26 Oct 2018 14:48:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 976572BB49 for ; Fri, 26 Oct 2018 14:48:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8468A2A8D3; Fri, 26 Oct 2018 14:48:23 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D07992AE28 for ; Fri, 26 Oct 2018 14:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V4EaUqWR842Q+a12PnphonSL3xY2sUyBF3f+cpBv7h8=; b=t/q+PpQnK5ZBrW YPCIiQoksx5YMn91TCl444XDdxKIzWwofYYenihqpgy+vM7uvPD44rRPO09JmZy8dY2JhNyH/vRVC PQQelwkqEBFO8TkuOAZz9KchDmIB6v+n9DE64oSG90qu80QLx/+mmUMKZ0f75KkBaMukkI1E2UF2z A7ZuYmf8s68id92Dn5zuIWVEjBRPTF9MenJnk7wi2Ii77+JXIl2/ZFtnANAMKnS4i2kch5IHC3kmW tUcBbhOsBI4Y4vvoAoooSGRLG1Q4EnuStXprABGxGf+EUoo/9EBcqUmQMgiEzrxEkoTrYKPHTJuZm hCD0KciDq2myDzxIdqSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3PE-0003f2-2f; Fri, 26 Oct 2018 14:48:08 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Ly-0000ti-A7 for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:08 +0000 Received: by mail-pf1-x444.google.com with SMTP id b11-v6so668057pfi.5 for ; Fri, 26 Oct 2018 07:44:36 -0700 (PDT) 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=29lUjq4xsMxTFwOcUUS5UcZIBHs/5FcQ4oV4uekCsCQ=; b=M2ZvBQ4yLjSnFwZf7xSks091pOwRJ8bnrdCR2YaTd22lReyjxWlidRhPG+0Nb5ITR6 p5wojsnoJdEEI0AvdovFgOyBSAgkk8wMnwcNw+27hQIhznkkaI9aaDefFxG+Da7k65bn L9Z8OG6Ynq0crkNEnZ8uMOgjQX+ey4aSWcA90= 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=29lUjq4xsMxTFwOcUUS5UcZIBHs/5FcQ4oV4uekCsCQ=; b=K8O2fUrgNwhNpILrKxEIZtbvUygFQI2c1PRJdjQD+jr3xuMMmCVyiCrQEhvijwWkbe WtXTX0VAV6LG5sPaovWLGJilGClW5i6dPnRC7mhyNvVxRmsksxj7uovu+ngwEMqB3X2W 9Ch0nAEmNIvrUERwpO5xO/0law3w4O9vhREq4IZBKDC+91vMPIrhX2KIR8sgNyqoxzNZ W5SqGqNvAvUOt5+a8zhFdAbDiUCnh1OhW1YRsHNTYJea8VDNZttdfWcJDxxC34niaW4h coZrh2zUkd415VVtL0Ek8AebJbh7ghovBdtrX+sL6Yuybf3hVMY6KuEvBueQr4kDT7U+ /sTQ== X-Gm-Message-State: AGRZ1gJPZTekplibQeWgXPLl5AQ1DxKz+tTb4FdY8owICa7pciqcgtXM +NdNS1zASPh+NmTUGaKMNRbyIg== X-Google-Smtp-Source: AJdET5fJtfb6GmLORnmPLTP+T+5QR5NC07q1CQ7Sm49aRy3LYvI8IH9Uzdq3rR1sE8CtZVQWpH/NKQ== X-Received: by 2002:a63:cc51:: with SMTP id q17-v6mr3692742pgi.291.1540565075200; Fri, 26 Oct 2018 07:44:35 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:34 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 04/25] drm/sun4i: sun6i_mipi_dsi: Add Allwinner A64 MIPI DSI support Date: Fri, 26 Oct 2018 20:13:23 +0530 Message-Id: <20181026144344.27778-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074446_395511_4FA201D5 X-CRM114-Status: GOOD ( 19.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Tested-by: Jagan Teki --- Changes for v3: - add tested credit Changes for v2: - none drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 47 ++++++++++++++++++++------ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 5 +++ 2 files changed, 41 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..8e9c76febca2 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,24 @@ 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 sun6i_dsi_variant sun50i_a64_dsi = { + .has_mod_clk = false, +}; + 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, + }, + { + .compatible = "allwinner,sun50i-a64-mipi-dsi", + .data = &sun50i_a64_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 Fri Oct 26 14:43: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: 10657521 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 891345A4 for ; Fri, 26 Oct 2018 14:47:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 756F42C810 for ; Fri, 26 Oct 2018 14:47:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6953F2C86D; Fri, 26 Oct 2018 14:47:31 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F04232C86B for ; Fri, 26 Oct 2018 14:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=id/ye8LSWWJCtNQejdcR6VcnqZpSc3O1Ct5tldR5ECQ=; b=mOHjo7L3hrVgwj YLDf4yZVEVEIm/em99QMRb/NKRc5Q5yLpuy0FfDJIs6bC4wm3zfjBC1+X1wV3v12vaQ/AFpZMrDq4 e/bf1jHRjkCROMSjUoCF2mkA6q6fX4T2BUpIdYPO7YXskY60w6mWkGZzA31HNj0QSalN2+e+s+4T7 aUnlW3+CGipcOUiRg2xcaHgAPUmODVUmFUPkhanAgKA71236j+LMNLL/9ZIbhqXUSk8gI8KkyQHHg 4i+HEdFFoJwLbbFhGZKFKCvi+b3NcZTFpPEXFV2pLnjtqrRdORcUnB0k7Aj6edZBeVwH00i9jDkyP 97Qh4A66wrkr/3L6pHOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3OO-0003Hk-TG; Fri, 26 Oct 2018 14:47:16 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Ly-0000wW-A1 for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:03 +0000 Received: by mail-pf1-x444.google.com with SMTP id f78-v6so676952pfe.1 for ; Fri, 26 Oct 2018 07:44:41 -0700 (PDT) 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=9riTQ9ZUQloojan2IQ3yvqR1uY++RI/JA1qd1PVuxxo=; b=CXj6JMYzpt19nF8RCdog67DMukbYMr7N12u8gq6N357OOjnRvkhJqmGOFFVq0oAReO g1t2eAnpew4KnK+SLIYPDboFo6nJ8gSFI1o3jSBjHtKXOp/eCCrkhOXLh/5zr63QwlgO 6QzbHMkUGB36l8yrLVxHydeH8kxpXCJOS/uFw= 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=9riTQ9ZUQloojan2IQ3yvqR1uY++RI/JA1qd1PVuxxo=; b=EQTsbfNENPJSrDgPWStz2CYwjMj2958r3BWHpzTtnneTiv+ueEE5Un0QQYZYRq/z2S PrFv3yYR/ULbX+ChWRS0VSL/YLYRTqjIdLEQyF7u1gWqsaI4sSglMx5TCShS0PEmcGab +6keZ2hsv69RA+GvgM50G2ngS29/zFMX6GV5kv66ILG3MpJcaw/7MUfxrhsEsq1Q5Dql vPimsAV1T/i0CWE7xmCxwXbNMeB8c4wyZJBunY+2w6MxcDuFQij8/qAuil+NCTPXOl1H UMLJfnzELbnZ9zFR4Dhc4hf6yhjX3dYQWr71M9Ld0ZkcbA0EZhoITWDgwEKmHpSPTlRQ 96Ew== X-Gm-Message-State: AGRZ1gLzMWwBXq9ER2InUv4dL7ddfS7tiwkL21yfrRY4q+bdVT7nKXki lkgsMNzqt4A9EEF4etjGhTvQrw== X-Google-Smtp-Source: AJdET5fIDV0oa38s49ddMH0fRlRTaZ6oYCU6o5Evm1+pJ+bzTzN2Uh6hDhktwHJ2s3QBgBuighWIiQ== X-Received: by 2002:a63:1555:: with SMTP id 21-v6mr3681066pgv.383.1540565080777; Fri, 26 Oct 2018 07:44:40 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:40 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 05/25] dt-bindings: sun6i-dsi: Add compatible for A64 MIPI DSI Date: Fri, 26 Oct 2018 20:13:24 +0530 Message-Id: <20181026144344.27778-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074446_391941_6FACEAF5 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Tested-by: Jagan Teki --- Changes for v3: - add tested credit Changes for v2: - none 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 Fri Oct 26 14:43: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: 10657527 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 9B67A5A4 for ; Fri, 26 Oct 2018 14:48:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8649E2C938 for ; Fri, 26 Oct 2018 14:48:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A15B2C93B; Fri, 26 Oct 2018 14:48:56 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D4FCC2C938 for ; Fri, 26 Oct 2018 14:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+yhHJnQYGfgPaRZbsIp6TIKOWwZton51BFx+LXO3Cpc=; b=iTbrnwSbkVOFKn 40LzsibPXhkouNY3DV7qM05dAdHPyNQUA5AxTAxXA0AF70WPLZ5b5ra4lANyZrhaq9SXhNazpbs87 oyU2BaM9YJSieEaxjZFFicD4ZSGqHstSHxmBdJ517NuH2psiV1tS2ylK805Odp5dNllawNrvI3hDn OYxK0BcbFWMhiPvK+VnSq0GrqYlJoYF9U9iVEk3TnQpYn22UI5kNFHsvgOHR9PlCCehd6kfE55+Qu c+aZif5bOC07n33tQsmSwPJ4iSxToujphI5bYUQXaxRoPlfSAr2n7TNvNneg0o5kVWSrL4chShN9p uCDjkT5HmQtegtIN/UAw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Pu-0003vg-50; Fri, 26 Oct 2018 14:48:50 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3M0-0000zq-28 for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:12 +0000 Received: by mail-pf1-x441.google.com with SMTP id j23-v6so673780pfi.4 for ; Fri, 26 Oct 2018 07:44:47 -0700 (PDT) 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=cVRNMokL+W5QoyKoWUV5pE0kc2iWWL0MLvzndReDF1w=; b=V5YdT1/l3Yz1J970D4epM3oWJ2wjiQLWGohq3RBi3Ppq+eJLE1CRCHQOrYsh4U/VDq Z52ug+9VwZr+NmHpz3f6QIPib5DfU+z/j/GmZaOgZ3H07tP7SYt5HLfvxyJYdQNctPV1 cMYu5Lak1vTDgYSQuyjDpJfjCTMfuprH2yyOA= 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=cVRNMokL+W5QoyKoWUV5pE0kc2iWWL0MLvzndReDF1w=; b=jPoz/ZqwgYHpSf9oq+S3zl7Pz50GyOHe6rkxfHurQHSQAPrJuQJSI5bKECj14iRkaL 2bypq8YhlmA6BgNu69bFu7v4884qenLUKq5hfQjz3n3whNOpSDfdAtjDlSOTCkMI5rDJ VV/9FsvmtOL6fzkcId83hDMgZYV/j0VARwBN7sdA5ljsUrL6O5lHGnVoQmOcq3jUlkWb +1nZERaNbTrl8LZZtrhIvOQ7VYZjCeX5M/KMJusGpkdc4Q/oFKchBzqaCH6WRnmcklIk DUGdUeBV/XMLeoZfeKL6j94UvrY7EfkN+kVoeVAh7J/005ldLnVsXuh1YdmGTl9ic4As yRpA== X-Gm-Message-State: AGRZ1gKe1wkBDm/H3XQoZ79Cp1mt3u/J8bP8XyP2UvEX28HXPa0IadN7 8WnhOWZLfjvG9UGcZiHglSPccw== X-Google-Smtp-Source: AJdET5etpZ6TDNZrXZ5prFQGg/uyFIFNwVuKmkoddw6Y1yZkMR8kNgOj7/B1IDhcatC9qSq6ohWbYg== X-Received: by 2002:a63:4f61:: with SMTP id p33-v6mr3749528pgl.71.1540565086365; Fri, 26 Oct 2018 07:44:46 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:45 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 06/25] drm/sun4i: sun6i_mipi_dsi: Add DSI Generic short write 2 param transfer Date: Fri, 26 Oct 2018 20:13:25 +0530 Message-Id: <20181026144344.27778-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074448_174214_5E7479B0 X-CRM114-Status: GOOD ( 13.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Tested-by: Jagan Teki --- Changes for v3: - add tested credit Changes for v2: - none 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 8e9c76febca2..fc8560607147 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 Fri Oct 26 14:43: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: 10657569 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 8DF5A13A4 for ; Fri, 26 Oct 2018 15:17:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E7A82C9C7 for ; Fri, 26 Oct 2018 15:17:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EC2C2C9D5; Fri, 26 Oct 2018 15:17:10 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAA582C9C7 for ; Fri, 26 Oct 2018 15:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R8FTf6tRS5BlKCh7Qmc7ghKBOPqGxBN4eyssW5osbzs=; b=omsQP58+GtvU36 wqcsvmTTTD5vARrubS0u10eH9LJuN3rxWZIkkk4GlqzMM30pOjuOBOFkxQrbWtDBJdPS2SAhEpjX8 XQIu53iS4O8KcZ44pdIhNI9vBvBAHZwVhiWgabNy3iw3JAPOSBdsrzizfsawAYOJFKgPBV0F5yCY0 cJMfmynWcDhNSjg73n6mf84ANXtswQL7Z8yYB4zBi/6qtaFVOgZ4FGp+qqPlUI/8fHmsSeclFjiqv ubCiEhHWmr3IQOp2aLNCWLP4cuuFp2Jg79mH+dnTyC18bn8Dx3uyshX6Vv9f3RVxWjQ1MyRbTE8kM 1Z63Lfr3MsduCaqIYQvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3rG-0008IM-17; Fri, 26 Oct 2018 15:17:06 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3MF-00012f-WE for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:46:16 +0000 Received: by mail-pl1-x644.google.com with SMTP id bh10-v6so627273plb.4 for ; Fri, 26 Oct 2018 07:44:53 -0700 (PDT) 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=QcyEYMwNoNsH7/pEFnqDrYSAkVmaqVikL9S5nmhdtCc=; b=S8p20kByd5U672qL/qHhAOQAL21yOyWqvIAnM8dyfWgKF/juzSBhy8QtKdIDM/l5Lj eA85hKtx0/4H1xTPu+bjj2CR8raXV0waKdX7bLn+RuzE7W4hGHadtw39qbmWwnpWdaIp jAev7rxS5CfuWX7H8Go/8CYXXMnJCcbafE4bM= 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=QcyEYMwNoNsH7/pEFnqDrYSAkVmaqVikL9S5nmhdtCc=; b=E5HjvTr1/acqW3sKJKDuIG8V+WuFWjmmO2NMJSKs6gC19IFGwJu8P+G7fFJ6QeBPwM zATlcGAEEyQ0MP7TJJndSB0lFp28Ws20nDutAreQt8rZIODt8fiqJcX/UdXq3WeULd09 j+i63zYRN3tHxpAMCH6setXnlYgq50DQp+jPb70AfPqmEXB7QAqGM97MpcsiAY1fIgmM m5OvbZIWIggp3CJ6uvr1R9Yh2rKqM0ymvT49LMA+DWg9JdQ3pZXa9mmjF1VAtr9HdY2P 12Cy3hdE3fEBtma4Bwe5ND6SXoWQYzWpo+4A/axHgycNb8Li8Fr5993okQL8gRsIQ4mr HhZQ== X-Gm-Message-State: AGRZ1gKG+7JzMtDjWeZ0PxJ1hpji/FPsBXGjH8eRZ5noM5OwTx/kKq8s ufcYsAJajoW30eYbLf8uc5cHqQ== X-Google-Smtp-Source: AJdET5fRX18D6J+W1oD9KGuQYtj3LLqpIcL390bKaD3qSxmQSYUA00Q2DovPP1eq0FzC/3b/8I13Cw== X-Received: by 2002:a17:902:8c84:: with SMTP id t4-v6mr3862074plo.188.1540565091986; Fri, 26 Oct 2018 07:44:51 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:51 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 07/25] drm/sun4i: sun6i_mipi_dsi: Fix VBP size calculation Date: Fri, 26 Oct 2018 20:13:26 +0530 Message-Id: <20181026144344.27778-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074504_090145_42C187F9 X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The horizontal and vertical back porch calculation in BSP code is simply following the Linux drm comment diagram, in include/drm/drm_modes.h which is [hv]back porch = [hv]total - [hv]sync_end BSP code form BPI-M64-bsp is calculating vertical back porch as (from linux-sunxi/drivers/video/sunxi/disp2/disp/de/disp_lcd.c) timmings->ver_sync_time= panel_info->lcd_vspw; timmings->ver_back_porch= panel_info->lcd_vbp-panel_info->lcd_vspw; vbp = panel->lcd_vbp; vspw = panel->lcd_vspw; dsi_dev[sel]->dsi_basic_size0.bits.vbp = vbp-vspw; dsi_dev[sel]->dsi_basic_size0.bits.vbp = panel->lcd_vbp - panel->lcd_vspw; => timmings->ver_back_porch + panel_info->lcd_vspw - panel_info->lcd_vspw => timmings->ver_back_porch => mode->vtotal - mode->end Which evatually same as mode->vtotal - mode->vsync_end so update the same in SUN6I_DSI_BASIC_SIZE0_VBP On the information note, existing SUN6I_DSI_BASIC_SIZE0_VSA is proper value. Signed-off-by: Jagan Teki Tested-by: Jagan Teki --- Changes for v3: - Fixed proper commit message - add tested credit Changes for v2: - none 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 fc8560607147..3a1d48bc1996 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -526,8 +526,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, regmap_write(dsi->regs, SUN6I_DSI_BASIC_SIZE0_REG, SUN6I_DSI_BASIC_SIZE0_VSA(mode->vsync_end - mode->vsync_start) | - SUN6I_DSI_BASIC_SIZE0_VBP(mode->vsync_start - - mode->vdisplay)); + SUN6I_DSI_BASIC_SIZE0_VBP(mode->vtotal - + mode->vsync_end)); regmap_write(dsi->regs, SUN6I_DSI_BASIC_SIZE1_REG, SUN6I_DSI_BASIC_SIZE1_VACT(mode->vdisplay) | From patchwork Fri Oct 26 14:43: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: 10657537 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 81D145A4 for ; Fri, 26 Oct 2018 14:51:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EA032C94A for ; Fri, 26 Oct 2018 14:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62EB12C94C; Fri, 26 Oct 2018 14:51:07 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0ADA72C94A for ; Fri, 26 Oct 2018 14:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VuChkcSVKhzgCWu2D8RTohOKFsAwmn7MWS8QpRS3Qus=; b=Ujph4dT22uqMRP XDPZkLARCgEVx29JBkNnrM1PIXJ1AMPlqDWD+rsD/dQBcobDBurDUejN2lm5nPu/2TtmpkwgYnQpv QR2L/1tkgC12XjrA9RJmR0nJkptwad1QE7HCJHsNcjKE4h6MokU1XLWYv22j3xYEhXWgO9WdxIT0R D8pcL1PCwkT0RJXpuLM1QkSG1uJhQXcGmtXJ3TPeXzww37YPNwAhwaEv97unYyfeOyjakhFv204fZ s+osPC6Olf1urDxLLdCDNN1hk5irDKMS83+yMsdky4QmEsN61m7GY1PHE6zQciO2yijTrH87Jhsfy qvt0VjwiF3Wtw0tpvtIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Rs-00061i-N9; Fri, 26 Oct 2018 14:50:52 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3ML-00018N-0f for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:46:54 +0000 Received: by mail-pg1-x543.google.com with SMTP id z2-v6so659739pgp.0 for ; Fri, 26 Oct 2018 07:44:58 -0700 (PDT) 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=WMs9eO77nl0Eah3EaCbogJZGiro2jRBYTgO70Xm449I=; b=a+9DETh0u939w4jAirodb/qnd2j+apuSoNCYkyoljf3MVh9k2qQLRJT6MtcUrZeG/J B1jZoo4ZbiLlLfeWF1Z2uekx/+cvkX/06qBnPtnHdgwa6mbvkuM5x55QoKhGPKhTK1m1 Q9gDBJzgc3Ktf2GgDb81jjw9cZcConF+pzBtQ= 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=WMs9eO77nl0Eah3EaCbogJZGiro2jRBYTgO70Xm449I=; b=iHEkXghFPdQSkLWi/GcWQXTBL3BnPqj+6QLNd9HnwXXLXeBlas8JFeh9hCp37Xz/41 os5c4vg/UJL2f+it7Pj4FS2S0RW2QC88Ys92NylhED3EtFlxUbAA4CWi/j7xPI+iT0Di /TV8NqvDZpCbxTedcX7cZ2r4bL4Gu1UvnFPpPriwir/h2Zv/ghVGBti905E5fPc2ddAj mpRk0skLyG9bX0u4e4nacEpsqt6htuj46rpzghSbWPqE3UKBQEMDK6dZU0tDRXyYq+vY e1+K6OxzjNT73O/yQuwzu504g84DvcGVXdX2I0yLljZZcHoBiboqDthn+RdqBuZK26TA JX1g== X-Gm-Message-State: AGRZ1gJiy8Ks+uWrc82atWK2EpRcSKgvBPzxRNrkuhwfX0ZKku/986ie E/cLo1ME9PKt9lx0vhgBSLPrqw== X-Google-Smtp-Source: AJdET5dgwl8AGfxA5UhLunN3uxeVtMs9gaT+XpatQelxAyvZpuQ46W7uxHtqkj7NCXxoK7BKPBpvPw== X-Received: by 2002:a62:b802:: with SMTP id p2-v6mr629099pfe.1.1540565097511; Fri, 26 Oct 2018 07:44:57 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:44:56 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 08/25] drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits Date: Fri, 26 Oct 2018 20:13:27 +0530 Message-Id: <20181026144344.27778-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074509_155527_64116CA3 X-CRM114-Status: GOOD ( 15.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 (in 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 Tested-by: Jagan Teki --- Changes for v3: - Fixed proper commit message - add tested credit Changes for v2: - none 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 3a1d48bc1996..8d154cf2e6d6 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 Fri Oct 26 14:43: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: 10657587 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 37CCF13A4 for ; Fri, 26 Oct 2018 15:19:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A4472C9DB for ; Fri, 26 Oct 2018 15:19:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E9742C9DD; Fri, 26 Oct 2018 15: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A7C962C9DB for ; Fri, 26 Oct 2018 15:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RM3FKzp14Z6OGTLamLL/SqGmLUSLIxlMuorSuX3indQ=; b=tu4QT+J5DPbta9 wcFcrKPuaZNkCK473VnULq5w3EfF4NFb4uQKfha37kiYV0+S7S/VFPY9IsZEvNX+srmbsm/N4ezLT DNcQXzYq+3tDachK3KF0axcevnBKObJpf2mhqBSkVkM4Bs5uSzudQ1M46xnczm3FMxwNxFBffnm3s Y9bz9Ym2H/IGOetMr3EFDPK33SneBnhqfHexrDcU1ciEEOe0ri4GlEmtMwOa1RHY9/IgtBD7rtBzt /TrmEpDociBEBQXERZEhw8HmYcm4VAqTSRXaEIfxjIQyV4JGyEPAfH9BJTH7TTVn8Rb8QyeTnC2ji /2Xw3uluuifJACo4tO4Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3tE-0000uk-KJ; Fri, 26 Oct 2018 15:19:08 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3bt-00012G-Vr for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 15:01:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ygp+3SnprJhnbmLUgRdGawXUPjC/BTULTbCFbZ067cc=; b=uknX8x/YVRmzeQGkXhNxA3Pva3 gVdFVNB3TEP5FE9ZpIajv+J+8Xq9ty5zPQRckBVzFWEsXRD6Mdc8dz6+rUW0ANEMjHKALtxrEb9m3 sjv25ZRYAktdthcjbcMORNzzw//Uzv26hXWd5cwE1bg8nma0/rChN4NHTjuFc4MvT5oZUciRjeWO1 2aPUTNT7hkVXwW68d574foZ6nXHyiSBcstfdvGGn1p9mm6XkyN1GYt99VyUAa30TPM0KZ5XpDhsi+ ziaY+KD8qcQ945J2z8Fr4Cdcw/QclEcEhxwiBYEnj+1yGvQRldsENlgOrLasRnSoyguu1GdwbPqyJ XxS/geEA==; Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3MR-0008IJ-Ai for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:16 +0000 Received: by mail-pl1-x641.google.com with SMTP id p7-v6so624684plk.5 for ; Fri, 26 Oct 2018 07:45:04 -0700 (PDT) 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=ygp+3SnprJhnbmLUgRdGawXUPjC/BTULTbCFbZ067cc=; b=cc1ITzOq6renkXS39VEzpzI9qforSXwKRu53A3Jcd2aCV7FRFjv31cecPUaNvVxUoL vb93mpt2cy4W48WhC3IIdA1VhwXjL11I7qAOmITITn5nM8BLtMby3xvQ4GVbMg1hPp4g I71GuCE7HLRpkqcMqlpl34E9OTCvPCgTWLQhI= 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=ygp+3SnprJhnbmLUgRdGawXUPjC/BTULTbCFbZ067cc=; b=gNsci3hbc9Zg71c7TQ1bXRcxKeakokc/inE5qtseWRdW2YuiPK18JH+Kmj2YtoYS6j PjGwTJwGp8Qb6F3byQoxYAJAoZB5LfVRf5zTdeAYHp6JTaxmeHfj0UMgn9mSgUeETIio /eShYHRjuZKqgdCmeKYSynrXgZ+kfIpQTrbIZerTI0GZ34CaijXpE64Kd8yTewzHUJe6 ssdxeOusCYE6QuQLId6Z0iYGIhW3UlRc6VS3CnFVMJYKRykqw/Wt0c5GTgd6IRDtq+aB 0u9jl3CQTR/pJPUdCeYghJauiutPsNv5inBtx+X+lzpivAMsbHGu47V533/+U/99BSty 5MEA== X-Gm-Message-State: AGRZ1gJuBi1f/WDOW99b+qVas4yxqDW1ul7f2Br91F7V/oCRpd2XYruk 1CfDkIgz93KLZ8DDOZLX8JjO3Q== X-Google-Smtp-Source: AJdET5f7igh1BKVvkMSAzIy+VfsF+TBLbwiw5FU55gW9N+8bQAN/icqoyRMN9cvvaQDvln/5hpjAyw== X-Received: by 2002:a17:902:aa45:: with SMTP id c5-v6mr3889262plr.100.1540565103086; Fri, 26 Oct 2018 07:45:03 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.44.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:02 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 09/25] drm/sun4i: sun6i_mipi_dsi: Refactor vertical video start delay Date: Fri, 26 Oct 2018 20:13:28 +0530 Message-Id: <20181026144344.27778-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_154515_362997_69B52E01 X-CRM114-Status: GOOD ( 18.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 (in 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 Tested-by: Jagan Teki --- Changes for v3: - Fixed proper commit message - add tested credit Changes for v2: - none 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 8d154cf2e6d6..6bece492b1f7 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 Fri Oct 26 14:43: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: 10657535 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 5E11514BD for ; Fri, 26 Oct 2018 14:49:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 460F62C939 for ; Fri, 26 Oct 2018 14:49:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3961C2C938; Fri, 26 Oct 2018 14:49: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7C682C941 for ; Fri, 26 Oct 2018 14:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jiwMXzoaar9lU4sFI+HgOj0R9LV5PpX62/iiGG2jWAo=; b=TTtWvvJ4ppXbPH nnZuzEgj73ea26y9CcppXrjIOGhRnGL0ZfO7ioN0oXVdfawyhnfHz1DbAjQNAj2tlhBJ9mc4QDFRL WSBSks4K2pd8QU2CxN60GvbxYb1W2xKtg1DneqxR5jXv7VecbEHvmyFhwWM5asQs+qIL1KVOwCS4R DzwEbuq36UYIUHFCMjiJZc832tcBdRfn4FiWZPkcqhPV7EhCzNPjzvu3yzQcrU0n5QaKsm9eN7i1/ cHiS+oqQfUVHjglECaCzvLlDHwmhZ49EDh3bNQC7QzCK//EETJCdWyATTVsQ60Y532d/1kyVYNZr5 wGN3Feth1HtswX8sOuMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Qa-0004F6-Ed; Fri, 26 Oct 2018 14:49:32 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Mc-0002Cp-VQ for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 14:45:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Bf1jX/QAXYpOjKEyQOR7939jlZu4ci0BnR1i24YJ9yM=; b=19gLVXTqAECsLkNlTUkgM/csvc CUwccaDKeUOPbMLOwjy7crmieK0hgfPThAZwPbrT5d/dDkz6OCfSAXhiG6ooGpWpjhmn2gbMzZ+QN xz/eW4yZHb8Oh1nKt58VTPr6YYv3QAX1PGC/tQlzx6GzIm7i3byO4J/mYJ5t8Vxe93mXxSjzdWVFR TUANb5aov/OqmnYcHA1unBhNf4Ux8w1uzsrU8DFq0eN9vTP5c0Vlc2Tn0oxFT3pgnTJSNr5deOsTO SR0n5Ya9Hv9vlhiO7aJ7J69xk5H+GjAdy5W24Tkfu7QWQzY68vThwxo/B7PivIXdKTfMIKZEtjMw/ H7a9r2mw==; Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Ma-0002nL-1i for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:24 +0000 Received: by mail-pf1-x441.google.com with SMTP id b11-v6so668780pfi.5 for ; Fri, 26 Oct 2018 07:45:10 -0700 (PDT) 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=Bf1jX/QAXYpOjKEyQOR7939jlZu4ci0BnR1i24YJ9yM=; b=menwlbWCxRfV/uapcJsCL9CPFYnMiWJhOAuXTh7Sx/iUI4yVSyM25sfKHRZJk4W366 CQGB88ChYMqzzNGhPVEF63Ie/bbHlTjkbhfU3QqIHBt8mU+99e5s/bD9gGuH1U5UwRln 1STuNhnCePzEkYpZoj9XQR5q4ZWbpaEohJHaQ= 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=Bf1jX/QAXYpOjKEyQOR7939jlZu4ci0BnR1i24YJ9yM=; b=cm7y2oOZEfIq16g72G3ddG8ZeodMsaKnw5Mhx38amWd9VqR7x+K7VbaltwFkbLwdnm 0Avc1qEOn6PGhdfscXEveC4rqfvVfAnu7Yf8Con4o15KNNn0cWDZhrVi2SzWleOFMDyc Ux4HigQ+uAtokraw25GxFFneT9WeZoZdmzS5/sSul3DXtg9pjMw50o/kMJUMMZIz4Kid JQ485+/NMdyvv+Uq50enni+/rXL/EK8peU9bepjyTVFffQd8PxOLAyK47TU+zwoxp911 ATHtYkKpACjsD/K56N1B177QQLfb5hJKnUyJhxJs4KNzgnGr4W/712a+BzXez0TccnNh dCyg== X-Gm-Message-State: AGRZ1gLXeiqNhRPNIefSKDTPre28yM1o6n9mH6wuH6R/qasaofWkLeCY NLWYw6KS/YVBeOSlHURcwAxzaQ== X-Google-Smtp-Source: AJdET5cey5/nZsw/eJb8gK2YMexy5LD0d3FhLyKPKYLx/e/etvBqeiL5vA1XpoXPLlgLz4pfVSWi7w== X-Received: by 2002:a63:b218:: with SMTP id x24mr3608116pge.223.1540565108682; Fri, 26 Oct 2018 07:45:08 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:08 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 10/25] drm/sun4i: sun6i_mipi_dsi: Fix DSI hbp timing value Date: Fri, 26 Oct 2018 20:13:29 +0530 Message-Id: <20181026144344.27778-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_104524_111616_138A6CD8 X-CRM114-Status: GOOD ( 16.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Tested-by: Jagan Teki --- Changes for v3: - Fixed proper commit message - add tested credit Changes for v2: - none 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 6bece492b1f7..78bad71045ca 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 Fri Oct 26 14:43:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657539 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 257A714BD for ; Fri, 26 Oct 2018 14:52:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CFD92C931 for ; Fri, 26 Oct 2018 14:52:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3DDC2C94E; Fri, 26 Oct 2018 14:52:01 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 898502C931 for ; Fri, 26 Oct 2018 14:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mGyfpiE9kLJVVikZvF3wY+cZEJDvDUoqxWlD+BOgKGM=; b=dv0WaJOv4mg+uI r9nrFeDHXFiWoRU3jWsjc0RHrFHQ1r5pUbTma8KFx79aRWgrdy7OWPyW4npKY5v0MedBtFfsAbHoU mOL9lISuDymk8Xqd02gflQ4ZLEwa7tnQ72NJYt4ZzUCQhd8MX/SE4sj1N0IwAkkFLJhJS6+3ZJJ4d pzQrzbrwxR5q77n/mCOPYUJAkD/MeSAqPSwvX6TNeksFEvFY+S8TWGu78rAFciULGZkUvdrKHYTOT 1pFSdrz8AKaFI/zzzweLhBo3JWT6ogyDYy7rIE2sti7WLOUymia+IYdCcgU8Vf37WhnKP/Gv0OLTx 59cgH7EJ9fNQaRYIjYuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Si-0006Qu-U3; Fri, 26 Oct 2018 14:51:45 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Mb-0001bq-It for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:47:25 +0000 Received: by mail-pl1-x642.google.com with SMTP id f10-v6so631585plr.1 for ; Fri, 26 Oct 2018 07:45:15 -0700 (PDT) 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=dzYsobS71oU5eR+nCqctsEelM8iLw0Ecr2La7CxlAO8=; b=BR/O0TL5MOkrEbMcuc7MkTgo4m3V4Fxw1ESKkXIpCxC/17FzfssRNmxVV3PaL6j4Wm MDtll/L04n3t/bNVGECryTTlglskuI/pte8xXuK3XyLybCuFhQzppvVo9iiTD0FyQl5Q 4p/dXV5oMMAqek5FXutWeuqMQOuDWAi3xF0hc= 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=dzYsobS71oU5eR+nCqctsEelM8iLw0Ecr2La7CxlAO8=; b=uZBlayGx5rYq5mmZLSLZjyyqotZrDac6SlxEO9YNgt7xOIMR1Bb4SK/mico2i/6Epf sOd5eJw3LJOo9inMtyDWs395QcOBh/qJ50maGBEireYLI8MvuYXWWjJP9QpH/C6FaHT9 e7LOxwstCFj10aLrIY1xBCinvajOidI/X57i0YmLTKPeLJT/DaHTrqlQwTELE2eofegw 8cKjSRleTqN+DMvJsoqFBITePD+gHI/CghFUVSQqT5uT60jzAmc9DtG4mDsCxr6ymlbK v8nRGx/ubyuej2f40legJ4CI04kDVHIkw2N2AWnAuNLb79ed5USui1veG1zwlnYX08h7 jYQg== X-Gm-Message-State: AGRZ1gIltuBdbsR7Z+ruFoESRqCnIH89M0vBzuQcChReP9oINKZ8hYBD abNl+MsmjJULXz6xwt3mqVzcuA== X-Google-Smtp-Source: AJdET5dB/Dxd/8QFJYIpBnoUYvo7mQsaQ0AobFhN6+4RxofTwTehooR371empGplpVn4+Nth/1g+nQ== X-Received: by 2002:a17:902:9b84:: with SMTP id y4-v6mr3845077plp.332.1540565114258; Fri, 26 Oct 2018 07:45:14 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:13 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 11/25] drm/sun4i: sun6i_mipi_dsi: Fix DSI hblk timing calculation Date: Fri, 26 Oct 2018 20:13:30 +0530 Message-Id: <20181026144344.27778-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074525_662340_9C58585D X-CRM114-Status: GOOD ( 17.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 (in 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 Tested-by: Jagan Teki --- Changes for v3: - new patch Changes for v2: - none 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 78bad71045ca..596e560263bf 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 Fri Oct 26 14:43:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657625 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 EA8DD5A4 for ; Fri, 26 Oct 2018 15:50:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D60512CA77 for ; Fri, 26 Oct 2018 15:50:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3D202CAAB; Fri, 26 Oct 2018 15:50:40 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 58CBA2CA9D for ; Fri, 26 Oct 2018 15:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ed2ZiY8sq4zlB9vf0Np64oPk8hACCnC44CmKPk8oix0=; b=ey22xf30vFOsFJ pknl43GKB6Bgabs8aOrYKkdi5hCG6nEoPtG0skXmoJLoG0JPuBjDaqJo6qWHMpK1fo1xIfZk5vn6/ yFShHhR6Xpcz08RTH0sSkyQe3r0RcyCiauUD9RwgkLGq7IaG+ew2yne3T77/kRT/MBU0/UZNGIyg/ ZTW3GyOS25sqxp7dCi5Fwb8Fv5bJwtsw9QFztzHSbZFy4/7/unlQ/hNAyMfffsKoXfkji16/jkiCj PGmSCcEccMJW/iAXSQC/yEcQzg2V5WOqVjh3eVlOWRKWZ7kGls2e63kNXBCwRGZdzqO7UU4zAe0Ig heIaSIZPyRS1xLKmWBcw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG4Ng-0006U9-5k; Fri, 26 Oct 2018 15:50:36 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG4KT-0003vT-N8 for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 15:47:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4csUWAGh39LPVgyuP+BQQjALYVYKTKyjREVujLRWfRw=; b=XhT1tfxZ3gY7zwTjeRPj3ybrSZ G4fnfUTor7EtM/EM8ZacBMIiKSPn6QVXN9noyC6ahtf8zY9D3Z8+EfySoppmvV+2VOzMoX1v7dWju 3uPj+iwr5Gv2Km+VFATXY1XBDK7Q9RGhAPodORleV8FTDGjOZyPcP3+Ov+zWC60l6MGkZtfTAtdWa KGVIcIHS1nV163Xf2SDjoFqRbSI8529wst/VeByPzhbdxK3N30yzG55Wc1vdXSZW+RE/7ZWscPWr3 QJdN5y3WMk9KVMBqiIhHKeVFYAwLXoraoxnPWRoZa5fpoGhWR4xJw9cLN+5knCqr11hMIW+7n6tns FEIouFhg==; Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Mi-0002nf-Hg for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:33 +0000 Received: by mail-pf1-x442.google.com with SMTP id j2-v6so651209pfn.11 for ; Fri, 26 Oct 2018 07:45:22 -0700 (PDT) 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=4csUWAGh39LPVgyuP+BQQjALYVYKTKyjREVujLRWfRw=; b=jxjJGsVQTf4etw0gieZ0E4SLLyhVdfXzLDPUOBbqTFMgj1yDnsshq5HreLLziEINQU eVXpfdh6aUPZJyK1aIK0hQIbJ+KcrGMVYHmH+h3NukXPerPpmNMWhipOw8LpR1h1aVKs T2dRZo68+VnxS0ga8BiznjUjHC9dhOfbSfaEc= 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=4csUWAGh39LPVgyuP+BQQjALYVYKTKyjREVujLRWfRw=; b=dCR59jQB0Jgyawz8Mv5O0kc1ulSgfl04L/nckNcl731NU/jIYhGQsIvA9y8Y/sFBKi IWBwaDJQYovUOTr5d4ANsaBYdSUED9JFlOt9AFvtKBMqtfSvkpCYofRfNwsRT49pb1Wa xLi4g99FKIHixm5pkznObI62xgZ+7sHCUGnKXGpg3nukGGfaU2r3tBeOhpnhWQvuenOY tQG/BYy49GfPSzRpyd0wLpp3YigELYIGn573SBfBff1HBuGQ+5CR/6nE+bnvqp7R64oV yFghBAEtyxU+HheuOino+g38Iot8f815ZW9q/lB506ZwNJ0TAHW7OEcDlHQyRva/+JmQ eBNg== X-Gm-Message-State: AGRZ1gIGt8gc2NNuppFvQMKVb0cqpqxd8gHIxsTgh86kXAn6aHv/GnfB fQ4uzK0sqjOdR29udnLuDhDb7w== X-Google-Smtp-Source: AJdET5c0tXb2s+1FRPYuGryZehtZmX1lbn3/l7r7tI90/Q924c3f00RKXW9dcyKBilDNBUefaClUeQ== X-Received: by 2002:a63:cd45:: with SMTP id a5-v6mr3833382pgj.43.1540565119859; Fri, 26 Oct 2018 07:45:19 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:19 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 12/25] drm/sun4i: sun6i_mipi_dsi: Add DSI hblk packet overhead Date: Fri, 26 Oct 2018 20:13:31 +0530 Message-Id: <20181026144344.27778-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_104532_649390_B7759A7D X-CRM114-Status: GOOD ( 16.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 (in 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 Tested-by: Jagan Teki --- Changes for v3: - new patch Changes for v2: - none drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 596e560263bf..cf42be1f1ba1 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -461,7 +461,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, { struct mipi_dsi_device *device = dsi->device; unsigned int Bpp = mipi_dsi_pixel_format_to_bpp(device->format) / 8; - u16 hbp, hfp, hsa, hblk, vblk; + u16 hbp, hfp, hsa, hblk_max, hblk, vblk; size_t bytes; u8 *buffer; @@ -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 = (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp; + hblk_max -= HBLK_PACKET_OVERHEAD; + hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, hblk_max); /* * And I'm not entirely sure what vblk is about. The driver in From patchwork Fri Oct 26 14:43:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657621 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 6B61414BD for ; Fri, 26 Oct 2018 15:50:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 589532C99D for ; Fri, 26 Oct 2018 15:50:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C0332CA04; Fri, 26 Oct 2018 15:50:05 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AC9212C99D for ; Fri, 26 Oct 2018 15:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Icxkmr9XfaDDWdySXbJtKRWkF7iTnbeUraQo5R/gnXQ=; b=JmiDIWHA/rWD2E 2cc9xJX/Ej7W99A9XGh/L2oMRZS5t3vogWFX+WCXyD+YZYRP7tF/WD/T6XgefwKdRJHVIrkPGrb9J UvSm9HQ4HXqjdxTSmTHWk9UFq7UF+eI1oEti6BK5medvQLF/uw3f8CHatxywZV6W6UMu8Tw/jXC6N jajEkzR/na+9swj+r2+EymKmWTAIIVbl0SWpHh7GWr5JBlkYKIj95A50K9nteSJi7hnFzjoTvNsE6 WwJcTCkts2aYxAj2L8t79z1gyLwPDhP533JFyqekDnAan8C0qCZgQkJuO4/gFCG/vE9NukRTrSxm/ 1+PJd+mRY2yOUUCzYnPQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG4Mx-0004zh-3x; Fri, 26 Oct 2018 15:49:51 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG4KS-0003vT-58 for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 15:47:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gStIo7NjdB+TGqHNblRTUUqjFPTn5lbRTmfmm273Bxc=; b=XtgYh7/kmP5cJVGQsnY6h+XMMY jeoI83Hkfi+aGOptqEzXa7E5Piwyk0MgCvFAO2j+dAdv4fLEfbCVNq+qlLiQZq/OLawDYWBy4u4gT ef23wu0Qshi6yuJcD+IThgZPgV+vHVVst/nyyFvUJRYYe37Lsqk8rTaGSVd41AGUqCqWHfK48GLuL 9rFw8b6gIuuMv/6j0g/Tw+5D+JjNH8tV0LhxoF3obZbaNYIVIVMKhR2j6kpQ8TpSXdcVKeW9R4BlJ e4XG6KQzJHAAApej7z7jYJbWl6Io6vm3U4lp+4SdnM87D2yxdb3TEGLVabOphIz2TmlKNeCIHlmy+ nXG4PuCw==; Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Mn-0002o1-Mx for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:38 +0000 Received: by mail-pf1-x441.google.com with SMTP id g21-v6so663755pfi.7 for ; Fri, 26 Oct 2018 07:45:27 -0700 (PDT) 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=gStIo7NjdB+TGqHNblRTUUqjFPTn5lbRTmfmm273Bxc=; b=Yf5VhCYNunBsPm3e5TIp1NrtyNuZROnCExwWWP+jnKIHm/8MdKp3HleEcNYZvbuCHY ygswg13ZW87y3w5GYwhMds9ymeERXjpJSE/u8Xv/NyRUW6+QXOI5d1hn2GnZrMol6SUL gs1ZU94O9ECeCVRNBgDdaKvljgbrQXRsCNsvI= 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=gStIo7NjdB+TGqHNblRTUUqjFPTn5lbRTmfmm273Bxc=; b=Bgkn+tbpYoQda2e4W2LgBlMbQLu0ZXDUFzdCGJHhiUCYE8ZBtOUxeuwKIvSRLcxsQo qL3862QLJm+TyD96H1i1VBPRix5VJwt2Un41lZbVFc05guEfDIUk6U4FkGVA02plIwlH anFwtDsUyoEOFvBQ8cj4PvNEwH4frGGC+SORD2Iqdt9VQ6J00bV+TruAtBYds4i+mJ87 70tgTtEc3WgqaxWKWkkTRUMkqlJy1qjLGl81KL2KFadYhlsXjM2h9CoL7AaNCC4owaxY RaUGqYJVO2zym154S5xL0aIJ6aLJfj94aq3+tW2t6oUnhynEVMOByj+4p9AEDU/l2nbg YiHw== X-Gm-Message-State: AGRZ1gIHMLBibxLeNBXupbwXTBNZq+KJcePOc+xE96fuLHcWI+Y1aF78 SEWvqXd0d9CyUGHWeMUda/DhAw== X-Google-Smtp-Source: AJdET5f2tELebo7pA+gv81OluwfXob4rp1XQeVgf2g02+EfXF3ZDPpSJJx7eZAew0I6nmSg/Yy8auA== X-Received: by 2002:a63:b218:: with SMTP id x24mr3608910pge.223.1540565125481; Fri, 26 Oct 2018 07:45:25 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:25 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 13/25] drm/sun4i: sun6i_mipi_dsi: Fix DSI hfp timing value Date: Fri, 26 Oct 2018 20:13:32 +0530 Message-Id: <20181026144344.27778-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_104537_778961_AB581FDB X-CRM114-Status: GOOD ( 17.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 (in 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 Tested-by: Jagan Teki --- Changes for v3: - new patch Changes for v2: - none 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 cf42be1f1ba1..6584b51736a9 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -490,7 +490,7 @@ 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 Fri Oct 26 14:43:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657541 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 A720714BD for ; Fri, 26 Oct 2018 14:52:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 946D02C951 for ; Fri, 26 Oct 2018 14:52:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 879322C953; Fri, 26 Oct 2018 14:52: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 084E02C951 for ; Fri, 26 Oct 2018 14:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2platC7i19VkzlW8xQEjOQ04QBDuvUQy5SEe5+q6WCc=; b=Qnmge3Qhn4QYC6 Ymc/cOS8UCtDmvvIQDuchbUpLXEpDOZARHcHQjn/F98JvGvTipCVFeHEB6gVNVWhbVmr7IpjqM/5F t7+ojeJmo32NLemytaWlxJRu1yfcn8gcr0nWwSA549Ms2WB3LPZo5cUMIvdSmTNEQQLsk4dpMJ71L as1/1U7jMZCh0xwL9osGbIyCMAYVdTMJ2APFZqjjCnB3uwoi0/xKltzahXb6Ly7ixlD0BUsW2u21l rcDahWmmJs1+p9kdWD8imxeVQl4D7Mk4NwRknywl9yTGglF7mnIfqwGyCStE4xsdxG/7FaQxFCZhT api6/5mhaPo7X6xUcdyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3TL-0006jF-DT; Fri, 26 Oct 2018 14:52:23 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Ms-0002ZB-Go for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:47:42 +0000 Received: by mail-pl1-x641.google.com with SMTP id o19-v6so606379pll.12 for ; Fri, 26 Oct 2018 07:45:32 -0700 (PDT) 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=efp6sFiQWGhKGiEpT9DPizID7xKe3bNjf2I9V30y+Ys=; b=fgB+w/jtIZgJ3cUnZ6wBZHi5PXY/IpocFCJWrAWselKgGvHeS0V9aqCXHUEbdEjQ44 ErNWTafUecoXd3fhSrnYeSt4xcw75Y5R0o04cGYTSrXjiMnk4792xGpiZ62SxA2fnZAd 0FIzExMCXDksaN/p57I3Lqn531A2ajs+387Z4= 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=efp6sFiQWGhKGiEpT9DPizID7xKe3bNjf2I9V30y+Ys=; b=YGoFIlPc23BKHCEGw/eULG7pUNxOPcMqYAvM0/mL0ROb57nfE9OH14HLknA2ZKFM2w H8IpxeePHtfyRnK1HnC+YMQsVWmIDgv/S96fKcvkkSCbiYkcfWBs6Zks34kUG2Me0PwB nedbY35XwKZVXF4Xhwp5fLjHn4SGfMF7ejaZ9CdCaK/XTCQmpZg2ZObrBw8ZDcYhC+E9 5Bm9JWevEKwG6l84Me1brc+vemSK1kG+RLlFGkRGP8u6Ir8zRskY4iTLqUt/eonWTQqF s44mBhcUgWHi6zE0z9+A8G2b2L8QAzuyzZ6cxHjLUkbv6TIWzbTEWDIK6rLwTwHo+lzX XOBg== X-Gm-Message-State: AGRZ1gJEUjmqUmZCHWP3QRMTpPaSqPycoCBAXE/k7KXbSzb8W8RyoEQZ NUeJcffoaSFo2uS8cSGfpVOQ8Q== X-Google-Smtp-Source: AJdET5fucCB5re78rfZVblg7SE55jUyPO8u1lB6Zs29yTuXi0Svqs/9BYlVGAZ5aL7lBnP6KYNcuFg== X-Received: by 2002:a17:902:b106:: with SMTP id q6-v6mr3811436plr.238.1540565131346; Fri, 26 Oct 2018 07:45:31 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:30 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 14/25] drm/sun4i: sun6i_mipi_dsi: Increase hfp packet overhead Date: Fri, 26 Oct 2018 20:13:33 +0530 Message-Id: <20181026144344.27778-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074542_610613_740D414F X-CRM114-Status: GOOD ( 17.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Increase the hfp packet overhead with another 10 bytes, the extra 10 bytes(which is hblk packet overhead) is adding for hfp packet overhead since hfp depends on hblk. This is truely as per BSP code from BPI-M64-bsp. The real computation from BSP is (in 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, increase the DSI hfp packet overhead by hblk packet overhead. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki Tested-by: Jagan Teki --- Changes for v3: - new patch Changes for v2: - none drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 6584b51736a9..20e330186b7f 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -461,7 +461,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, { struct mipi_dsi_device *device = dsi->device; unsigned int Bpp = mipi_dsi_pixel_format_to_bpp(device->format) / 8; - u16 hbp, hfp, hsa, hblk_max, hblk, vblk; + u16 hbp, hfp_pkt_overhead, hfp, hsa, hblk_max, hblk, vblk; size_t bytes; u8 *buffer; @@ -484,14 +484,6 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, hbp = max((unsigned int)HBP_PACKET_OVERHEAD, (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD); - /* - * The frontporch is set using a blanking packet (4 bytes + - * payload + 2 bytes). Its minimal size is therefore 6 bytes - */ -#define HFP_PACKET_OVERHEAD 6 - hfp = max((unsigned int)HFP_PACKET_OVERHEAD, - (mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD); - /* * hblk seems to be the line + porches length. * The blank is set using a blanking packet (4 bytes + 4 bytes + @@ -502,6 +494,18 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, hblk_max -= HBLK_PACKET_OVERHEAD; hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, hblk_max); + /* + * The frontporch is set using a blanking packet (4 bytes + + * payload + 2 bytes). Its minimal size is therefore 6 bytes + * + * According to BSP code, extra 10 bytes(which is hblk packet overhead) + * is adding for hfp packet overhead since hfp depends on hblk. + */ +#define HFP_PACKET_OVERHEAD 6 + hfp_pkt_overhead = (HFP_PACKET_OVERHEAD + HBLK_PACKET_OVERHEAD); + hfp = max((unsigned int)hfp_pkt_overhead, + (mode->hsync_start - mode->hdisplay) * Bpp - hfp_pkt_overhead); + /* * And I'm not entirely sure what vblk is about. The driver in * Allwinner BSP is using a rather convoluted calculation From patchwork Fri Oct 26 14:43:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657543 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 B3B315A4 for ; Fri, 26 Oct 2018 14:53:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F62E2C955 for ; Fri, 26 Oct 2018 14:53:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92F522C956; Fri, 26 Oct 2018 14:53:05 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 232F12C954 for ; Fri, 26 Oct 2018 14:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HRL5rE5R7ugvNQdsa4DKew2Ot05SxsAo9X1oqjR0NZU=; b=jgzfJrp32IqZio r9l8ieXpHlmRgX+N6TFPuounzg5LOKZb8Bn4gaoQI4u/scRO3Ut5b16loA6HxMSOlMyhdtFvWWuN7 KIFQIHvCeeliADlNtGCuu8HMVkswujWZL5HhuJerv2OGtaJynjkCocstO75zjaA9a2K7llomKaYOH bMV5VcarvT3kc2DzrSscWtYOF2FSw7VjYhm3sgsC6Ze4dLzT1najN85ex8y9apPdVzmFHKSLmhpjB 7M15et9TghuqkeGM6tWKmszzQ7rxp8cECGMcGIrKxhG+xsL44U1wO9U5OGl7ua8g8L1gwo5RJHucE v9Mp7DumHiStzhFtGhFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Tw-0006yl-8k; Fri, 26 Oct 2018 14:53:00 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3My-0002b3-2D for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:47:48 +0000 Received: by mail-pl1-x643.google.com with SMTP id bh10-v6so628332plb.4 for ; Fri, 26 Oct 2018 07:45:37 -0700 (PDT) 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=UenRKo6OwvlFVAyYotlbn7LHAAkj6pMaa7wSfZK+ZAg=; b=qCn+CrVtnXCEoxMdBkn7/Ql4nXBkUWxhrhSwVTUosuf/V+OH4kIQFcbpvN+Hv1aNF/ bNM0CftpaS6doZ9THR5unnaaaS4ehW65SrhzLsP8bZB/em+6iIvTQv3P4Q2+62KRAZCy 96qifaCVulYjBpIKrIpRlvSnaeMOsa3NXGGFY= 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=UenRKo6OwvlFVAyYotlbn7LHAAkj6pMaa7wSfZK+ZAg=; b=flM9QXitlyOUg3gfS2KDrOZSM8qcQXr1GMyh10w73g0wtA+Wv4pOivjAYqlOUhlxq5 pjd4irYJ+nsrRsNRWoiKiL+c0PaSpqbPTqm4GnDjKTalLF+mA/T6ChF12/IXOq5AUznj EiZcblIq7V7ImVHe1mcm5WE6j0rYRVcJaJzkpVzo6XpvuHBf8tMTJzqPfWckpHr5Np2v 6QzCl1uF0NME4Kb0FBJHPopjDS+Cd/579sFlF56e5LynCwfDNgnHwngK9dMpkzeDNrkw RhYv19TRUi6QUgWJ5vZb50kES/3mAL+dIqlszAV/5IR3KRGnfs0TyH8jR0MiGB4ZFBps HLuQ== X-Gm-Message-State: AGRZ1gIAgs6beZYhk6KmG9+awkmZuynHkQDgRu+p9a3M0CmfrMmFzY+9 9zT8tkWkuRnAYsaP7N2mZQZb7woEJok= X-Google-Smtp-Source: AJdET5fDAHkS/vHusTVMTAA1dHL/rHuu08w6nk79FMLY4a8CZbFU+ntkK0EOPt7KCuk2ibeUTT0tXg== X-Received: by 2002:a17:902:bb96:: with SMTP id m22-v6mr3748802pls.117.1540565136958; Fri, 26 Oct 2018 07:45:36 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:36 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 15/25] drm/sun4i: sun6i_mipi_dsi: Set proper vblk timing calculation Date: Fri, 26 Oct 2018 20:13:34 +0530 Message-Id: <20181026144344.27778-16-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_074548_221382_E77517ED X-CRM114-Status: GOOD ( 17.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 (in 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 Tested-by: Jagan Teki --- Changes for v3: - new patch Changes for v2: - none drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 20e330186b7f..42bd7506abaf 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -511,8 +511,19 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, * 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... + * + * The vertical blank is set using a blanking packet (4 bytes + + * payload + 2 bytes). Its minimal size is therefore 6 bytes */ - vblk = 0; +#define VBLK_PACKET_OVERHEAD 6 + if (device->lanes == 4) { + int tmp; + + tmp = (mode->htotal * Bpp) * mode->vtotal - (hblk + VBLK_PACKET_OVERHEAD); + vblk =(device->lanes - tmp % device->lanes); + } else { + vblk = 0; + } /* 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 Fri Oct 26 14:43:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657619 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 D1F9E5A4 for ; Fri, 26 Oct 2018 15:49:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEF3C2C989 for ; Fri, 26 Oct 2018 15:49:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2DF72C990; Fri, 26 Oct 2018 15:49:16 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 290AB2C989 for ; Fri, 26 Oct 2018 15:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kDeGGIQ87+5b2R9mH2dMm2zVfQTvh/uTPPkLscXOh+g=; b=pTrMV36dTh9KIJ QQV+1r/l6qlqOod+1Lh26i0eWarzTPsQfEXwlB7GDc1NuJUf7A7WJfnKhHB93sJ0+tQeuWuEXjKPN l43tOddZxEBNAGdjS8V19ez0kW1hKogvGph6qHE6n6B6/Xz5i0JcmEh4KS+vLgu4aP8Dxm6USzEEg R1Be5EuCsPCDlogSGPeMcf4SCnjypFmkRoCLKMtc/310Hi8+5MTJ9xCXRjSYGbtBa/pa1XtFHhQtF 4hr/bQ1Fav0hUwajdZkVQdO43bnBbut6WsiW2vrX8Ekvyr06cZqZvhpDJ6hto1KwN8vZtRKMzKRzc 2EvMEAHE/wbC0bcW00vQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG4MJ-0004if-99; Fri, 26 Oct 2018 15:49:11 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG4KQ-0003vT-La for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 15:47:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hFXSuNqrssYbWTTz3HCAz9AYQlGBmTmtTIlmYuYmHlg=; b=FfAQpwecDGA33KvpCbpLiKNpgU YctL0NR5eyr2aVvnLCUvYjNHAAgDkbeHPXBUQvRChEifL6l+oHzbERqVIrJgc2RW6zR/REw70Wj7j tapkDInnDDcOA5ulUY7xB9ZHnZIeCpYvDl3hIra3LhyyrCeBy5JOOArPLiP+aJI8XM0fNFlTAxpPb RXDmjEm9UnX9e6XHNmfxwFP58PZIEw1TdFgb7EpkosbP8/vdeeSGzdwHOFK87fAC4HnQzVpJe6j72 y7/eHLeMqTmFlFXnRJ2T+LIMvjmOA0XL1ZqDKhtCPEehMdeKNwES6DH4xduGYfKEASDJr8ZQjUfJ6 UyUP/jKw==; Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3N4-0002oq-QX for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:55 +0000 Received: by mail-pg1-x542.google.com with SMTP id f8-v6so645562pgq.5 for ; Fri, 26 Oct 2018 07:45:44 -0700 (PDT) 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=hFXSuNqrssYbWTTz3HCAz9AYQlGBmTmtTIlmYuYmHlg=; b=HRHXdaLJr2Aa2ePTF//BjBnnaaBcSB3te5TQbG7wiyI5IATlUrGSxvl60Wx3DdV34y woQuW34ue5NMJVWLSXFEOcQDjtO4ubgwevclD3cql3YCrDgF3c7BO3jvUmT9SLoXAye9 qrYY3ZZ4e6b68avKeliw6yWlzKElFu94zYy/c= 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=hFXSuNqrssYbWTTz3HCAz9AYQlGBmTmtTIlmYuYmHlg=; b=CcH8iNaumZ+xy139RO4qZz6LEgV5yIZaGzRGR841f8Gp2ENbmk++p2P3pcauy5pg0j fvcHPu+Pvr1+pTMTRJDdRz6mLe8QslE4I2CRqsvp41NatbZpf6j5XCp8TDVzFsQjmsY3 WOlihFE3tDzCvJhkQUa0m1fLlcNOEzEZX/7THjWUzUGxv14ET6VSWGCYX43Du9PWpClh dT+DtoiOXNpX+uqaKSybVIz7Op/eNV3m/h0/IDzKDLJEr7fxmzJcD3fY/T/tDhJC3PmU xFz4u71k86hRuZJqHikTdAhJaBdiB9cxrQ08UBlqThuscR+iaAIqMdI5E/YCjs7e9M0K UoqA== X-Gm-Message-State: AGRZ1gIdYOs+SD8Ftlj0SlusdV+VQNueSRHoHoVAUh1JlKYJXpalIrP9 MAiRXpBDBfT2rkuQjUEzV35txg== X-Google-Smtp-Source: AJdET5fpKXQ9TMHJ93fYydde3aZ5tiYcPMcXp1K5AadZV/Op5N1E1lv427KgTgLNdNnB7ESJQ0yxnw== X-Received: by 2002:a63:df03:: with SMTP id u3-v6mr3640604pgg.362.1540565142552; Fri, 26 Oct 2018 07:45:42 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:42 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 16/25] drm/sun4i: sun6i_mipi_dsi: Add support for VCC-DSI voltage regulator Date: Fri, 26 Oct 2018 20:13:35 +0530 Message-Id: <20181026144344.27778-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_104554_900862_DDF92C20 X-CRM114-Status: GOOD ( 20.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Tested-by: Jagan Teki --- Changes for v3: - new patch Changes for v2: - none 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 42bd7506abaf..bc57343592e0 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -949,6 +949,12 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, dsi->drv = drv; + ret = regulator_enable(dsi->regulator); + if (ret) { + dev_err(dev, "Failed to enable regulator\n"); + return ret; + } + drm_encoder_helper_add(&dsi->encoder, &sun6i_dsi_enc_helper_funcs); ret = drm_encoder_init(drm, @@ -980,6 +986,7 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, err_cleanup_connector: drm_encoder_cleanup(&dsi->encoder); + regulator_disable(dsi->regulator); return ret; } @@ -989,6 +996,7 @@ static void sun6i_dsi_unbind(struct device *dev, struct device *master, struct sun6i_dsi *dsi = dev_get_drvdata(dev); drm_panel_detach(dsi->panel); + regulator_disable(dsi->regulator); } static const struct component_ops sun6i_dsi_ops = { @@ -1022,6 +1030,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 regulator\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)) { 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 Fri Oct 26 14:43:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657579 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 1ABC014BD for ; Fri, 26 Oct 2018 15:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AD792C03B for ; Fri, 26 Oct 2018 15:18:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEBF02C03F; Fri, 26 Oct 2018 15:18:26 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9C2C42C03B for ; Fri, 26 Oct 2018 15:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j4ypDOVl6a55N75VDBqyJK7HgJRkJrCmVKKleVpq7TE=; b=VWIros1Fj4SRin Vbad1/+2gGk0go5Bi50W4qyTgfaHHxE+/RV9b14qfutNrtTjNYr2Pn/raUI+2ECUVeJHCWe6eJEF7 BzZ1j5+r5jt7XYWlvbp1tASgFrB00kCMEb0lkflbQpxai+Y68H5ZnvSHE7hspV5R3hE63C/5FxLy6 il7D7JgiE26j/8LPybQQJMbwDVE+Kja7gLygxznp4DyZ5atnBNRJDsQGEsOFnAZWm88ubpH4YJ5Sf dvL9RX4LkeBGrM9YFksy1324jx4F5jv5LlPiS3iECPYGrprcU9o+rgC3PNMymG2ybeTeYDozA1JhF WBKog66s14TYDlDrwuug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3sT-0000Zt-LL; Fri, 26 Oct 2018 15:18:21 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3bl-0001uc-Py for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 15:01:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oeSMNKpNfhPY+Ywe9odsVBbi7HxlUs5js+iUwbEI7fY=; b=LMTVwWDz9Z2aKBYibx6KwD9a9I OPG+wj4UxYc65vxRzf6RBPeIk4jehkB/CcRxadpXQIYPX7ZC3ZIuR+Z2U4UH7nw8RIUfhyvgE5SPa mmU95kkcGUBdWFQLA9V3IowLmjumUtIuWT2pG2Z5EFHkSntygUME0epDmskXqZUgeBtG+VQACmXUp D/80SX18H2lT/K0nQBBEhHGu6UP8LQ8L+cpzS56AepBHJ+Uwt3blhvx/iUy/HVYeL8VYMjAuaRxfo yBrgwvu1BSvNcAASXoXDt7bTeGkjTWzZqrKM1TkXvp+IJSvJWsJ+5OV+Ad+hNX93OMdBE9aYXAvdy uNI+6BWg==; Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3N9-0008LV-S6 for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:46:01 +0000 Received: by mail-pl1-x643.google.com with SMTP id bh10-v6so628635plb.4 for ; Fri, 26 Oct 2018 07:45:49 -0700 (PDT) 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=oeSMNKpNfhPY+Ywe9odsVBbi7HxlUs5js+iUwbEI7fY=; b=X6HHISz1Ob4/o1zChSdV8ygNvjFt/GbpwkT12/qLNrlRU2odUyoJjbDIza9uISvsop zLNrn3eQOt2NZsewltYEGV/FWBiIk2blpLaAqQsCWy0A+l9JAOCimrLvXRc7bzzoQDNj f1rhjI7deAaYEPIbrLjrljNStdOtyX3KuJyFQ= 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=oeSMNKpNfhPY+Ywe9odsVBbi7HxlUs5js+iUwbEI7fY=; b=dsA15RuVfXV5qivPbupy7ZHsptEySLWeMreF0w6ZSKMsXCBkOIySC957oSoklKzMsk U2i734Cmud0N2x1crVgBXNq5PVCEJqplDqL7hisy7sA+JjwA1hv1pWWnYRkyP2eH8Q4A MbackpG8G345gs0/PrfqFLeNUEWt6ulZkTpDtC66C6ikFp4EPfwTD7Zi62H3OZZyNvWS cIKNXQ/dXdVM1R93b8Oj5xCXWQ+GpkmqkckrZPZOL5BxusDSTlxwgXgEAWKPslcFSfXY K/OLivULi+s/Gf0NX4P7GDsYyO/CYICgEO+w3+rMaCBlm3rF+6nCSzZZyMQDqGgStWXe WWCA== X-Gm-Message-State: AGRZ1gJ7cy2/xrhzvQ+ozZH0A1L4iq+TaxTHH8aN9lYihBem4taPlVW+ ROtbMv9J7D0XmnvVNU5lh5axQQ== X-Google-Smtp-Source: AJdET5eCSw09pC+nyEzugpgTLUFFRA3oIYc1CZlO/7K3hhLsvt95Uo2gbj80mVh0MyOmVoCooM4DKw== X-Received: by 2002:a17:902:e00a:: with SMTP id ca10-v6mr3745128plb.166.1540565148172; Fri, 26 Oct 2018 07:45:48 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:47 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 17/25] dt-bindings: panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge Date: Fri, 26 Oct 2018 20:13:36 +0530 Message-Id: <20181026144344.27778-18-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_154559_898645_49CB4EA3 X-CRM114-Status: GOOD ( 19.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Bananapi S070WV20-CT16 ICN6211 is 800x480, 4-lane MIPI-DSI to RGB bridge panel, which is available on same PCB with 24-bit RGB interface. So, this patch adds DSI specific binding details on existing dt-bindings file. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring --- Changes for v3: - Use existing binding doc and update dsi details Changes for v2: - none .../display/panel/bananapi,s070wv20-ct16.txt | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16.txt b/Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16.txt index 35bc0c839f49..b7855dc7c66f 100644 --- a/Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16.txt +++ b/Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16.txt @@ -1,12 +1,39 @@ Banana Pi 7" (S070WV20-CT16) TFT LCD Panel +S070WV20-CT16 is 7" 800x480 panel connected through a 24-bit RGB interface. + +Depending on the variant, the PCB attached to the panel module either +supports DSI, or DSI + 24-bit RGB. DSI is converted to 24-bit RGB via +an onboard ICN6211 MIPI DSI - RGB bridge chip, then fed to the panel +itself + Required properties: -- compatible: should be "bananapi,s070wv20-ct16" +- compatible: + for 24-bit RGB interface, use "bananapi,s070wv20-ct16" + for ICN6211 MIPI-DSI to RGB bridge, use "bananapi,s070wv20-ct16-icn6211" + +Required properties for RGB: - power-supply: see ./panel-common.txt +Required properties for MIPI-DSI to RGB: +- reg: for DSI virtual channel used by that screen +- avdd-supply: analog regulator dc1 switch +- dvdd-supply: 3v3 digital regulator +- reset-gpios: a GPIO phandle for the reset pin + Optional properties: -- enable-gpios: see ./simple-panel.txt +- enable-gpios: see ./simple-panel.txt(not available in MIPI-DSI to RGB bridge) - backlight: see ./simple-panel.txt This binding is compatible with the simple-panel binding, which is specified in ./simple-panel.txt. + +Example: +panel@0 { + compatible = "bananapi,s070wv20-ct16-icn6211"; + reg = <0>; + avdd-supply = <®_dc1sw>; + dvdd-supply = <®_dldo1>; + reset-gpios = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ + backlight = <&backlight_dsi>; +}; From patchwork Fri Oct 26 14:43:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657573 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 D333814BD for ; Fri, 26 Oct 2018 15:17:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C40C12C9C7 for ; Fri, 26 Oct 2018 15:17:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B81C82C9DD; Fri, 26 Oct 2018 15:17: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 117DF2C9C7 for ; Fri, 26 Oct 2018 15:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QXL49xfsD9J4zXRuwRJqq9xTE+JxpONSVxS0vKE5pEE=; b=VT0wmuZ5UTpbWg AQ857Gi8inb/k0IHpx8cEqECH7iTywYa7DCfEhu5ae2BWFTbKaebuQ/x0szRgF+5DGCp8pSyaUfqP XBLndwkXWLMGxf+8nMorUVnzmdgfDHjZArZXp2bJTwMehM5JQsSc7XhzPuyo+Th0330Uj/pI7iSgQ Dt6JvNQx/r0bFbI5moD9j8fC/1NCAdTShBPgYVJqiOJ8laag4dMzg+TMdd5KnC9LsohjlXe9DWJ8B sKetOwi3FhizDQovCl011RZDsutW4uqVoXXhIkQ6jAQVNGIjPCpPhn1VXahlx32FYp+z6oW4Y5Zei ecVZ5JmQxSriY6RuL+vg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3rj-00006W-Aw; Fri, 26 Oct 2018 15:17:35 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3bj-00012G-PS for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 15:01:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/F8dMaCNMFKq/EyugOUVTAbhzlNwtGch4eQYIYheg1s=; b=BJx82D6dpbpvp4NAAnOSSjG0tJ /lu4dEVsIveBKY1qwcyg6bwDArv2A2/jl0cViGaVby6c1WLGn9/9uxP9SEud9g75ius/kpmc483QG 3FvjxD8G1KdXl882cS/NjgkBL5acPsznhBbJCBpVmtpyu+gLrmY0DceLfMFNkBpmUCH4mt/O+Q8zq qp4VW9CihHOvOR7arR5BwVJXxcoUTK+SMwq8SRU6z7H9/kFjE7JUlQeHWGtcohIvZX5KNITc+I6Iz G3I/iUoazs85p9deCK19ZfF4NA6LZSh9IuJoFiMo7R5bgV4Qu9oHD6GVsPEOIlrRsMSojnMOjYhqW vYxMLyyA==; Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3NB-0008Lq-Am for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:46:07 +0000 Received: by mail-pg1-x541.google.com with SMTP id w3-v6so632780pgs.11 for ; Fri, 26 Oct 2018 07:45:55 -0700 (PDT) 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=/F8dMaCNMFKq/EyugOUVTAbhzlNwtGch4eQYIYheg1s=; b=GEaAlk6yTT777d7BfS+tpJ8S4xYtoqT/e2pZ3pT7elj4zM+GBcPTHfh/XlQcRoJZXR CFaAQBR6CEt7UEauRNh6cBPiTw+zoqkDjQMoemJKZl1pY6kRKRR+yK7TCz1YhdBefAVm oLPJEwgHGuZdGvOu15BsV7oHkVfQPQJGvaouE= 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=/F8dMaCNMFKq/EyugOUVTAbhzlNwtGch4eQYIYheg1s=; b=tYZbaze1K38nA0Of58TXuxfMIlQOM2mlRnZ3d65iC3vTXUbCgwQd3O68pyDNVyArD/ 69WU+lvhdFj6anMAbF/yDWEl3Xh4o2ZgDEPlbEfOBQYTIEQAqcZvdqC73yFcplwN3fLs A8SpupnCCJcWR0SiZicH0dtm03qRddisPaQXqlmv65pZ4rFlj8BqPADI//9yO3GXLZaP RmYqAIp2PLY/lpTeTkUKxi4EbN8gDHh4H4NF7qGrrkfKxAlUh4j6L9p12a2ZI3yXicbL 9luhxFSTtRsoMrFCZ8lEsifip08UQWD9kfxdcQgyeCTJJJg96ftGlrlYgnjVlrRNLg88 P5EA== X-Gm-Message-State: AGRZ1gLp8OTGLVqCimVqHFUxTMD0UqQmmht4SbzKF5NKLRO6EGBVY8Kc 4KehgUXXq96rp3Buutj3+tz3Gg== X-Google-Smtp-Source: AJdET5ei6CkytoTjWDhaa0kJ7NVhvlCoiRGN5rAKGIYt7tTGlMkh+wvUafYpFyHwDFbvqOn404p0cw== X-Received: by 2002:a62:670f:: with SMTP id b15-v6mr3964805pfc.243.1540565154087; Fri, 26 Oct 2018 07:45:54 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:53 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 18/25] drm/panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge Date: Fri, 26 Oct 2018 20:13:37 +0530 Message-Id: <20181026144344.27778-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_154601_517603_30C7E366 X-CRM114-Status: GOOD ( 30.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Bananapi S070WV20-CT16 ICN6211 is 800x480, 4-lane MIPI-DSI to RGB bridge panel which can be used to connect via DSI port on BPI-M64 board, so add a driver for it. The same panel PCB comes with parallel RBG which is supported via panel-simple driver with "bananapi,s070wv20-ct16" compatible. BSP dclock of 30MHz is not working with existing sunxi-ng and sun4i sun4i_dclk_recalc, so updated to 55MHz can result proper working nkm dividers. dclock, 30MHz => PLL_MIPI, 300MHz => set rate 440MHz with 1,2,1 nkm dclock, 55MHz => PLL_MIPI, 300MHz => set rate 330MHz with 5,2,9 nkm Signed-off-by: Jagan Teki Tested-by: Jagan Teki --- Changes for v3: - Fixed to add proper commit message - add tested credit Changes for v2: - none drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../panel/panel-bananapi-s070wv20-icn6211.c | 336 ++++++++++++++++++ 3 files changed, 346 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6020c30a33b3..20b88c275421 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -17,6 +17,15 @@ config DRM_PANEL_ARM_VERSATILE reference designs. The panel is detected using special registers in the Versatile family syscon registers. +config DRM_PANEL_BANANAPI_S070WV20_ICN6211 + tristate "Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge panel driver" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y if you want to enable support for panels based on the + Bananapi S070WV20-CT16 MIPI-DSI controller. + config DRM_PANEL_LVDS tristate "Generic LVDS panel driver" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 5ccaaa9d13af..04696bb85218 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o +obj-$(CONFIG_DRM_PANEL_BANANAPI_S070WV20_ICN6211) += panel-bananapi-s070wv20-icn6211.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o diff --git a/drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c b/drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c new file mode 100644 index 000000000000..643b215bec34 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-bananapi-s070wv20-icn6211.c @@ -0,0 +1,336 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2018 Amarula Solutions + * Author: Jagan Teki + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include