From patchwork Mon Mar 11 13:36:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847491 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 3F0331669 for ; Mon, 11 Mar 2019 13:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A3FC291A9 for ; Mon, 11 Mar 2019 13:37:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10B78291E9; Mon, 11 Mar 2019 13:37:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4CD5291EA for ; Mon, 11 Mar 2019 13:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727598AbfCKNhO (ORCPT ); Mon, 11 Mar 2019 09:37:14 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40310 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727597AbfCKNhO (ORCPT ); Mon, 11 Mar 2019 09:37:14 -0400 Received: by mail-pf1-f195.google.com with SMTP id h1so3715825pfo.7 for ; Mon, 11 Mar 2019 06:37:14 -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=MkagwlmaneGvabM0zWKgTIFVY3fD3rJzVWmLGOw3QRg=; b=XErLydjXMg/QyI27+lL8zd+GEF4hndh+xt4uFSI2FPJ8nxjLniWmr6+TVkvdqJjfmi CPWuViuINP+DP7WSAjjC17T8nQ3bsTAms8GEl+PBZ5MlGIji/OhpNwwYT54Dq+wwQf8p 7J1a88YNyCChcBjq6esKarAOf4z9EmKUQmmoo= 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=MkagwlmaneGvabM0zWKgTIFVY3fD3rJzVWmLGOw3QRg=; b=OJh0DFZ9bzo+9l12bS4CN48Ol3+wspFEF28Mw5cDMNXZXB2Lav14WVqG6YGfnGgDgL C/shv0wC+Kp7Df5peFomghYy2sHPIVHpDIcTO0nh5iaoX29le57LBUuJo62a5zn+vnAo pMya2x0xvREDSX9l7eJlbL8s1tza7BUdylWtyA1bDVsSZln6FfpxbVRF5gqBu6Qu7dsk 4P/CyKnYSlabxQvtTf5XNeqe6N82m0D1Yfe6L7oVPbxGTtqyBaSLKLaQPQ47a4Om0eCr 39bU669XaWoQ1FDAfl8ApCvU+POoicol6QJXGWlz/ri8E27uZXZfAed6Y3Mfx3l4/8VG u3fA== X-Gm-Message-State: APjAAAW1lgYZKklP4bvsWB224/Iu4Oa690cK1tQgOclbe8oFe1dVCOxx WeZkhm/PMZe7ovAGsp3nOVh9WEFyQOo= X-Google-Smtp-Source: APXvYqzgDkRmYbgZGTC2UrWOeicCqY4vApUX7An7J715NGniYxmfJNivATrHauH7tdqmvXkAa9wkDg== X-Received: by 2002:a17:902:aa92:: with SMTP id d18mr3697807plr.278.1552311434067; Mon, 11 Mar 2019 06:37:14 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:13 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 01/15] drm/sun4i: dsi: Fix video start delay computation Date: Mon, 11 Mar 2019 19:06:23 +0530 Message-Id: <20190311133637.18334-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Vertical video start delay is computed by excluding vertical front porch value from total vertical timings. This clearly confirmed from BSP code and here how it computed, (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 But the current driver is assuming it can exclude vertical front porch along with vertical sync values from total vertical timings, which resulting wrong start delay indeed wrong picture rendering in the panel. Example: timings, where it produces the issue. { .vdisplay = 600, .vsync_start = 600 + 12, .vsync_end = 600 + 12 + 2, .vtotal = 600 + 12 + 2 + 21, } It produces the desired start delay value as 19 but the correct working value should be 513. So, Fix it by computing proper video start delay. Fixes: 69006ef0ecb1 ("drm/sun4i: dsi: Change the start delay calculation") Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 62a508420227..8d6292c0158b 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -364,8 +364,14 @@ 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) { - u16 start = clamp(mode->vtotal - mode->vdisplay - 10, 8, 100); - u16 delay = mode->vtotal - (mode->vsync_end - mode->vdisplay) + start; + u16 delay = mode->vtotal - (mode->vsync_start - mode->vdisplay); + + /** + * BSP comment: + * put start_delay to tcon. set ready sync early to dramfreq, + * so set start_delay 1 + */ + delay += 1; if (delay > mode->vtotal) delay = delay % mode->vtotal; From patchwork Mon Mar 11 13:36:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847495 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 BE14A139A for ; Mon, 11 Mar 2019 13:37:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57CFC291F0 for ; Mon, 11 Mar 2019 13:37:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D59CF291FD; Mon, 11 Mar 2019 13:37: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E962291FD for ; Mon, 11 Mar 2019 13:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727694AbfCKNhV (ORCPT ); Mon, 11 Mar 2019 09:37:21 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40611 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727435AbfCKNhU (ORCPT ); Mon, 11 Mar 2019 09:37:20 -0400 Received: by mail-pg1-f193.google.com with SMTP id u9so4058880pgo.7 for ; Mon, 11 Mar 2019 06:37:20 -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=/ET2SANK/wHVq0QXTm2x4G8KkMw/va+BLQnLjopmn8Q=; b=GE40YkM+ZtlVQujTvvWvz08Y0k50Gs4IFQSnWhXytWqhMAQvtUTh851ppkbGr3m7Tn Nj8IteZ6gBkbX3BN/RPEs/iDiD62mXrsqzEK983QlGLrpXODx8LQh18hCbwVjyZtGQVC pn0h6vOSoVPIClJDZYYeRojApw/n4+Oj7iwOI= 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=/ET2SANK/wHVq0QXTm2x4G8KkMw/va+BLQnLjopmn8Q=; b=gnUD8qIbImnxw8IecRFtQCmq4AEmCk0rzJtP0e/h3nJS6iHTmwUqJK82K27w86btS/ UxGYARIDdnSGZXfKNYEEGHxURQxHPHfUSK39fANQy0orQD7kTD8s1yhzGaoYBF9rE2mt npbaqMVaXJ8b7XAodn4Qv69+MKQouE/Ck9v7jTEJWyRIa2mbjQ97dJWUxIp9VU6gkcc3 0QjCG7vHBtrYjIXdzbMGQy5cC8jyBRzU54VTQAC4lyjeWHxLE+akNSl8KITPrlyNWh0H ilTUmauuaPPhzm37CY4BK96njpjlv95hrQR/i9t+6u1DWdWF9KW/1XzU05GNo7Enp+4q hlkA== X-Gm-Message-State: APjAAAWtJIz9StkzU+FBcbzzx4QMIJIo1pFDTr1x1QeGdkqRTpgz5pyj RMzdWYrHwuE5vTcFtFzEnHR1nQ== X-Google-Smtp-Source: APXvYqwhenf7qGpkwbdKLmXya+DJF9KRSA/4ff40kcLVV9BisaDGzvPeZllZF+e0BN1f6mu538eh/Q== X-Received: by 2002:aa7:8847:: with SMTP id k7mr32426578pfo.99.1552311439648; Mon, 11 Mar 2019 06:37:19 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:18 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 02/15] drm/sun4i: tcon: Compute DCLK dividers based on format, lanes Date: Mon, 11 Mar 2019 19:06:24 +0530 Message-Id: <20190311133637.18334-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pll-video => pll-mipi => tcon0 => tcon0-pixel-clock is the typical MIPI clock topology in Allwinner DSI controller. TCON dotclock driver is computing the desired DCLK divider based on panel pixel clock along with input DCLK min, max divider values from tcon driver and that would eventually set the pll-mipi clock rate. The current code allows the TCON clock divider to have a default 4 for min, max ranges that would fail to compute the desired pll-mipi rate while supporting new panels. So, add the computation logic 'format/lanes' to dclk min and max dividers and instead of default 4. This computation logic align with Allwinner A64 BSP, hoping that would work even for A33. Tested this on 4 different DSI panels. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index e75f77ff8e0f..339f9b1f5745 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -341,8 +341,8 @@ static void sun4i_tcon0_mode_set_cpu(struct sun4i_tcon *tcon, u32 block_space, start_delay; u32 tcon_div; - tcon->dclk_min_div = SUN6I_DSI_TCON_DIV; - tcon->dclk_max_div = SUN6I_DSI_TCON_DIV; + tcon->dclk_min_div = bpp/lanes; + tcon->dclk_max_div = bpp/lanes; sun4i_tcon0_mode_set_common(tcon, mode); From patchwork Mon Mar 11 13:36:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847503 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 682831874 for ; Mon, 11 Mar 2019 13:37:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E17FD2921F for ; Mon, 11 Mar 2019 13:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31B2829280; Mon, 11 Mar 2019 13:37:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70A6B29237 for ; Mon, 11 Mar 2019 13:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbfCKNh1 (ORCPT ); Mon, 11 Mar 2019 09:37:27 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46708 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727334AbfCKNh0 (ORCPT ); Mon, 11 Mar 2019 09:37:26 -0400 Received: by mail-pf1-f195.google.com with SMTP id s23so1615909pfe.13 for ; Mon, 11 Mar 2019 06:37:26 -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=6wckgVcjU0hTcLberbqeJXR3An8TYASrxW/s4B8OxZU=; b=lyfEr09bGOqXzjjck6O/FzYRUS3RRZsGXHVfHpxs0wQQYzhAxvofdKaz41SR54j38n H5HUzqYLRmc4iiEYH+DVwPdt6bLjMTTD2SKa7cs/VF4FwKFHfklBBxKUhx02QuKlhQ1T 93vjicGo4KTsRaFXstXtyiFaQUxW7QGZ0TvCs= 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=6wckgVcjU0hTcLberbqeJXR3An8TYASrxW/s4B8OxZU=; b=OdcPE49itr3yJhQVF6lEkcbF/7PyPYWMqJWgcNjldx464YaN5y0d3s0XaiHtC1wpv3 aPXDuEvTlVx833OxThhdjC3yZL6oN1mt/O83q+axzHvez72ofgYc38YlvDXUYlHdQFrC 2lJT7DlELsbh6ai0yTJPQcOvDQJRdjdDGMFNkO+b1JoXglNAxZbD/jkEcForpf7hbeOb ObOj3h/CucXB3+Z7KycRXGIlgXSGFuj2t7J/nRA4x55Wr0X4Atu5KCgC7dFfDe77MZLQ 7GMd8wYIKZOEOQNXH1v7LwZ8iHYvmZnfC0m17Gs49eYUyaxJCeFHOPBJc7GOe4OTkX7O KGcQ== X-Gm-Message-State: APjAAAV4B+/ab/CqTdZFASvirk1O7gTyYMtWMnVrSeKp9HgIh4Dh7VSu IRdG6uZnrb8zsNC1KS1xd2aptA== X-Google-Smtp-Source: APXvYqyFmFPKFsY7HV959IgiWajMsjYgGW978PjdXK1xhbdXEvcELPjcnz0AXQdkcM55PBCwZ6LzDw== X-Received: by 2002:a17:902:ba84:: with SMTP id k4mr34530252pls.103.1552311445782; Mon, 11 Mar 2019 06:37:25 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:25 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 03/15] drm/sun4i: tcon: Export get tcon0 routine Date: Mon, 11 Mar 2019 19:06:25 +0530 Message-Id: <20190311133637.18334-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sometimes tcon attributes like tcon divider, clock rate etc are needed in interface drivers like DSI. So for such cases interface driver must probe the respective tcon and get the attributes. Since tcon0 probe is already available, via sun4i_get_tcon0 function, export the same instead of probing tcon explicitly. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 3 ++- drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 339f9b1f5745..6cf9661807aa 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -221,7 +221,7 @@ EXPORT_SYMBOL(sun4i_tcon_enable_vblank); * are located in TCON0. This helper returns a pointer to TCON0's * sun4i_tcon structure, or NULL if not found. */ -static struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm) +struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm) { struct sun4i_drv *drv = drm->dev_private; struct sun4i_tcon *tcon; @@ -235,6 +235,7 @@ static struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm) return NULL; } +EXPORT_SYMBOL(sun4i_get_tcon0); void sun4i_tcon_set_mux(struct sun4i_tcon *tcon, int channel, const struct drm_encoder *encoder) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index b5214d71610f..a52696db14a5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -274,6 +274,7 @@ struct sun4i_tcon { struct drm_bridge *sun4i_tcon_find_bridge(struct device_node *node); struct drm_panel *sun4i_tcon_find_panel(struct device_node *node); +struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm); void sun4i_tcon_enable_vblank(struct sun4i_tcon *tcon, bool enable); void sun4i_tcon_mode_set(struct sun4i_tcon *tcon, const struct drm_encoder *encoder, From patchwork Mon Mar 11 13:36:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847507 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 373B71669 for ; Mon, 11 Mar 2019 13:37:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D44829240 for ; Mon, 11 Mar 2019 13:37:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEB32291BE; Mon, 11 Mar 2019 13:37:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 416FE291C2 for ; Mon, 11 Mar 2019 13:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727750AbfCKNhd (ORCPT ); Mon, 11 Mar 2019 09:37:33 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45022 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727360AbfCKNhc (ORCPT ); Mon, 11 Mar 2019 09:37:32 -0400 Received: by mail-pg1-f196.google.com with SMTP id h34so504485pgh.11 for ; Mon, 11 Mar 2019 06:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ptl+5hneR2t7UWZEtSZkUl01CD0BP2fXJcHeyJDA6xo=; b=MmxC2i8xC4jvR9E6pnxJ5Xd7UPRT+U+xQgAbDcTCAOIlbN4jx8nE4R9BNTWmFy0AiE ceFdtcoKUQEKHNEm/DjVSIasKsllnwpY9mY093tQjYm3ppxl6rXCnNgx/1DAjS28V/Nd JXfMefJdNcMuLo9G6RiHpSjKJpBoJIeJCtGcI= 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=Ptl+5hneR2t7UWZEtSZkUl01CD0BP2fXJcHeyJDA6xo=; b=WlTf0Eg2VTTVUr32iS5/zJU0jnaBoZ6gyJ4B6lvB6SsSz2vob1C6NDe5pC41lyZcfm tJCVfQLqamSLmnVhHz/3J1CBjg0seU3md4ukv2s/ZAVUsL5xAjsGbqfTnKUFpDqJxa1y Kx4EeANIMs0pH2O7fuoklcNaICSgF+V/x8L4hWVTsdLSDTvj+UPe6PmkS5wsHZ7E3/bE CGgUBHV3oZUk3xEVFxuiHORcpPwGUG8qOdqBgHl2q/fjChdyZj0oO656QB3S1WGzZaVj 0AJ32I8cNpJFp5jTUfZq7zTrorXeBkkDUCNtNN9Y77aNVlm6kqOethVP0YIa0VH4J+oL SO5Q== X-Gm-Message-State: APjAAAXk3sHlEDWtFiF7j0mRMJEg/Oe8NTEghAW2VkI2KHymEhB7b693 6U1ou5S4aBE4XMSjf7H2hk3/AQ== X-Google-Smtp-Source: APXvYqzxjLw/ZIF991dQ/3orLt6X9ACHu9PJZ8Pvr3SGqkHTrPg6Dti2vfjibsATx1zVHP1gjKlsRw== X-Received: by 2002:a65:44cb:: with SMTP id g11mr30386292pgs.29.1552311452012; Mon, 11 Mar 2019 06:37:32 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:31 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 04/15] drm/sun4i: dsi: Probe tcon0 during dsi_bind Date: Mon, 11 Mar 2019 19:06:26 +0530 Message-Id: <20190311133637.18334-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Probe tcon0 during dsi_bind, so-that the tcon attributes like divider value, clock rate can get whenever it need. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 6 ++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 8d6292c0158b..a8d3df0ea8f5 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1045,6 +1045,7 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, struct drm_device *drm = data; struct sun4i_drv *drv = drm->dev_private; struct sun6i_dsi *dsi = dev_get_drvdata(dev); + struct sun4i_tcon *tcon0 = sun4i_get_tcon0(drm); int ret; if (!dsi->panel) @@ -1052,6 +1053,11 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, dsi->drv = drv; + if (!tcon0) + return -EINVAL; + + dsi->tcon = tcon0; + drm_encoder_helper_add(&dsi->encoder, &sun6i_dsi_enc_helper_funcs); ret = drm_encoder_init(drm, diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 5c3ad5be0690..20516f7ab179 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -28,6 +28,7 @@ struct sun6i_dsi { struct device *dev; struct sun4i_drv *drv; + struct sun4i_tcon *tcon; struct mipi_dsi_device *device; struct drm_panel *panel; }; From patchwork Mon Mar 11 13:36:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847509 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 EFBDD14DE for ; Mon, 11 Mar 2019 13:37:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4E892918C for ; Mon, 11 Mar 2019 13:37:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A9E12919F; Mon, 11 Mar 2019 13:37:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BDE32918C for ; Mon, 11 Mar 2019 13:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbfCKNhj (ORCPT ); Mon, 11 Mar 2019 09:37:39 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45765 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727735AbfCKNhi (ORCPT ); Mon, 11 Mar 2019 09:37:38 -0400 Received: by mail-pf1-f193.google.com with SMTP id v21so3707380pfm.12 for ; Mon, 11 Mar 2019 06:37:38 -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=wkMsNwyY53cH+tA381Ozy9jdybtcb0xlgRRfpGP+ijE=; b=ccJ5Jpwk5iya7fy6+FYdzI3y//jbG8FwKwLp3maPcEUhkdqMcgImfcFYsnmCIRbJ8J D9sqATKEcMccjrz5PpgoxBoNF9QhZ8AhSMy1VkGWf/XVfRooWQ+WGMzhUGyHv6MZ4kk8 XvvDIQvgQdv/UFPJdEwvOhOgzKooTmckFRDlM= 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=wkMsNwyY53cH+tA381Ozy9jdybtcb0xlgRRfpGP+ijE=; b=uCumREO0xUD++yVsNrZaRoHbNXUteoP+FBkm344gQGPfQJ42D6PcA7xOYJI/Tl/9gu 3xrJUwhzLb2OJp9N59aH4Eoq7ArPwFMzgF0eWSmbPThkX/4kP9H5+EFBcSuzpBWg3Oqp bZ3Jnt9P2pUia5k6qEP8HC6kflfnqiF+sfKudXq1Th9Nv0S4vPu2keyYMAn+ufoB17dF AHukZopkVfgK1ojH2EfsxWzWaaLOsDTtgkw26RGzAzAcYbXWHRQ9SNCwD0e7w1udQvFE TxSpTxwuc1HZXvUk8eLVazikFHrWqphFnMxQW/RwGKz/mdNH2IldCGtedFfloX1aQLMJ ZjOg== X-Gm-Message-State: APjAAAW6x7GDscQ+kKV2Zz/2WmktDW1jPL0KCmjXaIVYIdmxOMv2w+f7 BOIFgZngFHsR/sGIOh7Z9G/Kww== X-Google-Smtp-Source: APXvYqwAVXXS+sEAJWk9MVNbPfsJiVpvNsXJ11YLk6uHl8kGqCkvFhGOQD4cpCoVCtaUNvjnaQO6AQ== X-Received: by 2002:a63:5813:: with SMTP id m19mr30213063pgb.294.1552311457673; Mon, 11 Mar 2019 06:37:37 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:37 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 05/15] drm/sun4i: dsi: Get tcon0_div at runtime Date: Mon, 11 Mar 2019 19:06:27 +0530 Message-Id: <20190311133637.18334-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP tcon0 divider is used while computing drq edge0 for burst mode devices, currently driver is using default macro value 4 via SUN6I_DSI_TCON_DIV. Unfortunately not all the panel devices are working with this default divider value 4, so to make future changes on this divider value get the divider from tcon dot clock at runtime. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 +++++++- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index a8d3df0ea8f5..388e1161974c 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -392,9 +392,15 @@ static u16 sun6i_dsi_get_drq_edge0(struct sun6i_dsi *dsi, struct drm_display_mode *mode, u16 line_num, u16 edge1) { + struct sun4i_tcon *tcon = dsi->tcon; + unsigned long dclk_rate, dclk_parent_rate, tcon0_div; u16 edge0 = edge1; - edge0 += (mode->hdisplay + 40) * SUN6I_DSI_TCON_DIV / 8; + dclk_rate = clk_get_rate(tcon->dclk); + dclk_parent_rate = clk_get_rate(clk_get_parent(tcon->dclk)); + tcon0_div = dclk_parent_rate / dclk_rate; + + edge0 += (mode->hdisplay + 40) * tcon0_div / 8; if (edge0 > line_num) return edge0 - line_num; diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 20516f7ab179..747c451a9a20 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -13,8 +13,6 @@ #include #include -#define SUN6I_DSI_TCON_DIV 4 - struct sun6i_dsi { struct drm_connector connector; struct drm_encoder encoder; From patchwork Mon Mar 11 13:36:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847517 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 9B3C414DE for ; Mon, 11 Mar 2019 13:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86FC9291C2 for ; Mon, 11 Mar 2019 13:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AD16291F5; Mon, 11 Mar 2019 13:37:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C9A9291BF for ; Mon, 11 Mar 2019 13:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727805AbfCKNho (ORCPT ); Mon, 11 Mar 2019 09:37:44 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33141 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727762AbfCKNho (ORCPT ); Mon, 11 Mar 2019 09:37:44 -0400 Received: by mail-pf1-f194.google.com with SMTP id i19so3734245pfd.0 for ; Mon, 11 Mar 2019 06:37:43 -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=LwL9AwGWtKYUFgkk+kHgF189NcSW5g0gFHkQNio/TBM=; b=knChio7a8E3cVF9gY6oKV7zce39i9wP/0UbX1yclniMsAb6k+WT2WqQ/MECAhS6qpe g0hADz/6Tnt/ONR3Px/YQdTPrxtnigpcULWd9JCPe38Nwek+2NJVXTkvRj9GKJt3diob ijaWwaKG4rXm/ELrFRBb7iXGhWz3FGl9wIyCQ= 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=LwL9AwGWtKYUFgkk+kHgF189NcSW5g0gFHkQNio/TBM=; b=au5RS1WSX90N/AoNKlu0W57C1MDCat5NPe+iV5lY3WrTskYN0o+9MsdQIoAEd39+rq pmlo8Fvuhwa5EsZN+1Kg94dFCAviP+pjXc95DazbMIdR9AyfXCIhrYORWE2eU0raIHZP DdW4LQtvMUfLTJ9vJzv0hfbi7/uqIi3w98RZqPyjLPr2XQ40NLEX8+88HGFpUSC5+I1U lbtztwQxAsp4cSc3VAVGbt10qM/je1wZZl0QHgJxs6o0cmZehzkjaXGfV90nmbDUO0XL F7g+NkTQmnoZsT9IsLMRkoXemdSS5MR9JdQlZ8tUis6v6+HUXNwW1KFj9tn/nbon6o7C l0zA== X-Gm-Message-State: APjAAAUoToCCwoll5Qkq4MNSDLCz3F0Q4AXl+mje5Wb3JOSco9+oyDte JkSBWA2deCiuvaC+9+ZFhCwjqw== X-Google-Smtp-Source: APXvYqyfbA3ylDyMoL7eK8EdVlyMJjpbdPgT6dp78EMM7u9p19QZ21aradx6mL0N0lJCCOTLocF1NQ== X-Received: by 2002:a63:3f48:: with SMTP id m69mr30353130pga.207.1552311463221; Mon, 11 Mar 2019 06:37:43 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:42 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 06/15] dt-bindings: sun6i-dsi: Add VCC-DSI supply property Date: Mon, 11 Mar 2019 19:06:28 +0530 Message-Id: <20190311133637.18334-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allwinner MIPI DSI controllers are supplied with SoC DSI power rails via VCC-DSI pin. Some board still work without supplying this but give more faith on datasheet and hardware schematics and document this supply property in required property list. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring Tested-by: Merlijn Wajer --- 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..1cc40663b7a2 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt @@ -21,6 +21,7 @@ Required properties: - phys: phandle to the D-PHY - phy-names: must be "dphy" - resets: phandle to the reset controller driving the encoder + - vcc-dsi-supply: the VCC-DSI power supply of the DSI encoder - ports: A ports node with endpoint definitions as defined in Documentation/devicetree/bindings/media/video-interfaces.txt. The From patchwork Mon Mar 11 13:36:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847523 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 1E939139A for ; Mon, 11 Mar 2019 13:37:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 097A6291C0 for ; Mon, 11 Mar 2019 13:37:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07425291EE; Mon, 11 Mar 2019 13:37:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7F27291C0 for ; Mon, 11 Mar 2019 13:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbfCKNhu (ORCPT ); Mon, 11 Mar 2019 09:37:50 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34430 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727548AbfCKNhu (ORCPT ); Mon, 11 Mar 2019 09:37:50 -0400 Received: by mail-pf1-f193.google.com with SMTP id u9so3733875pfn.1 for ; Mon, 11 Mar 2019 06:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ckydVo2IPZQfXMKYGz1uqlUzm7n70fMIZ1xjq1PJknE=; b=K6AoFmOsvBeSoy2R9DvjoRG7CUz9NhugeLSTFnXh5vpwCDZYIV8lGEcUiR2sAlBTSn kvaIY0jm9r+/lG25xMEZt97rjCnzNtxofViiTGd+pQAR3KZG0Un6FKhC1BP/kifjBk3p lumikLZr3bM59um6hFxPED3u5YW6EBvja0Jzs= 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=ckydVo2IPZQfXMKYGz1uqlUzm7n70fMIZ1xjq1PJknE=; b=gPjQ5jKSObsk37k/a+UDOJKkONw5yccu/PepjQyOhNDUmCLUCOFkMZTJ1iB/dFYdrr Dt/PegfV3tRsrhXyUTK5SMPg5laGkga9SC+klQ4IqbJ9+5IPi9tlp9sOSwvm2ygEOX/u g3r8DUj8kwqPzbKQb5+YOavFSre2U7y6lYfgItm0iwhkaRp2XCTmE6WFXHCeSZ8nRHm7 NRvALqNv+b8g6Fpdef79BvffXsfC1pUxkRaBE7QlJryWP4TmBSJfH56SVp/UyWL8Ffuu Pg1DkoNtos/8m73tTJSMaDiq5OYXAvZu0TVSzyQm706WFo/s5bR/K5xSObuNOF88QDvA 9pQw== X-Gm-Message-State: APjAAAXgRJ+PoVh+Aj3jYT3Mg16r7cqtkZqlrbKBU8Zz8k3buO8A2YOV D5csZRKM2kST62brOS/m1Q/qQje6HSU= X-Google-Smtp-Source: APXvYqzwHorUX7e1L/skEZltcHC2vUfcxzbugCU38pVqLg5d2V/TJNegSrveDVfPq6SNbUBDJtnOlw== X-Received: by 2002:a63:c0e:: with SMTP id b14mr30183128pgl.236.1552311469128; Mon, 11 Mar 2019 06:37:49 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:48 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 07/15] dt-bindings: sun6i-dsi: Add A64 MIPI-DSI compatible Date: Mon, 11 Mar 2019 19:06:29 +0530 Message-Id: <20190311133637.18334-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The MIPI DSI controller in Allwinner A64 is similar to A33. But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid to with separate compatible for A64 on the same driver. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring Tested-by: Merlijn Wajer --- 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 1cc40663b7a2..9877398be69a 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt @@ -12,6 +12,7 @@ The DSI Encoder generates the DSI signal from the TCON's. Required properties: - compatible: value must be one of: * allwinner,sun6i-a31-mipi-dsi + * allwinner,sun50i-a64-mipi-dsi - reg: base address and size of memory-mapped region - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the DSI encoder From patchwork Mon Mar 11 13:36:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847525 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 D24AE14DE for ; Mon, 11 Mar 2019 13:37:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B93C5291A9 for ; Mon, 11 Mar 2019 13:37:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7633291FA; Mon, 11 Mar 2019 13:37:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5909E291A9 for ; Mon, 11 Mar 2019 13:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727847AbfCKNh4 (ORCPT ); Mon, 11 Mar 2019 09:37:56 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36911 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727868AbfCKNhz (ORCPT ); Mon, 11 Mar 2019 09:37:55 -0400 Received: by mail-pf1-f193.google.com with SMTP id s22so3728835pfh.4 for ; Mon, 11 Mar 2019 06:37:54 -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=/HOJUJPmu0DEDj06ebaN852o3ZXmTIE5qbyIrE/4RCQ=; b=FXSnlxHgR/qYHZVhxw406BUzlv7bcz92Z3LtRp9Bv6FgDIVzeFtOKpJvQ7Orugp7E2 JN1RJg0Rjwcd/FSyt496oCrqqCWTjxW5pJJl5BapBV4vwLP1jOJnRffu34e/YlfVAprf Udn3yw076GrUrSafZtRts/oma2a9n9Jd1g6QU= 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=/HOJUJPmu0DEDj06ebaN852o3ZXmTIE5qbyIrE/4RCQ=; b=BsXLa8REB+YdlnEautSwDZy6IythI4IkNjvVDfYFpKsqbut4xU769vbalyxZk3NKl2 Dn4DirDRG022EU+vXzzl3LoNFyrUKgGxbKF3rv22rs4zEwfbbIVuoaHCYlDRSmb38PM6 Sx0SzaeexSiSzoj6ZSCY5RLaY1z/t1Dy+uXxBQbFmDb35N7uvMEZZhVAHEYmPXAG1MAL pmwjm5JSNEAw8EkbSyYSuakyWzFogJU59X29/8PAYF/uUiEFoBd95eSqTnMV0h9c+vog 08cWBLCJxWV3jIuXJbxpN9OAvNRaL7MdtR9Mn8K6ebXrz10ESbAmEWtN+iDRDjwJgH2T 5dDA== X-Gm-Message-State: APjAAAVHqEquBMybogSAAuSImI7fnfyGpXsJdR2Ihx+XPZtevZo6wYaL fvPvmSOQAhg51nsXBC5/67a66w== X-Google-Smtp-Source: APXvYqzvcoJ5TkwPI8PFUuqJq5Yih1x64/56VkVo4c2Tp3wVqBG2QZs7s+o3udGRfgnBeqvKxzuJFQ== X-Received: by 2002:a17:902:f24:: with SMTP id 33mr33075713ply.47.1552311474577; Mon, 11 Mar 2019 06:37:54 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:53 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 08/15] dt-bindings: sun6i-dsi: Add A64 DPHY compatible (w/ A31 fallback) Date: Mon, 11 Mar 2019 19:06:30 +0530 Message-Id: <20190311133637.18334-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The MIPI DSI PHY controller on Allwinner A64 is similar on the one on A31. Add A64 compatible and append A31 compatible as fallback. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt index 9877398be69a..d0ce51fea103 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun6i-dsi.txt @@ -38,6 +38,7 @@ D-PHY Required properties: - compatible: value must be one of: * allwinner,sun6i-a31-mipi-dphy + * allwinner,sun50i-a64-mipi-dphy, allwinner,sun6i-a31-mipi-dphy - reg: base address and size of memory-mapped region - clocks: phandles to the clocks feeding the DSI encoder * bus: the DSI interface clock From patchwork Mon Mar 11 13:36:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847529 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 F3CCD14DE for ; Mon, 11 Mar 2019 13:38:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB03429230 for ; Mon, 11 Mar 2019 13:38:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2644D291A4; Mon, 11 Mar 2019 13:38: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F28229255 for ; Mon, 11 Mar 2019 13:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbfCKNiB (ORCPT ); Mon, 11 Mar 2019 09:38:01 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42781 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727491AbfCKNiA (ORCPT ); Mon, 11 Mar 2019 09:38:00 -0400 Received: by mail-pg1-f194.google.com with SMTP id b2so4056167pgl.9 for ; Mon, 11 Mar 2019 06:38: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=TF5z7mL3PH3afkXmJ7BvBklURV/GryvaXbr0ZQUzq4M=; b=e0qXwrwYAH5wvRjseqC54KQNb4ukzeLU3kufN+UtKvhPVR09hRKJmyrpD3KYwZvFGl Y7kN1KHSPbJmGiAFL4yBcWA1cXcsu7ekGUz5TsUbbd3w13F3moEABCv/CQW9qVf46Hfy eHAh7coDA0ialcKVWxUz9TnjnR587fnxFyAs4= 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=TF5z7mL3PH3afkXmJ7BvBklURV/GryvaXbr0ZQUzq4M=; b=pd5ULr/qoc//JuQK7PWtvgf3gNoj4ICl+nQPJ9gnamlWy9TfnF353Q+3GP+bn1yiMO 0U1+G5INMgts25r4qFU/HUVC+Xd48jufNF8Ew8vA+gm9OKTLHwk+OEZceqiYPV6TuuTC rVcRar5RaAGwMzElPWWUwWEnd9TGObXJhO2xFkPedQOoxYnsKUFEIa7J1ra9QBH0kCmw 1I0yYoSAdJKyA6nftXyOPBurW6O7oiFaDnBwIBRaJYCMF12Mg2SI6FbCLNaUgGU7AWDH +5T3l7L/L9RIjte2wUd/F8AgT6qaMyutKkFiGpOKRJWKnE6Ytax69ooz6SD2XjOIFvkb uFCQ== X-Gm-Message-State: APjAAAW4Kig/AdvABiRA034FV1ImljcuMwharMpptdNpQVhx7D7YU5CW ecLNzQeLZ9TpRbj0c4ygtG2z9g== X-Google-Smtp-Source: APXvYqyJC2p8K5cK6E7JAsiCXSZTUkVUvhRCxGA756p4PUL0TBix90m2pMsAgir/muyoPHd97NuSbA== X-Received: by 2002:a17:902:8602:: with SMTP id f2mr34360179plo.263.1552311480178; Mon, 11 Mar 2019 06:38:00 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:59 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 09/15] drm/sun4i: sun6i_mipi_dsi: Add has_mod_clk quirk Date: Mon, 11 Mar 2019 19:06:31 +0530 Message-Id: <20190311133637.18334-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As per the user manual, look like mod clock is not mandatory for all Allwinner MIPI DSI controllers, it is connected to CLK_DSI_SCLK for A31 and not available in A64. So add has_mod_clk quirk and process the clk accordingly. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 14 ++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 388e1161974c..f42ea806f6c8 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1134,6 +1134,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return PTR_ERR(base); } + dsi->regulator = devm_regulator_get(dev, "vcc-dsi"); + if (IS_ERR(dsi->regulator)) { + dev_err(dev, "Couldn't get VCC-DSI supply\n"); + return PTR_ERR(dsi->regulator); + } + dsi->regs = devm_regmap_init_mmio_clk(dev, "bus", base, &sun6i_dsi_regmap_config); if (IS_ERR(dsi->regs)) { @@ -1207,6 +1213,13 @@ static int sun6i_dsi_remove(struct platform_device *pdev) static int __maybe_unused sun6i_dsi_runtime_resume(struct device *dev) { struct sun6i_dsi *dsi = dev_get_drvdata(dev); + int err; + + err = regulator_enable(dsi->regulator); + if (err) { + dev_err(dsi->dev, "failed to enable VCC-DSI supply: %d\n", err); + return err; + } reset_control_deassert(dsi->reset); clk_prepare_enable(dsi->mod_clk); @@ -1239,6 +1252,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev) clk_disable_unprepare(dsi->mod_clk); reset_control_assert(dsi->reset); + regulator_disable(dsi->regulator); return 0; } diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 747c451a9a20..c570f2b3868f 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -13,6 +13,8 @@ #include #include +#include + struct sun6i_dsi { struct drm_connector connector; struct drm_encoder encoder; @@ -21,6 +23,7 @@ struct sun6i_dsi { struct clk *bus_clk; struct clk *mod_clk; struct regmap *regs; + struct regulator *regulator; struct reset_control *reset; struct phy *dphy; From patchwork Mon Mar 11 13:36:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847533 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 35F981669 for ; Mon, 11 Mar 2019 13:38:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D2EF2924D for ; Mon, 11 Mar 2019 13:38:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E398129208; Mon, 11 Mar 2019 13:38: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58B27291C0 for ; Mon, 11 Mar 2019 13:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727622AbfCKNiI (ORCPT ); Mon, 11 Mar 2019 09:38:08 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46264 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727560AbfCKNiH (ORCPT ); Mon, 11 Mar 2019 09:38:07 -0400 Received: by mail-pg1-f196.google.com with SMTP id a22so4049623pgg.13 for ; Mon, 11 Mar 2019 06:38:06 -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=ji/qwC/DQKZSBaaS9TqlAOwzz5Vf5lhGPWQ9JxpSNtE=; b=FHFikPl03Y/gVSgIWpbi7MkZhF6+/I73Hw5CFcVwMC41+qPKNtZpG9vu9IUDniIaR2 yjOshoMkmvw99WUnSc2uhTWemZBsxMSIhmRzCArT8p5e35Vx/ltRv2k7rHQMPyK53eck tyDLK6jvWXcZM0JWHBZGkKBujmXS93fQ4Sws0= 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=ji/qwC/DQKZSBaaS9TqlAOwzz5Vf5lhGPWQ9JxpSNtE=; b=icwCj/MUouwg17/nd3aGA0Qltd4qVyh7AN9CZkYM80pAOXxn9bUH0T5LMB2NSYnyav d31cAPs/dvruwoAzgMsrqfEzkFst2ka4gc++CVFSrf7omklDXnAordblZRQyv8NMI0iw TdcAhu7WNDhUajdIjpoohrWoT1h0nqo+fr2+sYF64qas6Rsaao9h/vWAlZ/GgI13K0We 7yH6fidFG+Q3ppl1IK9Ac3i519iLekgNqHA6/1yNAor+bq2CvWPj1L8nEKRH9exR2FCD Ein8MHotGednROFk0AbSiBhFkBxsgWtq8rQ0mRQ28vjPsvEhBGcp/yVIfGLAJdukcOA3 gHjQ== X-Gm-Message-State: APjAAAV1xp2I1GUfCaqTz7a0cD0UYmiFrzlxAe7QvqEd3WNyxzpz3zHo LHOn8gmZN9Upa6GqV2sHz6d9Tw== X-Google-Smtp-Source: APXvYqxNcOxNAKyPN85uaNs0q6HZpl4SrIXm5s4xueRiKv3yknqulCYRfuqoFBK4pHQPZQCX+iZn1w== X-Received: by 2002:a65:60c7:: with SMTP id r7mr30943274pgv.37.1552311486234; Mon, 11 Mar 2019 06:38:06 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.38.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:38:05 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 10/15] drm/sun4i: sun6i_mipi_dsi: Add has_mod_clk quirk Date: Mon, 11 Mar 2019 19:06:32 +0530 Message-Id: <20190311133637.18334-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As per the user manual, look like mod clock is not mandatory for all Allwinner MIPI DSI controllers, it is connected to CLK_DSI_SCLK for A31 and not available in A64. So add has_mod_clk quirk and process the clk accordingly. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 38 ++++++++++++++++++-------- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 5 ++++ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index f42ea806f6c8..2a63e96aaff9 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 @@ -1126,6 +1127,7 @@ static int sun6i_dsi_probe(struct platform_device *pdev) dsi->dev = dev; 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); @@ -1153,17 +1155,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); dsi->dphy = devm_phy_get(dev, "dphy"); if (IS_ERR(dsi->dphy)) { @@ -1193,7 +1198,8 @@ static int sun6i_dsi_probe(struct platform_device *pdev) err_pm_disable: pm_runtime_disable(dev); 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; } @@ -1205,7 +1211,8 @@ static int sun6i_dsi_remove(struct platform_device *pdev) component_del(&pdev->dev, &sun6i_dsi_ops); mipi_dsi_host_unregister(&dsi->host); pm_runtime_disable(dev); - clk_rate_exclusive_put(dsi->mod_clk); + if (dsi->variant->has_mod_clk) + clk_rate_exclusive_put(dsi->mod_clk); return 0; } @@ -1222,7 +1229,8 @@ static int __maybe_unused sun6i_dsi_runtime_resume(struct device *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. @@ -1250,7 +1258,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); regulator_disable(dsi->regulator); @@ -1263,9 +1272,16 @@ static const struct dev_pm_ops sun6i_dsi_pm_ops = { NULL) }; +static const struct sun6i_dsi_variant sun6i_a31_mipi_dsi = { + .has_mod_clk = true, +}; + static const struct of_device_id sun6i_dsi_of_table[] = { - { .compatible = "allwinner,sun6i-a31-mipi-dsi" }, - { } + { + .compatible = "allwinner,sun6i-a31-mipi-dsi", + .data = &sun6i_a31_mipi_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 c570f2b3868f..5c4983212f89 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -15,6 +15,10 @@ #include +struct sun6i_dsi_variant { + bool has_mod_clk; +}; + struct sun6i_dsi { struct drm_connector connector; struct drm_encoder encoder; @@ -32,6 +36,7 @@ struct sun6i_dsi { struct sun4i_tcon *tcon; struct mipi_dsi_device *device; struct drm_panel *panel; + const struct sun6i_dsi_variant *variant; }; static inline struct sun6i_dsi *host_to_sun6i_dsi(struct mipi_dsi_host *host) From patchwork Mon Mar 11 13:36:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847539 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 229D1139A for ; Mon, 11 Mar 2019 13:38:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D9E9291E0 for ; Mon, 11 Mar 2019 13:38:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 016D9291C7; Mon, 11 Mar 2019 13:38:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 996F1291BB for ; Mon, 11 Mar 2019 13:38:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727658AbfCKNiN (ORCPT ); Mon, 11 Mar 2019 09:38:13 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46824 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbfCKNiM (ORCPT ); Mon, 11 Mar 2019 09:38:12 -0400 Received: by mail-pf1-f196.google.com with SMTP id s23so1617316pfe.13 for ; Mon, 11 Mar 2019 06:38:12 -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=lLaXdMfskoRPTGZByJafsf5LDMgcrgF2xzpvJ4wAjTE=; b=aUQHXHHumq98rviMFe8QK1+rjAfzuUeNkuobadbtcqsO9opduWj/TMeOY7is7ydvmn wdBqPkee7jmLWszPW6qVPH5SLgfKWhHhXmZeZr2pdJQcoB7Ck/6sGxePm52xVVgGrs8W xEgrzRI+OJAxT5S2FExW4LOJLWyUIgu8ws9FM= 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=lLaXdMfskoRPTGZByJafsf5LDMgcrgF2xzpvJ4wAjTE=; b=oMXXhooFgd2WgI8meCM+q+W3Yv9+IINMnXA/trhtNnt1tcwDg4Zm83DgrrdFAhGZ0+ UesSOzRFliZ0LUZX298o78I/VAnjQoWDKJUNFUOM90KZMj7VZF39vMLzFv+JphCUoEES jzguNy3ruzQvEEDAqZ545pejaJlr7jtZWDWBUA8WPxC7jW1DHzoejQZO26Qt/Otbx4aX Av7jqwI+dzfgksl3iIeSKdQMYhuC7LustuEncPvHdfwBHhhsGGop/gSgvEcS1oXKQ+iP HyoEE5kaKhHuJF1XsfLZT1SqNjdfWw9DZZnFzu6hDYNzv17G9o4vShKFUFoUUxGrFn91 Ycew== X-Gm-Message-State: APjAAAV1kBmb8l4Bgi4ZSfDgKdr0FxDwJwiWkJ4gL6ITWRhrwCnWmj5e zb8jf5piItziHM+uDLJbqSa4vQ== X-Google-Smtp-Source: APXvYqyaIfdcz7BrGilI/zcOJlSwWlwGFweg4DjPvmG2RM86KrZrIJB7rrPohyJkQ0QWKLm2BA0bmg== X-Received: by 2002:a65:5108:: with SMTP id f8mr29993630pgq.441.1552311491700; Mon, 11 Mar 2019 06:38:11 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.38.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:38:11 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 11/15] drm/sun4i: sun6i_mipi_dsi: Add Allwinner A64 MIPI DSI support Date: Mon, 11 Mar 2019 19:06:33 +0530 Message-Id: <20190311133637.18334-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The MIPI DSI controller in Allwinner A64 is similar to A33. But unlike A33, A64 doesn't have DSI_SCLK gating so add compatible for Allwinner A64 with uninitialized has_mod_clk driver. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 2a63e96aaff9..0960b96b62cc 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1276,11 +1276,18 @@ static const struct sun6i_dsi_variant sun6i_a31_mipi_dsi = { .has_mod_clk = true, }; +static const struct sun6i_dsi_variant sun50i_a64_mipi_dsi = { +}; + static const struct of_device_id sun6i_dsi_of_table[] = { { .compatible = "allwinner,sun6i-a31-mipi-dsi", .data = &sun6i_a31_mipi_dsi, }, + { + .compatible = "allwinner,sun50i-a64-mipi-dsi", + .data = &sun50i_a64_mipi_dsi, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table); From patchwork Mon Mar 11 13:36:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847551 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 5AA2614DE for ; Mon, 11 Mar 2019 13:38:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4521E2918A for ; Mon, 11 Mar 2019 13:38:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 391E9291A5; Mon, 11 Mar 2019 13:38:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCE75291E0 for ; Mon, 11 Mar 2019 13:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727652AbfCKNiY (ORCPT ); Mon, 11 Mar 2019 09:38:24 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39099 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727914AbfCKNiS (ORCPT ); Mon, 11 Mar 2019 09:38:18 -0400 Received: by mail-pg1-f196.google.com with SMTP id h8so4062305pgp.6 for ; Mon, 11 Mar 2019 06:38:17 -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=JpkYvz2XVIh29oXHw9wh2ZVrMuDNfed6jV8hIQF4UlE=; b=iHSqwI6HDgJucsXctyUIRXrQ9/vL1sObFZBZeTrlGMRQBhzCraj2xChMOHdqo21edI gMrmSYXvA7GZfTKCsRn7+Z8Rpo3jxWsH/FyEeuZSrNHn7FV7A/91HBlV/ChZKyO42n8o PjB/V+1nZ3cynylJXJJg7Yu7pEroNs29AzHOc= 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=JpkYvz2XVIh29oXHw9wh2ZVrMuDNfed6jV8hIQF4UlE=; b=n7BJuiW8Ea72uiaYfO6tGOCSRrV6+TUxHarLflQ67nEhvGf6jElufwi/J1lmu6tRLm 4IsEDdvs9X/ktuvoua6sxREIKztRqYivZG1qtMDO79mceGdLfm7hFZDdta5bgdUapNgU UCTeCEkM8PTruCXiFTTW98t2mDkLqN7nUAWbovjuuYs5QPoPN5KEy95DDl0HtN/rm1/h h8VIJ9YO02T6Vymo1T1e6RIOua3rmOEWQJDjJqjyU4iyhsVhURXPe2xndI0DyeKgOcew 9LM23Z+Mg/Db18kz+RTbcmWdwr6wx4ZmaDCb4TzoOevEQH/PZ2pHFOKQoZa1MpohQjrU RI/w== X-Gm-Message-State: APjAAAV2ruMm16vBZxdojjyzxK39YikIB82VsjrES+zRWiaOgrZVf8F6 D13Cf/jzNRY8MjZWUgv9kOoSfw== X-Google-Smtp-Source: APXvYqxA2/p+Oe4YFcvNjoPQCuNCDDxv42eoG4JOiltR8aSciBTB/VWnd1XF9ltTFWLKjnGgdUXuOA== X-Received: by 2002:a17:902:501:: with SMTP id 1mr33497507plf.72.1552311497008; Mon, 11 Mar 2019 06:38:17 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.38.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:38:16 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 12/15] arm64: dts: allwinner: a64: Add MIPI DSI pipeline Date: Mon, 11 Mar 2019 19:06:34 +0530 Message-Id: <20190311133637.18334-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add MIPI DSI pipeline for Allwinner A64. - dsi node, with A64 compatible since it doesn't support DSI_SCLK gating unlike A33 - dphy node, with A64 compatible with A33 fallback since DPHY on A64 and A33 is similar - finally, attach the dsi_in to tcon0 for complete MIPI DSI Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index e628d063931b..5525fc571fc6 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -360,6 +360,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <1>; + + tcon0_out_dsi: endpoint@1 { + reg = <1>; + remote-endpoint = <&dsi_in_tcon0>; + allwinner,tcon-channel = <1>; + }; }; }; }; @@ -946,6 +952,45 @@ status = "disabled"; }; + dsi: dsi@1ca0000 { + compatible = "allwinner,sun50i-a64-mipi-dsi"; + reg = <0x01ca0000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_MIPI_DSI>; + clock-names = "bus"; + resets = <&ccu RST_BUS_MIPI_DSI>; + phys = <&dphy>; + phy-names = "dphy"; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + dsi_in_tcon0: endpoint { + remote-endpoint = <&tcon0_out_dsi>; + }; + }; + }; + }; + + dphy: d-phy@1ca1000 { + compatible = "allwinner,sun50i-a64-mipi-dphy", + "allwinner,sun6i-a31-mipi-dphy"; + reg = <0x01ca1000 0x1000>; + clocks = <&ccu CLK_BUS_MIPI_DSI>, + <&ccu CLK_DSI_DPHY>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_MIPI_DSI>; + status = "disabled"; + #phy-cells = <0>; + }; + hdmi: hdmi@1ee0000 { compatible = "allwinner,sun50i-a64-dw-hdmi", "allwinner,sun8i-a83t-dw-hdmi"; From patchwork Mon Mar 11 13:36:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847547 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 B8F4F14DE for ; Mon, 11 Mar 2019 13:38:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A36A9291B0 for ; Mon, 11 Mar 2019 13:38:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 978C4291B1; Mon, 11 Mar 2019 13:38: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3225C291B0 for ; Mon, 11 Mar 2019 13:38:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727914AbfCKNiY (ORCPT ); Mon, 11 Mar 2019 09:38:24 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33612 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727937AbfCKNiX (ORCPT ); Mon, 11 Mar 2019 09:38:23 -0400 Received: by mail-pg1-f194.google.com with SMTP id h11so4077050pgl.0 for ; Mon, 11 Mar 2019 06:38: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=bbfFLXYgQgT96KQWpvufycXDySGsaHFmNnIKKD+QAAA=; b=csEEdpOUWidR/rAy4QShLws7efipBmkqHzYhqWoqzdkIV4rQRgkXvv+KBi9PSfRJuS wqWQydGxXgbk3qHYHD16eMu4DG6/olNqnmRfxhxnar4NRjNOWMRUyQ2viLosWLRy4leh m8SuRFgOXNUjxQMbmvL1JfCCQUhuit8gMsv7c= 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=bbfFLXYgQgT96KQWpvufycXDySGsaHFmNnIKKD+QAAA=; b=hIALRvIjsBkdbJ3owZr5Mx9XF2NnMKYxHpQWnRP1wCpe0ipKPyvMDAs28t0wlb7FHm EJlvZyDq7aHj1fbbD6r/IjbLSIU1GzUH4P0+ITSb5TX6jWUBiT5MCvUMQNHOMjcS2WpO FCdt150NxdakqWNmpanUHMcXNdgIF7pR7+YC0pQoV9CMRheBhhEz6qq21d/NZZQtfIVY tXfHS3k7bZ5gr3yEKobYEgbwY8SO8X6WYQYgVtOlxGwyy23t8DFz8U5wVVgwJKZ7ZmPV 4uwEFrq873TOTw+WNV74Rprcmol2np9qYx44YQ2DOs7U1a/osKHgKqA+h6e29Rj9mnI0 ggCg== X-Gm-Message-State: APjAAAUn5CoNEKXBR2eOMmT322kNFPWpcADAiGzRP17P85rAe727UJCG iIdLV7TOk/j/0Q12gylm+ix6NA== X-Google-Smtp-Source: APXvYqxihZgwbs8x/hv6/mbmtMCpQgLB5ajg0UB/OnQ0Jh5OA4JPEullW6ykEbSdknv9GluEVYoyxA== X-Received: by 2002:a65:4608:: with SMTP id v8mr30653224pgq.9.1552311502540; Mon, 11 Mar 2019 06:38:22 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.38.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:38:22 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 13/15] arm64: dts: allwinner: a64-amarula-relic: Add Techstar TS8550B MIPI-DSI panel Date: Mon, 11 Mar 2019 19:06:35 +0530 Message-Id: <20190311133637.18334-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Amarula A64-Relic board by default bound with Techstar TS8550B MIPI-DSI panel, add support for it. DSI panel connected via board DSI port with, - DLDO2 as VCC supply - DLDO2 as IOVCC supply - DLDO1 as VCC-DSI supply - PD24 gpio for reset pin - PD23 gpio for backlight enable pin Signed-off-by: Jagan Teki --- .../allwinner/sun50i-a64-amarula-relic.dts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts index 6cb2b7f0c817..f85ed0b99942 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts @@ -9,6 +9,7 @@ #include "sun50i-a64.dtsi" #include +#include / { model = "Amarula A64-Relic"; @@ -18,6 +19,14 @@ serial0 = &uart0; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <1 2 4 8 16 32 64 128 512>; + default-brightness-level = <2>; + enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PD23 */ + }; + chosen { stdout-path = "serial0:115200n8"; }; @@ -30,6 +39,30 @@ }; }; +&de { + status = "okay"; +}; + +&dphy { + status = "okay"; +}; + +&dsi { + vcc-dsi-supply = <®_dldo1>; /* VCC3V3-DSI */ + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + panel@0 { + compatible = "techstar,ts8550b", "sitronix,st7701"; + reg = <0>; + VCC-supply = <®_dldo2>; /* VCC-LCD */ + IOVCC-supply = <®_dldo2>; /* VCC-LCD */ + reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* LCD-RST: PD24 */ + backlight = <&backlight>; + }; +}; + &ehci0 { status = "okay"; }; @@ -72,6 +105,12 @@ status = "okay"; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pin>; + status = "okay"; +}; + &r_rsb { status = "okay"; From patchwork Mon Mar 11 13:36:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847555 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 565D7139A for ; Mon, 11 Mar 2019 13:38:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 413722918A for ; Mon, 11 Mar 2019 13:38:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EBB0291D7; Mon, 11 Mar 2019 13:38:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8730291C0 for ; Mon, 11 Mar 2019 13:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727967AbfCKNi3 (ORCPT ); Mon, 11 Mar 2019 09:38:29 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40498 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727969AbfCKNi3 (ORCPT ); Mon, 11 Mar 2019 09:38:29 -0400 Received: by mail-pf1-f194.google.com with SMTP id h1so3718185pfo.7 for ; Mon, 11 Mar 2019 06:38: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=9PxoL5qRhhi9/8I/MxsRIxkuMzLQLSJqsW5+iDKE8rA=; b=bndJ8EPlGei0VqAmSKeefIugVP1+1mzrI/1sjt8TC2fThx0cXpvQszvo0hPOIVkhIi 70haJK/LkjV2SWLNBV9nk0HUXA8AYBRRPSq54sRyABBL9mUy/jcugpQn6DP4XkXFo29Q 3bHcmLcHsD4FOdDPklPtE+O8/dMOji25u8aT0= 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=9PxoL5qRhhi9/8I/MxsRIxkuMzLQLSJqsW5+iDKE8rA=; b=EEDqNxr3AlJqOgXmdX2IPDnfVwUzVdaNYS/MFF3etxix4t+hsuOILqD7Ody/umqDA8 PiGbXzp58aj+bJf7EgESMvBqy6rJi5uT/jOryFwkEVMIYSIJ7R2udWnPc7IBh+AxiPPD GcCaCJawFV816mLdA+5la+E8zw8O93aufGx6jg2YuLCf7dfLLiEO1VNnlwR3G5u79spk KuRuMqNQYbCKQM8gagVTqQ7KDRVtjIOR1xKjRyig4lQOokNHDuO4JPHGLqVZHxFK8CfK dJw2QsqH/A7857N57eWyvmyHJi+SfTHVnihmMBCkOGs5guUIPtYTOzBuVp+ddJO+awxZ Uxjg== X-Gm-Message-State: APjAAAXIv8Ipl8QpFaQkJFXIzNH5jX9GWXnUuv22EYMpkZD/okFehqFE l+7MMR42gibXDk+pVtVcSIeuRw== X-Google-Smtp-Source: APXvYqzmhTmep4xHmLO/7cx5/kp3S6tQWFg9A9tSuN6B3MX1yJy12Gn1cdhV11E/TzCHAIvNu2PBAQ== X-Received: by 2002:a65:5c41:: with SMTP id v1mr24606300pgr.404.1552311508420; Mon, 11 Mar 2019 06:38:28 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.38.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:38:27 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [DO NOT MERGE] [PATCH v8 14/15] arm64: dts: allwinner: a64-pine64-lts: Enable Feiyang FY07024DI26A30-D DSI panel Date: Mon, 11 Mar 2019 19:06:36 +0530 Message-Id: <20190311133637.18334-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Feiyang FY07024DI26A30-D MIPI_DSI panel is desiged to attach with DSI connector on pine64 boards, enable the same for pine64 LTS. DSI panel connected via board DSI port with, - DC1SW as AVDD supply - DLDO2 as DVDD supply - DLDO1 as VCC-DSI supply - PD24 gpio for reset pin - PH10 gpio for backlight enable pin Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- .../dts/allwinner/sun50i-a64-pine64-lts.dts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts index 72d6961dc312..341b1c035604 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts @@ -5,9 +5,48 @@ */ #include "sun50i-a64-sopine-baseboard.dts" +#include / { model = "Pine64 LTS"; compatible = "pine64,pine64-lts", "allwinner,sun50i-r18", "allwinner,sun50i-a64"; + + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <1 2 4 8 16 32 64 128 512>; + default-brightness-level = <8>; + enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PH10 */ + }; +}; + +&de { + status = "okay"; +}; + +&dphy { + status = "okay"; +}; + +&dsi { + vcc-dsi-supply = <®_dldo1>; /* VCC3V3-DSI */ + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + panel@0 { + compatible = "feiyang,fy07024di26a30d"; + reg = <0>; + avdd-supply = <®_dc1sw>; /* VCC-LCD */ + dvdd-supply = <®_dldo2>; /* VCC-MIPI */ + reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* LCD-RST: PD24 */ + backlight = <&backlight>; + }; +}; + +&r_pwm { + pinctrl-names = "default"; + pinctrl-0 = <&r_pwm_pin>; + status = "okay"; }; From patchwork Mon Mar 11 13:36:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10847561 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 BB433139A for ; Mon, 11 Mar 2019 13:38:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7D0A2918E for ; Mon, 11 Mar 2019 13:38:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A61F0291CA; Mon, 11 Mar 2019 13:38:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42C7A291E6 for ; Mon, 11 Mar 2019 13:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727465AbfCKNif (ORCPT ); Mon, 11 Mar 2019 09:38:35 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34929 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727467AbfCKNif (ORCPT ); Mon, 11 Mar 2019 09:38:35 -0400 Received: by mail-pg1-f194.google.com with SMTP id e17so4073730pgd.2 for ; Mon, 11 Mar 2019 06:38:34 -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=ywK6pcoFaKLaYGBN5FuWj3q4y3hHnb3hpgGYqdNyD7Y=; b=ncOMkBB8mB7oL36RVl5q+7LNC2GRiivcr43tpO1ceLPFPCLlPSnXiPt2qKjh0YY0pf nja5/2O5TYU3jrRicWkHqK6ldbein4tSsC3gfUJG/nLpMJABIxPw7TGxARnCWn3lMKWJ tOhCz4I+Lj/sVy0/sTbkBDAjH2jOrS2xYqbh0= 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=ywK6pcoFaKLaYGBN5FuWj3q4y3hHnb3hpgGYqdNyD7Y=; b=NLXMcjGdH7nOahuj5ts650FVU+FjJKbthxh3CCgGCn/Isc1YejrG4C6BBZY6ta0NTj jtWjJNq15S2JnQ2RmeSk+Lpm5LVmxoR1lRo8bJ61ZfD1EovIa+p8SU7mGDIAP+WeBVPc 5I89wOWjhfB7ecCFQb5+KsOAuuIswa7i5PDgisglFzPpKmeWcecY/SGUAn9bgB6VKzEJ bNBTbw8hMEnmOaz57nuymKHj95kKCiVC1xKa+hxLD+XmT7PeciE0Q0Jz1IGx2tp8rSoL 99mYmI2EF6LMhyVzQdysabMNsB22IBJwkqeekQ8Rh3Lw7wopijr3HkYNknIfCAGpG6wp Zgpw== X-Gm-Message-State: APjAAAVOY18A4rBEefePlahtOHwSai6DefVdKPsH9JwT1P3GEis/8B3r 4qh5xqIpGP9W3xZJ49wzA/po+w== X-Google-Smtp-Source: APXvYqywa4k2PZAD46bMMH8bMhhIyGJ5Um33yGmFDDkMdwtxmXYS3hFK8dUXwopXD0rJiC4n++R79g== X-Received: by 2002:a62:1283:: with SMTP id 3mr33977851pfs.122.1552311514206; Mon, 11 Mar 2019 06:38:34 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.38.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:38:33 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [DO NOT MERGE] [PATCH v8 15/15] arm64: dts: allwinner: bananapi-m64: Enable Bananapi S070WV20-CT16 DSI panel Date: Mon, 11 Mar 2019 19:06:37 +0530 Message-Id: <20190311133637.18334-16-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch add support for Bananapi S070WV20-CT16 DSI panel to BPI-M64 board. DSI panel connected via board DSI port with, - DLDO1 as VDD supply - DLDO1 as VCC-DSI supply - PD6 gpio for reset pin - PD5 gpio for backlight enable pin - PD7 gpio for backlight vdd supply Signed-off-by: Jagan Teki --- .../dts/allwinner/sun50i-a64-bananapi-m64.dts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts index 7793ebb5d2b8..9d740afadd30 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts @@ -45,6 +45,7 @@ #include "sun50i-a64.dtsi" #include +#include / { model = "BananaPi-M64"; @@ -56,6 +57,15 @@ serial1 = &uart1; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <1 2 4 8 16 32 64 128 512>; + default-brightness-level = <2>; + enable-gpios = <&pio 3 5 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PD5 */ + power-supply = <®_vdd_backlight>; + }; + chosen { stdout-path = "serial0:115200n8"; }; @@ -91,6 +101,15 @@ }; }; + reg_vdd_backlight: vdd-backlight { + compatible = "regulator-fixed"; + regulator-name = "vdd-backlight"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&pio 3 7 GPIO_ACTIVE_HIGH>; /* LCD-PWR-EN: PD7 */ + enable-active-high; + }; + wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ @@ -116,6 +135,25 @@ status = "okay"; }; +&dphy { + status = "okay"; +}; + +&dsi { + vcc-dsi-supply = <®_dldo1>; /* VCC3V3-DSI */ + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "bananapi,s070wv20-ct16-icn6211"; + reg = <0>; + reset-gpios = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* LCD-RST: PD6 */ + vdd-supply = <®_dldo1>; + backlight = <&backlight>; + }; +}; + &ehci0 { status = "okay"; }; @@ -208,6 +246,12 @@ status = "okay"; }; +&r_pwm { + pinctrl-names = "default"; + pinctrl-0 = <&r_pwm_pin>; + status = "okay"; +}; + &r_rsb { status = "okay";