Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
beagle
>
kernel-adaptation-dm3730
> 0004-displays-added-panel-for-medistream.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0004-displays-added-panel-for-medistream.patch of Package kernel-adaptation-dm3730
From 50a03871e28b8363a15877bee01db43bec53da10 Mon Sep 17 00:00:00 2001 From: MediStream-Devel-VM <info@berlinux-solutions.de> Date: Mon, 6 Aug 2012 11:15:19 +0200 Subject: [PATCH 4/9] displays: -added panel for medistream --- drivers/video/omap2/displays/Kconfig | 7 + drivers/video/omap2/displays/Makefile | 1 + drivers/video/omap2/displays/panel-medistream.c | 161 +++++++++++++++++++++++ 3 files changed, 169 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap2/displays/panel-medistream.c diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig index 408a992..8a4cd82 100644 --- a/drivers/video/omap2/displays/Kconfig +++ b/drivers/video/omap2/displays/Kconfig @@ -72,4 +72,11 @@ config PANEL_N8X0 depends on BACKLIGHT_CLASS_DEVICE help This is the LCD panel used on Nokia N8x0 + +config PANEL_MEDISTREAM + tristate "Bewatec MediStream Panel" + depends on OMAP2_DSS_DSI + help + Bewatec MediStream Panel + endmenu diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile index fbfafc6..0fc972c 100644 --- a/drivers/video/omap2/displays/Makefile +++ b/drivers/video/omap2/displays/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_PANEL_PICODLP) += panel-picodlp.o obj-$(CONFIG_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_PANEL_ACX565AKM) += panel-acx565akm.o obj-$(CONFIG_PANEL_N8X0) += panel-n8x0.o +obj-$(CONFIG_PANEL_MEDISTREAM) += panel-medistream.o diff --git a/drivers/video/omap2/displays/panel-medistream.c b/drivers/video/omap2/displays/panel-medistream.c new file mode 100644 index 0000000..a75dcdd --- /dev/null +++ b/drivers/video/omap2/displays/panel-medistream.c @@ -0,0 +1,161 @@ +/* + * LCD panel driver for Bewatec MediStream Panel + * + * Copyright (C) 2008 Nokia Corporation + * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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/backlight.h> +#include <linux/fb.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include <video/omapdss.h> + +struct medistream_data { + struct backlight_device *bl; +}; + +static struct omap_video_timings medistream_timings = { + .x_res = 1024, + .y_res = 600, + + .pixel_clock = 43970, + + .hsw = 49, + .hfp = 38, + .hbp = 39, + + .vsw = 3, + .vfp = 13, + .vbp = 29, +}; + +static int medistream_panel_probe(struct omap_dss_device *dssdev) +{ + dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | + OMAP_DSS_LCD_IHS; + dssdev->panel.acb = 0x28; + dssdev->panel.timings = medistream_timings; + + return 0; +} + +static void __exit medistream_panel_remove(struct omap_dss_device *dssdev) +{ +} + +static int medistream_power_on(struct omap_dss_device *dssdev) +{ + int r = 0; + + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) + return 0; + + 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 medistream_power_off(struct omap_dss_device *dssdev) +{ + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) + return; + + 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 medistream_panel_enable(struct omap_dss_device *dssdev) +{ + int r; + r = medistream_power_on(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + return r; +} + +static void medistream_panel_disable(struct omap_dss_device *dssdev) +{ + medistream_power_off(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; +} + +static int medistream_panel_suspend(struct omap_dss_device *dssdev) +{ + medistream_power_off(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; + return 0; +} + +static int medistream_panel_resume(struct omap_dss_device *dssdev) +{ + int r; + r = medistream_power_on(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + return r; +} + +static struct omap_dss_driver medistream_driver = { + .probe = medistream_panel_probe, + .remove = __exit_p(medistream_panel_remove), + + .enable = medistream_panel_enable, + .disable = medistream_panel_disable, + .suspend = medistream_panel_suspend, + .resume = medistream_panel_resume, + + .driver = { + .name = "Medistream Panel", + .owner = THIS_MODULE, + }, +}; + +static int __init medistream_panel_drv_init(void) +{ + return omap_dss_register_driver(&medistream_driver); +} + +static void __exit medistream_panel_drv_exit(void) +{ + omap_dss_unregister_driver(&medistream_driver); +} + +module_init(medistream_panel_drv_init); +module_exit(medistream_panel_drv_exit); +MODULE_LICENSE("GPL"); -- 1.7.5.4