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: 120353 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1342416qgn; Fri, 1 Dec 2017 08:19:15 -0800 (PST) X-Google-Smtp-Source: AGs4zMYAmpM0ct3JXCeL43jZJfDm24mES5SfQpxtnl1OeZxyOzyZ/j2lpQiMbtLnj4tK4NIqvmuu X-Received: by 10.84.179.165 with SMTP id b34mr6643850plc.372.1512145155575; Fri, 01 Dec 2017 08:19:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512145155; cv=none; d=google.com; s=arc-20160816; b=kiqwO8W2QpDC4MhcaIxRE0gBelP6oaSl898vIsIGm151IgDJw5qU1ys4viw0o75ElX KG0T2Lox8UmuKrVMtnxx6z+1VXBtrnC5hq2Gdvz5bGxG5z0kDEfiOpf+nwOLR+1s5lE7 2X6XBGIsDJvahxBKSrCq6MSPSl6jWeNqqdqRipjTKtGFokS9OcSFCMAj5ot1DH5uu367 vxCzz2HphHhi7iwM5kGaHm0+j2Q86Z0j6AOLBxwdgj20o5wt+NjvJ+aBVLvO5WiaWHcU OPc0CZKxaXF3T1A9Hguxoc9J9OfxcAZhqhl31PT0cWdvYu9yZEcH6lZThQyqee+5CzEl 0+MA== 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:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=wNnfsbhFcQ/dAslHKGh+AWOXY4mpTZ3bI5Qb1G0S9jE=; b=t7WUh8SlqAVjPWhz7cjxI6/pDdfxn9X2CjuhUOyAMNDuoyohatw75GIwOwWz5nnToK /kiPAoHRWMYIGU793cOeHqMX4pS4xzmDgV6UVaCZYqLGPJdPIugULYCghMZ4xvs3Yu0Z doLUGneRkxICqUv+575Q+GqzYpocwnV/UJvE/6WWN8sFSQywHmg4blpX8RTCcw22bCPV mdTwMRpds7rYp0hwUboH9ot2DRTB/f48HkH1/+pWFdmLt1VE2VuKU4oWX8WVnrwpBNFe Hx4mk6B/K1puoyUY33Kp9JrY5/dp6XfXcNKwt/9HK7AkgEAZB2pTc0YPw2mTXc0TXydK wndA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=C2fETSOB; 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 a74si5398035pfe.391.2017.12.01.08.19.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 08:19:15 -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=C2fETSOB; 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 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-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" 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