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: 9897739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A1BC603F2 for ; Sun, 13 Aug 2017 11:45:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B554286CC for ; Sun, 13 Aug 2017 11:45:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FDCE286DD; Sun, 13 Aug 2017 11:45:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D66AA286CC for ; Sun, 13 Aug 2017 11:45:05 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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