aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/s6e8ab0_mipi_lcd.c
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2012-06-02 13:09:29 +0200
committercodeworkx <daniel.hillenbrand@codeworkx.de>2012-06-02 13:09:29 +0200
commitc6da2cfeb05178a11c6d062a06f8078150ee492f (patch)
treef3b4021d252c52d6463a9b3c1bb7245e399b009c /drivers/video/backlight/s6e8ab0_mipi_lcd.c
parentc6d7c4dbff353eac7919342ae6b3299a378160a6 (diff)
downloadkernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.zip
kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.gz
kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.bz2
samsung update 1
Diffstat (limited to 'drivers/video/backlight/s6e8ab0_mipi_lcd.c')
-rw-r--r--drivers/video/backlight/s6e8ab0_mipi_lcd.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/video/backlight/s6e8ab0_mipi_lcd.c b/drivers/video/backlight/s6e8ab0_mipi_lcd.c
new file mode 100644
index 0000000..ef5c41f
--- /dev/null
+++ b/drivers/video/backlight/s6e8ab0_mipi_lcd.c
@@ -0,0 +1,77 @@
+/* linux/drivers/video/backlight/s6e8ab0_mipi_lcd.c
+ *
+ *
+ * Copyright (c) 2011 Samsung Electronics
+ *
+ * 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.
+ *
+ *
+*/
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/mutex.h>
+#include <linux/wait.h>
+#include <linux/ctype.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/gpio.h>
+#include <linux/workqueue.h>
+#include <linux/backlight.h>
+#include <linux/lcd.h>
+
+#include <video/mipi_display.h>
+
+#include <plat/gpio-cfg.h>
+#include <plat/regs-dsim.h>
+
+#include <plat/dsim.h>
+#include <plat/mipi_dsi.h>
+
+void init_lcd(struct mipi_dsim_device *dsim)
+{
+ s5p_mipi_dsi_wr_data(dsim, MIPI_DSI_DCS_SHORT_WRITE,
+ 0, 0);
+ msleep(60);
+ /* Exit sleep */
+ s5p_mipi_dsi_wr_data(dsim, MIPI_DSI_DCS_SHORT_WRITE,
+ 0x11, 0);
+ msleep(600);
+ s5p_mipi_dsi_wr_data(dsim, MIPI_DSI_TURN_ON_PERIPHERAL,
+ 0, 0);
+}
+
+void s6e8ab0_mipi_lcd_off(struct mipi_dsim_device *dsim)
+{
+ usleep_range(1000, 1200);
+}
+
+static int s6e8ab0_mipi_lcd_suspend(struct mipi_dsim_device *dsim)
+{
+ s6e8ab0_mipi_lcd_off(dsim);
+ return 0;
+}
+
+static int s6e8ab0_mipi_lcd_displayon(struct mipi_dsim_device *dsim)
+{
+ init_lcd(dsim);
+
+ return 0;
+}
+
+static int s6e8ab0_mipi_lcd_resume(struct mipi_dsim_device *dsim)
+{
+ init_lcd(dsim);
+ return 0;
+}
+
+struct mipi_dsim_lcd_driver s6e8ab0_mipi_lcd_driver = {
+ .suspend = s6e8ab0_mipi_lcd_suspend,
+ .displayon = s6e8ab0_mipi_lcd_displayon,
+ .resume = s6e8ab0_mipi_lcd_resume,
+};