From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06883C433F2 for ; Mon, 27 Jul 2020 16:47:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF2E620729 for ; Mon, 27 Jul 2020 16:47:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="LjEpgC7g" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729220AbgG0QrK (ORCPT ); Mon, 27 Jul 2020 12:47:10 -0400 Received: from crapouillou.net ([89.234.176.41]:37608 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbgG0QrJ (ORCPT ); Mon, 27 Jul 2020 12:47:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1595868397; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6ryDwEkQRN+TJxPrIQJ6Um9RQUjozFx4dCB8bKes0yY=; b=LjEpgC7gMVEY4A2C9Ha1j48xQsXl0kPHBkkh1OVILM3nGRA/uFNsD8OBj1uj/b541W5cft BUw7MF98NmyvWJcSDabKdBNNijYl7M0x0pB1ic3utKHJSQm0eIcQ9QcPL33vm17ibLvYM1 LERoYmKnwnKMdzYhZ/zssNMn7T3yi3A= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Cc: od@zcrc.me, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 5/6] drm/tiny: Add TinyDRM for DSI/DBI panels Date: Mon, 27 Jul 2020 18:46:12 +0200 Message-Id: <20200727164613.19744-6-paul@crapouillou.net> In-Reply-To: <20200727164613.19744-1-paul@crapouillou.net> References: <20200727164613.19744-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new API function mipi_dsi_maybe_register_tiny_driver() is supposed to be called by DSI/DBI panel drivers at the end of their probe. If it is detected that the panel is not connected to any controller, because it has no port #0 node in Device Tree that points back to it, then a TinyDRM driver is registered with it. This TinyDRM driver expects that a DCS-compliant protocol is used by the DSI/DBI panel and can only be used with these. Signed-off-by: Paul Cercueil --- drivers/gpu/drm/tiny/Kconfig | 8 + drivers/gpu/drm/tiny/Makefile | 1 + drivers/gpu/drm/tiny/tiny-dsi.c | 266 ++++++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 19 +++ 4 files changed, 294 insertions(+) create mode 100644 drivers/gpu/drm/tiny/tiny-dsi.c diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig index 2b6414f0fa75..b62427b88dfe 100644 --- a/drivers/gpu/drm/tiny/Kconfig +++ b/drivers/gpu/drm/tiny/Kconfig @@ -28,6 +28,14 @@ config DRM_GM12U320 This is a KMS driver for projectors which use the GM12U320 chipset for video transfer over USB2/3, such as the Acer C120 mini projector. +config TINYDRM_DSI + tristate "DRM support for generic DBI/DSI display panels" + depends on DRM && DRM_MIPI_DSI + select DRM_MIPI_DBI + select DRM_KMS_CMA_HELPER + help + DRM driver for generic DBI/DSI display panels + config TINYDRM_HX8357D tristate "DRM support for HX8357D display panels" depends on DRM && SPI diff --git a/drivers/gpu/drm/tiny/Makefile b/drivers/gpu/drm/tiny/Makefile index 6ae4e9e5a35f..2bfee13347a5 100644 --- a/drivers/gpu/drm/tiny/Makefile +++ b/drivers/gpu/drm/tiny/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus.o obj-$(CONFIG_DRM_GM12U320) += gm12u320.o +obj-$(CONFIG_TINYDRM_DSI) += tiny-dsi.o obj-$(CONFIG_TINYDRM_HX8357D) += hx8357d.o obj-$(CONFIG_TINYDRM_ILI9225) += ili9225.o obj-$(CONFIG_TINYDRM_ILI9341) += ili9341.o diff --git a/drivers/gpu/drm/tiny/tiny-dsi.c b/drivers/gpu/drm/tiny/tiny-dsi.c new file mode 100644 index 000000000000..b24d49836125 --- /dev/null +++ b/drivers/gpu/drm/tiny/tiny-dsi.c @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * TinyDRM driver for standard DSI/DBI panels + * + * Copyright 2020 Paul Cercueil + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include