From patchwork Fri Dec 1 16:16:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10087399 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 5899760327 for ; Fri, 1 Dec 2017 16:19:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4687429682 for ; Fri, 1 Dec 2017 16:19:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39A312A58B; Fri, 1 Dec 2017 16:19:17 +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 805C429682 for ; Fri, 1 Dec 2017 16:19:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C7FD76ED8E; Fri, 1 Dec 2017 16:19:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21F6C6ED8D for ; Fri, 1 Dec 2017 16:19:12 +0000 (UTC) Received: by mail-lf0-x241.google.com with SMTP id t197so12294352lfe.7 for ; Fri, 01 Dec 2017 08:19:12 -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:in-reply-to:references; bh=MFkw01zQEX7JlgLSx7aW5e5lKNxgW9RHnPfXmiU6Qgc=; b=C2fETSOBR1seDWYtpAQRbqHvWHiM2YhVLGYXf1PftsSVKh3Db+4zhoLrA+gs4Lawm/ hrdqrLIIjPYbZrHQSrc6nrg4LZWQOjVarx3iuMoZ/J4wpc8bWOKX3ZJ2Dnd/NWCbRcBA QDhVmY3D58+tYYFOirobkwso2I72NF7RMuBUo= 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=MFkw01zQEX7JlgLSx7aW5e5lKNxgW9RHnPfXmiU6Qgc=; b=bFSsR0YSM3KLEF5wFuD5JeNUvXLJujGeqeGHEwa5mYXW5r1MCWWD5S2yAUwwbZMWF3 BZT6TDAAa0Mr/uXTMPKdJLCzkudgGyFjfuXvPLCLaUp2o48W7LpryH8ez7xt/2ZXP2Ym D5pKxHoW8SAcXPmAqyOI0PZE+Pxh1p1Da66xvEdo6VJ8ngYimmeS4H2Zj/iCf4mDSLR2 0/rhSg2ehuZHuOZIH61tJ+m1tGVzPdVQJt+lYZMHmjjeRhLdCBkdiRQ8e0MjKeXb6KFa RA0LhcBdRZyCDFTmmZkkPop1IzOWnqKJ0/b/rxx0hC8/uOneH0uLvv1rOvHeq6KeHuJ9 cayw== X-Gm-Message-State: AJaThX5VUcyyqglOc0YM42QeO46BX1CSHySShLZcD7t199JPazU2KVzk dvtA0kX9j58OrXEpPxNnzJX66g== X-Google-Smtp-Source: AGs4zMbCVqJk+nxssiKchYIf+94zH8DQoVuWahMvpvSv2q6pjFtXjtFAYeeNxUGfW4a+dvifm+AvIA== X-Received: by 10.25.37.82 with SMTP id l79mr4346459lfl.81.1512145151229; Fri, 01 Dec 2017 08:19:11 -0800 (PST) Received: from localhost.localdomain (c-567171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.86]) by smtp.gmail.com with ESMTPSA id t16sm1374814lje.81.2017.12.01.08.19.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Dec 2017 08:19:09 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/panel: Add Ilitek ILI9322 driver Date: Fri, 1 Dec 2017 17:16:58 +0100 Message-Id: <20171201161659.9588-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171201161659.9588-1-linus.walleij@linaro.org> References: <20171201161659.9588-1-linus.walleij@linaro.org> 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 Signed-off-by: Linus Walleij Acked-by: Thierry Reding --- 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..e494de73b759 --- /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