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: 2021301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 0B6C0DF2EB for ; Tue, 22 Jan 2013 22:40:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TxmTH-0001aa-9Q; Tue, 22 Jan 2013 22:37:35 +0000 Received: from mail-ob0-f172.google.com ([209.85.214.172]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TxmSM-0001Sh-12 for linux-arm-kernel@lists.infradead.org; Tue, 22 Jan 2013 22:36:50 +0000 Received: by mail-ob0-f172.google.com with SMTP id ta17so2546390obb.31 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130122_173638_264833_8F790753 X-CRM114-Status: GOOD ( 23.32 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.172 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robdclark[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Rob Clark , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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