From patchwork Sun Aug 13 11:44:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109952 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp3125959qge; Sun, 13 Aug 2017 04:45:36 -0700 (PDT) X-Received: by 10.84.212.144 with SMTP id e16mr24488252pli.115.1502624735921; Sun, 13 Aug 2017 04:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502624735; cv=none; d=google.com; s=arc-20160816; b=jo7r0X4/begc0oQUeHc5rInFs4l9npTa0kYMftB1mN9FEaoDirQ/cJUoN8urPoCfE0 IKsVEF6BMGZc3pdik5tmUggWnRuKRmauLBFq63RRFrjBDNNi1uK2jcBQvC+TPU5wyTXM 3YLK3TtIv1bRVsW86qdphtfI2WwUygYvp5RmZs7lWRrY/uTp44MO8lVULjF+Oqot7K2+ 51m/B56knjwKXYm/MaocwArafOCBuV5LfN69DnGmsBGm/gzLrvbMY+9zj51jbpOKNPqq Vb4J5+nHPmVjW1YDus5ULCvu9MQR/Oz42c/JRlY6vtJXSSDS4dj4AiCXKJ2/ZpR9yWT/ YZ6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=EtqC3T3lXl2TX6NPqwCDsN+ygHijxyJE0itYr0JGk/A=; b=A1y2aQegm8WJX5n7QjplC+TszgADvyL5rbPL8nCQIH8ot+/3edn4tOlQsdXxKu0MpK E7C+keB+BMcY07mM+9R0AMzGA8rY3sQ6IHDHwpbr3p1mqe49Km9LTiiQaAefSEmlvifG Q/HtOb0G95k65y32ItCbh5cWKMj7Ri9UTFjSU+WlTc62Ja4y/r0MkDwWuZkInOujVYfs Jst2YvzMadnqM8KbfLm7ixSZ+xjm2XaIAvwI3twfaKzS1toh4dYWf5SQuah/9TU23vxd ycr1b5WqiDMCO49rtsgLrfUthyUTFPVlUm6rMhiastA7PUOix29TXFEBdu9A6K1dgBH+ 74nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RGKJUj6Q; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id e5si2894467pfg.282.2017.08.13.04.45.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Aug 2017 04:45:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RGKJUj6Q; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08E876E05D; Sun, 13 Aug 2017 11:45:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBE436E05D for ; Sun, 13 Aug 2017 11:45:03 +0000 (UTC) Received: by mail-lf0-x233.google.com with SMTP id g25so30493718lfh.1 for ; Sun, 13 Aug 2017 04:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q37g9dD4BBPWSQTJMGvOK/rQ6bCQtQAIGgKJh7+2tnU=; b=RGKJUj6Qof7asebcGQAZgvSUmylRoiolQS9sdkls6kiORw3JvFp5ZMRM0VOjEXvsOf B0aUSiCeLTBlQK3ZafZxweKncWMHeAyw+4exglzodcXJWHMbstfkR5B0R4QtFEmx6oeF xrqhOvAhwI2DRlg2Xar2xZRW/DlJ3OBX29yWc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q37g9dD4BBPWSQTJMGvOK/rQ6bCQtQAIGgKJh7+2tnU=; b=oZ+4yl2OPBdH2aLnswPpywIIiDNDOmLRTFMSS+BMkWYRAktQfCoQJ/jsrGjsT4sBm1 4bCu76aTlDN4uRsukUrW9EYH5R9jHs5FvNmi+AOFlExobCGlHw3qKRHg7+O5C9f4KNsc LqlJO5HNnJOUFwcx1UUyInPU1TsRIcjtOVfowe9MLa39u3qHbxCAcwptW2wHl94kOdKO YbPr//AtFwbFHmiy4eR2PgyO/DGteg66N76RYBS1Ef51841SKmc6LBaB3xxQXBIqez3W h0BNwKZ0linQGNu5vGQFeKghBghj3NPWXibB3X+UgqxNXe5LSocJkXHvedfCyElJi6pi rSVw== X-Gm-Message-State: AHYfb5g0gjYGir1MvVZQ3REi5Bc3eGXZUyEhV3ashbWhvhSNoVIwgl1N dO1TrKcBDroaH3sVNTPWcA== X-Received: by 10.25.16.168 with SMTP id 40mr7486974lfq.147.1502624701752; Sun, 13 Aug 2017 04:45:01 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id 1sm749759lju.63.2017.08.13.04.44.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Aug 2017 04:45:00 -0700 (PDT) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/panel: Add Ilitek ILI9322 driver Date: Sun, 13 Aug 2017 13:44:48 +0200 Message-Id: <20170813114448.20179-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170813114448.20179-1-linus.walleij@linaro.org> References: <20170813114448.20179-1-linus.walleij@linaro.org> 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This adds support for the Ilitek ILI9322 QVGA (320x240) TFT panel driver. This panel driver supports serial or parallel RGB or YUV input and also ITU-T BT.656 input streams. The controller is combined with a physical panel and configured through the device tree. Signed-off-by: Linus Walleij --- drivers/gpu/drm/panel/Kconfig | 8 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 936 +++++++++++++++++++++++++++ 3 files changed, 945 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9322.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index d84a031fae24..0159747c59fc 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -28,6 +28,14 @@ config DRM_PANEL_SIMPLE that it can be automatically turned off when the panel goes into a low power state. +config DRM_PANEL_ILITEK_IL9322 + tristate "Ilitek ILI9322 320x240 QVGA panels" + depends on OF && SPI + select REGMAP + help + Say Y here if you want to enable support for Ilitek IL9322 + QVGA (320x240) RGB, YUV and ITU-T BT.656 panels. + config DRM_PANEL_INNOLUX_P079ZCA tristate "Innolux P079ZCA panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 9f6610d08b00..76f722aaa6ac 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o +obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c new file mode 100644 index 000000000000..7eed6814184e --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -0,0 +1,936 @@ +/* + * Ilitek ILI9322 TFT LCD drm_panel driver. + * + * This panel can be configured to support: + * - 8-bit serial RGB interface + * - 24-bit parallel RGB interface + * - 8-bit ITU-R BT.601 interface + * - 8-bit ITU-R BT.656 interface + * - Up to 320RGBx240 dots resolution TFT LCD displays + * - Scaling, brightness and contrast + * + * The scaling means that the display accepts a 640x480 or 720x480 + * input and rescales it to fit to the 320x240 display. So what we + * present to the system is something else than what comes out on the + * actual display. + * + * Copyright (C) 2017 Linus Walleij + * Derived from drivers/drm/gpu/panel/panel-samsung-ld9040.c + * + * 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