From patchwork Fri Jan 26 13:33:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 125972 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp338604ljd; Fri, 26 Jan 2018 05:33:49 -0800 (PST) X-Google-Smtp-Source: AH8x225yXnNV3gjiIiXNOhBPypzi6YXa280jnVNi+bErK5HuP8JkbyZadw1+Np2aLSi4rFOdOTfS X-Received: by 2002:a17:902:6ac7:: with SMTP id i7-v6mr14023069plt.368.1516973629106; Fri, 26 Jan 2018 05:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516973629; cv=none; d=google.com; s=arc-20160816; b=RuMgO3soebv0OIDu7s1FkxqiM8nJ9Q2OnqfOvgzJm8+10fTCgTvA6VArAyS1ojTA9q xATsB5gH+i5yb14LPYBQXxUuBemX34iEFPROIcGigT+6R4sye22ykDTZ/BCT/2PQAx8A 7JirGlB3PPqqkmmBbV3QI5WHOy/a6C3nDTpui1+3LS/D+01gFk7z9aJqEDhY7LvGtddY Mv9oEoURv2uYpDOahQwd5TNlFvV+7vrEe+0CiAt4Fk9Py+farsrX7nHbEYow3GnUD8Ss zL44LeiWofY2Dt/67eed/gC0CSMklty/BHjBWqfu43c1BaWPmvxlSZBsHj7z2ypC9qP5 s9hA== 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=hMy9LFoNoSjFCAXJoYR4ETnAAXmTbMgisEA+hlnACx0=; b=K8xr7RsUjHIPYYOu+1C1CnHH6EjsWrxVgY5nrk118V9+KFuqrWbd1k0kPc73GbDx1u rIke0zn319K6a1T6Sj6g9ZRfZlSlBBExS7Ir00HGc6ebgwENDxq0gOPtO851B/6lnHnE sGX2scGl39yyJB7XIjNGbhQjVe31n5CTSH2f+8c21RHzUaCcg7D9cepQWyddoxKvjBMP 2AiijE31kuU1V6X8dmeXYqcQ5Lz+Be+G4EWE5XLl8SZfstnSoaMHQ5uoWXQk2w+yjcIO pEChvrFbbjLUM1phevkHl6Vz4dspPAlhqZ9cHXATK3kdwgNGG2gnr3hRSdNkAw197n+L gQAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XMNhQ0qZ; 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 61-v6si3734079plz.68.2018.01.26.05.33.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 05:33:49 -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=XMNhQ0qZ; 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 8EC1E6E21F; Fri, 26 Jan 2018 13:33:47 +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 6910D6E23C for ; Fri, 26 Jan 2018 13:33:45 +0000 (UTC) Received: by mail-lf0-x242.google.com with SMTP id 63so715395lfv.4 for ; Fri, 26 Jan 2018 05:33:45 -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=HnXvIgw2QQShZ8wuk95UaexoO1rJkgao/EaQWb4PMwc=; b=XMNhQ0qZdxb1wBMyTaY+AT9eb2D/fNeklhGzIJTQSHFEI5PPdswf8Foif7qjDYMvBS /Vvcwrdv7uHZE3sAMg090NaCpDrhHWw0DM4TCPLUfwdl2C8EVHe+mAXf2IhSESi8LccW owtECBP7mT6BzQqSYmOLmfZLwEkxZksYh9g0Y= 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=HnXvIgw2QQShZ8wuk95UaexoO1rJkgao/EaQWb4PMwc=; b=gHf3q3XTsZlOOANdFcPe99W+QAX3uuAMWZLo0Uoq7c4ms+5ye6R4+cgwKjtcK9PlU3 VTY3Qol211FOEr0dzmSn9A29PVBXq7n90UtGdMIKl83vDU3/sJryqjIu0LzXESEJZq86 qB+lyw0SkZAVtstGSKa+PvwdfZK0ZAFM8fbZj+o86vBJ7D+2DK9reb7HyFmKtcdDF8hR TVxIYYQhp1jAILKkKr5mfd7u61BrRQLkdvncJdNhEr8tFbWTJFfNU6ZsbySgZGc9J3x9 apbUADDmq9fKT2u6HP8TW0NasiDzKzpmcHQrs9wXOQUPnl/gv4hcFOPXxJ4rgX3CW440 Lz5g== X-Gm-Message-State: AKwxytdAwxRunYNok+lmG1RrMkGkSVdd4hsIRs485lMcVupL28u141VG agUb7PmPpU42iEtF8GwFrrUTZVyNFnk= X-Received: by 10.25.212.68 with SMTP id l65mr7954650lfg.5.1516973623518; Fri, 26 Jan 2018 05:33:43 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id f3sm928911lja.63.2018.01.26.05.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 05:33:42 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/panel: Add support for ARM Versatile panels Date: Fri, 26 Jan 2018 14:33:36 +0100 Message-Id: <20180126133336.21343-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180126133336.21343-1-linus.walleij@linaro.org> References: <20180126133336.21343-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. Signed-off-by: Linus Walleij Reviewed-by: Eric Anholt --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-arm-versatile.c | 353 ++++++++++++++++++++++++++++ 4 files changed, 371 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..ce778ca20f3f --- /dev/null +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c @@ -0,0 +1,353 @@ +// 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