From 4ed824d9aead77a6a4eb1e89c3b3d270ba386fad Mon Sep 17 00:00:00 2001 From: Sudhakar Rajashekhara Date: Tue, 22 Sep 2009 16:47:06 -0700 Subject: davinci: fb: Frame Buffer driver for TI DA8xx/OMAP-L1xx Add LCD controller (LCDC) driver for TI's DA8xx/OMAP-L1xx architecture. LCDC specifications can be found at http://www.ti.com/litv/pdf/sprufm0a. LCDC on DA8xx consists of two independent controllers, the Raster Controller and the LCD Interface Display Driver (LIDD) controller. LIDD further supports character and graphic displays. This patch adds support for the graphic display (Sharp LQ035Q3DG01) found on the DA830 based EVM. The EVM details can be found at: http://support.spectrumdigital.com/boards/dskda830/revc/. Signed-off-by: Sudhakar Rajashekhara Signed-off-by: Pavel Kiryukhin Signed-off-by: Steve Chen Acked-by: Krzysztof Helt DESC davinci-fb-frame-buffer-driver-for-ti-da8xx-omap-l1xx-fix EDESC From: Andrew Morton fix kconfig indenting Cc: Krzysztof Helt Cc: Pavel Kiryukhin Cc: Steve Chen Cc: Sudhakar Rajashekhara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/da8xx-fb.h | 106 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 include/video/da8xx-fb.h (limited to 'include/video') diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h new file mode 100644 index 000000000000..5f7767547fa0 --- /dev/null +++ b/include/video/da8xx-fb.h @@ -0,0 +1,106 @@ +/* + * Header file for TI DA8XX LCD controller platform data. + * + * Copyright (C) 2008-2009 MontaVista Software Inc. + * Copyright (C) 2008-2009 Texas Instruments Inc + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#ifndef DA8XX_FB_H +#define DA8XX_FB_H + +enum panel_type { + QVGA = 0 +}; + +enum panel_shade { + MONOCHROME = 0, + COLOR_ACTIVE, + COLOR_PASSIVE, +}; + +enum raster_load_mode { + LOAD_DATA = 1, + LOAD_PALETTE, +}; + +struct display_panel { + enum panel_type panel_type; /* QVGA */ + int max_bpp; + int min_bpp; + enum panel_shade panel_shade; +}; + +struct da8xx_lcdc_platform_data { + const char manu_name[10]; + void *controller_data; + const char type[25]; +}; + +struct lcd_ctrl_config { + const struct display_panel *p_disp_panel; + + /* AC Bias Pin Frequency */ + int ac_bias; + + /* AC Bias Pin Transitions per Interrupt */ + int ac_bias_intrpt; + + /* DMA burst size */ + int dma_burst_sz; + + /* Bits per pixel */ + int bpp; + + /* FIFO DMA Request Delay */ + int fdd; + + /* TFT Alternative Signal Mapping (Only for active) */ + unsigned char tft_alt_mode; + + /* 12 Bit Per Pixel (5-6-5) Mode (Only for passive) */ + unsigned char stn_565_mode; + + /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */ + unsigned char mono_8bit_mode; + + /* Invert pixel clock */ + unsigned char invert_pxl_clock; + + /* Invert line clock */ + unsigned char invert_line_clock; + + /* Invert frame clock */ + unsigned char invert_frm_clock; + + /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */ + unsigned char sync_edge; + + /* Horizontal and Vertical Sync: Control: 0=ignore */ + unsigned char sync_ctrl; + + /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */ + unsigned char raster_order; +}; + +struct lcd_sync_arg { + int back_porch; + int front_porch; + int pulse_width; +}; + +/* ioctls */ +#define FBIOGET_CONTRAST _IOR('F', 1, int) +#define FBIOPUT_CONTRAST _IOW('F', 2, int) +#define FBIGET_BRIGHTNESS _IOR('F', 3, int) +#define FBIPUT_BRIGHTNESS _IOW('F', 3, int) +#define FBIGET_COLOR _IOR('F', 5, int) +#define FBIPUT_COLOR _IOW('F', 6, int) +#define FBIPUT_HSYNC _IOW('F', 9, int) +#define FBIPUT_VSYNC _IOW('F', 10, int) + +#endif /* ifndef DA8XX_FB_H */ + -- cgit v1.2.3 From 2f93e8f4822fdd48fa9c4c901eea87ab1c902f87 Mon Sep 17 00:00:00 2001 From: Sudhakar Rajashekhara Date: Tue, 22 Sep 2009 16:47:06 -0700 Subject: davinci-fb-frame-buffer-driver-for-ti-da8xx-omap-l1xx-v4 Since the previous version, return values in ioctl() function have been modified. [akpm@linux-foundation.org: simplify lcd_disable_raster()] Signed-off-by: Sudhakar Rajashekhara Signed-off-by: Pavel Kiryukhin Signed-off-by: Steve Chen Acked-by: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/da8xx-fb.c | 61 +++++++++++++++++------------------------------- include/video/da8xx-fb.h | 3 --- 2 files changed, 21 insertions(+), 43 deletions(-) (limited to 'include/video') diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index e0bbc66499c8..42e1005e2916 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -107,7 +107,6 @@ static inline void lcdc_write(unsigned int val, unsigned int addr) } struct da8xx_fb_par { - wait_queue_head_t da8xx_wq; resource_size_t p_palette_base; unsigned char *v_palette_base; struct clk *lcdc_clk; @@ -158,6 +157,7 @@ struct da8xx_panel { int vbp; /* Vertical back porch */ int vsw; /* Vertical Sync Pulse Width */ int pxl_clk; /* Pixel clock */ + unsigned char invert_pxl_clk; /* Invert Pixel clock */ }; static struct da8xx_panel known_lcd_panels[] = { @@ -173,6 +173,7 @@ static struct da8xx_panel known_lcd_panels[] = { .vbp = 2, .vsw = 0, .pxl_clk = 0x10, + .invert_pxl_clk = 1, }, /* Sharp LK043T1DG01 */ [1] = { @@ -186,29 +187,18 @@ static struct da8xx_panel known_lcd_panels[] = { .vbp = 2, .vsw = 10, .pxl_clk = 0x12, + .invert_pxl_clk = 0, }, }; /* Disable the Raster Engine of the LCD Controller */ -static int lcd_disable_raster(struct da8xx_fb_par *par) +static void lcd_disable_raster(struct da8xx_fb_par *par) { - int ret = 0; u32 reg; reg = lcdc_read(LCD_RASTER_CTRL_REG); - if (reg & LCD_RASTER_ENABLE) { + if (reg & LCD_RASTER_ENABLE) lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); - ret = wait_event_interruptible_timeout(par->da8xx_wq, - !lcdc_read(LCD_STAT_REG) & - LCD_END_OF_FRAME0, WSI_TIMEOUT); - } - - if (ret < 0) - return ret; - if (ret == 0) - return -ETIMEDOUT; - - return 0; } static void lcd_blit(int load_mode, struct da8xx_fb_par *par) @@ -256,7 +246,7 @@ static int lcd_cfg_dma(int burst_size) default: return -EINVAL; } - lcdc_write(reg | LCD_END_OF_FRAME_INT_ENA, LCD_DMA_CTRL_REG); + lcdc_write(reg, LCD_DMA_CTRL_REG); return 0; } @@ -342,11 +332,6 @@ static int lcd_cfg_display(const struct lcd_ctrl_config *cfg) else reg &= ~LCD_SYNC_EDGE; - if (cfg->invert_pxl_clock) - reg |= LCD_INVERT_PIXEL_CLOCK; - else - reg &= ~LCD_INVERT_PIXEL_CLOCK; - if (cfg->invert_line_clock) reg |= LCD_INVERT_LINE_CLOCK; else @@ -456,19 +441,15 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } -static int lcd_reset(struct da8xx_fb_par *par) +static void lcd_reset(struct da8xx_fb_par *par) { - int ret = 0; - /* Disable the Raster if previously Enabled */ if (lcdc_read(LCD_RASTER_CTRL_REG) & LCD_RASTER_ENABLE) - ret = lcd_disable_raster(par); + lcd_disable_raster(par); /* DMA has to be disabled */ lcdc_write(0, LCD_DMA_CTRL_REG); lcdc_write(0, LCD_RASTER_CTRL_REG); - - return ret; } static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, @@ -477,14 +458,19 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, u32 bpp; int ret = 0; - ret = lcd_reset(par); - if (ret != 0) - return ret; + lcd_reset(par); /* Configure the LCD clock divisor. */ lcdc_write(LCD_CLK_DIVISOR(panel->pxl_clk) | (LCD_RASTER_MODE & 0x1), LCD_CTRL_REG); + if (panel->invert_pxl_clk) + lcdc_write((lcdc_read(LCD_RASTER_TIMING_2_REG) | + LCD_INVERT_PIXEL_CLOCK), LCD_RASTER_TIMING_2_REG); + else + lcdc_write((lcdc_read(LCD_RASTER_TIMING_2_REG) & + ~LCD_INVERT_PIXEL_CLOCK), LCD_RASTER_TIMING_2_REG); + /* Configure the DMA burst size. */ ret = lcd_cfg_dma(cfg->dma_burst_sz); if (ret < 0) @@ -528,7 +514,6 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, static irqreturn_t lcdc_irq_handler(int irq, void *arg) { u32 stat = lcdc_read(LCD_STAT_REG); - struct da8xx_fb_par *par = arg; u32 reg; if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) { @@ -539,7 +524,6 @@ static irqreturn_t lcdc_irq_handler(int irq, void *arg) } else lcdc_write(stat, LCD_STAT_REG); - wake_up_interruptible(&par->da8xx_wq); return IRQ_HANDLED; } @@ -594,13 +578,12 @@ static int fb_check_var(struct fb_var_screeninfo *var, static int __devexit fb_remove(struct platform_device *dev) { struct fb_info *info = dev_get_drvdata(&dev->dev); - int ret = 0; if (info) { struct da8xx_fb_par *par = info->par; if (lcdc_read(LCD_RASTER_CTRL_REG) & LCD_RASTER_ENABLE) - ret = lcd_disable_raster(par); + lcd_disable_raster(par); lcdc_write(0, LCD_RASTER_CTRL_REG); /* disable DMA */ @@ -619,7 +602,7 @@ static int __devexit fb_remove(struct platform_device *dev) release_mem_region(lcdc_regs->start, resource_size(lcdc_regs)); } - return ret; + return 0; } static int fb_ioctl(struct fb_info *info, unsigned int cmd, @@ -634,11 +617,11 @@ static int fb_ioctl(struct fb_info *info, unsigned int cmd, case FBIPUT_BRIGHTNESS: case FBIGET_COLOR: case FBIPUT_COLOR: - return -EINVAL; + return -ENOTTY; case FBIPUT_HSYNC: if (copy_from_user(&sync_arg, (char *)arg, sizeof(struct lcd_sync_arg))) - return -EINVAL; + return -EFAULT; lcd_cfg_horizontal_sync(sync_arg.back_porch, sync_arg.pulse_width, sync_arg.front_porch); @@ -646,7 +629,7 @@ static int fb_ioctl(struct fb_info *info, unsigned int cmd, case FBIPUT_VSYNC: if (copy_from_user(&sync_arg, (char *)arg, sizeof(struct lcd_sync_arg))) - return -EINVAL; + return -EFAULT; lcd_cfg_vertical_sync(sync_arg.back_porch, sync_arg.pulse_width, sync_arg.front_porch); @@ -773,8 +756,6 @@ static int __init fb_probe(struct platform_device *device) par->lcdc_clk = fb_clk; - init_waitqueue_head(&par->da8xx_wq); - par->irq = platform_get_irq(device, 0); if (par->irq < 0) { ret = -ENOENT; diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h index 5f7767547fa0..c051a50ed528 100644 --- a/include/video/da8xx-fb.h +++ b/include/video/da8xx-fb.h @@ -67,9 +67,6 @@ struct lcd_ctrl_config { /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */ unsigned char mono_8bit_mode; - /* Invert pixel clock */ - unsigned char invert_pxl_clock; - /* Invert line clock */ unsigned char invert_line_clock; -- cgit v1.2.3 From c41562b1626b578e9ce2aae5b3363ee2f142c635 Mon Sep 17 00:00:00 2001 From: Jun Nie Date: Tue, 10 Nov 2009 15:11:36 +0800 Subject: pxa168fb: remove useless vsync/hsync invert flag fb_var_screeninfo.var has already encoded this information. Signed-off-by: Jun Nie Signed-off-by: Eric Miao --- include/video/pxa168fb.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/video') diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h index b5cc72fe0461..8c2f385a90ea 100644 --- a/include/video/pxa168fb.h +++ b/include/video/pxa168fb.h @@ -117,8 +117,6 @@ struct pxa168fb_mach_info { unsigned invert_composite_blank:1; unsigned invert_pix_val_ena:1; unsigned invert_pixclock:1; - unsigned invert_vsync:1; - unsigned invert_hsync:1; unsigned panel_rbswap:1; unsigned active:1; unsigned enable_lcd:1; -- cgit v1.2.3 From 96c085db0a0f22895917f09cf942853186b892fd Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Sun, 1 Nov 2009 16:47:35 -0500 Subject: sgivwfb: Make use of ARRAY_SIZE. Cleanup the usage of DBE_VT_SIZE since the kernel already defines the same macro for the same propose. Also clean up a surrounding whitespaces. Signed-off-by: Thiago Farina Signed-off-by: Jiri Kosina --- drivers/video/sgivwfb.c | 4 ++-- include/video/sgivw.h | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'include/video') diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c index bba53714a7b1..f86012239bff 100644 --- a/drivers/video/sgivwfb.c +++ b/drivers/video/sgivwfb.c @@ -260,13 +260,13 @@ static int sgivwfb_check_var(struct fb_var_screeninfo *var, var->grayscale = 0; /* No grayscale for now */ /* determine valid resolution and timing */ - for (min_mode = 0; min_mode < DBE_VT_SIZE; min_mode++) { + for (min_mode = 0; min_mode < ARRAY_SIZE(dbeVTimings); min_mode++) { if (dbeVTimings[min_mode].width >= var->xres && dbeVTimings[min_mode].height >= var->yres) break; } - if (min_mode == DBE_VT_SIZE) + if (min_mode == ARRAY_SIZE(dbeVTimings)) return -EINVAL; /* Resolution to high */ /* XXX FIXME - should try to pick best refresh rate */ diff --git a/include/video/sgivw.h b/include/video/sgivw.h index 55f2a7c024af..f6aa5692e74b 100644 --- a/include/video/sgivw.h +++ b/include/video/sgivw.h @@ -351,7 +351,7 @@ typedef enum { struct dbe_timing_info { dbe_timing_t type; - int flags; + int flags; short width; /* Monitor resolution */ short height; int fields_sec; /* fields/sec (Hz -3 dec. places */ @@ -389,11 +389,11 @@ struct dbe_timing_info dbeVTimings[] = { { DBE_VT_640_480_60, /* flags, width, height, fields_sec, cfreq */ - 0, 640, 480, 59940, 25175, + 0, 640, 480, 59940, 25175, /* htotal, hblank_start, hblank_end, hsync_start, hsync_end */ - 800, 640, 800, 656, 752, + 800, 640, 800, 656, 752, /* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */ - 525, 480, 525, 490, 492, + 525, 480, 525, 490, 492, /* pll_m, pll_n, pll_p */ 15, 2, 3 }, @@ -650,7 +650,7 @@ struct dbe_timing_info dbeVTimings[] = { /* pll_m, pll_n, pll_p */ 6, 1, 0 }, - + { DBE_VT_1920_1200_60, /* flags, width, height, fields_sec, cfreq */ @@ -676,7 +676,6 @@ struct dbe_timing_info dbeVTimings[] = { } }; -#define DBE_VT_SIZE (sizeof(dbeVTimings)/sizeof(dbeVTimings[0])) #endif // INCLUDE_TIMING_TABLE_DATA #endif // ! __SGIVWFB_H__ -- cgit v1.2.3 From ef61aae4ddf1dbd0e9b6ad21e2e57632a8fe76f6 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Mon, 7 Dec 2009 14:20:06 +0000 Subject: sh: add a start_transfer() callback to the LCDC driver This patch adds a ->start_transfer() callback to the driver sh_mobile_lcdcfb.c. The callback is used to program the LCDC panel in the case of one-shot mode. Needed by the LCD controller used on the KFR2R09 board. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- drivers/video/sh_mobile_lcdcfb.c | 10 +++++++++- include/video/sh_mobile_lcdc.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'include/video') diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index b4b5de930cf5..d346bbab6cad 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -281,6 +281,7 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info, struct list_head *pagelist) { struct sh_mobile_lcdc_chan *ch = info->par; + struct sh_mobile_lcdc_board_cfg *bcfg = &ch->cfg.board_cfg; /* enable clocks before accessing hardware */ sh_mobile_lcdc_clk_on(ch->lcdc); @@ -305,10 +306,17 @@ static void sh_mobile_lcdc_deferred_io(struct fb_info *info, /* trigger panel update */ dma_map_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE); + if (bcfg->start_transfer) + bcfg->start_transfer(bcfg->board_data, ch, + &sh_mobile_lcdc_sys_bus_ops); lcdc_write_chan(ch, LDSM2R, 1); dma_unmap_sg(info->dev, ch->sglist, nr_pages, DMA_TO_DEVICE); - } else + } else { + if (bcfg->start_transfer) + bcfg->start_transfer(bcfg->board_data, ch, + &sh_mobile_lcdc_sys_bus_ops); lcdc_write_chan(ch, LDSM2R, 1); + } } static void sh_mobile_lcdc_deferred_io_touch(struct fb_info *info) diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 25144ab22b95..288205457713 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h @@ -50,6 +50,8 @@ struct sh_mobile_lcdc_board_cfg { void *board_data; int (*setup_sys)(void *board_data, void *sys_ops_handle, struct sh_mobile_lcdc_sys_bus_ops *sys_ops); + void (*start_transfer)(void *board_data, void *sys_ops_handle, + struct sh_mobile_lcdc_sys_bus_ops *sys_ops); void (*display_on)(void *board_data); void (*display_off)(void *board_data); }; -- cgit v1.2.3 From 3611380490c6ce27a2277709a34b8c5531524caf Mon Sep 17 00:00:00 2001 From: Chaithrika U S Date: Tue, 15 Dec 2009 16:46:38 -0800 Subject: davinci: fb: update the driver in preparation for addition of power management features Add a helper function to enable raster. Also add one member in the private data structure to track the current blank status, another function pointer which takes in the platform specific callback function to control panel power. These updates will help in adding suspend/resume and frame buffer blank operation features. Signed-off-by: Chaithrika U S Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/da8xx-fb.c | 43 +++++++++++++++++++++++++++---------------- include/video/da8xx-fb.h | 1 + 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'include/video') diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 8966274bbbbc..eb95b893e8b2 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -115,9 +115,11 @@ struct da8xx_fb_par { unsigned int databuf_sz; unsigned int palette_sz; unsigned int pxl_clk; + int blank; #ifdef CONFIG_CPU_FREQ struct notifier_block freq_transition; #endif + void (*panel_power_ctrl)(int); }; /* Variable Screen Information */ @@ -195,8 +197,18 @@ static struct da8xx_panel known_lcd_panels[] = { }, }; +/* Enable the Raster Engine of the LCD Controller */ +static inline void lcd_enable_raster(void) +{ + u32 reg; + + reg = lcdc_read(LCD_RASTER_CTRL_REG); + if (!(reg & LCD_RASTER_ENABLE)) + lcdc_write(reg | LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); +} + /* Disable the Raster Engine of the LCD Controller */ -static void lcd_disable_raster(struct da8xx_fb_par *par) +static inline void lcd_disable_raster(void) { u32 reg; @@ -448,8 +460,7 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green, static void lcd_reset(struct da8xx_fb_par *par) { /* Disable the Raster if previously Enabled */ - if (lcdc_read(LCD_RASTER_CTRL_REG) & LCD_RASTER_ENABLE) - lcd_disable_raster(par); + lcd_disable_raster(); /* DMA has to be disabled */ lcdc_write(0, LCD_DMA_CTRL_REG); @@ -529,13 +540,11 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, static irqreturn_t lcdc_irq_handler(int irq, void *arg) { u32 stat = lcdc_read(LCD_STAT_REG); - u32 reg; if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) { - reg = lcdc_read(LCD_RASTER_CTRL_REG); - lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); + lcd_disable_raster(); lcdc_write(stat, LCD_STAT_REG); - lcdc_write(reg | LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); + lcd_enable_raster(); } else lcdc_write(stat, LCD_STAT_REG); @@ -595,16 +604,13 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct da8xx_fb_par *par; - unsigned int reg; par = container_of(nb, struct da8xx_fb_par, freq_transition); if (val == CPUFREQ_PRECHANGE) { - reg = lcdc_read(LCD_RASTER_CTRL_REG); - lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); + lcd_disable_raster(); } else if (val == CPUFREQ_POSTCHANGE) { lcd_calc_clk_divider(par); - reg = lcdc_read(LCD_RASTER_CTRL_REG); - lcdc_write(reg | LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); + lcd_enable_raster(); } return 0; @@ -635,8 +641,10 @@ static int __devexit fb_remove(struct platform_device *dev) #ifdef CONFIG_CPU_FREQ lcd_da8xx_cpufreq_deregister(par); #endif - if (lcdc_read(LCD_RASTER_CTRL_REG) & LCD_RASTER_ENABLE) - lcd_disable_raster(par); + if (par->panel_power_ctrl) + par->panel_power_ctrl(0); + + lcd_disable_raster(); lcdc_write(0, LCD_RASTER_CTRL_REG); /* disable DMA */ @@ -777,6 +785,10 @@ static int __init fb_probe(struct platform_device *device) par = da8xx_fb_info->par; par->lcdc_clk = fb_clk; par->pxl_clk = lcdc_info->pxl_clk; + if (fb_pdata->panel_power_ctrl) { + par->panel_power_ctrl = fb_pdata->panel_power_ctrl; + par->panel_power_ctrl(1); + } if (lcd_init(par, lcd_cfg, lcdc_info) < 0) { dev_err(&device->dev, "lcd_init failed\n"); @@ -877,8 +889,7 @@ static int __init fb_probe(struct platform_device *device) #endif /* enable raster engine */ - lcdc_write(lcdc_read(LCD_RASTER_CTRL_REG) | - LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); + lcd_enable_raster(); return 0; diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h index c051a50ed528..89d43b3d4cb9 100644 --- a/include/video/da8xx-fb.h +++ b/include/video/da8xx-fb.h @@ -38,6 +38,7 @@ struct da8xx_lcdc_platform_data { const char manu_name[10]; void *controller_data; const char type[25]; + void (*panel_power_ctrl)(int); }; struct lcd_ctrl_config { -- cgit v1.2.3 From 40331b21f5fdb746e80fc609ef60ef71b5cd47d9 Mon Sep 17 00:00:00 2001 From: Phil Edworthy Date: Mon, 15 Feb 2010 13:57:49 +0000 Subject: video: sh_mobile_lcdcfb: Add wait for vsync. Added FBIO_WAITFORVSYNC ioctl for SH-Mobile devices. Tested on MS7724 and MigoR boards against 2.6.33-rc7. Signed-off-by: Phil Edworthy Signed-off-by: Paul Mundt --- drivers/video/sh_mobile_lcdcfb.c | 48 +++++++++++++++++++++++++++++++++++++++- include/video/sh_mobile_lcdc.h | 2 ++ 2 files changed, 49 insertions(+), 1 deletion(-) (limited to 'include/video') diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index a69830d26f7f..37aeced2dc18 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -19,6 +19,7 @@ #include #include #include +#include #include