From patchwork Fri Mar 28 11:52:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 3902671 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE4789F334 for ; Fri, 28 Mar 2014 11:53:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AF0B202EC for ; Fri, 28 Mar 2014 11:53:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DFCD2028D for ; Fri, 28 Mar 2014 11:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbaC1Lxf (ORCPT ); Fri, 28 Mar 2014 07:53:35 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:56958 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbaC1Lxc (ORCPT ); Fri, 28 Mar 2014 07:53:32 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N35003KRACZI3A0@mailout2.w1.samsung.com>; Fri, 28 Mar 2014 11:53:23 +0000 (GMT) X-AuditID: cbfec7f4-b7f796d000005a13-b6-533562bafe3e Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 11.39.23059.AB265335; Fri, 28 Mar 2014 11:53:30 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3500JZBACMH5A0@eusync4.samsung.com>; Fri, 28 Mar 2014 11:53:30 +0000 (GMT) From: Andrzej Hajda To: dri-devel@lists.freedesktop.org Cc: Andrzej Hajda , Mark Rutland , devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Pawel Moll , Ian Campbell , Kyungmin Park , Rob Herring , Kumar Gala , Grant Likely , Sean Paul , Inki Dae , Marek Szyprowski Subject: [PATCH v3 05/12] drm/exynos: add DSIM driver Date: Fri, 28 Mar 2014 12:52:40 +0100 Message-id: <1396007567-4015-6-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.8.3.2 In-reply-to: <1396007567-4015-1-git-send-email-a.hajda@samsung.com> References: <1396007567-4015-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHLMWRmVeSWpSXmKPExsVy+t/xa7q7kkyDDb4tkLa4te4cq8X8I0Di ytf3bBb9bxayWhz4s4PR4tyrlYwWk+5PYLE42/SG3WLG+X1MFmuP3GW3WHr9IpPFhOlrWSxa 9x5ht7i74SyjA5/HmnlrGD1mN1xk8bjc18vksXL5FzaPTas62TzuXNvD5nG/+ziTR9+WVYwe nzfJBXBGcdmkpOZklqUW6dslcGW86rjOVnDzIVPFzWb7BsZNC5m6GDk5JARMJBr7t7JA2GIS F+6tZ+ti5OIQEljKKPFoxi5WCKePSeL/ivtgVWwCmhJ/N99kA7FFBJQl/k5cxQhSxCzwnlli 75XJQA4Hh7CAqcS/1b4gNSwCqhIL95xjBbF5BZwkOl+cZYfYpiCx7MtaZhCbU8BZYtXbiWAz hYBq7jxvZJ7AyLuAkWEVo2hqaXJBcVJ6rqFecWJucWleul5yfu4mRkgYf9nBuPiY1SFGAQ5G JR7eGVYmwUKsiWXFlbmHGCU4mJVEeJfYmgYL8aYkVlalFuXHF5XmpBYfYmTi4JRqYLQ46FFa cjHr0+TsGqPy+CCNd5v2v/r6NDg2/sQ708cXL/wXSOLmW25Yf9Vyg+cLq/dM5iecTmhre/VN mDMr+VzJLfdaz+fsxT2Ji8x14wtWv/cx2vA5VunDnRJ1z0d33bi/1zBxZh4Oil5wx2Y6h7nG +n1F57QlBO1ZVqmfSs4ojhfY6HB2rRJLcUaioRZzUXEiAC3NSfhBAgAA 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=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The patch adds driver for Exynos DSI master (DSIM). It is a platform driver which is registered as exynos_drm_display sub-driver of exynos_drm framework and implements DRM encoder/connector pair. It is also MIPI-DSI host driver and provides DSI bus for panels. It interacts with its panel(s) using drm_panel framework. Signed-off-by: Andrzej Hajda --- v2: - add support for DSI message flags, - add support for new DT properties, - remove brightness DRM property, - corrected PM handlers, - minor fixes/improvements v3: - panel attach/detach moved to connector detect callback, - improved error handling, - removed exynos_drm_initialize callback, - added video interface handling, - moved dsi clock properties to dsi endpoint --- drivers/gpu/drm/exynos/Kconfig | 9 + drivers/gpu/drm/exynos/Makefile | 1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1525 +++++++++++++++++++++++++++++++ 5 files changed, 1551 insertions(+) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_dsi.c diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 56f9581..5bf5bca 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -39,6 +39,15 @@ config DRM_EXYNOS_DPI help This enables support for Exynos parallel output. +config DRM_EXYNOS_DSI + bool "EXYNOS DRM MIPI-DSI driver support" + depends on DRM_EXYNOS + select DRM_MIPI_DSI + select DRM_PANEL + default n + help + This enables support for Exynos MIPI-DSI device. + config DRM_EXYNOS_DP bool "EXYNOS DRM DP driver support" depends on DRM_EXYNOS && ARCH_EXYNOS diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index babcd52..33ae365 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -12,6 +12,7 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS_DPI) += exynos_drm_dpi.o +exynosdrm-$(CONFIG_DRM_EXYNOS_DSI) += exynos_drm_dsi.o exynosdrm-$(CONFIG_DRM_EXYNOS_DP) += exynos_dp_core.o exynos_dp_reg.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 771c87e..2d27ba2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -450,6 +450,12 @@ static int __init exynos_drm_init(void) goto out_dp; #endif +#ifdef CONFIG_DRM_EXYNOS_DSI + ret = platform_driver_register(&dsi_driver); + if (ret < 0) + goto out_dsi; +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMD ret = platform_driver_register(&fimd_driver); if (ret < 0) @@ -566,6 +572,11 @@ out_hdmi: out_fimd: #endif +#ifdef CONFIG_DRM_EXYNOS_DSI + platform_driver_unregister(&dsi_driver); +out_dsi: +#endif + #ifdef CONFIG_DRM_EXYNOS_DP platform_driver_unregister(&dp_driver); out_dp: @@ -613,6 +624,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(&fimd_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_DSI + platform_driver_unregister(&dsi_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_DP platform_driver_unregister(&dp_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 2d892f3..4c5cf68 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -370,6 +370,7 @@ static inline int exynos_dpi_remove(struct device *dev) { return 0; } #endif extern struct platform_driver dp_driver; +extern struct platform_driver dsi_driver; extern struct platform_driver fimd_driver; extern struct platform_driver hdmi_driver; extern struct platform_driver mixer_driver; diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c new file mode 100644 index 0000000..697228e --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -0,0 +1,1525 @@ +/* + * Samsung SoC MIPI DSI Master driver. + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd + * + * Contacts: Tomasz Figa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include