From patchwork Fri Jun 12 12:59:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 6598441 Return-Path: X-Original-To: patchwork-dri-devel@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 8A0FDC0433 for ; Fri, 12 Jun 2015 12:59:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 979372067A for ; Fri, 12 Jun 2015 12:59:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9D83E20687 for ; Fri, 12 Jun 2015 12:59:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8F7E7A0DA; Fri, 12 Jun 2015 05:59:33 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id D42886EAAD for ; Fri, 12 Jun 2015 05:59:30 -0700 (PDT) MIME-version: 1.0 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NPU02C791EVB130@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 12 Jun 2015 21:59:19 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.112]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id C7.00.20564.0B7DA755; Fri, 12 Jun 2015 21:59:28 +0900 (KST) X-AuditID: cbfee690-f796f6d000005054-f2-557ad7b07cfe Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 47.15.05312.0B7DA755; Fri, 12 Jun 2015 21:59:28 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NPU002KS1F1AP00@mmp2.samsung.com>; Fri, 12 Jun 2015 21:59:28 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH 1/3] drm/panel: add s6e63j0x03 LCD panel driver Date: Fri, 12 Jun 2015 21:59:14 +0900 Message-id: <1434113958-15877-20-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1434113958-15877-1-git-send-email-human.hwang@samsung.com> References: <1434113958-15877-1-git-send-email-human.hwang@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsWyRsSkQHfD9apQg0mbDCyutE5ntZh/5Byr xZWv79ksls7oY7WYdH8Ci8WLexdZLGZMfsnmwO7x4us2Zo/73ceZPPq2rGL0+LxJLoAlissm JTUnsyy1SN8ugStj0q5lrAUtChXn1zo2MLZIdzFycEgImEg83GTXxcgJZIpJXLi3nq2LkYtD SGApo8T3RXfYIRImEi+eLWaBSExnlFi26ycbSIJXQFDix+R7LCCDmAXkJY5cygYJMwuoS0ya t4gZxBYS+MEocfhpNIjNJqAnseDaD7CZIgL2Eou/nmIFmcks0M0osfL8U7CEMFBi5p0GsPks AqoSi05NZofY5SHxa8lnFoiD5CROHpvMCmJzAsXvHrzFArHMXeL//UPsIEMlBI6xS2y7chJq kIDEt8mHWCA+lpXYdIAZYo6kxMEVN1gmMIrNQvLOLIR3ZiF5ZwEj8ypG0dSC5ILipPQiE73i xNzi0rx0veT83E2MwDg7/e/ZhB2M9w5YH2IU4GBU4uHl0KgKFWJNLCuuzD3EaAp0xERmKdHk fGA055XEGxqbGVmYmpga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/+n+PYeNO1OeZ5x46oWCmXoLm7agR8e2/tv7t784vJkjUbPwXnaPavlnkw 6+JE8UUP/7qd1V6oxFKckWioxVxUnAgAWcIklPkCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: sw0312.kim@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 From: Inki Dae This patch adds MIPI-DSI based S6E63J0X03 AMOLED LCD panel driver which uses mipi_dsi bus to communicate with panel. The panel has 320×320 resolution in 1.63-inch physical panel. This panel is used in Samsung Galaxy Gear 2. Signed-off-by: Inki Dae Signed-off-by: Hyungwon Hwang Acked-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 31 +++++++++++++++++++------------ drivers/gpu/drm/panel/Kconfig | 6 ++++++ drivers/gpu/drm/panel/Makefile | 1 + 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 5576cc3..6cb4887 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -743,6 +743,14 @@ static void exynos_dsi_disable_clock(struct exynos_dsi *dsi) DSI_WRITE(dsi, DSIM_PLLCTRL_REG, reg); } +static void exynos_dsi_enable_lane(struct exynos_dsi *dsi, u32 lane) +{ + u32 reg = DSI_READ(dsi, DSIM_CONFIG_REG); + reg |= (DSIM_NUM_OF_DATA_LANE(dsi->lanes - 1) | DSIM_LANE_EN_CLK | + DSIM_LANE_EN(lane)); + DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); +} + static int exynos_dsi_init_link(struct exynos_dsi *dsi) { struct exynos_dsi_driver_data *driver_data = dsi->driver_data; @@ -815,17 +823,6 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) return -EINVAL; } - reg |= DSIM_NUM_OF_DATA_LANE(dsi->lanes - 1); - - DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); - - reg |= DSIM_LANE_EN_CLK; - DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); - - lanes_mask = BIT(dsi->lanes) - 1; - reg |= DSIM_LANE_EN(lanes_mask); - DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); - /* * Use non-continuous clock mode if the periparal wants and * host controller supports @@ -837,8 +834,11 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) if (driver_data->has_clklane_stop && dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) { reg |= DSIM_CLKLANE_STOP; - DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); } + DSI_WRITE(dsi, DSIM_CONFIG_REG, reg); + + lanes_mask = BIT(dsi->lanes) - 1; + exynos_dsi_enable_lane(dsi, lanes_mask); /* Check clock and data lane state are stop state */ timeout = 100; @@ -1301,6 +1301,10 @@ static int exynos_dsi_init(struct exynos_dsi *dsi) exynos_dsi_reset(dsi); exynos_dsi_enable_irq(dsi); + + if (driver_data->values[RESET_TYPE] == DSIM_FUNCRST) + exynos_dsi_enable_lane(dsi, BIT(dsi->lanes) - 1); + exynos_dsi_enable_clock(dsi); if (driver_data->wait_for_reset) exynos_dsi_wait_for_reset(dsi); @@ -1893,6 +1897,9 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->clks = devm_kzalloc(dev, sizeof(*dsi->clks) * dsi->driver_data->num_clks, GFP_KERNEL); + if (!dsi->clks) + goto err_del_component; + for (i = 0; i < dsi->driver_data->num_clks; i++) { dsi->clks[i] = devm_clk_get(dev, clk_names[i]); if (IS_ERR(dsi->clks[i])) { diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 6d64c7b..cb07bc6 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -43,4 +43,10 @@ config DRM_PANEL_SHARP_LQ101R1SX01 To compile this driver as a module, choose M here: the module will be called panel-sharp-lq101r1sx01. +config DRM_PANEL_S6E63J0X03 + tristate "S6E63J0X03 DSI video mode panel" + depends on OF + select DRM_MIPI_DSI + select VIDEOMODE_HELPERS + endmenu diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 4b2a043..27b0a90 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o +obj-$(CONFIG_DRM_PANEL_S6E63J0X03) += panel-s6e63j0x03.o