From patchwork Tue Oct 23 15:50: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: 10653297 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 0D74A13A9 for ; Tue, 23 Oct 2018 15:52:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF70E29E02 for ; Tue, 23 Oct 2018 15:52:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECEE329FFA; Tue, 23 Oct 2018 15: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 4B34929FA6 for ; Tue, 23 Oct 2018 15: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=jg1nGYDVYvY2XLPJffU8e6pswLBcxzx1/fOV9NydEks=; b=FhBX5rzQIaRNJd XCyjpWdKnWq8+oYcn8Y77ZRQC9kA/iT2AQil02iE7JU0ry5T8efeQAzEZmzECv7b2UYzh/t92nobf cv21ZJzUPRKChN8CdRns096sjiqUELpj2PdmmwhZm7OD5rCqOknHqZCJHwRLCee+ulgledsFrrExz Davn+4yCnUkfiS+nRwRBvx/quEBg+Qk+8IqZbTR1h3qknREwV5aB9Vo3nPIhKRz66CmQnjE/+HyF4 2fd9w9GXHoesLB85MUoUHpxdU2hjXaQfRk8Fo2FK5R6VAMJsAV0EMEuwdceS9g4nV8i6wANu7N2AL qPYFqln/B61abLSTV6fg==; 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 1gEyyJ-0004Yb-FR; Tue, 23 Oct 2018 15:51:55 +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 1gEyxa-0004Cc-Hm for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:51:17 +0000 Received: by mail-pf1-x442.google.com with SMTP id a19-v6so881762pfo.8 for ; Tue, 23 Oct 2018 08:51:00 -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=owvG08mCzufA5uZoCz7gh3bK+359aJ5DTWVXJJSc3f4=; b=DjwUqxwBLZjf1a9fJIsBpliZNeiSad140/whrcBdMwSWD0TLvehl1lUwqUZWQmfaIj bOnGOjNHS6OTS/errIyNtakMrB9QCii8jiYuMPHN2Kj5I2xntdalFmAAinuE4RPWMgfh hWsIfuj/rAL8rCS4nH5Y0ULrq9eAd3MhbhwVk= 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=owvG08mCzufA5uZoCz7gh3bK+359aJ5DTWVXJJSc3f4=; b=FE7pzbMC3DDJnoxGhm/KBos3r6DDQUSw9vamlkCR93Tbqwpkx2V0lkv6tbE/+h4OYr SFKTQx3kM2tD0AomyfNUZRWPL0XyAoINv8wfLAxdMML2fsrapPX9OTHPSAxcFUD8hVke fVXLIimRe59LKHICygBo/h9skp1hakqpUi+DDzfkbzrgq1k3UiAbE9LR5cK6UtX6mnSP sNmEZl7O55KIRT0AFSywxnWYX/9JKuYZ8t5GNhumzXqt9l5rlazrXF2oX+rh0bfGABJz LayyMwp8Pa9Gk38UyK4bH2nwsC0tS/smYDu6x/GxYFvmn4o5LWGI6u8nKRsFElVK1Rac n0gA== X-Gm-Message-State: ABuFfoj4U1ZCat9ENh3eSD0ECHhbkNEF76gTbISbQzJYaOkkzK+LlYgh mvGYkZ4MVWe3M8vPXd4ZPN8zKA== X-Google-Smtp-Source: ACcGV62QGCXofUr5IKML2JRpFmSxWakkBBbKBkBbOO/UHABwp7wG50CN3RF5pfY1tE+7RRnht2CyiA== X-Received: by 2002:a62:b209:: with SMTP id x9-v6mr51462381pfe.148.1540309859945; Tue, 23 Oct 2018 08:50:59 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.50.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:50:59 -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 v2 01/15] clk: sunxi-ng: a64: Fix gate bit of DSI DPHY Date: Tue, 23 Oct 2018 21:20:21 +0530 Message-Id: <20181023155035.9101-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085110_621555_25627D90 X-CRM114-Status: GOOD ( 14.83 ) 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 --- 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 Tue Oct 23 15:50: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: 10653309 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 8CC5013A9 for ; Tue, 23 Oct 2018 15:52:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79DDE29C1C for ; Tue, 23 Oct 2018 15:52:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E36429C64; Tue, 23 Oct 2018 15:52:45 +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 0A01629C1C for ; Tue, 23 Oct 2018 15:52:45 +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=qBL1XkFmGLRRwW43YrJMaVufqK/aA/qwNEOHZzbqiXA=; b=d9BRbpEW9jYDKb BA1RLqFo3noTbasR0WJ7R6IZmgXnMCNk1XlkWGasRMi9/TKlT9CfiWMsJwshJTlZSJ+XCUGP1hVvD gRcTsr8nGtKACSIB0aZnJWoTJjaKW0uBa1D8TfVN+9G25ZBWgAcAWzJvuZD0ILKqCDBKGWzHyYmQM InOpZc1GcmprUQ0CcdTPp/nfC+eiWiSif0KacX7x5RIUn8+Nxiq0rwfp2HunQcdIuBjZTYzXjPRjp Waq9ddDc+an3O8TNqxdzVY7YaJrjx8D3S9yDGxLcsSMY55lCRK2bBedkr+hgrBTzHI1sLv4gLWR3h hZXez0E/YurXMeWXxs+A==; 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 1gEyz1-0004tH-Eu; Tue, 23 Oct 2018 15:52:39 +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 1gEyxi-0004Do-51 for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:51:26 +0000 Received: by mail-pg1-x543.google.com with SMTP id r9-v6so854402pgv.6 for ; Tue, 23 Oct 2018 08:51:08 -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=1dyYdq2fGSrjONwrfY1SgFShhS+wEyBSRnppCGelZow=; b=FJGkYYgEP/eg/Wr9wbD7Fpq7rUFEazM/71HFrAqr/wVVs2hBXeyKynWEANE0N8bpBb jESZbeS8b406nfCpXeKdN6n0gjqx9WOvR7+fTrFJSTmV3w7TQ/LUXfVKnVpcwF+/PJZq Kfrr+u3rxntZwCx3QkK9EfmSyxpK1ORX3hTGU= 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=1dyYdq2fGSrjONwrfY1SgFShhS+wEyBSRnppCGelZow=; b=ZNUQJtSDO1i4MLb7oFu6CM1hg4Nlq3nNCG6nVpT/GIugK1y1NV1aXeuW2JdZ+C7Kn5 DfcEXiqrX3/o7+lVfpP8PSYuskRkaAKnSuXfGuzothQZH5kk/dt1r+VN7rF4UXsmi8h7 kjLLN8a/Qp141z9FW1872Sl0ppo+HFcOkYAqV8lf/nzMZHbr+gNzSOR199reoUrdDw4f 7AwaqM9smqc2E77pAQL01xmZtERmAdrTKRqBgB9cHneMSp8Hx39vz/giAqB5+JBbxorq OdyOEPszqGBAbI950qu55B2gjphys13AI1+pyfpu5DgMgxQDrPFHKjZW71qeKaliOaAz NU0A== X-Gm-Message-State: ABuFfogDljR3W9WqlNawzaKLhRno8+6kQjHr3/+gVHB8zB8oggqZs48b dB8gO52YPPijUMidUFGH/l20MQ== X-Google-Smtp-Source: ACcGV620rT4+klZBrl+72/MNbWP4Se0rx+vcw5DlyWGAQuwiKF6qJhGwL+yyA7oArbyCYbID4TVn7A== X-Received: by 2002:a63:1e5c:: with SMTP id p28-v6mr47910535pgm.376.1540309867407; Tue, 23 Oct 2018 08:51:07 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:06 -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 v2 02/15] clk: sunxi-ng: Add check for minimal rate to NKM PLLs Date: Tue, 23 Oct 2018 21:20:22 +0530 Message-Id: <20181023155035.9101-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085118_220520_09A3D29D X-CRM114-Status: GOOD ( 15.27 ) 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 --- Changes for v2: - new patch 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 Tue Oct 23 15:50: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: 10653311 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 02C5313B5 for ; Tue, 23 Oct 2018 15:53:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0665287F3 for ; Tue, 23 Oct 2018 15:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D41492890C; Tue, 23 Oct 2018 15:53:39 +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 64C22287F3 for ; Tue, 23 Oct 2018 15:53:27 +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=JpmF2pc3EBX/VUkZEzRe4/NZaTVIL9CcvYOFE3t4uJE=; b=i+Fk5WWYZMEgT6 3SryWNZOlhfgQzQmA/OZUgTY8ns+59DvAS2jewEa3VKEEVjl3YqkaRrDASLShkzECHKjtImzYlYUX HCeyvzbMr4QCkXKIpl1gZNftNCgaTaHBTnTGAsXsivma/+kXa4YwIH1ZAA08vPncyZtbhkWDx73/y hgODhYVkAd4kNQlzPCxYBZ+dSy1zfVwv7b/ohtywCjKmHcoSdCUkprm+rA1K6Vqa7I+FzcT6cz6Xq tv3N9zREecULf3grkK9+EkBGZUlxIxsplUy+IR3657x4JaCs4p4RVPd0G0ItgYF6kQNzRsWpQ7WO5 mSvKvj62kt8gyjnCDD5A==; 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 1gEyzi-0005Fd-Ow; Tue, 23 Oct 2018 15:53:22 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEyxp-0004Gr-M1 for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:51:37 +0000 Received: by mail-pf1-x443.google.com with SMTP id g21-v6so883051pfi.7 for ; Tue, 23 Oct 2018 08:51: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=o90/LNGE9upjKhzjm4op/FMEilKM/vCgfq8hDXmKf64=; b=Imiflp8pAB0VUbU3b//nP/qfOOs9pPcI2UxiPmJMGI1ZPfR+nxptAquSUYIsT5doA5 4S2HXsqpScsl1Nq3AbDgfUvQz63mZoRIVxzfYb6qUzBINDm3vF8tETPxifYLyoGPGgqT abK0Zl2QvfHgYu7TeNXCXPBliH4IGtcEV+7t0= 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=o90/LNGE9upjKhzjm4op/FMEilKM/vCgfq8hDXmKf64=; b=VqvOUnvveVuLpSTYgiQtJjZ6tdnSvrxx+f1/5hQZuU5FKzvY+AD7gKkgVTuWGqkr6P 8PpCbh7shSvndLGTMXkKVjby/zFxEV0QytxVFjjk/+45OyvlOzTEOMXCg1rEQcoemGCz JwzLIbfOJznXnPQdf/c75Imxkvj1WxYyvf87ryBFeDHLR9zpchSAQBHWnseDiTIRoMaw 80RU84z5CTZ6EkE2Gcikx/1DA7DU5d5YhoIeADr/iqsquro0uRsICrvtQ7fDE8eZXZhg xiDGpWxs9ztCBp1uoxe6fhrGMNEbIaIJq5ggdl/rpd2NmfCrktvZnULT/mstsjeejIGw wXiA== X-Gm-Message-State: ABuFfoilI/GkWiWhlvYioc85D/J5GTcUNyAEhQZLFtcO4FBE1Jbuu4BR KjKdLgpr/7kN0z06rQ8FeBlbbA== X-Google-Smtp-Source: ACcGV618MFfAxH9ZOLOgjXtx3sU4kllTNV131HDzCFD6/jCITjF+8GvPpW//NyAt/wn5FCe4GTtMBw== X-Received: by 2002:a62:d085:: with SMTP id p127-v6mr24323446pfg.202.1540309874761; Tue, 23 Oct 2018 08:51:14 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:14 -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 v2 03/15] clk: sunxi-ng: Add check for maximum rate to NKM PLLs Date: Tue, 23 Oct 2018 21:20:23 +0530 Message-Id: <20181023155035.9101-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085125_801178_27DCC922 X-CRM114-Status: GOOD ( 15.48 ) 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 --- Changes for v2: - new patch 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 Tue Oct 23 15:50: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: 10653313 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 71D5B13A9 for ; Tue, 23 Oct 2018 15:54:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E58129D1B for ; Tue, 23 Oct 2018 15:54:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50DAF29D49; Tue, 23 Oct 2018 15:54: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=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 B76BB29D1B for ; Tue, 23 Oct 2018 15:54: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=0zlLmKMwAWTwmxKdsjatnLfGlgWDFsmBgPIMSBTYiIk=; b=BtLEEq2/x9Bpkf bfCQHkPAbxiodFqQvBhTN0hxGu/FicDzvsdwxzOVpMJegeID9w2Q1kvIK0uJDOblI03cI2RLZmGwC LNERYO+fp7fp1u+QcleMGqNTFMDy9xrq9a0UrzKgvszlwS+w0T9u0rqrpu8solgPRgoe2JjZgQbqC 2utJQedEzd8bRewT9JllXNRda2aXmSmxOTjmd/0gpjsAAfUYlH8BVAWcVCDI6qWzM091/mCZvc7xk P8XwX0lS+F5gPaYfdG12UagNN37hzfVGipoRxbIUxUpnZH2p/0FalSJRszUmvqunZZL9Zsq68GmK7 i6FHa/F8n21nuUNZ7nMA==; 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 1gEz0M-0005YQ-46; Tue, 23 Oct 2018 15:54:02 +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 1gEyxw-0004KS-FI for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:51:49 +0000 Received: by mail-pg1-x543.google.com with SMTP id 23-v6so850531pgc.8 for ; Tue, 23 Oct 2018 08:51: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=6O+bKIpaRU1xNmIxDVHfAdJTMH9a5FqvJg2+MWooA9w=; b=PGrYiEMPaGMKtNxEjkt3eWFCpt9pgqXPUuPauYpZh7dt9ptv4An2Dyn3pfOeIVOHiM 39RFla1Ht7gF6ePGwK2AgK7IuCsbILwcg2MmMgaGcbANPUsRV1aN20hA3tK3r/NWWGnQ BxyH/9S5/Irk7GyZBsLHuz9TNzQSwwFPNyRaM= 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=6O+bKIpaRU1xNmIxDVHfAdJTMH9a5FqvJg2+MWooA9w=; b=S/jlWR/0n71cP8JLGiYNJDaWK7hBxY85rzOZvBkqMcTTM84Z0ISbC9ASfXXGOKaXRl NesW3FZI9MNaZxhh/VBtJlw0AQ9xOtM2AvIOTDCkmO4Uupza2Rrp9nefZqANoThKxwEw 5cL+sMVTR3wMsVKO1HJvjt3VDaHVUXTxhfrDacFvuNnIWq495waHSaxL/tO1b/80ZwSl xNVr5oBL7VO77+m8thbMa7Vdt7nyehOVvpWGANQvYZwaOtNypV2RlhyUuvr/euXkCMKW CYiLnm6DThi2yZw2MiE0jeDi6oYDtYsPuqnxUZeDuFEbCWwIVZskzvx1KDrCIqhuJZUj pVyw== X-Gm-Message-State: ABuFfogTLmmVgdIULYVsp1Q1YOHPoiqwTiPVJoceYafxRv77w942cXbo o9dottu3hmMZdu8fAFH23inGGQ== X-Google-Smtp-Source: ACcGV60D3BFv/o3UPI5UV3Eqhg64DxoH79hVRJx0QmY7lphUQUP8NxnhbPtEdxVR+gb9U/7lmEWBew== X-Received: by 2002:a63:1c1b:: with SMTP id c27-v6mr47761734pgc.351.1540309881639; Tue, 23 Oct 2018 08:51:21 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:21 -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 v2 04/15] drm/sun4i: sun6i_mipi_dsi: Add Allwinner A64 MIPI DSI support Date: Tue, 23 Oct 2018 21:20:24 +0530 Message-Id: <20181023155035.9101-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085132_584920_4ACA2CDD X-CRM114-Status: GOOD ( 19.61 ) 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 --- 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 Tue Oct 23 15:50: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: 10653339 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 D175113A9 for ; Tue, 23 Oct 2018 16:01:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFC6329EB0 for ; Tue, 23 Oct 2018 16:01:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B367229E30; Tue, 23 Oct 2018 16:01:22 +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 3791029EB0 for ; Tue, 23 Oct 2018 16:01: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=E1jEfe5hIoysUIFb615wFvX+S0teZXZPA4M7n3nCOtU=; b=fKJluAyV3jWqoO Cv40cEuZOI8TD/ge6dA6d1iz9xevXjahG2pa+iD5r1SDYGV/Z2oOGO4jH6JW+JADxpavkM5klJLph oNz+UlKAGgVYPXmXHpfwrS9A8lOgP8rpYB2PdKUHNUFDMaqz9JpJ40olL1JQnuwXwF5QcKf5RaTCd Thq6WVuMK/+TzwQH3Kzb5o5QJkneZc5rIedBqd9DFTanoLIKsZI/oP6sigAdAxPqztXbDYNWt9gzG HM2Wyim8sA0Z39OBMrawyQ0glqZ64GPnUs3gahEdAQcMUO5Rlxli5XA2+XEej3cOzZBeDrDoENxyc 6fJtCSsnym8CrflliXYQ==; 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 1gEz7O-0001nc-Up; Tue, 23 Oct 2018 16:01:18 +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 1gEyy2-0004Na-Ev for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:52:10 +0000 Received: by mail-pf1-x441.google.com with SMTP id l81-v6so894342pfg.3 for ; Tue, 23 Oct 2018 08:51:28 -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=UFr9vzKrF456DG+Pg5hEEmJgU+xNz0cRAoIrygcGoQk=; b=NbsYaNbz6wlrq1ZZXHHrvLy1RDVKKQusiSWTFBfpAeKMWXAAStMRMlG8unpfxgjx5T JI3O1SuExtYKHej8phzFWlK8YO5HX3+j+sAIw2vBzOOA76SnpaQAvIH8CXnJp7lITSIO EaVWf3PEPyJCFTISg1zqXfdrANM9Svka5uleE= 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=UFr9vzKrF456DG+Pg5hEEmJgU+xNz0cRAoIrygcGoQk=; b=hDxCNQxRbLpbgnWDO4BnURQd693GvtOyyJARwLIHPGev9Otgfodl2YhC1GLIx/62jS ka0/TbYvGdN9BoSFAB9Djkda93mhuI/dQIRHnFACuvZRywlVkj78If7PwYQx1qCIha6j wkCKmwh9fJSV7Qd2rqiyPQrKgVxRVaxGk29uPvSn350Qv2sbnV+O5Axg0xZMerotAR9l Z0bDwF4YYCOFUdq9nVP27nlpfgQovCE03THhFVqpOI7DwPtz199PVDUOe6eo8w3ZRfDj ymRxHiRRjnYzRcliQ22eHczToYjWuiInbjfwQceqDTF0PN4bFlApoFgZKpnsue4dRwGG GgKA== X-Gm-Message-State: ABuFfogtc4Ee5gIjRcvRGFlkP4isN1dO7sFr8PmDR1IKwsxBocVkc4xZ n2GagZSWrN4H9ejzbd/UODjxJA== X-Google-Smtp-Source: ACcGV63WPpysLsuJQMv48NXTPtyXtyRl40D16tjRufTy0O5Mr0zeZKzhRXg5yTJ0jAXUQ3vZ9XCgpQ== X-Received: by 2002:a63:4343:: with SMTP id q64-v6mr48790849pga.276.1540309887347; Tue, 23 Oct 2018 08:51:27 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:26 -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 v2 05/15] dt-bindings: sun6i-dsi: Add compatible for A64 MIPI DSI Date: Tue, 23 Oct 2018 21:20:25 +0530 Message-Id: <20181023155035.9101-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085138_621549_5F7DF437 X-CRM114-Status: GOOD ( 13.78 ) 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 --- 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 Tue Oct 23 15:50: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: 10653345 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 DCC1A14DE for ; Tue, 23 Oct 2018 16:02:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD18429F51 for ; Tue, 23 Oct 2018 16:02:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0AE829F20; Tue, 23 Oct 2018 16:02:08 +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 592C029F20 for ; Tue, 23 Oct 2018 16:02: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=nFylRo7wdAVkdgq9oqwW11LjXHOPxm4IlHnmxSYEfvs=; b=E5dF5XX7JRnYst NOpBAd9VHdp2sTSsMuYGb/CyfyXhciI4zKWNbNWkAyUgZKWz91oGyQafsHze7INLPX9mE/eJnkEPk dxHcyr2zse4kCT34eM5W8Vf29nzTNqQm+9Zep0hBbRDGx6hMsVXGfj5i6u8Gj0ClRi50EytXPviVl 1hoDJjpRdMdXPqvAx1n/01XkiMANFdOpxgbIXa/A4xRISw3/KhJKJBzcLx6II1ZrKQ8gLCS9I9nEu rJ/nPcX2P2JTzol4ni4y11Yr9WH6bxcE2I1dlaj+SctdCSX6HMJevM5gcn0oY4JMlw86GKzz3C1jX RlGulu23SktpIMrlBXwQ==; 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 1gEz81-00026g-TM; Tue, 23 Oct 2018 16:01:57 +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 1gEyy7-0004Q5-VR for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:53:04 +0000 Received: by mail-pl1-x642.google.com with SMTP id p7-v6so835181plk.5 for ; Tue, 23 Oct 2018 08:51:33 -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=3eeg4cPMpf6ZO8A2CN8XTlIX+ceIdjQJrEvIG6Ts4Fw=; b=oRPQpqnBjUdrfV6xGscSNy217s+6s+q1t3/C6B54OBKvGWmOVMTvue/7ZRTw14c7lA 64yV15lGLRrnHk1qEsa8MBe/bX2aQRgjOMAhRQ6YAUQlsTG8d0Rh3upAk60TUz0zsFUy JmMHDzKKepsvrMuq4ggQOPcxHKNPgSuhdrbF0= 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=3eeg4cPMpf6ZO8A2CN8XTlIX+ceIdjQJrEvIG6Ts4Fw=; b=Bb9L1KwTSDNTxBVtiVMY2Hdx97hCM8Q0OyvXQaMm/TZVR/94ExPP/FZT11zMCfOryq 1tX7kL/+KuxeSRNvy94gi6gcbDb2U4yA15jrh97PNCRs9BltrJ9yS40NJ1EwAe+HvbN1 pEZpzE722dGmzwziN7T335VBroS6JlXDCP/8ZwzGBcYp5DJKPX8tftQVXAi13aEfZ7eL FPd1mqzh4ry/Hu79p9rGR8VrkWdIbiqCyG/hf1GbDcull+4nCOUZ7+mKvjfCOKAghRxk S/mdg6ZmwpLkgM3JKYSEJZ4QeQrq2/gEpQ0b1nyi5ENOKN8Trr/3d6xUlKys3VeRa3uK Oo4g== X-Gm-Message-State: AGRZ1gIj3uMhNlQSFAAJa47VkMAJZotn3eG/I2mfBHnmRnOArTLOve+g VXjsAOw0erPAzI980WYEX2g5KQ== X-Google-Smtp-Source: AJdET5ftv9r5/C4cgca0UT1ygc5rqgGsXmjPT9QBWKUbhGijsZbwSf027FciwTHWChSaUtVbZfzyOQ== X-Received: by 2002:a17:902:66e5:: with SMTP id e92-v6mr3353277plk.92.1540309892881; Tue, 23 Oct 2018 08:51:32 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:32 -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 v2 06/15] drm/sun4i: sun6i_mipi_dsi: Add DSI Generic short write 2 param transfer Date: Tue, 23 Oct 2018 21:20:26 +0530 Message-Id: <20181023155035.9101-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085144_039464_180D2631 X-CRM114-Status: GOOD ( 13.38 ) 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 --- Changes for v2: - drop dev_err - add macro in alphabetical 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 Tue Oct 23 15:50: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: 10653377 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 0FF1B13B5 for ; Tue, 23 Oct 2018 16:16:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00CF729EAB for ; Tue, 23 Oct 2018 16:16:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8ACF29F38; Tue, 23 Oct 2018 16:16:22 +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 EDC9B29F71 for ; Tue, 23 Oct 2018 16:16:21 +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=12r+yRud1nNVAjVgPwF24Yee/oa8pzOxQZoCyx28i7o=; b=FFcWmZl02/eoij +ft7vOtmVZm7nyy+opGX3W4GeDwpcek3VPoUsXXOlerGdBUu9jqB9cAqxaI2sYo6lXDJcI8AZyhCc B3L9aQEMSm8LBaeXpEWfiqgvgCpzNGqBXsPVdiuhM0hIsNIMN4aN5ZTLWlvGwvZRDgt0iXyTY1HIu Ojb3/aUcco/l8V8f+BBDZ2D90MIn+EGzRw7Ob/PTqV3LwrgShylNE6gusJQK87rJwKpUBf0cze6eB 2YGoH2VBmkyO1s8hpAJG/HN7AQFv4/dm1tLNLRbRd2sRci1+KS4PKj0g32K9Bpa21XUO3Ok3FIp28 Bzf4QStX5IRBzn5aPI1g==; 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 1gEzLu-0000TN-Ff; Tue, 23 Oct 2018 16:16:18 +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 1gEyyE-0004TE-33 for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:53:39 +0000 Received: by mail-pf1-x442.google.com with SMTP id f26-v6so879148pfn.9 for ; Tue, 23 Oct 2018 08:51:39 -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=NlgASVRlNX+ALqEjtYF3sm1E5YI3hOJ6Lz3xqdNlUFw=; b=SKwRUoCuPWk11pAUkiNGBqeHeZLkKJh618KwzDJ01LmNIlq42ZYy9LxDrkddubq3oX TykXJjlDB1+v7EXF+wDHX195vHqLDEbE5MMOBEr6FhlJKoxW95DEqF1H8dms2/6rBR6+ F3r9ZLjTCJ/R7HwpG4SNwurOdH4RePqcSTYiQ= 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=NlgASVRlNX+ALqEjtYF3sm1E5YI3hOJ6Lz3xqdNlUFw=; b=OTq7a2uTF0axLTbRJA7xbu5XYt54kwfHZt9N5nc2nl0ONFXahL/+51MqW0eZZM+o3S JL3JPmmil+R7I2zZyhEgAsLEXA4lZzPWSJ7Y62Wt0iev/ZvFijQZ9ceMXomiwEvyt4TP pMdYcU4UhWnSIGGzAQXrihLkjm0l6BqhlG9KOa0tkxUXEv0MIFsEKOl/wxQkcoZbih3r M6+t8DdGWBN9b9tDbhuCLnRqFV4RwxZCjJXec3qpyR9NTdN5enjAvJDBUHJ+f9EOBnWR 3twbyfJHAZPbprEOLMtjyb1I6hEGhfVl5VQoIMnd1eVyJv5y91V5lwYt7sAFq/WYUVi8 3QSg== X-Gm-Message-State: AGRZ1gIHR0khG1jZB7h2Dfb8yDFm3OGrDGz+eUGq+rk7WNpuDYsHeErW DdqMkV31mTcyK1PrunuEUmI4dQ== X-Google-Smtp-Source: AJdET5czfKeMo4WdpKorjXN7oSgKMFLettza7vTigo3eYGZAoObGBmiWE8R1oWBnJQRj2vkFeHCspQ== X-Received: by 2002:a63:734e:: with SMTP id d14-v6mr9580018pgn.397.1540309898443; Tue, 23 Oct 2018 08:51:38 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:37 -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 v2 07/15] drm/sun4i: sun6i_mipi_dsi: Fix VBP size calculation Date: Tue, 23 Oct 2018 21:20:27 +0530 Message-Id: <20181023155035.9101-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085150_182740_9A6EC30A X-CRM114-Status: GOOD ( 15.09 ) 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 According to horizontal and vertical timings are defined per the diagram from include/drm/drm_modes.h Back porch = [hv]total - [hv]sync_end So, update SUN6I_DSI_BASIC_SIZE0_VBP calculation as mode->vtotal - mode->vsync_end Horizontal or Vertical back porch calculation in BSP code is simply following the Linux drm comment diagram from include/drm/drm_modes.h which is [hv]back porch = [hv]total - [hv]sync_end BSP code form BPI-M64-bsp is calculating as vertical back porch as in 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 --- Changes for v2: - Add detailed commit message 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 Tue Oct 23 15:50: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: 10653447 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 5EBB814BD for ; Tue, 23 Oct 2018 16:47:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CDCB2A111 for ; Tue, 23 Oct 2018 16:47:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 407B22A139; Tue, 23 Oct 2018 16:47:39 +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 CFE082A111 for ; Tue, 23 Oct 2018 16:47: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=aH7Ky6pv2wUj3SkPgiBr4VyrmW8M23h4+TZrl46Lh98=; b=gjU0Gavcnp8Hdw Ze3cGN7540d9NMFiNPfuZco6kn6JXKFyXuGEFXeScTRgTmO57DdS0iMfpdRhKwuIrROYSC6pkQZKX scEGAIAit2Wc32ll8yYB4qZOpYRmgMbHc8ZzNXuQOAzvjxkkYT0FqATxj/vUjghIZ0AqnaLdmBwAA kI2OuHBjplxOWJHX7zDoaLymk0IShCXfmh1LqCNdcgDRnF12hEYrb9wjD6rjsTCX6BDP4v6G3H0md ClEHEou2o0nmy4jmOHtWSs41s15b8gQcoBHbLfu6J4z2t4pq07fQ+uMGFEXUt8nSVQmIdBeNBZKWU dBdx56VbGHR9C/NMYLqA==; 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 1gEzq9-0005Nq-I5; Tue, 23 Oct 2018 16:47:33 +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 1gEzpZ-000579-EB for linux-arm-kernel@bombadil.infradead.org; Tue, 23 Oct 2018 16:46:57 +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=mgo287Yan4wJCzR1Tu9+/fvGRpj2dOPV0KdcK2/NbdY=; b=gl5VWK9/BldbMuVS6IQXYtwS87 XAkyETgAgaDDy459umxWOL7sKDtphenYRB0QFGYbELMk3s6eUTyueq5Vu3ZRGw4+xYz6vKsm5JlXe s5ZP9AI+eM7QabfHIpL+oCTqnMz2dPjSSH/7foxA3nEwMbRn9Woer3Nukxqjr1u0Suz72ygCuIPOQ wj71uc3oOXfWlL1zrxDH0O67NI1+wEr15OuVFfXK5XlQD0M3mphb37ZQyRDTn/9zPcCesM3ALEBev LDWeim77+2fPCoctGyjJulzhoCDD+gyVo2/06TnVJ2GocIFIVbSg6k9RL912xTuGyUU2UeR0EJ6c3 R1U9J1dA==; Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEyyM-0002sH-NA for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:51:59 +0000 Received: by mail-pg1-x544.google.com with SMTP id s3-v6so842173pga.12 for ; Tue, 23 Oct 2018 08:51:46 -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=mgo287Yan4wJCzR1Tu9+/fvGRpj2dOPV0KdcK2/NbdY=; b=ioly+0z7xD9HR2uoTZWvPZlsyWFjvRAbAMYpCBou5yJk/KkAcuLCjJu6n6f8PE3HD/ JR1cOvdXZIMLsv1o76e2HqcVGXsyQiSgVlbCI2XehtkLvWo4g5peg9439v+g05KDq4yw OiMTFaah+Hd9zOJe0tTc43KlCqPzXs4/XhXvA= 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=mgo287Yan4wJCzR1Tu9+/fvGRpj2dOPV0KdcK2/NbdY=; b=mhoXgQ0WS1z4pG1mBpE6lW7iZ6zCnzVtBTT1xcM0CC/b+AfFNd0QuUVyqOyZrT5Dd3 ErcGxGTf/+gVZvJ4LaXtctw+cRn8xYdjRG738Dkt0Wh6GZKMS7D3VSKYcogH+6eRFMzH JryJPYEk7RbgFvweiauTTb7XNUWgRI+9oM3Al2UEznW7glp/+grxAIrKnPp7bx/FNEy9 5qoZYoN8G6jJUunWmTP1m5W1o95NnvtUKTKLyIMH6UEGHavbSmH0Zn28j700OFm2N/hP x5RqtE0dDB/7DJwFy+qsMrsOH/jwvshSJuNjoCEAe4kMa5fiTvob9IiVBFKNMTsORaLy J3+A== X-Gm-Message-State: ABuFfojKz/O8OrANIN3R4vcRO4ts3kpjGh6dIMTd33YQCAJiSY7vtdfb 2bJkJxKDhP7CoGuF0WISeIxvTg== X-Google-Smtp-Source: ACcGV61EWJA4KzZg5ExM6xaHV5J0VPKvzVF0Z7lMPLRI9Bt/Uagm3c3METIhZxqn+WafjU3zV5u10w== X-Received: by 2002:a62:808c:: with SMTP id j134-v6mr49709353pfd.47.1540309904196; Tue, 23 Oct 2018 08:51:44 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:43 -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 v2 08/15] drm/sun4i: sun6i_mipi_dsi: Fix TCON DRQ set bits Date: Tue, 23 Oct 2018 21:20:28 +0530 Message-Id: <20181023155035.9101-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_115158_785263_8CCB992E X-CRM114-Status: GOOD ( 16.44 ) 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. According to BSP code form BPI-M64-bsp in linux-sunxi/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c TCON DRQ set bits are computed for non-burst mode as => 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 --- Changes for v2: - Add detailed commit message 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 Tue Oct 23 15:50: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: 10653379 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 A38C514BB for ; Tue, 23 Oct 2018 16:16:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91C6E299C2 for ; Tue, 23 Oct 2018 16:16:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 827C329EAB; Tue, 23 Oct 2018 16:16: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=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 1A80D299C2 for ; Tue, 23 Oct 2018 16:16: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=Y6sOehSbx55XFnbcNjbhiK0T72msy3Qf4eMtP0SAkBs=; b=qL+DlUTGCf+gXk Tqk1z6s/IjqAStNrWmQdF8dc/0wUHj/v2DdLHuZjrZqxgB8OIGn8bDlLPi0filnEoqUbDltOo0/jk 0W4bwx6Y42c80R+TLMC2riEyTP2dnvZ3mf/umV3EpI5DyNNg2lodm7he9Qayp4AxFTL2NnhJxSoKS 4NWnjnHIWslR/mCrG4pAsyagkU0XhJoGtEokd414CTCKy7GLR76wGfYIN5W7LES8f3AHi2uyNf1uQ DCMgoQ8hL2tSIN/3svpTA6qURWASHZETft38t8NU9Y5d6Hq+JBWhd969zuGp+NZpdx6d+1zYewbR3 Ntx/HBJE6RJSR1BDMBeA==; 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 1gEzLx-0000Tr-Mb; Tue, 23 Oct 2018 16:16:21 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gEyyO-0004Xu-NS for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:54:01 +0000 Received: by mail-pf1-x443.google.com with SMTP id c25-v6so888032pfe.6 for ; Tue, 23 Oct 2018 08:51:50 -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=h3lvXaaEY5R/F0dznPRLXAqH2n34ZCnPFDUOB+iRgwM=; b=iTnr6UYVsIoWa/9U1/cxKRVTlP61bw/A7blbPeW9txXE/4aYxmUTnhhHSllDM+ds6R qAlXmWuCEGixsNkVFuRzXoskq0UCmXwm6/W8bzrB4uACgc1h3rfCAo2kzVmUxEe2qI6A K9lULq0o7B++akpf8bVtO0sg50gwt3iGU1KmU= 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=h3lvXaaEY5R/F0dznPRLXAqH2n34ZCnPFDUOB+iRgwM=; b=dL0N3UM6Q9uviQ6/cgqZcZOArsg1oK5A4e6jXXYmmrFsglsAtI2dNZ+04IrDbImqL2 nT97/NW1cIVbUEri+j7QVU3PLBgxhZph6WAhXMHFsOZkF9yRdU2Heyf1TlypySwo01Rp feLyaDrPsW9SpIOX6zsgdB8Kc4TElv4nLRxxebq6qLnh2Orc7OgrgAhaFFIxsUARltTy y/+iErvoBD3IVQW/MJRAfdohxXM6HvuPu3jJAN+h+lvnaddY908HVa4K3+ZSnOgl+UnH i/gxErZY/eTpovgyucLwkPBCaa8ZgKIBYPPkvj/CNMPOXen1MIKte8Nbiit0zRAdrTUG UXvg== X-Gm-Message-State: ABuFfohTy03cYWMzo9CUO+YsJiferSIwNbWOaDf5zl+YkecG6WVP9CQQ 5KAMx/E4QScB1ADnNOMb02Cijg== X-Google-Smtp-Source: ACcGV613EAo6RhMG6M/4/ULzIQ/11ssY8rphLwn+chPHm9bfbBu+09eI6I2kCKaDSk/Rn4S4FZWoDg== X-Received: by 2002:a62:d085:: with SMTP id p127-v6mr24325213pfg.202.1540309909705; Tue, 23 Oct 2018 08:51:49 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:49 -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 v2 09/15] drm/sun4i: sun6i_mipi_dsi: Refactor vertical video start delay Date: Tue, 23 Oct 2018 21:20:29 +0530 Message-Id: <20181023155035.9101-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085200_830724_7113ED1B X-CRM114-Status: GOOD ( 15.85 ) 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 Accordingly to BPI-M64-bsp DE DSI code Video start delay can be computed by subtracting total vertical timing with front porch timing and with adding 1 delay line for TCON. Video start delay is computed in BPI-M64-bsp code as 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 --- Changes for v2: - Add detailed commit message 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 Tue Oct 23 15:50: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: 10653353 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 2305C14DE for ; Tue, 23 Oct 2018 16:03:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E7BE29C5C for ; Tue, 23 Oct 2018 16:03:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01DAD29D3B; Tue, 23 Oct 2018 16:03:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 912D229C5C for ; Tue, 23 Oct 2018 16:03:42 +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=7pF0ZoKrHkdb/uyDx7BxnFex+4YhaPpoeBxOzeTxDOI=; b=bD0BqLTb0hjlWL SizJ5hfAGnoVRUi634EYiOesHxrVqiJR41+mIxLs+DnDjIutJJtX9YowM25X5Ai7WEOY6YjvoOiDg DHgQCoujyYGrKNwrWZbGTZ7yiwkYCLv290K/TY9KKNs5lt2QSOpWViWx7LrTbUkvTqXVwQ85DXXvG AL6rDEFL3fhxDFE41tTAr2J6NJfM7Qifs+jdIanHFUWa/tTMlfIpnaVQ58bIpk2wAdxjO5jDzgdbP 1pB2oHatI4Uohk4MH3MbqriTEifLnERI5vpR5GmfISLStwPGnQSkBlMOgqJ9h1oe7Ig1niLnKRLvl yzH/oiV5bl4w/x9oyZ/g==; 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 1gEz9e-0002ps-67; Tue, 23 Oct 2018 16:03:38 +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 1gEyyU-0004af-DX for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:54:06 +0000 Received: by mail-pf1-x444.google.com with SMTP id u12-v6so871352pfn.12 for ; Tue, 23 Oct 2018 08:51:56 -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=NRiFnFQmO06c8gbDZJ9nZvUMTAdDKJG1daWAYZ4wH/4=; b=nDZYTJthbAS700AB0GYWsXHuRI/lQxkVQGqbVjw5wCthpdUJWsQd0pX9Mee9BytBXJ ERog5/JmmRuv07+siJz8L21I5wejxeyziltWB+uKKCS/w+1oZb6r7j/TONszUv5ViJ+w zKd/4nX+Z7RH7sYjWTuJsI1GQlnG//FS0MrqQ= 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=NRiFnFQmO06c8gbDZJ9nZvUMTAdDKJG1daWAYZ4wH/4=; b=SoaFnbT4roH6FYEcUPovFcElbC0vkZGqnGxlFmEd70S7bJzTq38DkcXo+THPIGulzI zQR0ygbTt5XZjZPpbzi04jzVaN6Zl46AevkJaU/duq29z7ciN31TOOz/BfZ5Ek4Bn273 mLUiwihsn2O7uWkIL9jxCYvLm7YBc5TxNg5zJG3pv5GUy++to9g8bLQICWfDf5YZvpTe C18OBgUZ+OKOPq1HGXsAFS3O6JL3cHbUZlZHvtpXOgRa9+Cm2+eqXDqB7WnwvRGGNU16 cYggkDBoe9vpjgaLA7K4h+NG//BbmFC5NRTqD4CkDUdlLMTF0UMiVr21qk27zMIpIssf vpPQ== X-Gm-Message-State: ABuFfojCwX8AHdx6xIVGplg4N4s4ZRhw56kt17fTrCuUjzRhOpovKde7 89QP6cGVNnnOWgNZzPY/yvulgA== X-Google-Smtp-Source: ACcGV60fxKUNm5uI3h7V/PkBURRubPQ/BisaA0zjnkdAXt0zMc9lDipf+Y0FsdIdN/RqqPlJFCkRQg== X-Received: by 2002:a63:1e5c:: with SMTP id p28-v6mr47912857pgm.376.1540309915327; Tue, 23 Oct 2018 08:51:55 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:54 -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 v2 10/15] dt-bindings: panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge Date: Tue, 23 Oct 2018 21:20:30 +0530 Message-Id: <20181023155035.9101-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_085206_480954_DD761C26 X-CRM114-Status: GOOD ( 15.37 ) 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, the same panel PCB comes with parallel RBG which is supported via panel-simple driver with "bananapi,s070wv20-ct16" compatible. But this binding is specific for MIPI DSI to RGB bridge panels, which usually accessed using MIPI DSI controller driver. for information: - "bananapi,s070wv20-ct16" compatible for parallel RGB panels - "bananapi,s070wv20-ct16-icn6211" compatible for MIPI-DSI to RGB bridge panels Signed-off-by: Jagan Teki --- Changes for v2: - Add detailed commit message - Update the bindings as MIPI-DSI to RGB bridge .../panel/bananapi,s070wv20-ct16-icn6211.txt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16-icn6211.txt diff --git a/Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16-icn6211.txt b/Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16-icn6211.txt new file mode 100644 index 000000000000..68a89b6feaee --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/bananapi,s070wv20-ct16-icn6211.txt @@ -0,0 +1,21 @@ +Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge + +Required properties: +- compatible: must be "bananapi,s070wv20-ct16-icn6211" +- reg: 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: +- backlight: phandle for the backlight control. + +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 Tue Oct 23 15:50: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: 10653365 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 5E57B14DE for ; Tue, 23 Oct 2018 16:09:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D2B029EAC for ; Tue, 23 Oct 2018 16:09:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4120C29EB4; Tue, 23 Oct 2018 16:09:02 +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 64F4929EAC for ; Tue, 23 Oct 2018 16:09: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=EGw/8BPbwY/k5ZMuF7VY18Z8f6OJQCzDa6s2myZUiNA=; b=L3+X7ufqcBWT1V T2/I0RskFx1V6wO5efH07IE8jKoFBrKX8hwo/czywLWyiARuFKhymej5UakHCB9jhliVv4Q1Kfy+B Ppnla3Zvml8hbhPaaSrM7VJq/L1tQYVN8u73qYl8ACYvt+xX21aa1wGchW8FVkr3ApBDPXc1pwrSg MZi7Xw5O5GiEl2NDAeuQLTTCTPp64ssDMCv++pjfgxl+/qOzEv9Mcd9VGRmzVbkq67tnskeWhbOJc Dc2Xc8bHRIUbiaestyLs2gpkOcQVcJrTl36S2Ra/ytlF0jzQnsJetsDJ5V0rRtc3hEX757wI9nBhA 5TWyfgcQyI3zpqE9mefw==; 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 1gEzEc-0005JO-E6; Tue, 23 Oct 2018 16:08:46 +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 1gEzE4-0004yG-Dy for linux-arm-kernel@bombadil.infradead.org; Tue, 23 Oct 2018 16:08:12 +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=Mxf9bLJ64wGfshFY8z9ZlFTV50JGRovm/Nkf235Myp8=; b=tMtze7pJ78Z4rWXkcCe6X8TwFN kriRwp/ZtC1C0E55Kuz65hswFGyfW9e122yWQ9CZFnrIQhVAzj5nQUBQGfb5CCpy55U9CPFV08FpX 5z9YkmkMSLYtBzbEznZiFVKB4nZGjSztRthCkuV0/0PqK5TDuvJTBhsCdE4oTYWwt53iEqkQbUkzc XOF6J9nhDssMnGAjEAjdsX9ExkiE6JOvcOZEdoEc/BHm88NJ48FaAP5CO9A+Qr1HvQ2uPgZOABWOE Kjr+Krn8WQsR+UfWzkKQDXtHXCRuuqszEpb/3bv8RekqBy381f0aH9T2x+4MyXjDbRhf+A5Xc/yJN 5cOs7Nsg==; 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 1gEyyb-00013U-Go for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2018 15:52:15 +0000 Received: by mail-pg1-x541.google.com with SMTP id 32-v6so865034pgu.2 for ; Tue, 23 Oct 2018 08:52:02 -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=Mxf9bLJ64wGfshFY8z9ZlFTV50JGRovm/Nkf235Myp8=; b=O7cpwft6JaLDKZ9XT4opBiZzGwX6J4CvP6FV37dQY3QmBXyRnjI8vwpVK1E/ksxMm/ EJRhM2RQCqAoorhAq0ZJkEkoqSGIEwee+/HNMasHsrgzPnp1dn+kA+wsUyRO3ljdHaC3 mTSd/CwZ8pC5QN7q2i4I8nfxxzGwlyHr7knt0= 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=Mxf9bLJ64wGfshFY8z9ZlFTV50JGRovm/Nkf235Myp8=; b=iClxxnZBaYpxlkEALNIBE+NCKCblEP1LGb08TvkyI3G0vhUeWw8oJaNxEN0adF/fqy 2UeemKoXEe+Pe8A9l5RyXAw1ym0FYHUzDT2FL5JA+7waGju285zZUuRzcZGinDNG0IN1 xiFv9nrBFJP5BlsoZ51XR84ENlMJYTmgrJl4wmeLhaWxbbJIu4rozyh9RH2q45dzAAcA KTEWXwEjFyjrrAjmB5r6nwdhCoV59K4kTcccgKb8M5hHb3pG6lvi4eyGywuN+jaJ2Fg5 H2zjZderH68KZW/7Pl76gCwEwakvuqCl1V6JlM8GZUqLBw+ZI/yu3oxbF6S/ZMkzq5Gp ijAg== X-Gm-Message-State: ABuFfoiel/GXzGjX/oxN+Eq/I3KPWe5oZEvPlbIVZ+ezlPqrjkkDf35S BiAONVx4B16G/khIhs75yncgQA== X-Google-Smtp-Source: ACcGV60EbjWDJpyU6LQyMR5ISQRSoRJZ/WtrmDjL84l80LBmoGRyuaOkjS44bC3uBfcFNeoUfLBZAQ== X-Received: by 2002:a63:ce56:: with SMTP id r22-v6mr46751275pgi.217.1540309921005; Tue, 23 Oct 2018 08:52:01 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:52:00 -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 v2 11/15] drm/panel: Add Bananapi S070WV20-CT16 ICN6211 MIPI-DSI to RGB bridge Date: Tue, 23 Oct 2018 21:20:31 +0530 Message-Id: <20181023155035.9101-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181023_165213_625399_722B5174 X-CRM114-Status: GOOD ( 32.40 ) 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. Panel clock frequency used by BSP is 30MHz but the same cannot be handle via A64 PLL_MIPI and which is not working. So use 55MHz so-that it can rounded to 33MHz while calculating nkm dividers. Signed-off-by: Jagan Teki --- Changes for v2: - Add detailed commit message - Update the compatible string for MIPI-DSI to RGB bridge - Use clock as 55MHz 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