AUO-K190x: add framebuffer rotation support
From: Heiko Stuebner <heiko@...> Date: Mon, 13 Aug 2012 00:29:10 +0200
Commit-Message
Patch-Comment
drivers/video/auo_k190x.c | 25 ++++++++++++++++++++----- include/video/auo_k190xfb.h | 1 - 2 files changed, 20 insertions(+), 6 deletions(-)
Statistics
- 20 lines added
- 6 lines removed
Changes
-------------------------- drivers/video/auo_k190x.c ---------------------------
index 69abb9c..87cff5b 100644
@@ -486,12 +486,20 @@ static int auok190xfb_check_var(struct fb_var_screeninfo *var,
* Dimensions
*/
+ switch (var->rotate) {
+ case FB_ROTATE_UR:
+ case FB_ROTATE_UD:
var->xres = panel->w;
var->yres = panel->h;
+ break;
+ case FB_ROTATE_CW:
+ case FB_ROTATE_CCW:
+ var->xres = panel->h;
+ var->yres = panel->w;
+ break;
+ default:
+ dev_dbg(dev, "Invalid rotation request\n");
+ return -EINVAL;
}
var->xres_virtual = var->xres;
@@ -533,8 +541,15 @@ static int auok190xfb_set_par(struct fb_info *info)
{
struct auok190xfb_par *par = info->par;
+ par->rotation = info->var.rotate;
auok190xfb_set_fix(info);
+ /* reinit the controller to honor the rotation */
+ par->init(par);
+
+ /* wait for init to complete */
+ par->board->wait_for_rdy(par);
+
return 0;
}
@@ -1029,7 +1044,7 @@ int __devinit auok190x_common_probe(struct platform_device *pdev,
panel = &panel_table[board->resolution];
par->resolution = board->resolution;
+ par->rotation = 0;
/* videomemory handling */
------------------------- include/video/auo_k190xfb.h --------------------------
index 609efe8..ad7bc51 100644
@@ -98,7 +98,6 @@ struct auok190x_board {
int gpio_nbusy;
int resolution;
int quirks;
int fps;
};