From patchwork Fri Nov 16 16:39:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 51 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-it1-f200.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id D9CE52E5432 for ; Fri, 16 Nov 2018 17:40:39 +0100 (CET) Received: by mail-it1-f200.google.com with SMTP id m123-v6sf28358975ite.6 for ; Fri, 16 Nov 2018 08:40:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542386438; cv=pass; d=google.com; s=arc-20160816; b=mZSij5sMXTGk7OZA7fXe1QYZi09ZawBrjl8txZ37tZyZ8nvybGX7yeHaZJ1Zu0lKJX 1H+l7zAAnOPKIDabaRISr+C1dDyV7imXc52jib4vsAitfQGdQV1U9gHYvDm/K0lFniha zF7/BW/1W64hvXYbgKuYkGfjO/qB8aaDxZt9w6g2tlTFI8oV8ZfCOWrH6G+e7fTJayBR mYGwRC7SjT16syOO2qJEbBZELa4iaXAcOnLHltSRNouWl7eToCigCmXDysI7KNjWFLNc eWdVWY7w0cwdCZrsUOtwxDqc8z7pUfSotsJL+ZZSiucfqdHOOhQnFEdVUeAUDUMy6rai 0oSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xQWYOyjdRmGs9UhZs6bBgbQ0IL6akLwNeZEkqRrFzQQ=; b=0lvMBxzk3W5EJR+iJIU9HgkGiRNZIwEJIl7wff+DNvr7p7HL13tHSOIL6f8zEYsfKm ej3apEXgpSfRGOm5Bej5/EvpeVyjz2Ja0LgA9CmZeWry41UwXbTlgFX9OY1Ntm3Dhui0 bEurx7rwcWlp/Lb+lgB7Zycvi1JHPrpIJKhKSUqnXNiEw0K+Y/R8l5opE/2GhywA+z99 yiv77do0P0fyWOoX57nfCkUTjvQ+mKTTQGL0nImM68Tkn190YGu0PKwVZQYTiVsOwcXt 43rOZ8nYsDwBDEAxB/ZmA6sWNzwUJW6laYlhafDN/cRiQP5N5kxDbyw97Yk5F8Q/EiJ8 eB+g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JqGzCIoF; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=xQWYOyjdRmGs9UhZs6bBgbQ0IL6akLwNeZEkqRrFzQQ=; b=IWho5DeorIl8a0VGQqmPtNmtWPJdTIXSJmkG1/SDkQuyvXHWqUX/mzA+T3AgrT05KI h5W4hUorAy1tDjnwFfkf8OKisZP7E/44O7nQ+1Qj3cppUivM0Q/t5Q88LT6Mr6rPlXQu 5ZVnKXe5AsIM6mKXL4LjhPUeZk9ysJmWYgdAA= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=xQWYOyjdRmGs9UhZs6bBgbQ0IL6akLwNeZEkqRrFzQQ=; b=qh5iL3aBYC3f/WJ0oT8Gv+0N1tBDUvhTc2UNoHtW1x3ysPrSPYqE5F7bFpyKwb0uaC 7BQbFn5zdzlEeeUJhrI+byrrbMastgt9rnO0NiI31Vkege6ZwmRoRHPddCuExtyxbhb0 v8tO6IS3Ece2somYZs1JzxqkiVdOjfhOue+W9n+g0/YuVkGhbBGzUMA+BneqnAiQNDzr 55Cfrhq67IJFBIDPXgUCt/xPJk0sq4ORj8QsH2KJfP8Kiqu7s8DF5atI45d2txHH4lNy xfPNWB4nhAIkOUBz9oUStEW6B3jONQR9w3YyTCpvVz8D4eJS48WpNsBPoLsmfhyRLEIo zwKw== X-Gm-Message-State: AGRZ1gKLclJ+qAnQzY38VUTZpjIQAgUKReiZkKzATHCmelUMEUPJk5gh 4BVuOFEmh8luUfbqjJcPZTiyAu/0 X-Google-Smtp-Source: AJdET5dOlQLPAnXKiQqEGH7py91nRyYvz0KELsTk0erf28cNIMQ3vPz8Qlo25H0HUS+eWlARqLLLbg== X-Received: by 2002:a24:76d4:: with SMTP id z203-v6mr3743850itb.24.1542386438713; Fri, 16 Nov 2018 08:40:38 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5e:a909:: with SMTP id c9ls418939iod.5.gmail; Fri, 16 Nov 2018 08:40:38 -0800 (PST) X-Received: by 2002:a6b:b249:: with SMTP id b70mr9047292iof.63.1542386438457; Fri, 16 Nov 2018 08:40:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542386438; cv=none; d=google.com; s=arc-20160816; b=x73fDPHWP+mW7z9omZpEBumwiMHO7UmkwcJpJZSilWoXGgm0savpiEVlAPihhGo0gR XWPLFRKdJrXShLPxtmhxWZNTNpQ+qpxJ8MULdhqa0RBeaHMbJ/f8+Mx0AJNyuoXvzIhj L5U8hgyzS2pevFKycLuEPwQpSaiOCVSeQcGP5XzyBdFAfzOHG3cIpI4KYfhoy8MPgnRx u+no5Kc4p3fuVuCnZKiqo3G8hvZ/Q6bpDNw5xgZLOzgxbx7SwspZr6geUSZp/xlQhdYS WGeK/WhL8Ti9/p4BL2dip7NUV+BxJSr3RkociDTZrgLvkwqTqrNV3lCDNfJz2pBK8Guz Jx3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=xQWYOyjdRmGs9UhZs6bBgbQ0IL6akLwNeZEkqRrFzQQ=; b=RaJiGHG5H8P0GVxesOfMW3a00N/orLOehcoYAZXrcvELMfnapICGKpwItbC45uoKzo KcikZS0Px6FPgKrCKialGtemRILYcaPslEZc9fivArKtxqT1KAMqI2lYBYGratYcA6MV 1uWfXMzgY87wuIrk4ch+R4tSJzI9y+oGsH8rtjfe9iBKWCrHjteKUuAYWClWIfYosC+2 MLYaVMwpEUtZc0S1pE3nysWaUcyKX06SV8qCTJGXqCsPqd1mZ74cZVS6ZSgKdnYap5Uj CNKjNyxakW6XFmU8IvhNCmeJplqph09gScCeBVxTp+PhOgnqdsY2GbctW00+1BnIrHhN CkhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JqGzCIoF; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f21sor1498ioc.38.2018.11.16.08.40.38 for (Google Transport Security); Fri, 16 Nov 2018 08:40:38 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:4025:: with SMTP id b34-v6mr11739165pld.318.1542386437932; Fri, 16 Nov 2018 08:40:37 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.40.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:40:37 -0800 (PST) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v2 08/12] drm/sun4i: sun6i_mipi_dsi: Enable 2byte trail for 4-lane burst mode Date: Fri, 16 Nov 2018 22:09:12 +0530 Message-Id: <20181116163916.29621-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JqGzCIoF; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , For 4-lane, burst mode panels would need to enable 2byte trail_fill along with filling trail_env in dsi base control register. Similar reference code avialable in BSP (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) if (panel->lcd_dsi_lane == 4) { dsi_dev[sel]->dsi_basic_ctl.bits.trail_inv = 0xc; dsi_dev[sel]->dsi_basic_ctl.bits.trail_fill = 1; } Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 0182408f8932..22d2987c3298 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -34,6 +34,8 @@ #define SUN6I_DSI_CTL_EN BIT(0) #define SUN6I_DSI_BASIC_CTL_REG 0x00c +#define SUN6I_DSI_BASIC_CTL_TRAIL_INV(n) (((n) & 0xf) << 4) +#define SUN6I_DSI_BASIC_CTL_TRAIL_FILL BIT(3) #define SUN6I_DSI_BASIC_CTL_HBP_DIS BIT(2) #define SUN6I_DSI_BASIC_CTL_HSA_HSE_DIS BIT(1) #define SUN6I_DSI_BASIC_CTL_VIDEO_BURST BIT(0) @@ -559,6 +561,10 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, /* enable burst mode */ regmap_read(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, &val); val |= SUN6I_DSI_BASIC_CTL_VIDEO_BURST; + if (device->lanes == 4) { + val |= SUN6I_DSI_BASIC_CTL_TRAIL_INV(0xc); + val |= SUN6I_DSI_BASIC_CTL_TRAIL_FILL; + } regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, val); }