From patchwork Thu Dec 21 23:44:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10128555 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 EE4ED603B5 for ; Thu, 21 Dec 2017 23:46:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE3D629E75 for ; Thu, 21 Dec 2017 23:46:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2ECE29EDB; Thu, 21 Dec 2017 23:46:25 +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 06B3F29E75 for ; Thu, 21 Dec 2017 23:46:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D87696E6A5; Thu, 21 Dec 2017 23:46:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 351426E6A5 for ; Thu, 21 Dec 2017 23:46:20 +0000 (UTC) Received: by mail-lf0-x242.google.com with SMTP id o26so15463022lfc.10 for ; Thu, 21 Dec 2017 15:46:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=dv6t4Zkfd8brob1f3Y2dZlN4TFqp67m2s3E/zNCO7A0=; b=jlJ120/0mnW95yh3ZceURADeNMPy/pXOfuei2oK+c3MgFrL01gnd8PMnJ5Ih6fbs0Z xhXlZRnfgdOcYWm5Ym+RKVqAuZoNxLmS4TTcYn2JSdt67t4k+KpwnEfWrhHwukjWo5iw ggQ7yDLhodBA3jNZdK7DljMzu7elfAv5rKt0k= 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; bh=dv6t4Zkfd8brob1f3Y2dZlN4TFqp67m2s3E/zNCO7A0=; b=mvlG5nzL4ZI0LsXx4Cy72SNqlixZx/x8KjRYANH6a0TKlarbeltwH67RXVRQsxvvCA oAqa5qKTc6dUDsHtEe+EHCTLV+/Gzwh2WRzmwmUiG8IQ4uBMYWpDQ4WsXxwg3+7Zf1M+ ozI5L08TXaxzQaiANFDFozaY+/xt7M0N8FLsb1ezxAVfUjZ9VBk1BSu8WRcI6p8ko6Dw L3yQFJoU+Ha7WnNv6OPT+x7opbCwoDvXriFbaamAIzbJEwi1m46qKYqdhtapFuiU0Hl+ 4UD38aGJMr46ToO8L5auHr/qNKhsrsbWj+rbYga7iEepFsF5T16uhsbtvVFMlarXjh69 GYVQ== X-Gm-Message-State: AKGB3mIONRnNYSw3nAN7spQDG+wuA1UDXFYp6sZUBBYzVcY+gqF84lln VtPm7l98Lhni21AyILKf66KkfQ== X-Google-Smtp-Source: ACJfBotfy71s3S9/iWco+bMvkLILefnzaMk7EzQ//LZOnQ64xWvUilL0KN+xDXCJVEvlUIHoWFaXOw== X-Received: by 10.25.37.205 with SMTP id l196mr7395744lfl.81.1513899976817; Thu, 21 Dec 2017 15:46:16 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id h26sm4525649lfb.27.2017.12.21.15.46.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Dec 2017 15:46:15 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2 v3] drm/panel: Add Ilitek ILI9322 driver Date: Fri, 22 Dec 2017 00:44:11 +0100 Message-Id: <20171221234411.12156-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 Cc: Ben Dooks , David Lechner , Stefano Babic 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. Cc: David Lechner Cc: Stefano Babic Cc: Ben Dooks Acked-by: Thierry Reding Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Fix minor checkpatch fallouts. - Collect Thierry's ACK. ChangeLog v1->v2: - Dropped all DT parsing code in favor of open-coding the display config on a per-system basis based on system-specific compatible strings, after feedback from the DT maintainers. - Define a set of configs for the D-Link DIR-685 router. - Tested on the D-Link DIR-685. --- drivers/gpu/drm/panel/Kconfig | 8 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 962 +++++++++++++++++++++++++++ 3 files changed, 971 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 726f3fb3312d..6ba4031f3919 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 2c4e1a93e05f..6d251ebc568c 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 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..b4ec0ecff807 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -0,0 +1,962 @@ +/* + * 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 + +#include