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: 122612 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1547579qgn; Thu, 21 Dec 2017 15:46:23 -0800 (PST) X-Google-Smtp-Source: ACJfBotDFdThn1dTnCSiZlNlKALr8QddX7XHknsqpcp0Px+zyJiMCa/nvjBqkrZNOj95jiFz9f1Q X-Received: by 10.98.249.67 with SMTP id g3mr12256147pfm.197.1513899983616; Thu, 21 Dec 2017 15:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513899983; cv=none; d=google.com; s=arc-20160816; b=0An9yizSwgribXGFNwtchUdXjE2zAx85sOQXjc3knEYbEhLFyaU4+NJTYdOjdZGwhX HZSPZRxaMV1mcSp6TYqoxufhh4GJoLFcj8wjc4Yo+ExZrP/Zpo+JEHa8Jau7UFEvJKXb GIYfgUJJjwv1TjW9/zD7mP/JckDe/IVv7Y+6mymGSIS6OiUl/nRGAI2sIY2fHng0EQS/ 8TOpNwDzkX3L60Ic4A4mOq9hBJzAXkRHjGzwd/mjLvpKNv87M5vGtec9Befd8cSfkc7E 880Zo0lq0nMKhjK+9wPcPC6h0w40lTtN08lah5MQRXt+7RqbdpCluq3wWSzDpEswkR2t /h7Q== 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:cc:message-id:date:subject:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=s+MEnDGqHS1VyFvjjV5xTeszrQ/zUN0BrsckFHF1wSU=; b=xk/HlwAgTxLMoedXa8RAWOABsJbDl1AsetoZ6tfBHQcFI2UZzH+68NDAwHIwCKE2SK YV46tMU7uKsPm1gtIGaw0+PqIc0aLCGawMzxCxxmMbffl4xn09NhmTCBsjCMf2P4yXIV fID8aH4TkN38uI+gfIjCaGcE9aVyIVXxbd/OccZaFliyvcQvyYmN7Jmr9dbJtfbTe+yL giAsCKy8zYZSVVoVWrSa9eAyw5mm/5TsPkMHo1rQ1nXepxh9I/twxpR0vsw0X0RiLevn qTyZQPygiAdDdExsfYlyVfv3f1qKLKOuDX15J59a7oUl2DB2y2Tce3qMH+mMiBksNdxx /Ftg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jlJ120/0; 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 a91si15682500pla.455.2017.12.21.15.46.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 15:46:23 -0800 (PST) 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=jlJ120/0; 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 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-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" 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