From patchwork Tue Jan 22 22:36:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 14218 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 930B323E27 for ; Tue, 22 Jan 2013 22:36:38 +0000 (UTC) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by fiordland.canonical.com (Postfix) with ESMTP id 36125A1839F for ; Tue, 22 Jan 2013 22:36:38 +0000 (UTC) Received: by mail-vb0-f49.google.com with SMTP id s24so5600900vbi.8 for ; Tue, 22 Jan 2013 14:36:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:dkim-signature:x-received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:x-gm-message-state; bh=tIgpUD/SgeS90AtJdwFOl7LWd/VWZvp5wHirAlAGDzQ=; b=iK6QSQsY0PdoVDoO5hpWSL/sW89OSZuJjqUcspj9pc0Ud/PYr0W8pJc++IS7RxDLxX A5bYDtEjTdUhAKAA10MYw7t3g7T8TgEV6pOU9CORZaRdiF7TM2jQrtueNWn8Xt+Efuj5 NiE3GuiCBd0GTt3g4/K1eW28JKSmHRgrIYKY2aCn615RI6/gd1uMeFklPrFBkVxqs8OQ +iY5LQjkdKhy9sYlU5g7mjWS+XUYn5KEXiJmJ8CpWKDFn77l/Kuh3+pyl3E54BXV76mR 8r63C2r/6fj49gXRHfK0grfsJvgjByV1ObI8it1By4SWTY9J7MRQWLU5zC5lAa3jPCeZ BzXQ== X-Received: by 10.220.238.139 with SMTP id ks11mr25005017vcb.49.1358894197642; Tue, 22 Jan 2013 14:36:37 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp275050veb; Tue, 22 Jan 2013 14:36:37 -0800 (PST) X-Received: by 10.182.48.69 with SMTP id j5mr18040364obn.17.1358894197030; Tue, 22 Jan 2013 14:36:37 -0800 (PST) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by mx.google.com with ESMTPS id aa2si3561410obc.183.2013.01.22.14.36.36 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jan 2013 14:36:37 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.214.181 as permitted sender) client-ip=209.85.214.181; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.214.181 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-ob0-f181.google.com with SMTP id wc18so2257260obb.40 for ; Tue, 22 Jan 2013 14:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=tIgpUD/SgeS90AtJdwFOl7LWd/VWZvp5wHirAlAGDzQ=; b=T5UYfeZAB6/1cJLtGLJs09w5EOXWVMF8geHw/d+1Hr5nDocSJ/XZn6NMycLsO6C14t SlovDRqFn6hgoHab+zjRI/+4Pk8U2ozcy40Ml/vVfZCd8ak1QyWvya4NpiJ3i44YZLSf T/HX8nFap53047dx13G4F1+pVXwXrggQk46AWAHJxDg/COdLPqKip7Rdmw2Go21wGoyl xrp/Dn0iuGTNLXmUN3DE62NbLFlqp48n5Lfk00TYRM6lg05fiScmk+zYgfLYouQDFOiD ZkIK+2FtjP5NNBpfJRLj0Ul/Nwg75hjlX22c4yQHosFHPzRx+hY9AcZpifQi6xEztzsU lOSA== X-Received: by 10.182.151.9 with SMTP id um9mr1635330obb.89.1358894196641; Tue, 22 Jan 2013 14:36:36 -0800 (PST) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id ag15sm14445765oec.11.2013.01.22.14.36.35 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 22 Jan 2013 14:36:36 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Clark Subject: [PATCH 4/4] drm/tilcdc: add support for LCD panels (v4) Date: Tue, 22 Jan 2013 16:36:25 -0600 Message-Id: <1358894185-21617-5-git-send-email-robdclark@gmail.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1358894185-21617-1-git-send-email-robdclark@gmail.com> References: <1358894185-21617-1-git-send-email-robdclark@gmail.com> X-Gm-Message-State: ALoCoQkBCNcilc41A0lQ/I8vs0XySYET254cesYN6Scft2jZbcvdSCELPsj0DTsJwhIYy6CfjHYO Add an output panel driver for LCD panels. Tested with LCD3 cape on beaglebone. v1: original v2: s/of_find_node_by_name()/of_get_child_by_name()/ from Pantelis Antoniou v3: add backlight support v4: rebase to latest of video timing helpers Signed-off-by: Rob Clark --- drivers/gpu/drm/tilcdc/Kconfig | 3 + drivers/gpu/drm/tilcdc/Makefile | 1 + drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 + drivers/gpu/drm/tilcdc/tilcdc_panel.c | 443 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/tilcdc/tilcdc_panel.h | 26 ++ 5 files changed, 476 insertions(+) create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_panel.c create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_panel.h diff --git a/drivers/gpu/drm/tilcdc/Kconfig b/drivers/gpu/drm/tilcdc/Kconfig index 99beca2..f468b2b 100644 --- a/drivers/gpu/drm/tilcdc/Kconfig +++ b/drivers/gpu/drm/tilcdc/Kconfig @@ -4,6 +4,9 @@ config DRM_TILCDC select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER + select OF_VIDEOMODE + select OF_DISPLAY_TIMING + select BACKLIGHT_CLASS_DEVICE help Choose this option if you have an TI SoC with LCDC display controller, for example AM33xx in beagle-bone, DA8xx, or diff --git a/drivers/gpu/drm/tilcdc/Makefile b/drivers/gpu/drm/tilcdc/Makefile index aa9097e..deda656 100644 --- a/drivers/gpu/drm/tilcdc/Makefile +++ b/drivers/gpu/drm/tilcdc/Makefile @@ -4,6 +4,7 @@ tilcdc-y := \ tilcdc_crtc.o \ tilcdc_tfp410.o \ tilcdc_slave.o \ + tilcdc_panel.o \ tilcdc_drv.o obj-$(CONFIG_DRM_TILCDC) += tilcdc.o diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index ca76dbe..d10858c 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -21,6 +21,7 @@ #include "tilcdc_regs.h" #include "tilcdc_tfp410.h" #include "tilcdc_slave.h" +#include "tilcdc_panel.h" #include "drm_fb_helper.h" @@ -589,6 +590,7 @@ static int __init tilcdc_drm_init(void) DBG("init"); tilcdc_tfp410_init(); tilcdc_slave_init(); + tilcdc_panel_init(); return platform_driver_register(&tilcdc_platform_driver); } @@ -597,6 +599,7 @@ static void __exit tilcdc_drm_fini(void) DBG("fini"); tilcdc_tfp410_fini(); tilcdc_slave_fini(); + tilcdc_panel_fini(); platform_driver_unregister(&tilcdc_platform_driver); } diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c new file mode 100644 index 0000000..a3c7fe93 --- /dev/null +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -0,0 +1,443 @@ +/* + * Copyright (C) 2012 Texas Instruments + * Author: Rob Clark + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#include +#include +#include +#include