From patchwork Fri Feb 12 13:31:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 8291071 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D2925BEEE5 for ; Fri, 12 Feb 2016 13:33:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB32E203F4 for ; Fri, 12 Feb 2016 13:33:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC223203E9 for ; Fri, 12 Feb 2016 13:33:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbcBLNdi (ORCPT ); Fri, 12 Feb 2016 08:33:38 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34430 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752594AbcBLNcx (ORCPT ); Fri, 12 Feb 2016 08:32:53 -0500 Received: by mail-pf0-f196.google.com with SMTP id 71so4001110pfv.1 for ; Fri, 12 Feb 2016 05:32:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o23fK/oZowuKe1iL6FRxoiyBomJ6BzAXiRre67QvEJg=; b=FfKyHUiMrbJPowqmh1W6SLK3XLhUtIdgDkARFspShtVJC6K32oOBC5qrrAcntQd/AF Ewt/UPs6zGAhPxiXz98amX+TlvJ4JNyDMlCPAvXqRR10etz8R0mrsJj+VRqPizIJA1P2 LuHflKAs76Q/PVcBJJYTLjt93EWc52LZj/ApK/N/OeOwzIRZAPLkfUUAIW+I6DEqP5Uz USN8eppT8P+YrK4eS57fL8M08LMt8BKd+FEvlTVRF5JML+H27vu8pbWjxQrLV6Fx4ujf cdMp0LE6CJs3UmA/S2PTCfZBVOTqnqVsHCtyqovDst9RQurZw+b7l9sz2vYw/odJzjBS dT5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o23fK/oZowuKe1iL6FRxoiyBomJ6BzAXiRre67QvEJg=; b=hqIBPe6VPywE0TAo+9chE7PuNKxKIEdGZcyI2cyEC/Bwr1UXwiMr7XZoB4MQx7hSJg ROgp1VbKgrCEY5l15mway5h8d1aqLW4iYnPzM0SEDhhKR8HnNK3JckkaJVOjrSpV0QjL b6On/dZzO/C7dA1pR1oiF3RyeoRG9m+8b3liCcA960UMSvULyPAyCqQZ5u+tjHLY23za 5nbJ82oB8PBU3xpedMxkUc9EmNAah4Tzy4TmD5lGu9CaqWTsoHa6ZsWcJ+vsjtgw/rgV oHhqAUNHKp9FBwtRuSDDdjeBeRydgCYOe1rus10xozFf6MTdq7V+odI+AgSnnA/osQ5a JNzw== X-Gm-Message-State: AG10YOQY51mYS6fmYlQjy56u/VMdut1y+sQdY/vJcl30kZST7JOH5PEYgQCtp6TImSiLTA== X-Received: by 10.98.40.200 with SMTP id o191mr2146613pfo.83.1455283973288; Fri, 12 Feb 2016 05:32:53 -0800 (PST) Received: from localhost.localdomain ([182.225.40.2]) by smtp.gmail.com with ESMTPSA id r77sm19643139pfa.47.2016.02.12.05.32.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 05:32:52 -0800 (PST) From: Chanho Park X-Google-Original-From: Chanho Park To: Inki Dae , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Chanho Park , Joonyoung Shim , Seung-Woo Kim Subject: [PATCH 1/2] drm/exynos: add exynos5420 support for fimd Date: Fri, 12 Feb 2016 22:31:39 +0900 Message-Id: <1455283900-6913-2-git-send-email-chanho61.park@samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455283900-6913-1-git-send-email-chanho61.park@samsung.com> References: <1455283900-6913-1-git-send-email-chanho61.park@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a exynos5420 driver data to support mic_bypass option to bypass the mic from display out path. The mic(Mobile image compressor) compresses RGB data from fimd and send the compressed data to the mipi dsi. The bypass option can be founded from system register and the bit is 11. The option bit has been introduced since exynos5420. The only difference between exynos5250 and exynos5420/exynos5422 is existence of the bit. Until the MIC is defined and enabled from device tree, the bypass mic will be default option. Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Signed-off-by: Chanho Park --- .../bindings/display/exynos/samsung-fimd.txt | 3 ++- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 31 +++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/exynos/samsung-fimd.txt b/Documentation/devicetree/bindings/display/exynos/samsung-fimd.txt index 27c3ce0..c7c6b9a 100644 --- a/Documentation/devicetree/bindings/display/exynos/samsung-fimd.txt +++ b/Documentation/devicetree/bindings/display/exynos/samsung-fimd.txt @@ -12,7 +12,8 @@ Required properties: "samsung,exynos3250-fimd"; /* for Exynos3250/3472 SoCs */ "samsung,exynos4210-fimd"; /* for Exynos4 SoCs */ "samsung,exynos4415-fimd"; /* for Exynos4415 SoC */ - "samsung,exynos5250-fimd"; /* for Exynos5 SoCs */ + "samsung,exynos5250-fimd"; /* for Exynos5250 SoCs */ + "samsung,exynos5420-fimd"; /* for Exynos5420/5422/5800 SoCs */ - reg: physical base address and length of the FIMD registers set. diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 70194d0..41c3bb2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -94,12 +94,14 @@ struct fimd_driver_data { unsigned int lcdblk_offset; unsigned int lcdblk_vt_shift; unsigned int lcdblk_bypass_shift; + unsigned int lcdblk_mic_bypass_shift; unsigned int has_shadowcon:1; unsigned int has_clksel:1; unsigned int has_limited_fmt:1; unsigned int has_vidoutcon:1; unsigned int has_vtsel:1; + unsigned int has_mic_bypass:1; }; static struct fimd_driver_data s3c64xx_fimd_driver_data = { @@ -145,6 +147,18 @@ static struct fimd_driver_data exynos5_fimd_driver_data = { .has_vtsel = 1, }; +static struct fimd_driver_data exynos5420_fimd_driver_data = { + .timing_base = 0x20000, + .lcdblk_offset = 0x214, + .lcdblk_vt_shift = 24, + .lcdblk_bypass_shift = 15, + .lcdblk_mic_bypass_shift = 11, + .has_shadowcon = 1, + .has_vidoutcon = 1, + .has_vtsel = 1, + .has_mic_bypass = 1, +}; + struct fimd_context { struct device *dev; struct drm_device *drm_dev; @@ -184,6 +198,8 @@ static const struct of_device_id fimd_driver_dt_match[] = { .data = &exynos4415_fimd_driver_data }, { .compatible = "samsung,exynos5250-fimd", .data = &exynos5_fimd_driver_data }, + { .compatible = "samsung,exynos5420-fimd", + .data = &exynos5420_fimd_driver_data }, {}, }; MODULE_DEVICE_TABLE(of, fimd_driver_dt_match); @@ -461,6 +477,18 @@ static void fimd_commit(struct exynos_drm_crtc *crtc) return; } + /* TODO: When MIC is enabled for display path, the lcdblk_mic_bypass + * bit should be cleared. + */ + if (driver_data->has_mic_bypass && ctx->sysreg && + regmap_update_bits(ctx->sysreg, + driver_data->lcdblk_offset, + 0x1 << driver_data->lcdblk_mic_bypass_shift, + 0x1 << driver_data->lcdblk_mic_bypass_shift)) { + DRM_ERROR("Failed to update sysreg for bypass mic.\n"); + return; + } + /* setup horizontal and vertical display size. */ val = VIDTCON2_LINEVAL(mode->vdisplay - 1) | VIDTCON2_HOZVAL(mode->hdisplay - 1) | @@ -861,7 +889,8 @@ static void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable) * clock. On these SoCs the bootloader may enable it but any * power domain off/on will reset it to disable state. */ - if (ctx->driver_data != &exynos5_fimd_driver_data) + if (ctx->driver_data != &exynos5_fimd_driver_data || + ctx->driver_data != &exynos5420_fimd_driver_data) return; val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;