mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 03:47:43 +00:00
8564557a03
This patch adds sh_mobile_lcdcfb deferred io support for SYS panels. The LCDC hardware block managed by the sh_mobile_lcdcfb driver supports RGB or SYS panel configurations. SYS panels come with an external display controller that is resposible for refreshing the actual LCD panel. RGB panels are controlled directly by the LCDC and they need to be refreshed by the LCDC hardware. In the case of SYS panels we can save some power by configuring the LCDC hardware block in one-shot mode. In this one-shot mode panel refresh is managed by software. This works well together with deferred io since it allows us to stop clocks for most of the time and only enable clocks when we actually want to trigger an update. When there is no fbdev activity the clocks are kept stopped which allows us to deep sleep. The refresh rate in deferred io mode is set using platform data. The same platform data can also be used to disable deferred io mode. As with other deferred io frame buffers user space code should use fsync() on the frame buffer device to trigger an update. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
80 lines
2.3 KiB
C
80 lines
2.3 KiB
C
#ifndef __ASM_SH_MOBILE_LCDC_H__
|
|
#define __ASM_SH_MOBILE_LCDC_H__
|
|
|
|
#include <linux/fb.h>
|
|
|
|
enum { RGB8, /* 24bpp, 8:8:8 */
|
|
RGB9, /* 18bpp, 9:9 */
|
|
RGB12A, /* 24bpp, 12:12 */
|
|
RGB12B, /* 12bpp */
|
|
RGB16, /* 16bpp */
|
|
RGB18, /* 18bpp */
|
|
RGB24, /* 24bpp */
|
|
SYS8A, /* 24bpp, 8:8:8 */
|
|
SYS8B, /* 18bpp, 8:8:2 */
|
|
SYS8C, /* 18bpp, 2:8:8 */
|
|
SYS8D, /* 16bpp, 8:8 */
|
|
SYS9, /* 18bpp, 9:9 */
|
|
SYS12, /* 24bpp, 12:12 */
|
|
SYS16A, /* 16bpp */
|
|
SYS16B, /* 18bpp, 16:2 */
|
|
SYS16C, /* 18bpp, 2:16 */
|
|
SYS18, /* 18bpp */
|
|
SYS24 };/* 24bpp */
|
|
|
|
enum { LCDC_CHAN_DISABLED = 0,
|
|
LCDC_CHAN_MAINLCD,
|
|
LCDC_CHAN_SUBLCD };
|
|
|
|
enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL };
|
|
|
|
#define LCDC_FLAGS_DWPOL (1 << 0) /* Rising edge dot clock data latch */
|
|
#define LCDC_FLAGS_DIPOL (1 << 1) /* Active low display enable polarity */
|
|
#define LCDC_FLAGS_DAPOL (1 << 2) /* Active low display data polarity */
|
|
#define LCDC_FLAGS_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */
|
|
#define LCDC_FLAGS_DWCNT (1 << 4) /* Disable dotclock during blanking */
|
|
|
|
struct sh_mobile_lcdc_sys_bus_cfg {
|
|
unsigned long ldmt2r;
|
|
unsigned long ldmt3r;
|
|
unsigned long deferred_io_msec;
|
|
};
|
|
|
|
struct sh_mobile_lcdc_sys_bus_ops {
|
|
void (*write_index)(void *handle, unsigned long data);
|
|
void (*write_data)(void *handle, unsigned long data);
|
|
unsigned long (*read_data)(void *handle);
|
|
};
|
|
|
|
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 (*display_on)(void *board_data);
|
|
void (*display_off)(void *board_data);
|
|
};
|
|
|
|
struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
|
|
unsigned long width;
|
|
unsigned long height;
|
|
};
|
|
|
|
struct sh_mobile_lcdc_chan_cfg {
|
|
int chan;
|
|
int bpp;
|
|
int interface_type; /* selects RGBn or SYSn I/F, see above */
|
|
int clock_divider;
|
|
unsigned long flags; /* LCDC_FLAGS_... */
|
|
struct fb_videomode lcd_cfg;
|
|
struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
|
|
struct sh_mobile_lcdc_board_cfg board_cfg;
|
|
struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
|
|
};
|
|
|
|
struct sh_mobile_lcdc_info {
|
|
int clock_source;
|
|
struct sh_mobile_lcdc_chan_cfg ch[2];
|
|
};
|
|
|
|
#endif /* __ASM_SH_MOBILE_LCDC_H__ */
|