From patchwork Thu Oct 28 14:43:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo Serra X-Patchwork-Id: 287802 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9SEhJCa004006 for ; Thu, 28 Oct 2010 14:43:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933359Ab0J1OnS (ORCPT ); Thu, 28 Oct 2010 10:43:18 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:46395 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753333Ab0J1OnR (ORCPT ); Thu, 28 Oct 2010 10:43:17 -0400 Received: by mail-wy0-f174.google.com with SMTP id 28so2029886wyf.19 for ; Thu, 28 Oct 2010 07:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=N2E18Om17vYY4FtvKSpnuLl71L+vamSctHIe26TZLhE=; b=pbEorBvN5WOQdq7sMcl69tOmnf0uYOdMbOmmZ04Lraw3WkdWZdLFrthraSF5fs+qpm BceAWA1HeffYd/CxPursk+XDUm4k3kw1wLRyUY74PtDkQrsQ1TxmPqpoGFt4S0rrpLru xIT1d7LFfQPgSgzMAESL4RZKmp3SrHfQTO87A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Br7sZke1F9rwXdc4IDSC332bSrSL0BGCW6Or6mS3Gc0XXaFaGf0NGdyfdEreW8cDTU bxo5kzFESTpVccAXuJHsk5LxrZ4cXXQBZDhwlS5Ay2dW+dc/2//LS4Q1mcHQj+oSw0Ig WV195YbljJrb6OJ1Qt3amz4zx7gIkB9VBLAzo= Received: by 10.216.132.166 with SMTP id o38mr10720168wei.16.1288276996379; Thu, 28 Oct 2010 07:43:16 -0700 (PDT) Received: from localhost.localdomain (68.Red-217-125-26.staticIP.rima-tde.net [217.125.26.68]) by mx.google.com with ESMTPS id w8sm760390wei.21.2010.10.28.07.43.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 Oct 2010 07:43:15 -0700 (PDT) From: Enric Balletbo i Serra To: linux-omap@vger.kernel.org, tomi.valkeinen@nokia.com, hvaibhav@ti.com, notasas@gmail.com, roger.quadros@nokia.com, mike@compulab.co.il, linux-arm-kernel@lists.infradead.org Cc: Enric Balletbo i Serra Subject: [PATCH 1/2] OMAP: DSS2: Add Powertip PH480272T display panel Date: Thu, 28 Oct 2010 16:43:01 +0200 Message-Id: <1288276982-17225-2-git-send-email-eballetbo@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1288276982-17225-1-git-send-email-eballetbo@gmail.com> References: <1288276982-17225-1-git-send-email-eballetbo@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Oct 2010 14:43:19 +0000 (UTC) diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 12327bb..c3aa478 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -44,4 +44,11 @@ config PANEL_ACX565AKM select BACKLIGHT_CLASS_DEVICE help This is the LCD panel used on Nokia N900 + +config PANEL_POWERTIP_PH480272T + tristate "Powertip PH480272T LCD Panel" + depends on OMAP2_DSS + select BACKLIGHT_CLASS_DEVICE + help + LCD Panel used in IGEP boards. endmenu diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index aa38609..3967dbc 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -6,3 +6,4 @@ obj-$(CONFIG_PANEL_TAAL) += panel-taal.o obj-$(CONFIG_PANEL_TOPPOLY_TDO35S) += panel-toppoly-tdo35s.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o +obj-$(CONFIG_PANEL_POWERTIP_PH480272T) += panel-powertip-ph480272t.o diff --git a/drivers/video/omap2/displays/panel-powertip-ph480272t.c b/drivers/video/omap2/displays/panel-powertip-ph480272t.c new file mode 100644 index 0000000..d303180 --- /dev/null +++ b/drivers/video/omap2/displays/panel-powertip-ph480272t.c @@ -0,0 +1,155 @@ +/* + * LCD panel driver for Powertip PH480272T + * + * Copyright (C) 2010, ISEE 2007 SL + * Author: Enric Balletbo i Serra + * + * 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 + +#include + +static struct omap_video_timings ph480272t_timings = { + .x_res = 480, + .y_res = 272, + .pixel_clock = 9000, + .hsw = 40, + .hfp = 2, + .hbp = 2, + .vsw = 10, + .vfp = 2, + .vbp = 2, +}; + +static int ph480272t_power_on(struct omap_dss_device *dssdev) +{ + int r; + + r = omapdss_dpi_display_enable(dssdev); + if (r) + goto err0; + + /* wait couple of vsyncs until enabling the LCD */ + msleep(50); + + if (dssdev->platform_enable) { + r = dssdev->platform_enable(dssdev); + if (r) + goto err1; + } + + return 0; +err1: + omapdss_dpi_display_disable(dssdev); +err0: + return r; +} + +static void ph480272t_power_off(struct omap_dss_device *dssdev) +{ + if (dssdev->platform_disable) + dssdev->platform_disable(dssdev); + + /* wait at least 5 vsyncs after disabling the LCD */ + msleep(100); + + omapdss_dpi_display_disable(dssdev); +} + +static int ph480272t_probe(struct omap_dss_device *dssdev) +{ + + dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | + OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IEO; + + dssdev->panel.acb = 0x0; + dssdev->panel.timings = ph480272t_timings; + + return 0; +} + +static void ph480272t_remove(struct omap_dss_device *dssdev) +{ +} + +static int ph480272t_enable(struct omap_dss_device *dssdev) +{ + int r = 0; + + r = ph480272t_power_on(dssdev); + if (r) + return r; + + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + + return 0; +} + +static void ph480272t_disable(struct omap_dss_device *dssdev) +{ + ph480272t_power_off(dssdev); + + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; +} + +static int ph480272t_suspend(struct omap_dss_device *dssdev) +{ + ph480272t_power_off(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; + return 0; +} + +static int ph480272t_resume(struct omap_dss_device *dssdev) +{ + int r = 0; + + r = ph480272t_power_on(dssdev); + if (r) + return r; + + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + + return 0; +} + +static struct omap_dss_driver ph480272t_driver = { + .probe = ph480272t_probe, + .remove = ph480272t_remove, + .enable = ph480272t_enable, + .disable = ph480272t_disable, + .suspend = ph480272t_suspend, + .resume = ph480272t_resume, + .driver = { + .name = "ph480272t", + .owner = THIS_MODULE, + }, +}; + +static int __init ph480272t_init(void) +{ + return omap_dss_register_driver(&ph480272t_driver); +} + +static void __exit ph480272t_exit(void) +{ + omap_dss_unregister_driver(&ph480272t_driver); +} + +module_init(ph480272t_init); +module_exit(ph480272t_exit); +MODULE_LICENSE("GPL");