From patchwork Mon Feb 5 19:20:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 126924 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2252597ljc; Mon, 5 Feb 2018 11:31:41 -0800 (PST) X-Google-Smtp-Source: AH8x227pV1nrK29Bu1NPbuYA+zGZDBrL/PxnVqPf9BqQqorOsC+9MZ1NI+GxDbUKT7m7W3kt9/0c X-Received: by 10.101.80.202 with SMTP id s10mr9175995pgp.226.1517859101548; Mon, 05 Feb 2018 11:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517859101; cv=none; d=google.com; s=arc-20160816; b=YcjBgpczMU2hkY/clgE1Y16cc4M1YDeB7KLSwNJabFsUYMhgjAJ3u/FUSh6hFiKP/9 wgLOU3Ndf7rvJQ1VRJVVGaEAwdETxYmSz92blxSPsm44f9TWYEZn6qzt1/lJGKS/helO mrX6O6qqZ5yBqFvJEWrvG8MmpW5xIUwOmzvDQRPKO0PYwqsHMJMzZzNcURoN2gl9dmBq uQx2e1FzmFXcNmOtgl4md7FpBOC73pD+UyLmZKPpX8YN4T0LPpdeu98mAzPxDa1E6EDS M8UJ6lqPvv1D+VvZB9l811JsY4bpAkl4cYjBHe1ZlqC8nZJwmszXtgjnOXpwOf4yLufA hivg== 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:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=gZgEYaqSPs+Nl8RtEAPrmg4ZOSx58aT1zPksfwA2GvY=; b=zO5x6HmM+/FOhAh5CRtgF+P9atVzZt4H581Fsh7DqipZXczKGUvH8b40qnLnHqoG/h kXHytcDZj5xCvgccIJkO97l+0B+9lG64Qgu12ja19fzDG7Rag2aSawJd+oa5MupDGbhe I8DKnrpHW1T0uHYYccz1YYjr4ffF5Rp2CI4+/HmF3FJRKOqR5aFBz1IqsPbcWa9Z6I+y C1wAqZMyq200tzplFfj060n62mUf0K4U6IhTuFCuh3FsebdJ9otYQz5gRgjUpoWbHTVp DFAeDrMTl++dbe0jN3uQmNtEUKDkTIaHdKqDU3B6WV8/K46b30Ukbyv2nY91r9R9NK7C 95nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=J/J4HneG; 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 f71si4184954pgc.477.2018.02.05.11.31.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Feb 2018 11:31:41 -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=J/J4HneG; 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 D0CEC6E245; Mon, 5 Feb 2018 19:31:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 282316E230 for ; Mon, 5 Feb 2018 19:31:07 +0000 (UTC) Received: by mail-lf0-x235.google.com with SMTP id k19so43425579lfj.1 for ; Mon, 05 Feb 2018 11:31:07 -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=xe/DH6J5Uma4kQt21eLSiwrPfbvJ52sBga6VHXe9wdI=; b=J/J4HneGwzrcXjEreNHZbm0Na2BrcfYdhqxonILz2g5YMLSK5/R62xCh3C8aNrXX9T nYFFBcXVKTyCfU+VPFjhQpLxemlgl7A5H08MwOOQG80NdZRXH6/4zkzwobt7lt4iDp78 6tV8+O9eXLz85pN2A/O0m2LEdIroXeBFGKiTw= 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=xe/DH6J5Uma4kQt21eLSiwrPfbvJ52sBga6VHXe9wdI=; b=CkD033AUR+yUBBJbJWSb4p9AXQ28LOh1wgQU/YOvWFEHGFcR4NcLENoEInX1C0iIgI gWmf2zbYrlm4ZAHiI6tY71fg0qbQiDvSxL5NwTsy+bRKY5BLG3qy1Uw1loskR0yHoPLs xVL4cSkWBpJSQuBNAqlymWn23JHFWM0/u8RUUwv2txPpsjNtEwEyWgIWi8x5SvExXiGc 1Vjm+8cqsmFBQrNFzFnCMpLYBkQkVhwxdrCUbpoABv7WsbQ+7NIBABAyvtD4AQCbUem8 XXPsW3tSwk5jadSn9jcZiwPOdGNyH35t2ZU7oAECvxTAJuK3b3dBZkA2WM9rn72+1y95 8fpg== X-Gm-Message-State: APf1xPDsmrJ2ii3Ow4KGtgGjH6mfjrWmCFhouUR6RQbAqzdXrWH6nvMw 87wLLeSHkpeCesJLgOGZZV+Jmye+T5c= X-Received: by 10.25.31.200 with SMTP id f191mr8431407lff.68.1517859065370; Mon, 05 Feb 2018 11:31:05 -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 e21sm1958820lfb.51.2018.02.05.11.31.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Feb 2018 11:31:04 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2 v2] drm/panel: Add support for ARM Versatile panels Date: Mon, 5 Feb 2018 20:20:13 +0100 Message-Id: <20180205192013.5349-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180205192013.5349-1-linus.walleij@linaro.org> References: <20180205192013.5349-1-linus.walleij@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 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" The ARM reference designs "Versatile AB" and "Versatile PB" contain panel connectors with autodetection of the connected panel type. This adds a small driver utilizing the MFD syscon look-up to read the autodetection register and set up the corresponding panel appropriately. In the source file there is a bit of elaboration of the panel types and interfaces on these boards. This was tested with the PL111 DRM driver on the ARM Versatile AB with the IB2 daughterboard. Reviewed-by: Eric Anholt Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Use inline documentation style for the structs. - Explicit positive hsync and vsync on the panels requiring it - Convert two dev_info() to dev_dbg() - Collect Eric's Review tag. --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-arm-versatile.c | 377 ++++++++++++++++++++++++++++ 4 files changed, 395 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-arm-versatile.c diff --git a/MAINTAINERS b/MAINTAINERS index 18994806e441..e4fc490fa320 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4442,6 +4442,13 @@ T: git git://anongit.freedesktop.org/drm/drm-misc S: Supported F: drivers/gpu/drm/pl111/ +DRM DRIVER FOR ARM VERSATILE TFT PANELS +M: Linus Walleij +T: git git://anongit.freedesktop.org/drm/drm-misc +S: Maintained +F: drivers/gpu/drm/panel/panel-arm-versatile.c +F: Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.txt + DRM DRIVER FOR AST SERVER GRAPHICS CHIPS M: Dave Airlie S: Odd Fixes diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 726f3fb3312d..04732adbb48f 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -7,6 +7,16 @@ config DRM_PANEL menu "Display Panels" depends on DRM && DRM_PANEL +config DRM_PANEL_ARM_VERSATILE + tristate "ARM Versatile panel driver" + depends on OF + depends on MFD_SYSCON + select VIDEOMODE_HELPERS + help + This driver supports the ARM Versatile panels connected to ARM + reference designs. The panel is detected using special registers + in the Versatile family syscon registers. + config DRM_PANEL_LVDS tristate "Generic LVDS panel driver" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 2c4e1a93e05f..091fa6647769 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c new file mode 100644 index 000000000000..3930b4925b15 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -0,0 +1,377 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Panel driver for the ARM Versatile family reference designs from + * ARM Limited. + * + * Author: + * Linus Walleij + * + * On the Versatile AB, these panels come mounted on daughterboards + * named "IB1" or "IB2" (Interface Board 1 & 2 respectively.) They + * are documented in ARM DUI 0225D Appendix C and D. These daughter + * boards support TFT display panels. + * + * - The IB1 is a passive board where the display connector defines a + * few wires for encoding the display type for autodetection, + * suitable display settings can then be looked up from this setting. + * The magic bits can be read out from the system controller. + * + * - The IB2 is a more complex board intended for GSM phone development + * with some logic and a control register, which needs to be accessed + * and the board display needs to be turned on explicitly. + * + * On the Versatile PB, a special CLCD adaptor board is available + * supporting the same displays as the Versatile AB, plus one more + * Epson QCIF display. + * + */ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include