From: Andrzej Hajda Subject: [RFC PATCH v3] mipi-dsi-bus: add MIPI DSI bus support Date: Wed, 04 Dec 2013 16:35:12 +0100 Message-ID: <1386171312-8173-1-git-send-email-a.hajda@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTP id 462CDFAE9F for ; Wed, 4 Dec 2013 07:35:32 -0800 (PST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) 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 <0MXA004TQGN627A0@mailout2.w1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 04 Dec 2013 15:35:30 +0000 (GMT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: Thierry Reding Cc: Andrzej Hajda , tomi.valkeinen@ti.com, Kyungmin Park , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org MIPI DSI bus allows to model DSI hosts and DSI devices using Linux bus. DSI host should be registered by DSI master driver. During registration DSI devices will be created according to Device Tree sub-nodes, registration based on board info will be added later. DSI host exposes operations which can be used by slave drivers to access associated devices. Signed-off-by: Andrzej Hajda Signed-off-by: Kyungmin Park --- Hi Thierry, This is the 3rd version of MIPI DSI bus patch. Most of changes comes from Thierry comments. The main difference is complete change of 'philosophy' behind it. In previous version DSI host could be standalone driver without DRM dependency. In the current version it should be DRM device. This change breaks my drivers so I cannot test this version of patch on live system yet. There are few things which still bother me: - DSI mode flags - some of them seems to be too specific for my HW, - other DSI parameters, probably there should be more, like max clock, supported pixel modes,.... Regards Andrzej drivers/gpu/drm/Kconfig | 3 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_mipi_dsi.c | 316 +++++++++++++++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 155 ++++++++++++++++++++ 4 files changed, 475 insertions(+) create mode 100644 drivers/gpu/drm/drm_mipi_dsi.c create mode 100644 include/drm/drm_mipi_dsi.h diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index f864275..30fb2ad 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -20,6 +20,9 @@ menuconfig DRM details. You should also select and configure AGP (/dev/agpgart) support if it is available for your platform. +config DRM_MIPI_DSI + bool + config DRM_USB tristate depends on DRM diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index cc08b84..6266c6c 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -31,6 +31,7 @@ obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o CFLAGS_drm_trace_points.o := -I$(src) obj-$(CONFIG_DRM) += drm.o +obj-$(CONFIG_DRM_MIPI_DSI) += mipi_dsi.o obj-$(CONFIG_DRM_USB) += drm_usb.o obj-$(CONFIG_DRM_TTM) += ttm/ obj-$(CONFIG_DRM_TDFX) += tdfx/ diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c new file mode 100644 index 0000000..047e632 --- /dev/null +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -0,0 +1,316 @@ +/* + * MIPI DSI Bus + * + * Copyright (C) 2012-2013, Samsung Electronics, Co., Ltd. + * Andrzej Hajda + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include + +#include +#include +#include +#include +#include + +#include