diff options
author | Manuel Lauss <manuel.lauss@gmail.com> | 2014-07-23 18:36:24 +0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-07-30 15:53:28 +0400 |
commit | 1d09de7dc76ef96a9a2c7c0244e20f12d68e6ef8 (patch) | |
tree | 929cb54b63224fc65d7b56d52b00a89bb236b9a0 /drivers/video/fbdev | |
parent | 2ef1bb99116e49226e8bab8ebab255f12fa8a99e (diff) | |
download | linux-1d09de7dc76ef96a9a2c7c0244e20f12d68e6ef8.tar.xz |
MIPS: Alchemy: introduce helpers to access SYS register block.
This patch changes all absolute SYS_XY registers to offsets from the
SYS block base, prefixes them with AU1000 to avoid silent failures due
to changed addresses, and introduces helper functions to read/write
them.
No functional changes, comparing assembly of a few select functions shows
no differences.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/7464/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/au1100fb.c | 11 | ||||
-rw-r--r-- | drivers/video/fbdev/au1200fb.c | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index 372d4aea9d1c..c0832eaff4d1 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -507,8 +507,9 @@ static int au1100fb_drv_probe(struct platform_device *dev) print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); /* Setup LCD clock to AUX (48 MHz) */ - sys_clksrc = au_readl(SYS_CLKSRC) & ~(SYS_CS_ML_MASK | SYS_CS_DL | SYS_CS_CL); - au_writel((sys_clksrc | (1 << SYS_CS_ML_BIT)), SYS_CLKSRC); + sys_clksrc = alchemy_rdsys(AU1000_SYS_CLKSRC); + sys_clksrc &= ~(SYS_CS_ML_MASK | SYS_CS_DL | SYS_CS_CL); + alchemy_wrsys((sys_clksrc | (1 << SYS_CS_ML_BIT)), AU1000_SYS_CLKSRC); /* load the panel info into the var struct */ au1100fb_var.bits_per_pixel = fbdev->panel->bpp; @@ -591,13 +592,13 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state) return 0; /* Save the clock source state */ - sys_clksrc = au_readl(SYS_CLKSRC); + sys_clksrc = alchemy_rdsys(AU1000_SYS_CLKSRC); /* Blank the LCD */ au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); /* Stop LCD clocking */ - au_writel(sys_clksrc & ~SYS_CS_ML_MASK, SYS_CLKSRC); + alchemy_wrsys(sys_clksrc & ~SYS_CS_ML_MASK, AU1000_SYS_CLKSRC); memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs)); @@ -614,7 +615,7 @@ int au1100fb_drv_resume(struct platform_device *dev) memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs)); /* Restart LCD clocking */ - au_writel(sys_clksrc, SYS_CLKSRC); + alchemy_wrsys(sys_clksrc, AU1000_SYS_CLKSRC); /* Unblank the LCD */ au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info); diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c index 4cfba78a1458..2d77334af41b 100644 --- a/drivers/video/fbdev/au1200fb.c +++ b/drivers/video/fbdev/au1200fb.c @@ -830,10 +830,10 @@ static void au1200_setpanel(struct panel_settings *newpanel, if (!(panel->mode_clkcontrol & LCD_CLKCONTROL_EXT)) { uint32 sys_clksrc; - au_writel(panel->mode_auxpll, SYS_AUXPLL); - sys_clksrc = au_readl(SYS_CLKSRC) & ~0x0000001f; + alchemy_wrsys(panel->mode_auxpll, AU1000_SYS_AUXPLL); + sys_clksrc = alchemy_rdsys(AU1000_SYS_CLKSRC) & ~0x0000001f; sys_clksrc |= panel->mode_toyclksrc; - au_writel(sys_clksrc, SYS_CLKSRC); + alchemy_wrsys(sys_clksrc, AU1000_SYS_CLKSRC); } /* |