lxfb: create GP/DC/VP/FP-specific handlers rather than using readl/writel
PATCH 1/7 lxfb: create GP/DC/VP/FP-specific handlers rather than using readl/writel
This creates read_gp/write_gp, read_dc/write_dc, read_vp/write_vp, and read_fp/write_fp for reading and updating those registers. Note that we don't follow the 'DF' naming; those will be renamed to VP shortly.
Signed-off-by Andres Salomon <[email protected]>
--- drivers/video/geode/lxfb.h | 43 +++++++++++ drivers/video/geode/lxfb_core.c | 9 +-- drivers/video/geode/lxfb_ops.c | 151 ++++++++++++++++++--------------------- 3 files changed, 116 insertions(+), 87 deletions(-)
drivers/video/geode/lxfb.h +43 -0
@@ -188,4 +188,47 @@ void lx_set_palette_reg(struct fb_info *, unsigned int, unsigned int,#define GP_BS_BLT_BUSY (1 << 0)#define GP_BS_CB_EMPTY (1 << 4) + +/* register access functions */ + +static inline uint32_t read_gp (struct lxfb_par *par,int reg) +{ +return readl (par->gp_regs + reg); +} + +static inline void write_gp (struct lxfb_par *par,int reg,uint32_t val) +{ +writel (val, par->gp_regs + reg); +} + +static inline uint32_t read_dc (struct lxfb_par *par,int reg) +{ +return readl (par->dc_regs + reg); +} + +static inline void write_dc (struct lxfb_par *par,int reg,uint32_t val) +{ +writel (val, par->dc_regs + reg); +} + +static inline uint32_t read_vp (struct lxfb_par *par,int reg) +{ +return readl (par->df_regs + reg); +} + +static inline void write_vp (struct lxfb_par *par,int reg,uint32_t val) +{ +writel (val, par->df_regs + reg); +} + +static inline uint32_t read_fp (struct lxfb_par *par,int reg) +{ +return readl (par->df_regs + reg); +} + +static inline void write_fp (struct lxfb_par *par,int reg,uint32_t val) +{ +writel (val, par->df_regs + reg); +} +#endif
drivers/video/geode/lxfb_core.c +3 -6
@@ -366,12 +366,9 @@ static int __init lxfb_map_video_memory(struct fb_info *info,if (par->df_regs ==NULL )return ret; -writel (DC_UNLOCK_CODE , par->dc_regs +DC_UNLOCK ); - -writel (info->fix.smem_start &0xFF000000 , - par->dc_regs +DC_PHY_MEM_OFFSET ); - -writel (0 , par->dc_regs +DC_UNLOCK ); +write_dc (par,DC_UNLOCK ,DC_UNLOCK_CODE ); +write_dc (par,DC_PHY_MEM_OFFSET , info->fix.smem_start &0xFF000000 ); +write_dc (par,DC_UNLOCK ,0 );dev_info (&dev->dev,"%d KB of video memory at 0x%lx\n" , info->fix.smem_len /1024 , info->fix.smem_start);
drivers/video/geode/lxfb_ops.c +70 -81
292 lines not on this page · raw message
Signature · 8 lines
1.5.3.7 ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace