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: 10654233 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 3AD9114BB for ; Wed, 24 Oct 2018 07:22:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24A5D2A658 for ; Wed, 24 Oct 2018 07:22:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 186882A66E; Wed, 24 Oct 2018 07:22:33 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CEDA12A658 for ; Wed, 24 Oct 2018 07:22:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB90F6E266; Wed, 24 Oct 2018 07:21:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 651246E1DF for ; Tue, 23 Oct 2018 15:51:00 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id g21-v6so882671pfi.7 for ; Tue, 23 Oct 2018 08:51:00 -0700 (PDT) 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=E3PsTE5IrVV29OPSTCRRNZwwcs5QfUNE55oVl00kChwTZV9hQm1+p370XIvPuW3iPa gZadlEDIFq81W4GwnpdSiZq92Qs0bJqEGUrQQ7oEEQ+QTKWGt5rm1TCPtOooSl2lSPnx 1NPM3cCdXUUeFKKIBTMmFPrm8Y2zP8tkObexV7q4YIrAzK80Z9kzverPba68EiiNQIsn yD7JBm8ir578UUQi6DWCWTf6+gvM3WSiYEvkwnB8f/YprB09VCdAU/ZkgWbvaGpp7+oc p/UOt4adW/mZKBNSyWarSfkeQNB81GbzvXYg2daoapNhakySWd9VimnZ6I5MPkM1FQlr papA== X-Gm-Message-State: ABuFfoj8/q8l98sc2wnTkEpoW2t+47Ghal+rR0Eo1K5XfglEY8ykR+lp LAivVl+4z4+tHJxRyKD2UkJWog== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654235 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 C396C14BB for ; Wed, 24 Oct 2018 07:22:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC55F2A658 for ; Wed, 24 Oct 2018 07:22:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FC112A66E; Wed, 24 Oct 2018 07:22: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C3F02A658 for ; Wed, 24 Oct 2018 07:22:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95C07893EC; Wed, 24 Oct 2018 07:21:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id D33DD6E1D6 for ; Tue, 23 Oct 2018 15:51:07 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id z2-v6so869495pgp.0 for ; Tue, 23 Oct 2018 08:51:07 -0700 (PDT) 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=E8/px3xD7eALJgaT59QfyV2HFmPeJQJmrljepTQgJJSr/rvxZE7rYzu3wD9xJ4blR7 McWPnkMf93jqvEI61XcTFz69b6ezglrB8f0bKWdejLAODYJRNQnWw5y7k0M1mfObT+Bq SLzHE5cTpwRMtasNJwVyoQvh2OHp/xxQzqnGAWkH/dED5+q9JheXxCEA4DD0kCWi7GzQ gFctIPAHuFsVX2OvqQCfp1RwNstCxXqS8LLz+cV754KUb/kmd8A7GDb377mDtZxU8/xR Ra+NnrQ/dAswI1Ww+YBrJr0SqP69yXQIEKt2pCRj3+yUu95AN6FIbtyzLk+Uzoxq5p5l jcmg== X-Gm-Message-State: ABuFfoi1uzu8GFd8YCRLhTGl1Ck5SY6QlaStlQvu/CVPUTk8K1NuXHBG rq5YWA6FxLj5ndfICWiw3BFzEw== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654271 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 C956614BB for ; Wed, 24 Oct 2018 07:24:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFF9E29B5B for ; Wed, 24 Oct 2018 07:24:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0D8A2A658; Wed, 24 Oct 2018 07:24: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C62329B5B for ; Wed, 24 Oct 2018 07:24:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C08166E290; Wed, 24 Oct 2018 07:21:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 318326E1DF for ; Tue, 23 Oct 2018 15:51:15 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id z2-v6so869656pgp.0 for ; Tue, 23 Oct 2018 08:51:15 -0700 (PDT) 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=Bw7pEO+6HEyMmsALLnzxKalniugoy6akjsdsqt1Jl60AQeoyJ9fQQyYVPzoCJLQPGg MNlHk6aEH9PNDeGADK1dEHHNqGQ78jxonXlNFWAoEkOMbO+Y9HsGFNr19WIhMsaSFTNN 231v0JSxOvH+A1eXzZq5A38LMxE3R0t4gWGj1gQiVLiO9MNnn1DFvtCsz4RD3a8w5KuB 5R7oR1UD49rTVh3jDszBozvAL5dI0LFZeguYrDeFkQLOznfhPfbOVtmXoW0khjt9atlK O6sYT9dWI02ZUTLIYwILN3SgGzqBuwVEDFTUK1sV1x2SDZd3L0ofKYjpF4b2EJQxjRlR 7ECA== X-Gm-Message-State: ABuFfoj6qs7kQaKACyYG0g3OHsAcb9ffB5t4LtSsvPl7h8WE3ePfAXkm VXc5wzjqhHuizPWUV3MFuP5rQA== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654221 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 5281A14BB for ; Wed, 24 Oct 2018 07:22:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C8D22A658 for ; Wed, 24 Oct 2018 07:22:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FED92A66E; Wed, 24 Oct 2018 07:22: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C04A22A658 for ; Wed, 24 Oct 2018 07:22:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1AC7E6E24B; Wed, 24 Oct 2018 07:21:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1AE5A6E1D6 for ; Tue, 23 Oct 2018 15:51:22 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id f26-v6so878737pfn.9 for ; Tue, 23 Oct 2018 08:51:22 -0700 (PDT) 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=q8h7bkftVfgxb08bf6laSC1QxMsfgchlnu5OZzB93DZWrVyjRnv98hZSVMLTVcaDGq 96bWsMsmviRBauxUzW4y5QYO4XODfZqiMo9/O8nLifcv1TplZSigi+MFoeQhYU6ZtWSL I0ClPf7VdB+f9gh1akFeQPg3xI8DarrY2kN+OXBJPAmvg9+xFZxRam0MLA+3AcvTko3E NCLSdyqY6RBgJ9vPbCENUS/Fsz384mmaWFYk7wzXFRrIoqMVo3+GnjHaY7eVjkGCdsrN 1kHtttA5eQBznxhTDeFPsxc2BaAtuGZlhlx/XSK/0+FwYDR1O/6/qn666+u7bqWEVhBD Torw== X-Gm-Message-State: ABuFfojTfaZNL1LaxiKC0vb/RhILLh6XfFmbYc5hXoUV0eYURH0OuutQ FNFgE1OZ5YpjF6JuS6p/uMhPGg== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654251 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 AD68314BB for ; Wed, 24 Oct 2018 07:23:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9623A29F84 for ; Wed, 24 Oct 2018 07:23:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89FD82A08F; Wed, 24 Oct 2018 07:23: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4A93129F84 for ; Wed, 24 Oct 2018 07:23:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 645596E275; Wed, 24 Oct 2018 07:21:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF91F6E1DA for ; Tue, 23 Oct 2018 15:51:27 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id u12-v6so870689pfn.12 for ; Tue, 23 Oct 2018 08:51:27 -0700 (PDT) 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=uRTn3nM49/GzW7FOI0L03uISeKVsTiD6j3mXQIzk76LVVT9zZ0PgR0CLrND2rppVQk U1C5W1azkWkzHE5TNnDKuzKzHAH91iB8iYwf3P0lIkjIqQRXMYH6xrzf4GXcfXmty780 4ol0Mch0rl45gqobdfYuRVjMGf2eGzUfE6xzsbyd/VaGm3zplcCOE/nB4wLEhieb6C4U 89UYRNoJsoWd80yqO3wfCv/lzZrU5tErP0nC5lmrcgSmr3IrTz2maxkn/pduLJekuowy uX+yLsxR1GjyMOLjCcoJWuho7GwUfqHY3Un6TgO2H2DvHO6FT2LNxYYG3Sx+YPYpFCTU AelA== X-Gm-Message-State: ABuFfoiEi+K7pTThEhM+kQPOjLgLGe6jN5SflOHrChQFYHNQVY294bz9 GO2TkOJq+xdY7R9p2Cr3qCpFNw== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654259 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 2BEA613A4 for ; Wed, 24 Oct 2018 07:24:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1505429B5B for ; Wed, 24 Oct 2018 07:24:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 094CA2A658; Wed, 24 Oct 2018 07:24:00 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD5D729B5B for ; Wed, 24 Oct 2018 07:23:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30A9C6E2A2; Wed, 24 Oct 2018 07:21:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D6E86E1D6 for ; Tue, 23 Oct 2018 15:51:33 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id d23-v6so817151pls.11 for ; Tue, 23 Oct 2018 08:51:33 -0700 (PDT) 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=cZL7NpGyI3ZJEhdrD/s8DRhEw0fb2rZZ4GF7flIM2YNeRCpU87PjzMx5s808G62MXu AUI0n8DKFHz/i4FstzUpN/gfqZrrZx5nJU9T8G0KNYb5xxMPw3dEMMJzQ57P6b0xk0R1 ZN0jUXL56lyeBMCWyE5Atue4oaa6rSW759qlkk8bwo2pRsSl7A4ngIMtpnPJlmDwvIHD 4ntC2XebZRjMJBa8O+sBcQjPepfSWlsbSvjRa5qtA1wA7Z6eD4csuKqBbKRyXpmm/XCw PpMMaTXh6n3xsXcggIkAxg3li24Fm7DS+F9Kq+jzngpMmhczbOl7yqpeK/diEWjm+LIl nmKg== X-Gm-Message-State: AGRZ1gLxi377t/t1abwwrXzU9WSbx/P3H8CIWLzerls7g9pj9v5b3LXF JCX6tDJFKXE4gI/mHF8YqrcJSg== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: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: 10654213 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 9FC8714BB for ; Wed, 24 Oct 2018 07:21:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88F9F2A658 for ; Wed, 24 Oct 2018 07:21:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A6B22A66E; Wed, 24 Oct 2018 07:21: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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 38DFA2A658 for ; Wed, 24 Oct 2018 07:21:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64E976E241; Wed, 24 Oct 2018 07:21:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BCBB89B38 for ; Tue, 23 Oct 2018 15:51:44 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id 23-v6so851067pgc.8 for ; Tue, 23 Oct 2018 08:51:44 -0700 (PDT) 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=fPLYazdclqwGOsfI9u6uIGqTp8an2jxhvi9dKQj7ZeXaYfiGBtD4nru6Cqk8tAyhzy WDmWrq4SgK++oc00k4BgHhb1yFYDsKSEWJnk9mG22SwZQikxAx7cJMedXLfTuyxY26vF H5bCV2hrfRLlnPRFNXbZc/BieQZSZmwypaCYcDwY4x0qI17tQtYw3iMIms6OU0nzaaL6 Kl8GT+dcgL4Wl40d0RknyNN9xxK9hrC8SPvLOS/3u8d4A4HDu3qKjZhrvZbTTUTpB1Wz pGc3AAveAchypIO2p0N+21V/zkj2OE/RIKXtTGAckywr6LiL0EpcEOXSCW6F0uUdahxs jJRQ== X-Gm-Message-State: ABuFfohBz4rlb+ilS/rAW+eyErGKG49IBPVIVEhLGMvx/ayq4H5nwAWc 04YsManiArZS1pvzl3hj15wInQ== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654203 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 43D5217E2 for ; Wed, 24 Oct 2018 07:21:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EDA12A686 for ; Wed, 24 Oct 2018 07:21:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 223B72A66E; Wed, 24 Oct 2018 07:21:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE1DA2A662 for ; Wed, 24 Oct 2018 07:21:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D4816E1C0; Wed, 24 Oct 2018 07:21:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2ABB76E1D6 for ; Tue, 23 Oct 2018 15:51:50 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id u12-v6so871224pfn.12 for ; Tue, 23 Oct 2018 08:51:50 -0700 (PDT) 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=OCjURGqS1Kf+5z9fRAlOwgit3nQlHke81BFGOwEHt6HrPS8SExY6WRrFxZiXkJHsKK nx98dfAXbyzhzKeANYDEbDAE2QE/6iCC+ZkS9UoQMd8RHbjWknCBUOPEdPXEq1wne0f7 6PfJ6UhxHMQxY7gzduziAObp1uo0RNJ2hZdYna+dXS4a+p2ALgJ4r5X3rVc9GC+VEheb jHXpfcGdtiKzbxVX6sNHM/vd2UoBc9QRtdKltXlLCxUFUZDeef66cSXgvNZWm9Acu6dT Rr2bPllN65CNRoPR2Z84mDsZ4HJ7LyWGetJlXUCkCD0JPnC94fTcrfBC7gpxIBTqlnrW loLQ== X-Gm-Message-State: ABuFfoiztq8IAP8TlkK45gIkxisq/sxkimVrvUquJQPDDaINKlnvUOyr jo/sZdtTa0MR0rIm2qhrWlgIwA== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654243 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 4777013A4 for ; Wed, 24 Oct 2018 07:23:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3057D2A658 for ; Wed, 24 Oct 2018 07:23:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 243932A66E; Wed, 24 Oct 2018 07:23:06 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF1B32A658 for ; Wed, 24 Oct 2018 07:23:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B30436E277; Wed, 24 Oct 2018 07:21:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id C465B89B38 for ; Tue, 23 Oct 2018 15:51:55 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id s3-v6so842430pga.12 for ; Tue, 23 Oct 2018 08:51:55 -0700 (PDT) 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=VkkzipZXcvHyXM5YSzc1WPrXVA8ap/EZNEdmJEigqhOQi1X3/9AnYgi3/fva1GNG/8 hr0keGpbtZ7q+Y/hHbSdQ4ZzI5Z4MYNa5FwN+PxvMej3vUMN06M4LPHDusjkmhLYRiXQ 3reLmGYhHAqAGlHpJlWvqjXEAzjrMcHY8iwtggR4sX54TuxNzDbYM8koclvoGKKcbXuZ m467mxK/oTXOno6oLqenm3agWl7fD1C3H3rYYL8DB+Kw+z1GFJCOnB7PvAkLPozCk5jf veDN+Rxz7wh2etd4hlnaexZJMsvG/yBdFaz2CGtiuLGpWxQ2R05Ym5C8l2yDLzUkgyPf JmAA== X-Gm-Message-State: ABuFfohOgP1IMzpvP2UAovTLLva8q/GT3LrbGkk7BKKlRxFehQPkkIOT 5oxB6HKU4vk7ApuCkDexeRKZXA== 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 10654207 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 CCF6214BB for ; Wed, 24 Oct 2018 07:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B627A2A658 for ; Wed, 24 Oct 2018 07:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA73E2A66E; Wed, 24 Oct 2018 07:21:25 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 02CA72A658 for ; Wed, 24 Oct 2018 07:21:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFDE46E1C3; Wed, 24 Oct 2018 07:21:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 889136E1D6 for ; Tue, 23 Oct 2018 15:52:01 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id f8-v6so856479pgq.5 for ; Tue, 23 Oct 2018 08:52:01 -0700 (PDT) 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=Zst/+oGCnq4cmhCQiPMNiqpIgagvKHwDmkz4QZPkYtyyM5EfQne5NuhhmfYhZXHDtg Bp9g86w2o+4Y2xwvLgPPQNNojX3UkFPY9KqUPIcnxNOx7ekzRI3CXiuEEEkpedD865/6 vV0DYFbGC+pmREHEKvh7oB/njwzWfkgUrmi+CelXPTLbYyu8LMsdFDOH1t2WmOt7oahF 8ynrQ1yv+xmzqJq2Wqhy+2pblb4D/zHTz1jwWzItJQhsgHBLRvF6Awfyj15UtmJUF6rR ntQ3Cx3+PHt7LpzX1ksDxw6++Uxhz+J0y09NUUaFsqKVl1IxzKvi2YQhKYFXZRs9Q1P+ XWeA== X-Gm-Message-State: ABuFfoi7kwUfas2kukI8NZXdRB4/STtxXGjOckk17XVjCGVwis1ZX+mY qbs/ArfWPyJjv4pGU38ouW+kPuj/9BM= 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-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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