Commit 9286361b authored by Andres Salomon's avatar Andres Salomon Committed by Linus Torvalds

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: default avatarAndres Salomon <dilinger@debian.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3888d463
......@@ -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
......@@ -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);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment