linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eballetbo@gmail.com (Enric Balletbo i Serra)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] OMAP: DSS2: Add Powertip PH480272T display panel
Date: Thu, 28 Oct 2010 16:43:01 +0200	[thread overview]
Message-ID: <1288276982-17225-2-git-send-email-eballetbo@gmail.com> (raw)
In-Reply-To: <1288276982-17225-1-git-send-email-eballetbo@gmail.com>

From: Enric Balletbo i Serra <eballetbo@iseebcn.com>

Add new Powertip PH480242T panel, a LCD 4.3inch (480x242) display
type with 24-bit RGB interface.

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
---
 drivers/video/omap2/displays/Kconfig               |    7 +
 drivers/video/omap2/displays/Makefile              |    1 +
 .../omap2/displays/panel-powertip-ph480272t.c      |  155 ++++++++++++++++++++
 3 files changed, 163 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/omap2/displays/panel-powertip-ph480272t.c

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 <eballetbo@iseebcn.com>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/err.h>
+
+#include <plat/display.h>
+
+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");
-- 
1.7.0.4

  reply	other threads:[~2010-10-28 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28 14:43 [PATCH 0/2] OMAP: DSS2: Add new display panel Enric Balletbo i Serra
2010-10-28 14:43 ` Enric Balletbo i Serra [this message]
2010-10-28 14:43 ` [PATCH 2/2] OMAP: DSS2: Add Seiko 70WVW1TZ3 " Enric Balletbo i Serra
2010-11-01 14:15 ` [PATCH 0/2] OMAP: DSS2: Add new " Tomi Valkeinen
2010-11-01 16:45   ` Bryan Wu
2010-11-02  9:19     ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288276982-17225-2-git-send-email-eballetbo@gmail.com \
    --to=eballetbo@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).