···11+menu "OMAP2/3 Display Device Drivers"22+ depends on OMAP2_DSS33+44+config PANEL_GENERIC55+ tristate "Generic Panel"66+ help77+ Generic panel driver.88+ Used for DVI output for Beagle and OMAP3 SDP.99+1010+config PANEL_SHARP_LS037V7DW011111+ tristate "Sharp LS037V7DW01 LCD Panel"1212+ depends on OMAP2_DSS1313+ help1414+ LCD Panel used in TI's SDP3430 and EVM boards1515+1616+endmenu
···11+/*22+ * Generic panel support33+ *44+ * Copyright (C) 2008 Nokia Corporation55+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>66+ *77+ * This program is free software; you can redistribute it and/or modify it88+ * under the terms of the GNU General Public License version 2 as published by99+ * the Free Software Foundation.1010+ *1111+ * This program is distributed in the hope that it will be useful, but WITHOUT1212+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or1313+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for1414+ * more details.1515+ *1616+ * You should have received a copy of the GNU General Public License along with1717+ * this program. If not, see <http://www.gnu.org/licenses/>.1818+ */1919+2020+#include <linux/module.h>2121+#include <linux/delay.h>2222+2323+#include <plat/display.h>2424+2525+static struct omap_video_timings generic_panel_timings = {2626+ /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */2727+ .x_res = 640,2828+ .y_res = 480,2929+ .pixel_clock = 23500,3030+ .hfp = 48,3131+ .hsw = 32,3232+ .hbp = 80,3333+ .vfp = 3,3434+ .vsw = 4,3535+ .vbp = 7,3636+};3737+3838+static int generic_panel_probe(struct omap_dss_device *dssdev)3939+{4040+ dssdev->panel.config = OMAP_DSS_LCD_TFT;4141+ dssdev->panel.timings = generic_panel_timings;4242+4343+ return 0;4444+}4545+4646+static void generic_panel_remove(struct omap_dss_device *dssdev)4747+{4848+}4949+5050+static int generic_panel_enable(struct omap_dss_device *dssdev)5151+{5252+ int r = 0;5353+5454+ if (dssdev->platform_enable)5555+ r = dssdev->platform_enable(dssdev);5656+5757+ return r;5858+}5959+6060+static void generic_panel_disable(struct omap_dss_device *dssdev)6161+{6262+ if (dssdev->platform_disable)6363+ dssdev->platform_disable(dssdev);6464+}6565+6666+static int generic_panel_suspend(struct omap_dss_device *dssdev)6767+{6868+ generic_panel_disable(dssdev);6969+ return 0;7070+}7171+7272+static int generic_panel_resume(struct omap_dss_device *dssdev)7373+{7474+ return generic_panel_enable(dssdev);7575+}7676+7777+static struct omap_dss_driver generic_driver = {7878+ .probe = generic_panel_probe,7979+ .remove = generic_panel_remove,8080+8181+ .enable = generic_panel_enable,8282+ .disable = generic_panel_disable,8383+ .suspend = generic_panel_suspend,8484+ .resume = generic_panel_resume,8585+8686+ .driver = {8787+ .name = "generic_panel",8888+ .owner = THIS_MODULE,8989+ },9090+};9191+9292+static int __init generic_panel_drv_init(void)9393+{9494+ return omap_dss_register_driver(&generic_driver);9595+}9696+9797+static void __exit generic_panel_drv_exit(void)9898+{9999+ omap_dss_unregister_driver(&generic_driver);100100+}101101+102102+module_init(generic_panel_drv_init);103103+module_exit(generic_panel_drv_exit);104104+MODULE_LICENSE("GPL");
···11+/*22+ * LCD panel driver for Sharp LS037V7DW0133+ *44+ * Copyright (C) 2008 Nokia Corporation55+ * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>66+ *77+ * This program is free software; you can redistribute it and/or modify it88+ * under the terms of the GNU General Public License version 2 as published by99+ * the Free Software Foundation.1010+ *1111+ * This program is distributed in the hope that it will be useful, but WITHOUT1212+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or1313+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for1414+ * more details.1515+ *1616+ * You should have received a copy of the GNU General Public License along with1717+ * this program. If not, see <http://www.gnu.org/licenses/>.1818+ */1919+2020+#include <linux/module.h>2121+#include <linux/delay.h>2222+#include <linux/device.h>2323+#include <linux/regulator/consumer.h>2424+#include <linux/err.h>2525+2626+#include <plat/display.h>2727+2828+struct sharp_data {2929+ /* XXX This regulator should actually be in SDP board file, not here,3030+ * as it doesn't actually power the LCD, but something else that3131+ * affects the output to LCD (I think. Somebody clarify). It doesn't do3232+ * harm here, as SDP is the only board using this currently */3333+ struct regulator *vdvi_reg;3434+};3535+3636+static struct omap_video_timings sharp_ls_timings = {3737+ .x_res = 480,3838+ .y_res = 640,3939+4040+ .pixel_clock = 19200,4141+4242+ .hsw = 2,4343+ .hfp = 1,4444+ .hbp = 28,4545+4646+ .vsw = 1,4747+ .vfp = 1,4848+ .vbp = 1,4949+};5050+5151+static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)5252+{5353+ struct sharp_data *sd;5454+5555+ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |5656+ OMAP_DSS_LCD_IHS;5757+ dssdev->panel.acb = 0x28;5858+ dssdev->panel.timings = sharp_ls_timings;5959+6060+ sd = kzalloc(sizeof(*sd), GFP_KERNEL);6161+ if (!sd)6262+ return -ENOMEM;6363+6464+ dev_set_drvdata(&dssdev->dev, sd);6565+6666+ sd->vdvi_reg = regulator_get(&dssdev->dev, "vdvi");6767+ if (IS_ERR(sd->vdvi_reg)) {6868+ kfree(sd);6969+ pr_err("failed to get VDVI regulator\n");7070+ return PTR_ERR(sd->vdvi_reg);7171+ }7272+7373+ return 0;7474+}7575+7676+static void sharp_ls_panel_remove(struct omap_dss_device *dssdev)7777+{7878+ struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);7979+8080+ regulator_put(sd->vdvi_reg);8181+8282+ kfree(sd);8383+}8484+8585+static int sharp_ls_panel_enable(struct omap_dss_device *dssdev)8686+{8787+ struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);8888+ int r = 0;8989+9090+ /* wait couple of vsyncs until enabling the LCD */9191+ msleep(50);9292+9393+ regulator_enable(sd->vdvi_reg);9494+9595+ if (dssdev->platform_enable)9696+ r = dssdev->platform_enable(dssdev);9797+9898+ return r;9999+}100100+101101+static void sharp_ls_panel_disable(struct omap_dss_device *dssdev)102102+{103103+ struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);104104+105105+ if (dssdev->platform_disable)106106+ dssdev->platform_disable(dssdev);107107+108108+ regulator_disable(sd->vdvi_reg);109109+110110+ /* wait at least 5 vsyncs after disabling the LCD */111111+112112+ msleep(100);113113+}114114+115115+static int sharp_ls_panel_suspend(struct omap_dss_device *dssdev)116116+{117117+ sharp_ls_panel_disable(dssdev);118118+ return 0;119119+}120120+121121+static int sharp_ls_panel_resume(struct omap_dss_device *dssdev)122122+{123123+ return sharp_ls_panel_enable(dssdev);124124+}125125+126126+static struct omap_dss_driver sharp_ls_driver = {127127+ .probe = sharp_ls_panel_probe,128128+ .remove = sharp_ls_panel_remove,129129+130130+ .enable = sharp_ls_panel_enable,131131+ .disable = sharp_ls_panel_disable,132132+ .suspend = sharp_ls_panel_suspend,133133+ .resume = sharp_ls_panel_resume,134134+135135+ .driver = {136136+ .name = "sharp_ls_panel",137137+ .owner = THIS_MODULE,138138+ },139139+};140140+141141+static int __init sharp_ls_panel_drv_init(void)142142+{143143+ return omap_dss_register_driver(&sharp_ls_driver);144144+}145145+146146+static void __exit sharp_ls_panel_drv_exit(void)147147+{148148+ omap_dss_unregister_driver(&sharp_ls_driver);149149+}150150+151151+module_init(sharp_ls_panel_drv_init);152152+module_exit(sharp_ls_panel_drv_exit);153153+MODULE_LICENSE("GPL");